docs(generator): document data provenance and source-of-truth rules - #1111
Draft
teallarson wants to merge 6 commits into
Draft
docs(generator): document data provenance and source-of-truth rules#1111teallarson wants to merge 6 commits into
teallarson wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ARCHITECTURE.md described the pipeline but not where any individual field comes from, so tracing a wrong category or a missing callout back to its origin meant reading the generator end to end. Adds a pipeline diagram, a per-field provenance table, and the constraints that are not visible from any single file: - The output directory is also an input. Hand-authored documentationChunks, customImports, and subPages have no upstream source and survive only through previous-output carry-forward, so --force-regenerate and --overwrite-output discard them as a side effect. - src/shared/toolkit-schemas.ts is the one contract, validated on write by the generator and on read by the app. - metadata.category and docsLink come from a pinned design-system dependency and determine the page URL, making a version bump a routing change. An unrecognized category throws rather than falling back. - Toolkits are derived by grouping tools, not fetched as a list. - Absence and corruption are different failures, enforced on both halves. Also records the skip-toolkits/remove-toolkits distinction, the cached loader, and the shared modules under src/shared/. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
teallarson
force-pushed
the
docs/generator-architecture
branch
from
August 3, 2026 19:47
bebad0b to
532d544
Compare
…lve-pr-1111 # Conflicts: # tests/toolkit-data-cache.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The provenance-docs slice (S7) of the docs-pipeline series. Base is
chore/hardening(#1106); #1105 has since merged tomain, so #1106 is the only PR still beneath this one. Documentation only; no code changes.Why
ARCHITECTURE.mddescribed the pipeline's shape but never said where any individual field comes from. Answering "why is this toolkit in the wrong sidebar section" or "where did this callout go" meant reading the generator end to end and then guessing. Three sources feed the same output file with very different durability guarantees, and nothing wrote that down.What's here
A per-field provenance table — the main deliverable. For every field in the committed JSON: which of the four sources it came from, and what has to happen for it to change. Arcade Engine, the pinned design-system package, Anthropic, and hand-authoring are not interchangeable, and the table makes that legible at a glance.
A pipeline diagram in the repo's existing plain
graph TDdialect. The dottedArtifact -.-> Mergeredge is the point: the output directory is also an input.Source-of-truth rules — five constraints that are true but invisible from any single file:
documentationChunks,customImports, andsubPageshave no upstream source. The nightly workflow does not pass--custom-sections, so they survive only through previous-output carry-forward.--force-regenerateand--overwrite-outputboth set the previous-output directory toundefined, which discards them — a side effect, not the documented intent of either flag.src/diff/previous-output.tscarries these three fields past a failed schema parse for the same reason, which is why that leniency should not be tidied away without giving prose another home first.src/shared/toolkit-schemas.ts, validated on write by the generator and on read by the app (refactor: singular + enforced toolkit data contract #1105).category+docsLinkdetermine the path. An unrecognized category now throws rather than falling back (refactor: singular + enforced toolkit data contract #1105)./v1/tool_metadata_summarywould give an authoritative list with per-toolkit counts;fetchToolkitsSummaryimplements it and nothing calls it.Also records the
skip-toolkits.txt/remove-toolkits.txtdistinction (#1103), the cached loader (#1105), the placeholder-metadata behaviour and--require-complete(#1106), and the newsrc/shared/modules.Verification
Every claim was checked against this branch's tip rather than
main, since the stack changes several of them. Specifically confirmed still true after all four PRs:previousOutputDirassignments insrc/cli/index.tsare unchanged,mergeCustomSectionsArraysis unchanged,src/diff/previous-output.tsis untouched by the stack (chore: turn on the checks that were inert #1106 edits only its test), and the workflow still omits--custom-sections— so the prose warning describes the post-stack system, not a problem already fixed.fetchToolkitsSummaryremains uncalled outside its own test.Confirmed changed by the stack and written to match:
normalizeCategorythrows with the expected-values list,loadAllToolkitDataiscache()-wrapped, app types arez.inferof the shared schemas,getDefaultMetadataforcesisHidden: trueand is tracked viausedDefaultMetadata.Drops the note about the root layout reading request headers, which #1104 already superseded.
Not in scope
The prose hazard is documented here, not fixed. The fix — decoupling "regenerate LLM content" from "carry prose forward" so
--force-regeneratestops discarding hand-authored content — belongs indata-merger.tsandcli/index.ts, both of which #1106 owns. Worth doing before the next--force-regeneraterun.🤖 Generated with Claude Code