Fix stale doc_sourced reference and enforce provenance consistency - #27
Open
leggetter wants to merge 1 commit into
Open
Fix stale doc_sourced reference and enforce provenance consistency#27leggetter wants to merge 1 commit into
leggetter wants to merge 1 commit into
Conversation
…stency The README still told contributors that an all-doc-sourced provider carries `doc_sourced: true` in its index.json. Nothing has done that since provenance replaced the flag — no index.json sets it and no code reads it. Replaced with what actually marks those versions, `"sourced_via": "docs"`. That leaves two records of the same fact: the per-file `source` key doc-sourced samples carry, and the version-level provenance block. They're complementary — per-file travels with the payload, version-level is what a consumer filters on without downloading every version file — but nothing stopped them drifting. `compile.ts` now fails the build when a version marked `capture` contains a file with a `source` key. That's the drift that matters: doc-sourced samples published under a claim they were captured live. The reverse isn't checked, since a `docs` version legitimately need not mark every file. Verified against the full tree: 112 providers and 1,260 doc-sourced files compile clean, and planting a `source` key in a captured version fails as intended. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019pce9oHWGjdwHsJNya1ovP
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Two small follow-ups after #26 and #25 merged.
The README still referenced
doc_sourcedIt told contributors that a provider whose samples are all doc-sourced carries
doc_sourced: truein itsindex.json. Nothing has done that since provenance replaced the flag — noindex.jsonsets it, and no code reads it. Replaced with what actually marks those versions:The two provenance records could drift
After both PRs, the same fact is recorded twice: the per-file
sourcekey that doc-sourced samples carry (1,260 files), and the version-levelprovenanceblock (95 providers). They're complementary rather than redundant — per-file travels with the payload and records exactly where each example was read, version-level is what a consumer can filter on without downloading every version file — but nothing kept them in step.compile.tsnow fails the build when a version markedcapturecontains a file with asourcekey:That's the drift worth catching: doc-sourced samples published under a claim they were captured live. The reverse isn't checked — a
docsversion legitimately needn't mark every file.Testing
yarn compilepasses on the full tree: 112 providers, 1,260 doc-sourced files, publishingdocs: 93, unknown: 21, capture: 2. Planting asourcekey into a captured version fails as intended, and removing it passes again.One thing worth a second opinion
This is stricter than the tree it validates, so it's a new way for a build to break. If someone captures fresh samples over a version that was previously
docsand flipssourced_viatocapturewithout clearing the oldsourcekeys, compile stops rather than warns. That's deliberate — publishing a doc example as captured is the failure mode the whole provenance idea exists to prevent — but @garethx it's yoursamples-doc/workflow it would interrupt most, so say if you'd rather it warned.🤖 Generated with Claude Code
https://claude.ai/code/session_019pce9oHWGjdwHsJNya1ovP