Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## phase-0-enforcement #3884 +/- ##
====================================================
Coverage 87.56% 87.56%
====================================================
Files 198 198
Lines 12211 12211
Branches 2159 2159
====================================================
Hits 10692 10692
Misses 922 922
Partials 597 597 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
anth-volk
force-pushed
the
rules-registry
branch
from
October 12, 2026 19:28
dd974fe to
880260a
Compare
anth-volk
added this pull request to stack #3888
October 12, 2026 19:28
Standard-library tool (scripts/rules) that loads rules/registry.toml, checks each rule's enforcer and CI wiring, finds unregistered checks, compares ratchet baselines with the base branch, and renders the human and agent views. Byte-identical with policyengine-sim-api; see scripts/rules/SYNC.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Registers rules-registry in the quality guards, runs the tool's unittest suite in the quality-guards job, fetches full history so baselines can be compared with the base branch, and adds quality guards to the push workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Registers the existing boundary tests, quality guards, ruff/mypy checks and CI jobs, plus rules stated only in skills docs as doc-only. Adds a proof fixture and test for api.v2.validators-transformations-no-db. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard checked that a proof's fixtures and test exist, but not that any CI job runs the test, so a proof could silently stop being exercised. A pytest-enforced rule's proof test must now be collected by the rule's own CI job; any other rule names the job with proof.workflow, proof.job and proof.invocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enforce api.v2.crud-checks-cover-every-resource with the new connector classification test (it was a doc-only gap), record the explicit ruff rule selection, and register the code-owned rule machinery and the agent no-bypass rule as doc-only until branch rules enforce them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
api.process.stacked-prs-full-ci-at-bottom: only the lowest unmerged PR in a stack runs the full workflow, and the CI complete gate needs every pr.yml job. Enforced by test_pr_workflow_is_gated, with bad and good workflow fixtures proving the check, and it references the ci-complete job so the hidden-rule check knows what that job enforces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
rules-registry
branch
from
October 13, 2026 16:56
880260a to
71998b1
Compare
This branch was successfully deployed
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.
Fixes #3885
Summary
Stacked PR. This is the middle of a native GitHub stack: Phase 0 (#3887) → this PR → steps 1.3, 1.5 and 1.6 (#3890). It's based on
phase-0-enforcementand was rebased onto it, so the diff shows only this layer.Adds
rules/registry.toml: every rule that governs this repository, with its tier (mechanical, metric or judgment), status (enforced, ratcheted, advisory or doc-only), enforcer, and the CI job that runs it. There are 48 rules: 35 enforced, 2 advisory, and 11 doc-only gaps. The doc-only rules are taken fromv2-code-organization.md,api-routes.md,alembic-migrations.md,repository-maintenance.mdandobservability.md. Phase 0 made the CRUD boundary tests discover modules by filename, soapi.v2.crud-checks-cover-every-resourceis now enforced by the new classification test. Code-owned rule machinery and the agent no-bypass rule from Phase 0 are registered as doc-only until branch rules enforce them.Adds
scripts/rules/, a standard-library tool withvalidate,renderandguardcommands, registered as therules-registryquality guard. The guard fails when:make testpaths);review_bydate expires;The tool is byte-identical with the same directory in policyengine-sim-api (Add a rules registry that makes every enforced and unenforced rule visible policyengine-sim-api#752); see
scripts/rules/SYNC.md.Renders
docs/generated/rules.md(a summary, a Gaps section, and a per-category table with Mermaid graphs), and a generated Rules block inAGENTS.md.In
pr.yml, thequality-guardsjob now runs the tool's unittest suite and checks out withfetch-depth: 0so baselines can be compared with the base branch.push.ymlalso gets aquality-guardsjob, which does not gate deployment.Adds a proof fixture and test for
api.v2.validators-transformations-no-db. The existing check is factored into_has_database_query_dependencyso the proof exercises the same code.Documents how to add or change a rule in
docs/engineering/skills/rules-registry.md.Ruff rules are never ratcheted: adopting a ruff family is one standalone PR that fixes every violation.
Testing
python -m unittest discover -s scripts/rules/tests -t .: 54 tests pass. The first version, with 50, was run on Python 3.11 to 3.14; the 4 added since cover proof tests that must run in CI.python scripts/run_quality_guards.py:migration-contracts: passedandrules-registry: passed.python -m scripts.rules guard --base-ref origin/master: passes. The base has no registry yet, so the baseline comparison is skipped.uv run --frozen --extra dev pytest tests/unit/v2/test_data_crud_boundaries.py: 41 tests pass after the rebase. That's Phase 0's 39 discovered modules and classification test, plus this PR's proof test.ruff format --check .passes with ruff 0.15.12 (the locked version) and with the latest ruff.🤖 Generated with Claude Code