You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(media): remove personal transcript dependency from unit suite #641
The unit suite is not self-contained: imageAttachment.test.ts requires a personal Claude transcript at an absolute path under ~/.claude/projects. When that local corpus file is absent, the repository-wide test command fails even though the checked-in fixture and implementation are unchanged.
Impact
A clean checkout or worktree can report a red full suite for reasons unrelated to its diff. This weakens CI/local verification because contributors must distinguish product regressions from unavailable private corpus data.
Expected behavior
Checked-in automated tests either use repository-owned fixtures or skip/report external corpus validation explicitly when the referenced source session is unavailable.
Actual behavior
The corpus-wide invariant calls existsSync on the absolute source-session path and fails when this file is missing:
Run NODE_ENV=test npx vitest run --project unit src/providers/shared/renderer/protocols/media/imageAttachment.test.ts.
Observe atp-codex-image-inside-claude-transcript cites a missing session.
Environment
Branch: unchanged main at 116aecc9
Platform: macOS
Observed: 2026-08-26
Vitest project: unit
Resolution conditions
The media fixture contract remains traceable without making the ordinary unit suite depend on one developer's private filesystem. The intended corpus-audit behavior and its unavailable-data behavior are both covered.
Relationships
Discovered while verifying the managed personal skills feature. That feature does not touch the media protocol, fixture census, or transcript corpus.
Fixed by PR #1084 (3c40d415, 2b79c146, c1370041, 897ea538) and never closed.
imageAttachment.test.ts no longer imports homedir or existsSync at all. The deterministic tier now asserts only self-contained properties — malformedCitations(allFixtures()) is empty, every fixture has a census row and a proves line, the citation is a well-formed path:line, and the corpus count is pinned — so it cannot fail because of what is or is not in one developer's provider history.
The traceability half moved behind an opt-in: imageAttachment.live.test.ts, gated by AGENT_CODE_LIVE_IMAGE_CORPUS=1 through describe.skipIf, with **/*.live.test.ts excluded from the unit project and npm run test:live:image-corpus as the entry point.
The part worth recording, because it is the subtler half of this bug: c1370041 changed unreachableCitations to match on provider directory segments rather than the extractor's own home. Without that, the live suite would have passed vacuously on every machine except the one that wrote the fixtures — which is worse than not having it, since a green run would have meant nothing. imageAttachment.test.ts:267-277 now pins that property deterministically.
Activity
Juliusolsson05 commentedon Sep 20, 2026
Fixed by PR #1084 (
3c40d415,2b79c146,c1370041,897ea538) and never closed.imageAttachment.test.tsno longer importshomedirorexistsSyncat all. The deterministic tier now asserts only self-contained properties —malformedCitations(allFixtures())is empty, every fixture has a census row and aprovesline, the citation is a well-formedpath:line, and the corpus count is pinned — so it cannot fail because of what is or is not in one developer's provider history.The traceability half moved behind an opt-in:
imageAttachment.live.test.ts, gated byAGENT_CODE_LIVE_IMAGE_CORPUS=1throughdescribe.skipIf, with**/*.live.test.tsexcluded from the unit project andnpm run test:live:image-corpusas the entry point.The part worth recording, because it is the subtler half of this bug:
c1370041changedunreachableCitationsto match on provider directory segments rather than the extractor's own home. Without that, the live suite would have passed vacuously on every machine except the one that wrote the fixtures — which is worse than not having it, since a green run would have meant nothing.imageAttachment.test.ts:267-277now pins that property deterministically.