Skip to content

docs: quality upgrade plan to 9.5+ (Bun, DAG, security, CI) - #24

Draft
KitsuneKode wants to merge 28 commits into
mainfrom
cursor/quality-upgrade-plan-3e47
Draft

docs: quality upgrade plan to 9.5+ (Bun, DAG, security, CI)#24
KitsuneKode wants to merge 28 commits into
mainfrom
cursor/quality-upgrade-plan-3e47

Conversation

@KitsuneKode

@KitsuneKode KitsuneKode commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the quality upgrade plan to raise Architecture, Security, Reliability, Tests, DevEx/CI, and Code Quality toward ≥ 9.5, using Bun-first practices and production-grade DAG/queue patterns.

Plan: docs/superpowers/plans/2026-07-10-quality-upgrade-to-9.5.md

Completed (all plan tasks)

Phase 0 — Quality gates

  • Wire @buzz8n/tests workspace + bun test preload
  • Web check-types for Turbo CI
  • .env.example + README Environment section
  • Re-enable CI test + secretlint

Phase 1 — Security

  • AES-GCM credential envelopes; encrypt on write; redact API responses
  • Worker credential lookup scoped by userId
  • JWT expiry, uniform auth errors, env cookie domain
  • Honest security FAQ; signup auth middleware

Phase 2 — Reliability / DAG

  • Express error handler + 404 fallback
  • Webhook payload forwarding
  • Rate-limit key + fail policy
  • DAG module split + unit tests
  • Multi-worker shutdown + DLQ

Phase 3 — Bun practices

  • Logger over console.log; CONTRIBUTING Bun practices
  • Zod-validate queue payloads

Phase 4 — Tests / docs

  • Docs aligned to root scripts

Phase 5 — Polish

  • Workflow.status comment; UI dead export removed; React strict mode

Follow-up fixes (post-review)

  • Declare crypto/auth env vars in turbo.json globalEnv (CI lint)
  • Require CREDENTIALS_ENCRYPTION_KEY in backend/worker config validation
  • Align cookie Max-Age with JWT_EXPIRES_IN
  • Reject plaintext credentials unless ALLOW_PLAINTEXT_CREDENTIALS=true
  • DLQ execution failures before ACK (leave pending if DLQ write fails)
  • Uniform JSON error responses across auth/webhook/credential/workflow/execution
  • Shared getApiErrorMessage for web clients (useAuth, useWorkflow, CredentialModal)
  • Redact PII from email/telegram/AI agent logs
  • Canonical encryption docs (docs/CREDENTIAL_ENCRYPTION.md) — this PR’s Web Crypto envelope wins over PR feat: Phase 0 hardening — security, queue, CI, and frontend usability #23’s node:crypto format
  • Key resolution accepts hex / base64-32 / hashed secrets

Verification (local)

bun test (auth, webhook, jwt-expiry, load-credential, processor, crypto, api-error) → pass

Out of scope (as planned)

  • Express → Bun.serve
  • Prisma → Bun.sql
  • Startup XCLAIM reclaim
  • OAuth / formal SOC 2

Note vs PR #23

Do not merge both encryption formats. Prefer this PR. Cherry-pick OpenAPI/metrics/deploy/Playwright from #23 if still needed — skip credentials-crypto.ts.

Open in Web Open in Cursor 

Phased plan covering Bun workspace/CI gates, credential encryption,
JWT expiry, webhook payload forwarding, DAG hardening, multi-worker
Redis shutdown/DLQ, and test coverage exit criteria.
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
buzz8n-web Error Error Jul 10, 2026 6:04am

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: df6ed6d4-b050-4ce8-b923-1865cbdbdcea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/quality-upgrade-plan-3e47

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Replace placeholder credentials in plan and .env.example so the new
secretlint CI job does not fail on documentation examples.
Add CREDENTIALS_ENCRYPTION_KEY and related auth env vars to turbo
globalEnv so eslint turbo/no-undeclared-env-vars stops failing CI.
Require the encryption key in backend/worker config validation, and
derive cookie Max-Age from JWT_EXPIRES_IN so token and cookie lifetimes
stay in sync.
Reject plaintext credentials unless ALLOW_PLAINTEXT_CREDENTIALS is set,
send execution failures to the DLQ before ACK, and standardize auth/
webhook/credential error responses as JSON. Redact PII from worker
node logs and keep the web auth client compatible with JSON error bodies.
Convert remaining workflow/execution/credential responses to JSON,
share getApiErrorMessage across web clients, and document this branch's
Web Crypto envelope as canonical vs PR #23. Key resolution now accepts
hex/base64/hashed secrets for production-ready key provisioning.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/quality-upgrade-plan-3e47

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants