Skip to content

ci: guard tracked agent guidance against model and vendor names #78

Closed

Description

@TusanHomichi

Problem

Model and vendor names in tracked agent guidance are a recurring class, not an instance: #71 introduced them and #76 removes them at rung 3 (guidance) only. By CONTRIBUTING.md's "Correct the class, not the instance" rule, the next step is a guard that stops new instances before cleanup is ever needed again.

Outcome

pr-gate fails when a tracked guidance file names a specific model, a vendor's routing, or a paused vendor. Tool entrypoint file names (CLAUDE.md, .github/copilot-instructions.md, .agents/rules/*) are allowed because they name where a tool reads instructions, not which model runs.

Scope

  • A small script under scripts/ (or a step in .github/workflows/pr-gate.yml) that greps the guidance set — AGENTS.md, CONTRIBUTING.md, docs/workflow.md, docs/development.md, .agents/, .github/ISSUE_TEMPLATE/, .github/PULL_REQUEST_TEMPLATE.md, the tool shims — for a maintained pattern list (model families and IDs, vendor route names) with an explicit allowlist for entrypoint file names, and exits non-zero with path:line on a hit.
  • A negative control in the PR: a scratch commit that reintroduces one name must fail the step.
  • CONTRIBUTING.md names the guard as rung 2 for this class.

Out of scope: content changes to the guidance itself (#76), and anything model-specific (machine-local by design).

Acceptance

  • The guard runs in pr-gate and locally by one documented command.
  • A deliberately reintroduced name fails it (receipt preserved); the current tree passes.
  • The pattern list and allowlist live in one place with a comment on how to extend them.

Refs #76 (the cleanup this guard protects).

Activity

  1. TusanHomichi commented on Oct 7, 2026

    @TusanHomichi
    MemberAuthor

    Plan (integrator), 2026-10-08

    Base. #79 is still open, so this branch (ci/78-guidance-name-guard) is stacked on docs/76-role-based-guidance at 41e305c. The guard only passes on a tree that already has #79's cleanup, so the PR stays unopened until #79 merges. After that I rebase onto main and open it. Until then the hosted check runs on the pushed branch through workflow_dispatch.

    Decision (recorded): use a standalone script, not an inline workflow step. The acceptance needs one documented local command and one place for the lists, and CONTRIBUTING.md treats duplicate paths as defects. The script is POSIX sh with git grep and awk, with no system grep in the pipeline, so local and hosted runs behave the same. pr-gate runs it as the first step after checkout, so it fails in seconds.

    Correction-ladder rung: 2 (a repository guard the gates run). No ADR: this enforces the existing rule from #76 and adds no product behavior.

    # Node Owner role Depends on Acceptance (how it is decided) State
    1 scripts/check-guidance-names.sh: the scanned set, the pattern list and the entrypoint allowlist in one place. Allowlisted tokens are stripped from a hit line and the line is re-tested, so no file is skipped. The guard fails closed if a listed path matches no tracked file, and on a hit it exits non-zero with path:line. implementer — Command: the tree passes, and four dirty-tree controls give the expected result todo
    2 pr-gate.yml step; CONTRIBUTING.md command and rung-2 mention; docs/development.md source-map line for scripts/ worker 1 Command: git diff --check, plus the script passes on the tree todo
    3 Independent review of the exact candidate SHA reviewer 1, 2 Judgment: findings resolved or answered todo
    4 Full CONTRIBUTING gate sequence on the frozen candidate (system Chrome for e2e), plus a guard pass on the tree and a fail on a scratch commit that reintroduces one name verifier 3 Command: receipts with SHA-256 todo
    5 Push, hosted pr-gate run, PR after #79 merges, automated-review threads integrator 4, #79 merged Hosted check green; threads answered todo

    Note on the pattern list. The script's pattern list necessarily contains the family and vendor names it guards against. It is data, not guidance, it sits outside the scanned set, and its comments name no model.

    Next action: the implementer builds node 1 from a fixed spec.

  2. TusanHomichi commented on Oct 7, 2026

    @TusanHomichi
    MemberAuthor

    State (integrator), 2026-10-08: candidate 8317340 verified; the PR waits for #79

    Branch ci/78-guidance-name-guard is pushed. It sits on 41e305c, PR #79's head, with three commits:

    • b82424a adds the guard, the pr-gate step, the CONTRIBUTING rung-2 mention, and the docs/development.md map line.
    • 0708a70 and 8317340 fold in the independent review.
    # Node Owner role State Evidence
    1 scripts/check-guidance-names.sh implementer done Controls at 8317340, each run on a dirty tree. The current tree passes. These fail: a reintroduced name in CLAUDE.md:6; a prose vendor name; IDs joined to digits or _; a name inside a file git treats as binary; a nested web/AGENTS.md. A line holding only an entrypoint file name passes. Fail-closed cases exit 2: a missing scanned entry, a removed root entrypoint, a git grep error, an awk error. shellcheck is clean. Exit codes match across four awks and three POSIX shells.
    2 pr-gate step (first, after checkout), CONTRIBUTING sequence and rung-2 paragraph, docs/development.md worker done git diff --check clean; YAML step order checked
    3 Independent review reviewer done Two rounds. Round 1, on b82424a, found four gaps: IDs joined to digits or _, binary-attribute skip, nested entrypoints, awk status ambiguity. Round 2, on 0708a70, found two: root entrypoints no longer required, and an allowlist-boundary mismatch. All were fixed in 0708a70 and 8317340. Accepted as policy: ordinary English words that collide with a pattern are flagged; a NUL byte placed directly before a name is out of class.
    4 Full local gate sequence on 8317340 verifier done All exit 0: guard, npm ci/check/build, fmt, clippy, cargo test --workspace, cargo build -p consolebook-server, e2e with system Chrome 155, not the Playwright download (56 passed), and git diff --check. Negative control: scratch commit cd57e1c on the candidate, never pushed; the guard exits 1 with CLAUDE.md:6. Receipts are archived locally; manifest sha256 9060b3e2….
    5 Hosted pr-gate integrator done for 8317340 run 37698835855, started through workflow_dispatch because there is no PR yet: success. The Guidance names step printed ok (11 files scanned).
    6 PR integrator blocked on #79 —

    Acceptance status:

    Scope note: the scanned set is the set listed in this issue, plus nested AGENTS.md/CLAUDE.md at any depth. Other per-tool instruction locations are not scanned, deliberately, until one exists in the tree.

    Next action: when #79 merges, rebase ci/78-guidance-name-guard onto main (git rebase --onto origin/main 41e305c if #79 is squash-merged, since 41e305c will not be on main). Re-run the guard and its negative control, plus the gates if the base changed beyond #79. Then open the PR with Closes #78 and answer automated-review threads. Merge is the maintainer's call.

  3. TusanHomichi commented on Oct 7, 2026

    @TusanHomichi
    MemberAuthor

    Owner decisions, 2026-10-08:

    • The guard's pattern list is accepted as the one tracked place that holds vendor and model-family names. It is data the guard needs, not guidance, and it sits outside the scanned set.
    • The local negative-control receipt is sufficient; no hosted red run will be recorded. Hosted run 37698835855 already proved the step runs first on the runner, and a non-zero exit from a run: step failing the job is standard Actions behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions