Skip to content

fix(devtools): wire lab-policy gates into the live CI, not just build_verify_steps - #3587

Merged
Sinity merged 4 commits into
masterfrom
feature/chore/lab-policy-gate-placement
Aug 2, 2026
Merged

Sinity merged 4 commits into
masterfrom
feature/chore/lab-policy-gate-placement

Conversation

@Sinity

@Sinity Sinity commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes the gate-placement question in polylogue-ze5i for all 10 devtools lab policy * checks. Promotes demo-tour-freshness (previously red) into the default verify gate alongside schema-versioning/classifier-fingerprints, fixes CircleCI's quick-gate job so it actually runs that gate instead of a stale hand-picked subset, and wires the remaining 7 --lab-only checks into a new nightly CircleCI job so a continuously-failing policy is at least visible.

Problem

Measured 2026-07-28 (polylogue-ze5i): schema-versioning, demo-tour-freshness, backlog-hygiene, and bead-graph all sat behind devtools verify --lab, which no standing gate runs. A migration-number collision (PR #3566/#3568) made the live archive briefly unqueryable and was only caught by hand afterward (PR #3573).

A prior session moved schema-versioning (and classifier-fingerprints) out of --lab into devtools/verify.py's default if not commit: block. But investigating further this session found that promotion was hollow in practice: CircleCI's quick-gate job -- the only CI that actually runs in this repo (GitHub Actions is billing-locked/dark; .github/workflows/ci.yml references schema-versioning but does not execute) -- hand-picked five discrete steps (render all --check, public-claims, ruff, mypy) instead of calling devtools verify --quick. None of verify topology/verify layering/schema-versioning/classifier-fingerprints/schema promotion audit/etc. (~17 steps total) ever ran in live CI.

demo-tour-freshness itself was red: the committed docs/examples/demo-tour/ fixture was missing a healed_tiers key the demo receipts code had already grown.

Solution

  • devtools/verify.py: moved lab policy demo-tour-freshness from the if lab: block into the default if not commit: block, with a comment on why it's safe to gate every push (deterministic -- wall-clock timing already masked before comparison -- and fixed-cost against one committed fixture, unlike the corpus-scanning backlog-hygiene/bead-graph). Added an explanatory comment on why those two stay --lab-only.
  • docs/examples/demo-tour/: regenerated via polylogue demo tour --out-dir polylogue-demo-tour --force and copied the fresh evidence in, fixing the drift.
  • .circleci/config.yml: replaced quick-gate's four hand-picked steps with a single devtools verify --quick call (public-claims stays separate since it isn't part of that block) -- this self-heals going forward, since any future addition to build_verify_steps' default block is automatically covered without a matching CircleCI edit. Added a lab-policies job wired into the existing nightly scheduled workflow, running the 7 checks that remain intentionally --lab-only (timestamp-doctrine, insight-honesty, demo-packet-registry, docs-drift, campaign-archive-boundaries, backlog-hygiene, bead-graph), each step using when: always so the two known-red corpus-scan checks don't mask a regression in the other five.
  • tests/unit/devtools/test_verify.py: fixed test_quick_verify_omits_pytest's hardcoded step list, which was already failing on master before this change (missing classifier-fingerprints, added in an earlier PR without a matching test update).
  • Filed polylogue-2bp5f (485 backlog-hygiene findings) and polylogue-83nhi (225 beads missing acceptance criteria) to track the corpus-wide debt those two checks report, since fixing it is out of scope for a gate-placement change.
  • Closed polylogue-ze5i with the full per-policy classification table and rationale.

Verification

  • devtools test tests/unit/devtools/test_verify.py -- 88 passed.
  • devtools verify --quick -- green end-to-end, ~90-105s total.
  • Anti-vacuity: reintroduced the exact migration-number-collision shape (INDEX_SCHEMA_VERSION bump with no lifecycle.py delta declaration) and confirmed devtools verify --quick -- the exact command now wired into CircleCI's quick-gate -- fails with Policy violation: each index schema bump needs a declared delta class; reverted.
  • Anti-vacuity: injected drift into docs/examples/demo-tour/report.json and confirmed devtools lab policy demo-tour-freshness catches it; reverted.
  • python -c "import yaml; yaml.safe_load(open('.circleci/config.yml'))" parses cleanly; devtools verify ci-workflows passes (one pre-existing, unrelated warning on .github/workflows/ci.yml, not touched here).

Not run: the actual CircleCI pipeline (can't trigger from here) -- verified locally that the exact command it now calls (devtools verify --quick) behaves as claimed.

Ref polylogue-ze5i

Summary by CodeRabbit

  • Bug Fixes

    • Verification now includes additional policy checks, improving detection of stale demo content and classification issues.
    • Nightly validation now covers the complete policy-check suite, including known backlog items.
  • Documentation

    • Refreshed demo-tour examples with current manifest identifiers, timing data, output sizes, and report metadata.
    • Updated recorded transcripts and reports while preserving command results and exit statuses.
  • Tests

    • Updated verification expectations to reflect the expanded quick-check coverage.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dae666b3-240a-4370-8888-b085cf801949

📥 Commits

Reviewing files that changed from the base of the PR and between c4e709b and 0821280.

📒 Files selected for processing (7)
  • .circleci/config.yml
  • devtools/verify.py
  • docs/examples/demo-tour/command-output/01-claim-versus-receipt.txt
  • docs/examples/demo-tour/report.json
  • docs/examples/demo-tour/report.md
  • docs/examples/demo-tour/transcript.txt
  • tests/unit/devtools/test_verify.py

📝 Walkthrough

Walkthrough

The change routes quick CI verification through devtools verify --quick, adds scheduled lab policy checks, moves demo-tour freshness into standard verification, and refreshes demo-tour reports, transcripts, and sample manifest identifiers.

Changes

Verification and CI policy

Layer / File(s) Summary
Verification policy composition
devtools/verify.py, tests/unit/devtools/test_verify.py
The standard verification sequence now includes demo-tour freshness. The quick verification test expects classifier-fingerprints and demo-tour-freshness steps.
CircleCI verification workflows
.circleci/config.yml
quick-gate runs devtools verify --quick. A nightly lab-policies job runs seven lab policy commands with when: always.
Demo-tour fixture refresh
docs/examples/demo-tour/*
Demo-tour manifests, timings, report metadata, and transcript durations were updated. Command statuses, output sizes, and recorded content remain unchanged where specified.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes wiring lab-policy gates into active CI verification.
Description check ✅ Passed The description covers the required sections with clear problem, solution, verification, and scope details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/chore/lab-policy-gate-placement

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.

Sinity and others added 4 commits August 2, 2026 22:28
Problem: devtools/verify.py's build_verify_steps() keeps demo-tour-freshness
inside the `if lab:` block, so it never runs in `devtools verify`,
`devtools verify --quick` (the pre-push hook), or CI -- only the manual
`devtools verify --lab`/`--all` opt-in exercises it (polylogue-ze5i). The
committed docs/examples/demo-tour/ fixture had drifted (a `healed_tiers`
key the demo receipts code had already grown was missing from the
committed report.json/transcript.txt/command-output), invisible to every
standing gate.

What changed: regenerated the demo tour and copied the fresh evidence into
docs/examples/demo-tour/ so the check is green again. Moved the
"lab policy demo-tour-freshness" step from the `if lab:` block into the
default `if not commit:` block (same tier as schema-versioning and
classifier-fingerprints) with a comment explaining why it's safe to gate:
fully deterministic (wall-clock timing already masked before comparison)
and fixed-cost against one committed fixture, unlike backlog-hygiene/
bead-graph (which scan the whole Beads corpus and are left --lab-only,
also documented inline).

Also fixed test_quick_verify_omits_pytest, which hardcoded the exact step
list and was already failing on master before this change (missing
"lab policy classifier-fingerprints", added in an earlier PR without a
matching test update).

Verification: `devtools test tests/unit/devtools/test_verify.py` (88
passed). `devtools lab policy demo-tour-freshness` now passes standalone.

Ref polylogue-ze5i

Co-Authored-By: Claude <[email protected]>
Problem: docs/examples/demo-tour/ had drifted from what
`polylogue demo tour` actually emits -- report.json was missing the
`healed_tiers` key the demo receipts code had already grown, and the
completion-claim sample manifest hash had shifted accordingly. Nothing
caught this because devtools lab policy demo-tour-freshness only ran
behind `devtools verify --lab` (see the paired devtools/verify.py commit
promoting it into the default gate).

What changed: ran `polylogue demo tour --out-dir polylogue-demo-tour
--force` and copied the regenerated report.json/report.md/transcript.txt/
command-output/01-claim-versus-receipt.txt into docs/examples/demo-tour/.
Wall-clock timing fields differ run-to-run by design (masked by the
freshness check itself); the only substantive diff is the added
healed_tiers key.

Verification: `devtools lab policy demo-tour-freshness` passes.

Ref polylogue-ze5i

Co-Authored-By: Claude <[email protected]>
Problem: CircleCI's quick-gate job hand-picked five discrete steps
(render-all-check, ruff check, ruff format, mypy) as a stand-in for
`devtools verify --quick`, per its own header comment. That subset had
drifted from the real thing: devtools/verify.py's default `if not commit:`
block has grown to ~17 steps over time (topology/layering/closure-matrix,
lab schema roundtrip, manifests, ci-workflows, doc-commands,
docs-coverage, test-infra-currency, pytest-timeout-overrides,
degrade-loudly, hash-boundary-census, schema-versioning,
classifier-fingerprints, schema promotion audit, and now
demo-tour-freshness), none of which quick-gate ever ran. The
schema-versioning check specifically was wired only into
.github/workflows/ci.yml, a GitHub Actions workflow that does not
execute (GHA is billing-locked; CircleCI is the only live CI in this
repo) -- so the migration-number collision behind PR #3566/#3568 that
made the live archive briefly unqueryable (fixed by hand in PR #3573)
would not have been caught by any CI that actually ran, despite
appearing "CI-gated" in ci.yml. See polylogue-ze5i.

What changed: replaced the four hand-picked ruff/mypy/render-all steps
with a single `devtools verify --quick` call, which is the real superset
and self-heals going forward -- any future step added to build_verify_steps'
default block is automatically covered without a matching CircleCI edit.
`devtools verify public-claims --json` stays separate since it is not
part of that default block. Added a `lab-policies` job, wired into the
existing nightly scheduled workflow alongside full-suite, running the
7 `lab policy *` checks that remain intentionally --lab-only
(timestamp-doctrine, insight-honesty, demo-packet-registry, docs-drift,
campaign-archive-boundaries, backlog-hygiene, bead-graph) so a
continuously-failing policy is at least visible on a schedule instead of
reachable only via a human remembering `devtools verify --lab`. Each
step uses `when: always` so backlog-hygiene/bead-graph's known
pre-existing backlog debt (485 findings / 225 missing-AC beads) does not
mask a regression in one of the other five checks in the same job.

Verification: reintroduced the exact migration-number-collision shape
(bumped INDEX_SCHEMA_VERSION without a lifecycle.py delta declaration)
and confirmed `devtools verify --quick` -- the command now wired into
quick-gate -- fails with "Policy violation: each index schema bump needs
a declared delta class"; reverted. Also confirmed demo-tour-freshness
catches injected drift in docs/examples/demo-tour/report.json; reverted.
`python -c "import yaml; yaml.safe_load(open('.circleci/config.yml'))"`
parses cleanly; `devtools verify ci-workflows` passes (pre-existing
unrelated warning on .github/workflows/ci.yml, not touched here).

Ref polylogue-ze5i

Co-Authored-By: Claude <[email protected]>
@Sinity
Sinity force-pushed the feature/chore/lab-policy-gate-placement branch from 0425422 to 0821280 Compare August 2, 2026 20:36
@Sinity
Sinity merged commit b4db9eb into master Aug 2, 2026
3 checks passed
@Sinity
Sinity deleted the feature/chore/lab-policy-gate-placement branch August 2, 2026 20:39
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