Skip to content

[codex] Add external snippet provenance comments#609

Draft
danielporterda wants to merge 1 commit into
mainfrom
snippet-provenance-comments
Draft

[codex] Add external snippet provenance comments#609
danielporterda wants to merge 1 commit into
mainfrom
snippet-provenance-comments

Conversation

@danielporterda
Copy link
Copy Markdown
Contributor

What changed

Adds a searchable source-snippet HTML comment to each generated external snippet MDX file. The comment records the source repo, source path, source commit hash, snippet name, and extraction location.

The generator keeps import-leading MDX valid by placing the provenance comment after the import block when a generated snippet starts with import statements.

Also documents the provenance convention in the external snippet update workflow README.

Why

This creates a stable text-search join between generated snippet files and the source repository state that produced them, which is the first step toward auditing orphaned or stale external snippets.

Validation

  • node --check scripts/generateOutputDocs.js
  • node --check scripts/helpers/generateOutputDocs.js
  • npm run generate:external-snippets -- --list
  • git diff --check origin/main...HEAD
  • Temporary git-backed extraction smoke test verified the comment includes the source commit and preserves import-first MDX ordering.

Notes

This PR changes the generator and docs only. It does not regenerate the checked-in snippet corpus yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant