Adopt result errors for local pin reads#75
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
Summary by CodeRabbit
WalkthroughThis PR launches incremental adoption of 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Adds the Better Result error-handling adoption plan and implements the first local-pin read slice so invalid local state is typed before reaching command output boundaries.
Changes
.agents/projects, with Phase 1 marked implemented and later phases preserved for follow-up..prisma/local.jsonreads inpackages/cli/src/lib/project/local-pin.tsto returnResultvalues with localTaggedErrorvariants for invalid JSON, invalid shape, cancellation, and unexpected failures.project list, andapp deploycallers to exhaustively convert the new local-pin read errors while preserving existingLOCAL_STATE_STALE,LOCAL_PROJECT_WORKSPACE_MISMATCH, and local binding outputs.AGENTS.mderror-handling rules for result-returning functions, abort mapping, andResult.gencomposition.Why
This starts the migration on the smallest read-only project context boundary. Missing local pins remain successful absence, while parse and shape failures are now modeled errors that must be exhaustively handled as the remaining command boundaries migrate.
Verification
pnpm --filter @prisma/cli exec vitest run tests/project-resolution.test.ts tests/project.test.ts tests/app-controller.test.ts --testTimeout 15000pnpm --filter @prisma/cli exec tsc -p tsconfig.json --pretty falsestill fails on existing unrelated type errors in branch database, branch controller, project real-mode tests, helper typing, and script declaration imports.