The "all" domain had no findings — six claims re-measured, one comment was lying - #267
Conversation
`lib/audit-record.ts` opened by telling the reader that `@tenure/audit` "does not exist in this repository — `grep -rn '@tenure/audit'` finds exactly one hit, and it is the comment in `reconcile.ts` explaining the absence." Every clause of that is now false on main (9358bc2): · `packages/audit` is git-tracked here: record.ts (465), verify.ts (360), retention.ts (306), index.ts (74), audit.test.ts. · the grep finds four hits, not one. · `reconcile.ts:381` now says the OPPOSITE in as many words — "This comment used to say ... `@tenure/audit` exists only in the engine repository ... The gap is closed." It is wired, not merely present: root `workspaces: packages/*`, `apps/web/tsconfig.json:23` path map, jest `roots` naming `packages`, and a `moduleNameMapper` for the specifier. Its 71 tests are collected among the suite's 354 files and pass. Corrected in place rather than deleted, matching the convention `reconcile.ts` already set, and stating the thing that IS still true and is the reason the file exists: the two are separate on purpose. `buildAuditRecord` is a pure function over records; `recordAuditEvent` is the Prisma write path; nothing in `apps/web` imports the package yet. Comment-only. tsc 307 (parity), 95 tests green across both suites. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
satvikOS has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughThe module documentation now describes the existing ChangesAudit documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This PR corrects outdated documentation without changing application behavior or runtime configuration; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
ship-now-by-domain/all.jsoncontains exactly one entry,OB-6, and it is apointer entry —
"severity": "n/a","file": "(pointer entry, not a finding)",and an explicit instruction: "Do not re-file." So the deliverable for this
domain is the re-measurement, not a pile of fixes. Six claims, all checked at
9358bc24.The entry's one actionable line was a WARNING: "packages/ is empty on main —
confirm the audit package work is actually in flight." It is not in flight. It
landed. And the application still carries a comment insisting it does not exist,
which is the only thing in this domain I changed.
The one fix
apps/web/src/lib/audit-record.tsopened by telling its reader:Every clause is false on main.
packages/auditis git-tracked (record.ts465lines,
verify.ts360,retention.ts306,index.ts74, plusaudit.test.ts);the grep finds four hits; and
reconcile.ts:381now says the opposite in asmany words — "This comment used to say ...
@tenure/auditexists only in theengine repository ... The gap is closed."
It is wired, not merely present: root
workspaces: ["packages/*"],apps/web/tsconfig.json:23path map, jestroots: ["<rootDir>", ".../packages"],and a
moduleNameMapperfor the bare specifier. Its 71 tests are collectedamong the suite's 354 files and pass (0.149s).
Corrected in place rather than deleted — the convention
reconcile.tsalreadyset — and it now states what remains true and is the actual reason the file
exists: the two are separate on purpose.
buildAuditRecordis a purefunction over records touching no database;
recordAuditEventis the Prismawrite path; nothing in
apps/webimports the package yet. Comment-only.Refuted, with evidence
packages/auditcomplete, wired through four configs, 71 tests green.buildAuditRecord"recordAuditEvent. Exactly one rawdb.auditEvent.createremains outside the builder.budget.overrideguards an unread table whileadminAdjustBudgetholds the real poweradmin/actions.ts:1569"The BINDING happened";lib/finance-override.ts:110callsrequireCapability("budget.override", …).The single remaining hand-assembled audit write,
approvals/actions.ts:506, isnot a defect to sweep up. It is deliberate and documented on the spot:
recordAuditEventreads before it writes, so it cannot be an element of an array$transaction, and making the batch interactive would runeventUpdatesandreimbursementOps— already bound todb— outside the transaction, movingtwo compare-and-swaps out with them.
verifyAuditChainreports itunchainedand its successor still links through
legacyHashOf, so deleting it staysdetectable. The comment names the real fix and says it belongs in its own PR on
the money path. Agreed; left alone.
Confirmed, and correctly owned elsewhere — not re-filed
governance/register.ts:182— currency as a bare String. Alreadyregistered,
status: "FAIL", citing Financial Bible §14 and Payments Bible §5.write). Note for whoever writes it: 12 composite FKs already exist, written
references: [id, institutionId]. The sweep's own brief flags this exactpattern as the one a naive grep misses.
switcher exists: zero hits for
switchInstitution,InstitutionSwitcher,switch-institution,activeInstitutionId,currentInstitutionId.Verification
tsc --noEmit -p apps/web/tsconfig.json→ 307 errors = parity.jest audit-record audit.test→ 2 suites, 95 tests, all pass.indentation.
against the open-PR file lists.
What I did not do
No behavioural change anywhere. I did not converge
recordAuditEventontobuildAuditRecord— the shapes genuinely differ (pure function vs. Prisma writepath) and that is real work with its own tests. I did not run the full jest
suite; a comment-only diff cannot reach the three suites that fail on pristine
main, and I did not want to report a baseline I had not isolated.
🤖 Generated with Claude Code
Summary by CodeRabbit