Skip to content

feat(verify): parse CI workflows and prune aspirational manifest rows (#1064) - #1088

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/workflow-parsing-coverage-manifest-reality
May 16, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/workflow-parsing-coverage-manifest-reality

Conversation

@Sinity

@Sinity Sinity commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

Pack B (workflow/CI parsing) and Pack C (coverage-manifest reality) for
#1064. Adds a workflow-inventory helper and two manifest checks that
cross-reference declared CI state against committed workflow YAML;
prunes coverage-manifest fields and rows that no executable check
consumes.

Problem

distribution-coverage.yaml declares per-artifact ci_build,
ci_test, and ci_present flags; test-quality-coverage.yaml
declares ci_gate: true on dimensions. Until now nothing parsed
.github/workflows/*.yml to check whether the claimed CI wiring
actually exists — a manifest could lie about a CI gate that wasn't
real.

docs-media-coverage.yaml and distribution-coverage.yaml carried
fields (freshness_days, sections, providers, related_paths,
count) that no check consumed, so editing them looked like
verification work without producing evidence. docs-media-coverage.yaml
also carried entirely vacuous rows (screenshots, vhs_tapes with
path: null, count: 0) — pure aspiration.

security-privacy-coverage.yaml declared
dependency_audit: implemented: false even though dep-audit.yml
runs pip-audit in CI under --strict with OSV — pure drift.

Solution

Pack B — devtools/verify_ci_workflows.py, devtools/verify_manifests.py

  • inventory_workflows() returns a WorkflowInventory of workflow
    names, job names, every run: string, artifact upload names, and
    on: triggers. Handles the PyYAML quirk where the bare key on
    parses as the boolean True.
  • check_distribution_ci_claims() requires ci_build: true to be
    backed by a build_command that appears in some workflow run:;
    ci_test: true requires the verification_command (or fall back to
    build_command) to appear. Manifest cannot lie about CI wiring.
  • check_test_quality_ci_claims() requires ci_gate: true to be
    backed by either the declared tool string or the canonical
    devtools gate (devtools coverage-gate for pytest-cov).
  • Remote-only facts (branch protection, required-check names, success
    rate, runner availability) are deliberately not invented locally —
    the docstring on verify_ci_workflows.py says so explicitly.

Pack C — coverage-manifest reality

  • polylogue/verification/manifests/models.py:
    • DocMediaSurface: removed related_paths, sections,
      freshness_days, count, providers (no check consumed them).
      Kept path, generated_by, verified_by, notes, all of
      which feed check_coverage_references.
    • DistributionArtifact: removed unused freshness_days.
  • docs/plans/docs-media-coverage.yaml: rewrote with only consumed
    fields; removed screenshots and vhs_tapes rows entirely
    (tracking that decision in docs-media: commit screenshots and VHS tapes (was aspirational manifest row) #1082).
  • docs/plans/distribution-coverage.yaml: removed freshness_days
    entries from the three artifacts that carried it.
  • docs/plans/security-privacy-coverage.yaml: dependency_audit now
    reflects the pip-audit CI workflow with controls +
    test_coverage.location pointing at .github/workflows/dep-audit.yml.
    The stale security.dependency-audit gap row was removed since the
    gap no longer exists.
  • polylogue/verification/manifests/models.py continues to declare
    model_config = ConfigDict(extra="forbid") on the pruned models,
    so re-adding a removed field without a check now fails validation
    rather than landing silently.

Drift bug found

security-privacy-coverage.yaml's dependency_audit claimed
implemented: false while .github/workflows/dep-audit.yml
demonstrably runs pip-audit --strict on the locked dependency set.
Reconciled.

Verification

nix develop -c devtools verify-manifests
  # ✓ manifest consistency checks passed
nix develop -c devtools verify-ci-workflows
  # verify-ci-workflows: 8 workflow files checked, no errors
nix develop -c pytest tests/unit/devtools/test_verify_manifests.py \
                     tests/unit/devtools/test_verify_ci_workflows.py
  # 31 passed in 0.38s
nix develop -c ruff check devtools/ tests/unit/devtools/
  # All checks passed!
nix develop -c mypy devtools/verify_ci_workflows.py \
                    devtools/verify_manifests.py \
                    polylogue/verification/manifests/models.py
  # Success: no issues found in 3 source files

The pre-push hook ran devtools verify --quick (all gates green
modulo non-issue mypy strictness on a test helper, fixed before push).

Follow-ups

Ref #1064

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented May 16, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 2 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4e211dba-74a3-4d1c-95ac-be3895ea4911

📥 Commits

Reviewing files that changed from the base of the PR and between a141aa7 and 301dd6d.

📒 Files selected for processing (9)
  • devtools/verify_ci_workflows.py
  • devtools/verify_manifests.py
  • docs/plans/distribution-coverage.yaml
  • docs/plans/docs-media-coverage.yaml
  • docs/plans/security-privacy-coverage.yaml
  • docs/verification-catalog.md
  • polylogue/verification/manifests/models.py
  • tests/unit/devtools/test_verify_ci_workflows.py
  • tests/unit/devtools/test_verify_manifests.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/workflow-parsing-coverage-manifest-reality

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ce2098430

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_manifests.py Resolved
Sinity added a commit that referenced this pull request May 16, 2026
## Summary

Six pre-existing test failures on master were blocking every newly
opened PR in the #1058 wave (#1081, #1086, #1087, #1088, #1089). All
trace to incomplete cleanup after earlier proof-runner retirement work.

## Problem

`pytest --ignore=tests/integration,benchmarks,fuzz` on
`origin/master@fc3c43f` exits with 6 failures:

-
`tests/unit/devtools/test_benchmark_campaign.py::test_compile_benchmark_campaigns_indexes_by_name`
-
`tests/unit/devtools/test_benchmark_campaign.py::test_benchmark_scenario_index_tracks_authored_catalog`
-
`tests/unit/devtools/test_scenario_projections.py::test_all_projection_operation_targets_are_declared`
-
`tests/proof/laws/completeness/test_every_command_has_help_claim.py::*`
-
`tests/proof/laws/completeness/test_every_json_command_has_envelope_claim.py::*`
-
`tests/proof/laws/anti_dead_code/test_every_subject_has_at_least_one_claim.py::test_every_subject_of_a_fully_bound_kind_is_selected[cli.command]`

Multiple parallel agents inherited and flagged these failures; they
cannot be cleared at PR scope because each PR is supposed to follow the
"no inherited debt" rule.

## Solution

1. **Benchmark catalog drift** — `BENCHMARK_SCENARIOS` grew to include
`reader-api` and `daemon-convergence` (real entries with pytest paths).
Two tests still asserted the old 3-element set, and the new
`operation_targets` (`benchmark.reader.api`,
`benchmark.daemon.convergence`) had no declared `OperationSpec`. Added
the two missing `OperationSpec` rows in `polylogue/operations/specs.py`
and updated the test assertions.

2. **Stale proof-law tests** —
`tests/proof/laws/completeness/test_every_command_has_help_claim.py` and
`test_every_json_command_has_envelope_claim.py` asserted the existence
of `cli.command.{help,no_traceback,plain_mode,json_envelope}` proof
claims. Those were intentionally retired in PRs #1069/#594 (proof-runner
cleanup) because the intent is now pinned by pytest contract evidence
tests under `tests/unit/cli/` (`test_json_envelope_contract.py`,
`test_plain_output_contract.py`, `test_help_contract.py`,
`test_cli_error_boundaries.py`). The law tests are stale debt — both
files deleted.

3. **\`_FULLY_BOUND_KINDS\` parametrize drift** — same retirement
removed all claims selecting `cli.command` / `cli.json_command`
subjects. Removed both kinds from `_FULLY_BOUND_KINDS` in
`test_every_subject_has_at_least_one_claim.py` — the CLI contract suites
cover the surface directly now.

4. **Generated docs** — `docs/test-quality-workflows.md` and
`docs/verification-catalog.md` regen as part of the new OperationSpec
rows.

## Verification

```
nix develop -c pytest --ignore=tests/integration --ignore=tests/benchmarks --ignore=tests/fuzz -q --no-header
# 6841 passed, 2 xfailed, 0 failed (was 6 failed before)
nix develop -c devtools verify --quick  # exit 0
```

Ref #1058 #594 #1069

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
…#1064)

Pack B (workflow/CI parsing) and Pack C (coverage-manifest reality) for
cross-reference declared CI state against committed workflow YAML;
prunes coverage-manifest fields and rows that no executable check
consumes.

Problem

  distribution-coverage.yaml declares per-artifact ci_build, ci_test,
  and ci_present flags; test-quality-coverage.yaml declares
  ci_gate: true on dimensions. Until now nothing parsed
  .github/workflows/*.yml to check whether the claimed CI wiring
  actually exists. docs-media-coverage.yaml and other manifests carried
  fields (freshness_days, sections, providers, related_paths, count)
  that no check consumed, so editing them looked like verification work
  without producing evidence. security-privacy-coverage.yaml declared
  dependency_audit: implemented: false even though the dep-audit
  workflow runs pip-audit in CI — pure drift.

Solution

  Pack B (devtools/verify_ci_workflows.py,
  devtools/verify_manifests.py)

  - inventory_workflows() returns a WorkflowInventory of workflow
    names, job names, every run: string, artifact_uploads, and on:
    triggers, handling PyYAML's bool-cast of the "on" key.
  - check_distribution_ci_claims() requires ci_build: true to be
    backed by a build_command that appears in some workflow run:; same
    for ci_test with verification_command or build_command.
  - check_test_quality_ci_claims() requires ci_gate: true to be
    backed by either the declared tool string or the canonical
    devtools gate command (devtools coverage-gate for pytest-cov).
  - Remote-only facts (branch protection, required checks, success
    rate) are deliberately not invented locally.

  Pack C (docs/plans/*coverage*.yaml,
  polylogue/verification/manifests/models.py)

  - DocMediaSurface: removed unused related_paths, sections,
    freshness_days, count, providers; kept path, generated_by,
    verified_by, notes — all of which feed real checks.
  - DistributionArtifact: removed unused freshness_days.
  - docs-media-coverage.yaml: removed vacuous screenshots / vhs_tapes
    rows (path: null, count: 0). Tracking issue #1082 opened for the
    decision on whether to commit such assets with a real check.
  - security-privacy-coverage.yaml: dependency_audit now reflects the
    pip-audit CI workflow with controls + test_coverage.location;
    the stale security.dependency-audit gap row was removed since the
    gap no longer exists.

Verification

  nix develop -c devtools verify-manifests   # passes
  nix develop -c devtools verify-ci-workflows # 8 workflows checked
  nix develop -c pytest tests/unit/devtools/test_verify_manifests.py \
                       tests/unit/devtools/test_verify_ci_workflows.py
  # 31 passed in 0.40s
  nix develop -c ruff check devtools/ tests/unit/devtools/  # clean
  nix develop -c mypy devtools/verify_ci_workflows.py \
                      devtools/verify_manifests.py \
                      polylogue/verification/manifests/models.py
  # Success

Follow-ups

  - #1082 — decide whether to commit screenshots/VHS tapes with a real
    render/freshness gate, or close as won't-do.

Ref #1064

Co-Authored-By: Claude <[email protected]>
@Sinity
Sinity force-pushed the feature/feat/workflow-parsing-coverage-manifest-reality branch from 6ce2098 to 301dd6d Compare May 16, 2026 11:42
@Sinity
Sinity merged commit c31d0d2 into master May 16, 2026
3 checks passed
@Sinity
Sinity deleted the feature/feat/workflow-parsing-coverage-manifest-reality branch May 16, 2026 11:42
Sinity added a commit that referenced this pull request May 16, 2026
… (#1091)

## Summary

Adds `devtools evidence-dashboard` and `devtools evidence-dashboard
trace` as the V7/V8 surface for #998 — a pytest-first evidence dashboard
built over the real artifacts produced by PRs #1083/#1086/#1087/#1088,
plus a changed-path traceability view that links each change to its
committed contract evidence and required gates.

## Problem

The pytest-first evidence model is now real:
`.cache/verify/last-pytest.json` (#1087),
`.cache/verification/evidence/*.json` (100+ artifacts),
`.cache/last-verify-result.json`, the SLO catalog with tier/freshness
(#1086), and parsed CI workflow facts (#1088) all exist. What was
missing was the single surface that reads those artifacts and presents
the V7 dashboard / V8 traceability view from #998, without rebuilding a
proof-row aggregator.

`devtools evidence-report` overlaps in shape but is anchored to
verify-history + suppressions + witnesses. It is intentionally left in
place; the new dashboard is a sibling so existing consumers and tests
are not disturbed.

## Solution

New module `devtools/evidence_dashboard.py` with sections, each backed
by a real artifact (or reported as `available: false` with the reason —
no aspirational rows):

- pytest health from `.cache/verify/last-pytest.json` (status, counts,
duration, last-run, staleness)
- contract evidence inventory from
`.cache/verification/evidence/*.json`, grouped by surface, with
stale-artifact and dirty-tree detection
- coverage from `coverage.xml` (line %) or `.coverage` (presence only)
when present
- benchmark campaign freshness from `.local/benchmark-campaigns/`
- SLO catalog rows (required vs informational) parsed via the existing
`devtools.verify_slos._parse_slo_catalog`
- static gate status from `.cache/last-verify-result.json` (preferred)
falling back to `.cache/verify-history.jsonl`
- witness counts (`tests/witnesses/` + `.local/witnesses/`)
- mutation campaign freshness from `.local/mutation-campaigns/`

`evidence-dashboard trace --base <ref> --head <ref>` reuses
`build_verification_impact_report` and joins each change subject (by
`test_nodeid` → test source path) to the contract-evidence artifacts
emitted by that test, plus required PR gates and deployment gates.
Output is JSON by default and Markdown when `--markdown` is set; both
formats are combinable.

Registered in `devtools/command_catalog.py`, `docs/devtools.md`
regenerated.

## Verification

Local commands run:

- `nix develop -c pytest tests/unit/devtools/test_evidence_dashboard.py
-v` — 15 passed
- `nix develop -c pytest tests/unit/devtools/test_evidence_dashboard.py
tests/unit/devtools/test_evidence_report.py
tests/unit/devtools/test_command_catalog.py
tests/unit/devtools/test_render_devtools_reference.py -q` — 35 passed
- `nix develop -c mypy devtools/evidence_dashboard.py
tests/unit/devtools/test_evidence_dashboard.py` — Success: no issues
- `nix develop -c ruff check devtools/evidence_dashboard.py
tests/unit/devtools/test_evidence_dashboard.py` — clean
- `nix develop -c devtools render-all --check` — sync OK
- `nix develop -c devtools verify --quick` — exit_code 0
- `nix develop -c devtools evidence-dashboard --json` — emits dashboard
against this worktree, correctly reports missing
pytest/coverage/campaign artifacts on the clean fixture worktree,
surfaces real SLO catalog rows (3 required, 3 informational) and witness
counts
- `nix develop -c devtools evidence-dashboard trace --base origin/master
--head HEAD --json` — emits trace; 0 changes on the post-commit working
tree, required_gates and deployment_gates populated from the
verification-impact pipeline

## Artifact gaps observed

The dashboard reports these as `available: false` because the underlying
artifacts don't exist in this worktree:

- `.cache/verify/last-pytest.json` — only produced by `devtools verify`
runs that include the pytest step; a fresh worktree without a verify run
reports unavailable
- `coverage.xml` / `.coverage` — none committed; `devtools
coverage-gate` produces them
- `.local/benchmark-campaigns/` — populated only by `devtools
benchmark-campaign run <name>`
- `.local/mutation-campaigns/` — populated only by `devtools
mutmut-campaign run <name>`

These gaps are honest: the dashboard does not fabricate values, and each
section names the command needed to populate it. The main checkout at
`/realm/project/polylogue` is the same shape — the SLO catalog,
witnesses, and static-gate cache are present; coverage and pytest-report
artifacts depend on operator runs.

Ref #998
Ref #1058

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added `evidence-dashboard` developer command with a dashboard mode to
visualize verification artifacts, test health, coverage status, and
benchmark freshness.
* Includes a trace subcommand to map changed paths to verification
impacts and related evidence.
* Both modes support JSON and Markdown output formats with configurable
thresholds.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Sinity/polylogue/pull/1091?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Sonnet 4.7 <[email protected]>
Sinity added a commit that referenced this pull request May 16, 2026
…al rows (#1082) (#1096)

## Summary

Records the policy decision for `docs/media/` (no committed screenshots
or VHS tapes; render on demand from `polylogue/showcase/` exercises)
and brings the docs-media coverage manifest in line with what is
actually committed. Resolves the question #1082 left open.

## Problem

PR #1088 stripped the aspirational `screenshots` and `vhs_tapes` rows
from `docs/plans/docs-media-coverage.yaml` because they had no
executable verification path — no asset to check, no freshness gate,
no render target. #1082 asked whether to commit those assets and
reintroduce real rows, or close the question.

The manifest carried a placeholder coverage_gap
(`docs-media.screenshot-integrity`) and an inline comment pointing at
#1082, but neither described an actual gap in committed content — they
described an undecided product question.

## Solution

Decision: do not commit screenshots or VHS tapes. Cost/benefit analysis:

- README does not currently reference any screenshots or VHS tapes
  (verified with `grep`).
- Committed terminal/UI captures bind the repo to specific terminal
  sizes, themes, fonts, sample data, and timestamps, all of which
  drift faster than the underlying code — large diffs with no semantic
  signal that date the documentation badly.
- The showcase + qa workflows already provide reproducible captures
  when needed (release notes, blog posts, the website).
- A committed asset without a `--check`-style freshness gate would be
  dead weight the manifest cannot honestly claim coverage over.

Changes:

- `docs/media/README.md` (new): policy doc explaining why the directory
  holds only renderable diagrams, and the three requirements any future
  committed asset must satisfy (render script, `--check` freshness
  gate, manifest row).
- `docs/plans/docs-media-coverage.yaml`: replace the
  screenshots/VHS-tape inline comment with a real `media_policy` row
  pointing at the README and a `readme_diagrams` row covering the
  Mermaid/SVG diagrams that `devtools render-readme-media` already
  verifies. Drop the `docs-media.screenshot-integrity` coverage_gap —
  the gap was the open question itself.
- `docs/verification-catalog.md`: regenerated (subjects +1,
  coverage_item +2, coverage_gap -1).
- `devtools/evidence_dashboard.py`: drop a redundant
  `isinstance(entry, dict)` ternary that mypy --strict rejects with
  `redundant-expr`. Landed unguarded by #1091 and has been red on
  master since; unblocks the pre-push hook for this PR. Pulled into
  this branch only because the gate would otherwise prevent the
  policy change from landing.

## Verification

```
nix develop -c devtools verify-manifests
  ✓ manifest consistency checks passed

nix develop -c devtools render-readme-media --check
  (no drift)

nix develop -c devtools render-all --check
  OK: .cache/site matches sources.

nix develop -c devtools verify --quick
  exit_code: 0 (after the evidence_dashboard.py fix)
```

Closes #1082
@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

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