fix(deps): resolve @chittyos/schema lockfile drift#121
Conversation
Introduce a structural books/accounting boundary with no behavior change. Books writes facts (ingest, categorize, journal); accounting derives meaning (chart of accounts, reporting, tax, allocations). - move transactions/import/webhooks -> server/books/ - move accounts/reports/tax/allocations -> server/accounting/ - add concern-boundary READMEs for each tree - classification.ts stays in routes/ (straddles both); note added - fix import paths in app.ts and __tests__ Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Revert PR #103's refactor that introduced an unresolvable file: dependency. Root cause: PR #103 swapped the self-contained local scope-projector for a thin adapter over `@chittyos/schema`, declared as `file:../../CHITTYFOUNDATION/chittyschema`. That sibling-repo path only exists on the dev VM. In CI it cannot resolve, and worse, pnpm 10 refuses to record file: directory links in the lockfile importer block at all — so `pnpm install --frozen-lockfile` always sees a specifier mismatch ("1 dependencies were added: @chittyos/schema@file:..."), failing the Dependency Audit (High+) gate on every PR (#119, #120). No clean dependency form resolves in CI: the package is unpublished (npm 404), its dist/ is gitignored in the sibling repo (so a github: dep ships no build), and it has no prepare script. Fix: restore the pre-#103 self-contained implementation of server/lib/central-workflows.ts (175 lines, uses @neondatabase/serverless which is already a dependency) and drop the @chittyos/schema dependency. Public API (scopeLog, SCOPE_TYPES, ScopeStatus, etc.) is unchanged, so callers in workflows.ts and reports.ts are unaffected. Regenerated lockfile. Verified in a clean checkout (sibling repo absent, pnpm 10): pnpm install --frozen-lockfile -> exit 0 pnpm audit --prod --audit-level high ... -> exit 0 npm run check (tsc) -> exit 0 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 7 minutes and 11 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (21)
✨ Finishing Touches🧪 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 |
|
@coderabbitai review Please evaluate:
|
Code Review — PR #121: fix(deps): resolve @chittyos/schema lockfile drift
OverviewThree distinct concerns bundled into one fix:
All three are correct and the overall direction is good. A few things worth tracking: Issues1. PR description overstates API preservation The description claims
Suggestion: Either re-add 2. CLAUDE.md: "All DB access through The new 3. No test coverage for the restored The pre-#103 code was presumably also untested here. But this is a meaningful chunk of new logic (status mapping, SQL upsert shape, fall-open behavior). At minimum, a unit test for Minor Observations
Summary
The fix is solid. The two items above worth addressing in follow-up: re-export (or explicitly drop) the three types, and add a note in |
Root cause
PR #103 refactored
server/lib/central-workflows.tsto delegate to a shared@chittyos/schema/scope-projector, declaring the dependency asfile:../../CHITTYFOUNDATION/chittyschema. That path is a sibling repo that only exists on the dev VM.Two failures result:
file:directory links in the lockfileimportersblock, sopnpm install --frozen-lockfilealways reports a specifier mismatch:1 dependencies were added: @chittyos/schema@file:../../CHITTYFOUNDATION/chittyschemaThis fails the Dependency Audit (High+) gate (
security-gates.yml) on every PR, blocking #119 and #120.No clean dependency form fixes this:
@chittyos/schemais unpublished (npm 404), itsdist/is gitignored in the sibling repo (agithub:dep would ship no build output), and it has nopreparescript.Fix
Revert PR #103's refactor: restore the pre-#103 self-contained
central-workflows.ts(uses@neondatabase/serverless, already a dependency) and drop the@chittyos/schemadependency. Public API (scopeLog,SCOPE_TYPES,ScopeStatus,ScopeCharacterization,ScopeEnv) is unchanged, so callers inworkflows.tsandreports.tsare unaffected. The lockfile needs no change because pnpm 10 never recorded the link.Verification (clean checkout, sibling absent, pnpm 10)
Follow-up
If
@chittyos/schemashould be shared across services, publish it (npm/GH Packages) with builtdist/and pin a real version, then re-apply #103. Out of scope here.🤖 Generated with Claude Code