Commit 3f34549
authored
ci(governance): R5 generic — config-driven canonical-reference drift (#330)
## Summary
Adds a config-driven R5 step to the `security-policy` job in
`governance-reusable.yml`. Each caller repo declares its own
canonical-reference rules via
`.github/canonical-references/*.{yml,yaml}`; the step skips silently
when the directory is absent so repos opt in by creating it.
Rule file shape:
```yaml
id: short-slug
description: one-line summary
patterns:
- 'POSIX-ERE regex 1'
- 'POSIX-ERE regex 2'
canonical_pointer: path/to/single-source-of-truth.md
scope:
include:
- README.adoc
- CLAUDE.md
# …
```
POSIX-ERE semantics preserved via `grep -E`; YAML parsing via `python3`
+ PyYAML (standard on `ubuntu-latest`). Matches emit `::error
file=...,line=...::` annotations and fail the job.
## Why
Generalises echidna's R5a (bare prover counts → `docs/PROVER_COUNT.md`)
so sibling repos with their own canonical-reference cohorts can declare
drift patterns without carrying a per-repo workflow file:
- **proven**: lemma counts → `PROOF_STATUS.md`
- **affinescript**: stdlib fn counts → `STDLIB.md`
- **typed-wasm**: proof-obligation counts → `docs/PROOF_COUNT.md`
- **ephapax**: rule counts → `RULES.md`
R5b (estate-wide hardcoded version-string check) stays separate. The two
coexist: R5b is universal, R5 generic covers per-repo patterns.
## Self-tested
- ✅ YAML safe_load on the modified workflow
- ✅ Embedded heredoc Python compiles via `compile()` (58 lines, no
SyntaxError)
- ✅ Local exercise on synthetic config + drift docs: `128 prover
backends` + `144 ProverKind variants` both fire on line 2; `Tier-1
prover backends` correctly does NOT fire (anchoring preserved); clean
doc → 0 hits
- ✅ Backward-compat: standards itself has no
`.github/canonical-references/` → step exits 0 with `ℹ️ [R5] no
.github/canonical-references/ — skipped`
## Promotion roadmap
1. **(this PR)** Generic R5 lands in standards.
2. echidna migrates R5a into
`.github/canonical-references/prover-counts.yml` and deletes
`governance-doc-drift.yml`.
3. Cohort repos adopt incrementally as their canonical-reference docs
stabilise.
## Test plan
- [x] YAML safe_load OK
- [x] Embedded Python compiles
- [x] Negative test (synthetic drift) fires
- [x] Positive test (no config) skips silently
- [ ] CI on this PR — `governance / Security policy checks` green
Refs hyperpolymath/echidna#171, refs #329.1 parent bf406d6 commit 3f34549
1 file changed
Lines changed: 101 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
618 | 719 | | |
619 | 720 | | |
620 | 721 | | |
| |||
0 commit comments