feat: align DB signals with backend archetype (enum has no db member) - #22
Conversation
Map prisma/drizzle deps, .sql files, and migrations/ dirs to `backend` instead of being ignored, reversing archetype-file-tree-scan decision #2. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughThis PR extends backend archetype detection to recognize database-related signals: ChangesBackend archetype signal expansion
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.dev/features/archetype-enum-align/PLAN.md:
- Around line 31-34: The PLAN.md scope is missing the existing next + prisma
pinned case in tests/archetype.test.ts, which should now be updated to ['ssr',
'backend'] alongside the other DB-to-backend changes. Update the test/spec entry
for archetype classification to explicitly include this case, and make sure the
plan references the relevant symbols in tests/archetype.test.ts so the required
edit is fully captured.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7ed54419-09cf-476d-951b-b239671ceb3f
📒 Files selected for processing (14)
.dev/features/archetype-enum-align/GRILL.md.dev/features/archetype-enum-align/PLAN.md.dev/features/archetype-enum-align/REGRESSION.md.dev/features/archetype-enum-align/REVIEW.md.dev/features/archetype-enum-align/SHIP.md.dev/features/archetype-enum-align/VERIFY.md.dev/features/archetype-enum-align/regression-report.json.dev/features/archetype-enum-align/verify-report.json.pharn/pharn-dev-verify/results.json.pharn/writes-scope.jsonsrc/lib/archetype.tssrc/lib/detect-archetype.tstests/archetype.test.tstests/detect-archetype.test.ts
| - `src/lib/detect-archetype.ts` — in `classifyEntry`, add: a file whose name ends `.sql` → `backend` signal; a dir named `migrations` → `backend` signal; update the "contribute NOTHING" comment (lines 66-68) to record the reversal — layer: I/O boundary | ||
| - `src/lib/archetype.ts` — add ORM package names (`prisma`, `@prisma/client`, `drizzle-orm`) to `BACKEND_FRAMEWORKS`; update the set's comment — layer: pure classification rules | ||
| - `tests/detect-archetype.test.ts` — **flip** the pinned decision-#2 test (209-216): `.sql` + `migrations/` now → `['backend']`, not `['lib']`; rewrite its comment to cite this plan's reversal — layer: test/spec (P1) | ||
| - `tests/archetype.test.ts` — add package-name cases: `drizzle-orm` dep → `backend`; `prisma` / `@prisma/client` dep → `backend`; a DB-only project → `['backend']` — layer: test/spec (P1) |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the existing next + prisma pin to the plan.
The Files section misses tests/archetype.test.ts:37-41, which flips to ['ssr', 'backend'] under the approved DB→backend change. Update the plan scope or it will understate the required test edit.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.dev/features/archetype-enum-align/PLAN.md around lines 31 - 34, The PLAN.md
scope is missing the existing next + prisma pinned case in
tests/archetype.test.ts, which should now be updated to ['ssr', 'backend']
alongside the other DB-to-backend changes. Update the test/spec entry for
archetype classification to explicitly include this case, and make sure the plan
references the relevant symbols in tests/archetype.test.ts so the required edit
is fully captured.
Summary
prisma,@prisma/client,drizzle-orm) to thebackendarchetype in dependency-based detection..sqlfiles,migrations/dirs) tobackendinstead of being ignored, reversing archetype-file-tree-scan decision chore(deps): bump @clack/prompts from 1.5.1 to 1.7.0 #2.backend + spa,ssr + backend) and ship the archetype-enum-align feature audit trail.Test plan
npm test— archetype and detect-archetype suites passnpm run typechecknpm run lintnpm run format:checkMade with Cursor
Summary by CodeRabbit
.sqlfiles and migration folders so they’re no longer overlooked.