Repository navigation
Conversation
Add two checks to scripts/rules. The rules-registry guard now verifies that agent adapters ([agents] in the registry) only point to AGENTS.md. A new ci-scripts quality guard ([ci_scripts]) fails on run: blocks longer than one logical line, workflow scripts that no test runs, and shellcheck findings, each ratcheted against a baseline file that may only shrink. The workflow reader now records each step's run: block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both adapters duplicated the skill list and had drifted from AGENTS.md (observability and the rules registry were missing). They now only point to AGENTS.md; the safety boundary moves into AGENTS.md. The alembic skill test checks AGENTS.md instead of every adapter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document the rule in docs/engineering/skills/ci-workflows.md, install a pinned shellcheck in the quality-guards jobs, and record today's exceptions as baselines: 5 multi-line run: blocks, 1 untested script and 1 script with a shellcheck finding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steps 1.3, 1.5 and 1.6: api.agents.adapters-point-to-agents-md (enforced, with proof), api.process.pr-tracking-issue (doc-only), and three ratcheted api.ci.* rules with proofs. AGENTS.md gains the safety boundary and a pointer to the CI workflows skill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A folded (>) block and backslash-continued lines now count line by line,
and chaining commands on one line with &&, || or ; counts as more than one
line. Operators inside quotes or ${{ }} expressions are ignored, and a
single pipeline is still one command. The multi-line baseline grows from 5
to 10 entries: 2 folded blocks and 3 chained one-liners.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rules-registry #3890 +/- ##
===============================================
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:
|
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 #3889
Summary
The top of the rules stack: Phase 0 (#3887) → rules registry (#3884) → this PR, which covers Phase 1 steps 1.3, 1.5 and 1.6. The sim counterpart is PolicyEngine/policyengine-sim-api#757.
1.3: one source of agent instructions.
CLAUDE.mdand.github/copilot-instructions.mdare now short pointers toAGENTS.md. Both had duplicated the skill list and drifted from it.CLAUDE.mdintoAGENTS.md, so nothing is lost.test_alembic_skill.pynow checksAGENTS.mdonly.[agents]table: an adapter must mentionAGENTS.md, must not reference other docs or carry the generated rules block, and must stay within 20 non-empty lines.api.agents.adapters-point-to-agents-md(enforced, with proof).1.5:
api.process.pr-tracking-issueis registered as doc-only (tracking issue plusFixes #Nfirst line). CI enforcement comes in step 2.8.1.6: workflow logic lives in tested scripts. A new
ci-scriptsquality guard, configured in a[ci_scripts]table, runs three checks:run:blocks with more than one line of code. Every non-empty line counts, including each line of a folded>block and each backslash-continued line. Commands chained with&&,||or;also count as more than one line. Operators inside quotes or${{ }}are ignored, and a single pipeline is one command.shellcheckfindings in.github/scripts/*.sh.Each check is ratcheted against a baseline in
rules/baselines/: 10 multi-line or chained blocks, 1 untested script (cleanup_cloud_run_images.sh) and 1 shellcheck finding (deploy_observability_collector.sh, SC2129). Anything new fails, and so does a stale baseline entry, so the lists only shrink.The rules are
api.ci.multiline-run-is-script,api.ci.workflow-scripts-testedandapi.ci.shell-scripts-pass-shellcheck, all ratcheted, with proofs. Thequality-guardsjobs install a pinnedshellcheck-py==0.11.0.1. The rule and how to test a workflow script are documented indocs/engineering/skills/ci-workflows.md.Tool changes: the workflow reader now records each step's
run:block. The tool stays byte-identical with sim's copy; the tool sha256 inrules.mdmatches.Testing
python -m unittest discover -s scripts/rules/tests -t .: 74 tests pass, including the three CI-script proofs and the adapter proof. The shellcheck proof skips locally when shellcheck is missing, but fails in CI if it is missing there.With shellcheck installed,
python scripts/run_quality_guards.pypasses all three guards:migration-contracts,rules-registryandci-scripts.python -m scripts.rules guard --base-ref origin/masterpasses.pyteston the API tests that read workflows, scripts or adapters, plus the CRUD boundary tests: 204 pass.Negative checks, each reverted afterwards:
api.ci.multiline-run-is-scriptfailsapi.ci.workflow-scripts-testedfailshealth_check.shapi.ci.shell-scripts-pass-shellcheckfailsCLAUDE.mdruff format --check .passes.actionlintreports nothing new.🤖 Generated with Claude Code