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
refactor(spec): build-docs uses the shared generated-output sink (#3145)
#3138 extracted the emit()/manageDir()/flush() sink to lib/generated-output.ts and moved
build-skill-references + build-react-blocks-contract onto it, but left build-docs.ts
carrying the inline original — #3126 was rewriting the same file and the migration would
have conflicted. #3126 has landed, so collect the debt.
Two copies of a check/write sink is the one duplication this design cannot afford: its
whole claim is that --check and write are the same code, and that claim is per copy. A
fix to one silently leaves the other behind, and the failure mode is a gate that passes
on output a real run would not produce.
Adds wasEmitted() to the shared sink. build-docs is the first caller whose later output
depends on its earlier output — each category index links only the pages that got
generated — and that question belongs to the sink, which already owns the emitted map.
New export; the other two callers are unaffected. The empty-input guard moves to
flush()'s guard hook, same meaning.
Pure refactor, verified: byte-identical output across all 258 files; all five drift
classes still fail (stale content, missing page, stale leftover, no-schema guard,
in-sync green); both existing sink callers regress clean, including #3138's reverse test
that a hand-written .md in skills/*/references/ keeps the gate green and survives a write.
Net -58 lines.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments