scenario: measure and gate domain-workflow coverage (#364) #655
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
| name: Drift guard | |
| # Gates for the "a list that stopped matching what it describes" class of bug. | |
| # Every job here is fast and dependency-free; none of them compiles anything. | |
| # | |
| # Sections below: the spec <-> code gates, then the ladder rung-list gate. | |
| # | |
| # Two independent gates for the "spec <-> code drift" class of bug (a | |
| # docs/spec/*.md file stating a mechanical fact -- an enum cardinality, a | |
| # constant, a canonical error string, a glaze parsing flag -- that silently | |
| # stops matching the code): | |
| # | |
| # 1. The compiled pinned-facts test (tests/test_pinned_facts.cpp) needs no | |
| # job here: it is already part of the `morph_tests` target, so it runs | |
| # in every job of the main CI workflow (.github/workflows/ci.yml) for | |
| # free, and benefits from running under every compiler in that matrix | |
| # (GCC, Clang, MSVC, clang-cl) since the enum-cardinality switch pins | |
| # (see tests/test_pinned_facts.cpp) rely on compiler-specific warning | |
| # behavior that is worth exercising on all of them, not just one. | |
| # 2. The prose-vs-manifest lint (scripts/check_spec_citations.sh) is a | |
| # repo-wide text scan, unrelated to compilation -- it runs here, in its | |
| # own fast, dependency-free job. | |
| # | |
| # Unlike .github/workflows/spec-sync.yml, this gate has no "no docs update" | |
| # label escape hatch: a wrong citation or a reintroduced banned term is never | |
| # a legitimate state to merge, so there is nothing to opt out of. | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| # Supersede a run a newer commit on the same ref has made obsolete -- see the | |
| # note in ci.yml. Cheap here, but the queue it shares is account-wide. | |
| concurrency: | |
| group: drift-guard-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| prose-lint: | |
| name: Spec-citation & banned-terminology lint | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Same terms as rung-filter-lint below, and ci.yml's deprecation-lint and | |
| # test-type-name-lint: a lint gate nobody tests reports green whether or | |
| # not it still detects anything. The section-citation check (morph#316) | |
| # exists because this very script carried a check that could not fail, so | |
| # it is asserted to still fail before it is trusted to pass. | |
| - name: Self-test the spec-citation checker | |
| run: bash scripts/test_check_spec_citations.sh | |
| - name: Run prose-vs-manifest lint | |
| run: bash scripts/check_spec_citations.sh | |
| # ── Ladder rung list <-> the CI filters that are supposed to track it ── | |
| # examples/rungs.txt is the ladder's single authoritative rung list, and | |
| # almost every consumer now derives from it at run time. Two cannot -- | |
| # wasm-ladder.yml's `on.*.paths` (GitHub reads them before any step exists to | |
| # generate them) and codecov.yml (read by Codecov, not by us) -- so they are | |
| # checked against it here. | |
| # | |
| # This job has no path filter, deliberately. The bug it guards against | |
| # (morph#179) was a path filter that had gone stale; gating the guard on one | |
| # would reproduce the failure mode it exists to catch. | |
| rung-filter-lint: | |
| name: Ladder rung list vs. CI path filters | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # The gate itself is tested first, on the same terms as ci.yml's | |
| # deprecation-lint and test-type-name-lint jobs: a lint gate nobody tests | |
| # reports green whether or not it still detects anything -- and a filter | |
| # that detected nothing is precisely the defect this gate exists for. | |
| - name: Self-test the rung-filter checker | |
| run: bash scripts/test_check_rung_filters.sh | |
| - name: Check every known rung appears in the filters that cannot generate it | |
| run: bash scripts/check_rung_filters.sh |