Skip to content

Point agent adapters to AGENTS.md and move multi-line workflow steps into tested scripts - #757

Draft
anth-volk wants to merge 5 commits into
rules-registryfrom
rules-followups
Draft

anth-volk wants to merge 5 commits into
rules-registryfrom
rules-followups

Conversation

@anth-volk

@anth-volk anth-volk commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #756

Same-Repository Draft PR Check

  • This PR is a draft.
  • This PR is from a branch in PolicyEngine/policyengine-sim-api, not a personal fork.

Summary

The top of the rules stack: Phase 0 (#754) → rules registry (#752) → this PR, which covers Phase 1 steps 1.3, 1.5 and 1.6. The API counterpart is PolicyEngine/policyengine-api#3890.

  • 1.3: one source of agent instructions.

    • CLAUDE.md and .github/copilot-instructions.md are now short pointers to AGENTS.md. Both had duplicated part of the skill list and drifted from it.
    • The safety boundaries (no direct commits to main; no production deploys or client publishing unless asked) move into AGENTS.md.
    • The rules-registry guard enforces this through a new [agents] table. It's registered as sim.agents.adapters-point-to-agents-md (enforced, with proof).
  • 1.5: sim.process.pr-tracking-issue is registered as doc-only and split out of sim.process.same-repo-draft-prs. CI enforcement comes in step 2.8.

  • 1.6: workflow logic lives in tested scripts. The new ci-scripts quality guard (same tool as the API) checks for:

    • run: blocks with more than one line of code, counting every line, including folded and backslash-continued ones, plus commands chained with &&, || or ;;
    • workflow scripts that no test names;
    • shellcheck findings.

    Each check is ratcheted against rules/baselines/: 20 multi-line blocks, 4 untested scripts (the dependency-update scripts and update-policyengine-package.sh) and 1 shellcheck finding (modal-precompute.sh).

    The rules are sim.ci.multiline-run-is-script, sim.ci.workflow-scripts-tested and sim.ci.shell-scripts-pass-shellcheck, all ratcheted, with proofs. The quality-guards job installs a pinned shellcheck-py==0.11.0.1. See docs/engineering/skills/ci-workflows.md.

  • scripts/rules/ is byte-identical with the API's copy; the tool sha256 in rules.md matches.

Testing

  • python -m unittest discover -s scripts/rules/tests -t .: 74 tests pass.
  • With shellcheck installed, python scripts/run_quality_guards.py passes rules-registry and ci-scripts.
  • python -m scripts.rules guard --base-ref origin/main passes.
  • projects/policyengine-simulation-entry: uv run pytest tests/ passes 159 tests.
  • The workflow and changelog_entry.yaml parse as YAML. actionlint reports only the pre-existing note on the format loop.

🤖 Generated with Claude Code

anth-volk and others added 4 commits October 12, 2026 23:37
Sync scripts/rules with policyengine-api. The rules-registry guard now
verifies that agent adapters ([agents]) only point to AGENTS.md, and 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 that may only shrink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both adapters duplicated part of 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 boundaries move into AGENTS.md.

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 job, and record today's exceptions
as baselines: 16 multi-line run: blocks, 4 untested scripts 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: sim.agents.adapters-point-to-agents-md (enforced,
with proof), sim.process.pr-tracking-issue (doc-only, split out of
sim.process.same-repo-draft-prs), and three ratcheted sim.ci.* rules with
proofs. AGENTS.md gains the safety boundaries and a pointer to the CI
workflows skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync scripts/rules with policyengine-api: folded blocks and
backslash-continued lines now count line by line, and chaining commands
with &&, || or ; counts as more than one line. The multi-line baseline
grows from 16 to 20 entries (the backslash-continued commands).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Point agent adapters to AGENTS.md and move multi-line workflow steps into tested scripts

1 participant