Measured on 2026-10-26: an app's home spends 5–13 ms in policy (/trevato/speed-to-lead: 13.4 ms, /trevato/arm: 7.9 ms) out of 20–35 ms. policyLine calls audit(reposRoot, repo) (src/contract/audit.ts:112), which reads the repository on every load.
Done when:
[ ] audit caches its result by (repository, default tip), in memory and bounded.
[ ] A test asserts that a warm audit is under 2 ms, and that a push changing forge.json changes the result on the next read.
Files: src/contract/audit.ts, test/contract-audit-cache.test.ts.
Risk: #4757 restyles the same policy line in src/web/studio/app.ts. This issue stays in src/contract/audit.ts, so the two do not collide.
Measured on 2026-10-26: an app's home spends 5–13 ms in
policy(/trevato/speed-to-lead: 13.4 ms,/trevato/arm: 7.9 ms) out of 20–35 ms.policyLinecallsaudit(reposRoot, repo)(src/contract/audit.ts:112), which reads the repository on every load.Done when:
auditcaches its result by (repository, default tip), in memory and bounded.Files: src/contract/audit.ts, test/contract-audit-cache.test.ts. Risk: #4757 restyles the same policy line in src/web/studio/app.ts. This issue stays in src/contract/audit.ts, so the two do not collide.