Add canonical code index generator, tests, and governance validation/repair enhancements#68
Merged
CAM-Initiative merged 5 commits intoMay 23, 2026
Conversation
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.
Motivation
.github/Indicesfor downstream consumers.Description
.github/scripts/build-canonical-code-index.pywhich scansGovernance/*.mdcanonical declaration tables and emits.github/Indices/canonical-code-index.mdand.github/Indices/canonical-code-index.jsonand a--checkmode that validates duplicates and conflicts..github/Indices/canonical-code-index.mdand.github/Indices/canonical-code-index.json.lint_amendment_ledger.pyto detect and report malformed amendment-ledger rows with line numbers, normalize historical blank hashes deterministically, and produce clearer failure messages.repair_governance_validations.pyto attempt safe, deterministic repairs for short-document refs, missing sections (when uniquely resolvable), and malformed amendment-ledger rows; unresolved items are recorded in a report.validate_markdown_section_refs.pyto treat short/ambiguous instrument references as blockingfail_short_document_reference, emit TSV report when--report-fileis supplied, and optionally write a GitHub step summary..github/workflows/governance-rebuild.yml,.github/workflows/Workflows.md, and maintainer docs in.github/scripts/Maintainer.md..github/scripts/tests/includingtest_build_canonical_code_index.py,test_repair_governance_validations.py, and updates to ledger/section-ref tests to reflect stricter failure modes.Testing
python .github/scripts/build-canonical-code-index.py --root Governance --checkagainst sample governance fixtures and observed no blocking errors.python -m pytest .github/scripts/tests, includingtest_build_canonical_code_index.py,test_repair_governance_validations.py, and updatedtest_lint_amendment_ledger_sha_policy.py, and the tests passed.python .github/scripts/validate_markdown_section_refs.py --root Governance --report-file validation-reports/section-reference-report.tsvto verify TSV output and GitHub step-summary writing in CI integration.Codex Task