Repository navigation
Conversation
This was referenced Oct 12, 2026
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-api; see scripts/rules/SYNC.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds a quality guard runner and a dependency-free quality-guards PR job that runs the tool's unittest suite and the guards, with full history so baselines can be compared with the base branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Registers the Stage 12, deployment-asset and OpenAPI golden tests, ruff format and CI jobs, plus rules stated only in docs as doc-only. Adds a proof fixture and test for sim.stage12.no-schema-ddl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync scripts/rules with policyengine-api: the guard now checks that each proof test is collected by a CI job, not only that it exists. A pytest-enforced rule's proof runs in the rule's own job; other rules name the job with proof.workflow, proof.job and proof.invocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Register the explicit ruff rule selection in ruff.toml as an advisory lint rule, update the image-smoke and test-matrix rules now that Phase 0 fixed both gaps, 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>
anth-volk
force-pushed
the
rules-registry
branch
from
October 12, 2026 19:29
5870e49 to
665c34f
Compare
anth-volk
added this pull request to stack #755
October 12, 2026 19:29
2 tasks done
This branch has not been 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 #751
Same-Repository Draft PR Check
PolicyEngine/policyengine-sim-api, not a personal fork.Summary
Stacked PR. This is the middle of a native GitHub stack: Phase 0 (#754) → this PR → steps 1.3, 1.5 and 1.6 (#757). 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. 38 rules, of which 13 are doc-only gaps, for example the gateway/executor import boundary and the observability rules. After Phase 0, the image-smoke and test-matrix rules describe the fixed state; nothing enforces them yet. Phase 0's explicit ruff rule list is registered as an advisory lint rule. Code-owned rule machinery and the agent no-bypass rule are registered as doc-only until branch rules enforce them.Adds
scripts/rules/, a standard-library tool withvalidate,renderandguardcommands. The guard fails when:review_bydate expires;The tool is byte-identical with the same directory in policyengine-api; 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.Adds
scripts/run_quality_guards.pyand a dependency-freequality-guardsPR job. The job runs the tool's unittest suite and the guards, withfetch-depth: 0so baselines can be compared with the base branch.Adds a proof fixture and test for
sim.stage12.no-schema-ddl, showing the DDL check rejects a bad example and accepts a good one.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:rules-registry: passed.python -m scripts.rules guard --base-ref origin/main: passes. The base has no registry yet, so the baseline comparison is skipped.projects/policyengine-simulation-entry:uv run pytest tests/passes (159 tests, including the new proof test).libs/policyengine-stage12-persistence:uv run pytest tests/passes (12 tests).ruff format --checkpasses on allsrcdirectories and the new files.GUARDSentry;🤖 Generated with Claude Code