Fix(vinaya-web): Trace repo-root marker for /docs + /the-harness - #707
Fix(vinaya-web): Trace repo-root marker for /docs + /the-harness#707daniboomerang wants to merge 2 commits into
Conversation
- findRepoRoot() walks up for vinaya.config.json (ROOT_MARKER since #664) - tracing config still shipped only the previous marker, so both routes threw before reading any doctrine file — a prod-only 500 - add vinaya.config.json to outputFileTracingIncludes
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Security review — PR #707Scope reviewed: The question that mattered: what does this newly ship into the production lambda? Exactly one file: It also cannot be served. Two independent reasons:
Pre-existing traced content (checked, unchanged by this PR): 42 tracked files under Confirmed not changed by this diff: no new network call, no new file write (the added path is a read-only tracing declaration), no new The two documentation edits are architectural prose about marker files and file tracing. No credential, no internal hostname, no private endpoint, no non-public identifier introduced. VERDICT: PASS FINDINGS (ordered by severity):
CONFIG SCAN: not applicable — the PR touches no agent, skill, hook, or MCP configuration ( Tokens: pr-707: security — Security — claude-opus-5 — — |
|
|
VERDICT: REQUEST CHANGES BRIEF CONFORMANCE: The PR body is the specification here (standalone SPEC CONFORMANCE: clean — the addition to What I verified independently1. The trace entry fixes the stated cause, and the path is right. Reproduced the failure surface from the code, not the report: Path resolution checks out. 2. The verification is real, and I re-ran it. I found a stale pre-fix I also checked the doctrine glob itself rather than assuming it: 3. Keeping 4. No second instance of the same bug in this app. This was the finding most worth having, so I swept for it exhaustively rather than spot-checking. There are exactly three upward walks under
5. The FINDINGS (ordered by severity):
SCOPE: clean — three files, all germane. No drive-by edits, no unrelated cleanups. The code change is correct and I would not hold it for anything I found in Tokens: fix/vinaya-root-marker-tracing: review — Reviewer — claude-opus-5 — — |
- #664 moved two markers and declared one; it was not a late follow-up - load-diagram.ts said build-time /how-it-works; it is request-time /the-harness
Addressed in
|
|
VERDICT: APPROVE Re-review of BRIEF CONFORMANCE: The PR body remains the specification (standalone SPEC CONFORMANCE: clean. The MAJOR is fixed, and the replacement is correctI checked the new history claim against the commits, not against the correction. Every checkable assertion in both rewrites holds:
Against
The "never stale in the 'someone forgot to follow up' sense" framing is the accurate one, and it is a sharper lesson than the count it replaced: the commit looked complete because it did update the tracing list — just for the marker it was moving rather than the one it was creating. That is the thing a future reader needs. Nothing in either rewrite now contradicts the log. I also re-checked the surviving The MINOR stale comment is fixed
The fix itself still verifies at the new headThe doc commit touches no build-affecting code, but I did not assume that. At
Eight levels up from FINDINGS (ordered by severity):
SCOPE: clean — four files, all germane. The fourth ( Approving. The change is minimal, the root cause is right, the path resolves to the repo root, and the two markers that remain in the list are both live ( Tokens: fix/vinaya-root-marker-tracing: re-review — Reviewer — claude-opus-5 — — |
Tier: 1
Project: vinaya
Production hotfix.
https://vinaya.attalabs.dev/the-harnessand/docswere returning 500; every other route was fine.Symptom
The runtime error is visible only in
vercel logs— the build is green, because nothing about this fails at build time:Root cause
Both failing routes reach disk through
findRepoRoot()(apps/vinaya/web/src/lib/github-links.ts), which walks up fromprocess.cwd()looking for a marker file and throws if it never finds one. Every route that does not call it was unaffected — which is what made the failure look selective and unrelated to deploys.ROOT_MARKERbecamevinaya.config.jsonin #664 (5612c1bc), so that a repo carrying a Vinaya config but no project registry would still resolve.next.config.ts'soutputFileTracingIncludeswas never updated and still shipped only the previous marker,.vinaya/projects.md.On Vercel the serverless bundle contains only what file tracing detects.
aeg-root/**was present and the doctrine reads would have worked — but the marker that locates it was absent, so the walk failed before any doctrine file was opened. Locally the file is always there, so this could not reproduce outside production.Fix
One entry added to the tracing list, plus a comment recording the coupling that has now broken twice (
packages/governance/projects.md→.vinaya/projects.md→vinaya.config.json, tracing config following late each time):.vinaya/projects.mdstays —src/lib/repo-state/read-root.tswalks up for that one independently, by a different test.Verification
Built
@atta/vinaya-weband read the route file traces directly, which is the only local check that proves what the lambda will contain:bun run build --filter=@atta/vinaya-web— passes.bun run typecheck --filter=@atta/vinaya-web— passes.bunx biome check apps/vinaya/web/next.config.ts— passes.No behaviour changes locally; the marker file was always resolvable there. The real proof is post-merge: both routes returning 200 on
vinaya.attalabs.dev.Test Plan:
bun run build --filter=@atta/vinaya-webexits 0..next/server/app/(site)/{the-harness,docs}/page.js.nft.json) listvinaya.config.json.https://vinaya-git-fix-vinaya-7b814f-daniel-estevezs-projects-6fbb0ca1.vercel.app/the-harnessand/docsboth render instead of 500ing.