park-wiring-lib.sh: park_wiring_file_violations matches entry-point names inside YAML comments — fail-closed false positive (matou-app#419, swarm run 13413) #133

Closed
opened 2026-09-06 00:13:10 +00:00 by ben · 1 comment
Owner

From Matou/matou-app#419 (verified there by the healer and triage; the consumer's immediate repair — rewording the comment — landed as matou-app 20889e5).

What happened

park_wiring_file_violations tests PARK_WIRING_ENTRYPOINT_RE against a step's whole block, comments included. matou-app f443976 added an explanatory YAML comment inside ci.yml's "Frontend + backend checks in the sandbox image" step that named the healer script by its bare basename. That step spawns no agent and cannot park, yet the guard flagged it:

PREFLIGHT RED: park_token_wiring — park-capable workflow step(s) run WITHOUT the standby token $CLAUDE_CODE_OAUTH_TOKEN_B
    .forgejo/workflows/ci.yml: Frontend + backend checks in the sandbox image

and every swarm run on the host stopped (run 13413) until the comment was reworded. The remedy the guard prints (add the standby token) is wrong for this case — it would wire a secret into a step that cannot park.

Ask

Strip YAML comments (# to end of line, outside quotes) from a step block before the block ~ re test — an entry point can only be invoked from run: script text, never from a comment. Keep the over-approximation on the satisfaction side (job-/workflow-level env: counts); it is the detection side that needs narrowing. Add a test: a step whose only mention of a park-capable basename is in a comment is clean; the same name in run: still fires.

Repro: git -C <matou-app> show f443976:.forgejo/workflows/ci.yml > /tmp/ci.yml then park_wiring_file_violations /tmp/ci.yml → violation; 20889e5 → clean.

From Matou/matou-app#419 (verified there by the healer and triage; the consumer's immediate repair — rewording the comment — landed as matou-app 20889e5). ## What happened `park_wiring_file_violations` tests `PARK_WIRING_ENTRYPOINT_RE` against a step's **whole block, comments included**. matou-app f443976 added an explanatory YAML comment inside `ci.yml`'s "Frontend + backend checks in the sandbox image" step that named the healer script by its bare basename. That step spawns no agent and cannot park, yet the guard flagged it: ``` PREFLIGHT RED: park_token_wiring — park-capable workflow step(s) run WITHOUT the standby token $CLAUDE_CODE_OAUTH_TOKEN_B .forgejo/workflows/ci.yml: Frontend + backend checks in the sandbox image ``` and every swarm run on the host stopped (run 13413) until the comment was reworded. The remedy the guard prints (add the standby token) is wrong for this case — it would wire a secret into a step that cannot park. ## Ask Strip YAML comments (`#` to end of line, outside quotes) from a step block before the `block ~ re` test — an entry point can only be *invoked* from `run:` script text, never from a comment. Keep the over-approximation on the satisfaction side (job-/workflow-level `env:` counts); it is the detection side that needs narrowing. Add a test: a step whose only mention of a park-capable basename is in a comment is clean; the same name in `run:` still fires. Repro: `git -C <matou-app> show f443976:.forgejo/workflows/ci.yml > /tmp/ci.yml` then `park_wiring_file_violations /tmp/ci.yml` → violation; `20889e5` → clean.

close-report for #133 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 133,
  "status": "success",
  "commits": [
    "2ed40270c19bd8a2a4ec9d9a5d4d5de6ca466ab1"
  ],
  "changed_files": [
    "park-wiring-lib.sh",
    "tests/park-wiring-lib-test.sh",
    "STATUS.md",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "bash tests/park-wiring-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash onboarding/tests/park-token-guard-test.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Strip YAML comments (# to end of line, outside quotes) from a step block before the block ~ re test": "park-wiring-lib.sh flush() builds a comment-stripped copy via new strip_comment() (bare #-to-EOL outside \"…\"/'…' quotes, per line) and runs the invocation test against it",
    "Keep the over-approximation on the satisfaction side (job-/workflow-level env: counts)": "the token-present test still uses index(block, tok) on the whole block; job/workflow-level env test (case 2b) still passes",
    "Test: a step whose only mention of a park-capable basename is in a comment is clean": "tests/park-wiring-lib-test.sh — 'a step naming a park-capable basename only in a comment is clean' (comments.yml)",
    "Test: the same name in run: still fires": "tests/park-wiring-lib-test.sh — 'a real run: invocation still fires even with a trailing comment' plus quote-aware fixture quoted.yml"
  },
  "summary": "park_wiring_file_violations strips YAML comments before the entry-point invocation test so a comment naming a park-capable script no longer reds a step that spawns no agent.",
  "blockers": []
}
**close-report** for #133 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 133, "status": "success", "commits": [ "2ed40270c19bd8a2a4ec9d9a5d4d5de6ca466ab1" ], "changed_files": [ "park-wiring-lib.sh", "tests/park-wiring-lib-test.sh", "STATUS.md", "docs/GOTCHAS.md" ], "tests": [ { "command": "bash tests/park-wiring-lib-test.sh", "exit_code": 0 }, { "command": "bash onboarding/tests/park-token-guard-test.sh", "exit_code": 0 } ], "criteria": { "Strip YAML comments (# to end of line, outside quotes) from a step block before the block ~ re test": "park-wiring-lib.sh flush() builds a comment-stripped copy via new strip_comment() (bare #-to-EOL outside \"…\"/'…' quotes, per line) and runs the invocation test against it", "Keep the over-approximation on the satisfaction side (job-/workflow-level env: counts)": "the token-present test still uses index(block, tok) on the whole block; job/workflow-level env test (case 2b) still passes", "Test: a step whose only mention of a park-capable basename is in a comment is clean": "tests/park-wiring-lib-test.sh — 'a step naming a park-capable basename only in a comment is clean' (comments.yml)", "Test: the same name in run: still fires": "tests/park-wiring-lib-test.sh — 'a real run: invocation still fires even with a trailing comment' plus quote-aware fixture quoted.yml" }, "summary": "park_wiring_file_violations strips YAML comments before the entry-point invocation test so a comment naming a park-capable script no longer reds a step that spawns no agent.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#133
No description provided.