Skip to content

v1.94.36.0 fix(skill-contracts): agent_dispatch rejects markers; the waive hint names the installed bin (GST-1242) - #3964

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1242-contract-marker-waive
Nov 3, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1242-contract-marker-waive

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3964,
  "head": "f48e5192ad4ebbcec77afb035d7565613a2195c0",
  "version": "1.94.24.0",
  "base": "origin/main",
  "spend_usd": 2.7,
  "session_kind": "unattended",
  "run": "jam_01M6FGN8NNX1Y5JK5GZAMD8J4F",
  "thread": "GSTA-256",
  "head_tree": "1d9641b2bece62239b6608ab7340d79b0ad3b744",
  "product_patch_id": "b8f7b88b6f48736c5577dbb7f748dea776191551",
  "gstack_version": "1.94.24.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 22,
    "rules": "19881e1ecf7ed1ad",
    "base": "208d0c8fcc04e3024c880bd04ea9abd3eaf4de0c",
    "registry": "208d0c8fcc04e3024c880bd04ea9abd3eaf4de0c",
    "gate_scan": {
      "tagged": 0,
      "head": "f48e5192ad4ebbcec77afb035d7565613a2195c0"
    },
    "reasons": [
      "runtime=22"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @1d9641b2bece (7 checks, current for f48e5192ad4e)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41677129998/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41677129998/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41675922723/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=1d9641b2bece tests=34950 skipped=112 runs=41677129998/1 profiles=ci-reuse/free-tests heads=f48e5192ad4e verified=2026-11-03T16:50:00.186Z"
  ],
  "docs": {
    "status": "updated",
    "scope": "docs/skill-routing-and-contracts.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 5,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "ledgers_read": 3
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder",
    "date": "2026-11-03",
    "via": "GSTA-36",
    "reason": "one scoped fix-check by a single reader on the round-2 shell-quoting fix",
    "fix_check": {
      "head": "f48e5192ad4ebbcec77afb035d7565613a2195c0",
      "findings": 1,
      "files": [
        "lib/skill-contract.ts",
        "test/skill-contract.test.ts",
        "test/skill-contract-stop-hook.test.ts",
        "test/fixtures/skill-contract/block-message.txt",
        "docs/skill-routing-and-contracts.md"
      ]
    }
  }
}

Summary (GST-1242)

Three fixes to the skill contract checker from lane C's reader on #3922.

  1. A marker no longer stands in for the dispatch. lib/skill-contract.ts counted an agent_dispatch item with a marker: as met once the marker line appeared and any later Agent call ran. Binding the marker to the item's match would make it a no-op, because the fallback already accepts any Agent dispatch that matches. So parseContract now rejects marker on agent_dispatch until the checker can bind a marker to the dispatch it names, and the checker's marker branch is gone. No shipped contract used it there. /review's marker on selected_specialists_dispatched is unchanged.
  2. The waive hint names a path that runs. The Stop hook's block text said run gstack-skill-contract waive …. A standard install doesn't put that name on PATH, so the agent got exit 127. The hook now names the installed bin by the path it resolves its own bins with (binPath() in hosts/claude/hooks/spawn-bin.ts), and gstack-skill-contract check names its own path.
  3. Calibration wording. /review's "log the corrected pattern as a learning" pointed at a Capture Learnings section that lane C's diet cuts. It now reads "log it per Operational Self-Improvement", a pinned preamble piece that carries the logging command. It's the same length, so no size pin or parity cap moves.

Review fixes

  • Pass 1 found one test call still passing a single argument to blockMessage, which failed bun run typecheck:test (TS2554). Fixed in f91e895.
  • Pass 2's outside voice found that the double-quoted path let bash expand $(), backticks or a quote in the install path. The hint now single-quotes the path and escapes any ' in it (f48e519). A new test runs the rendered command through bash with /opt/it's gstack $(touch pwned)/bin/gstack-skill-contract and checks that bash prints the path literally. It also feeds that command back through the transcript reader and checks that the waiver counts. Before the fix, bash dropped the $(…) text from the path. That fix landed after round 2, at the cap. One scoped fix-check read it afterward and found nothing blocking.

Review-loop exception: accepted by GStack Minder 2026-11-03 via GSTA-36: one scoped fix-check by a single reader on the round-2 shell-quoting fix (fix-check at f48e519, 1 finding)

Review notes

  • A third-party contract that still sets marker on agent_dispatch now fails validation. The Stop hook then fails open for that skill's whole contract, the same way any invalid contract already does. No shipped contract is affected.
  • No test covers calling gstack-skill-contract through a symlink. Bun resolves the entry point's real path today.
  • The new quoting test's pwned file check looks next to the bin path, not in the directory bash runs in, so it can't fail. The assertion that bash prints the path literally is the real guard. Left as is.

Failing tests first

  • test/skill-contract.test.ts GST-1242: a marker followed by an unrelated Agent call gave met before the fix (captured: expected missing, received met). It now gives missing, and the right call gives met as the negative control. parseContract rejects a marker on agent_dispatch and still accepts one on selected_specialists_dispatched.
  • test/skill-contract-stop-hook.test.ts GST-1242: the block reason must not say run gstack-skill-contract waive. The quoted path it names must be the checkout's bin/gstack-skill-contract, and running <that path> waive repro-after-fix --reason … must exit 0.
  • test/gen-skill-docs.test.ts: /review carries the new wording, and its sections/preamble.md has ## Operational Self-Improvement.

The existing assertion that pinned the false pass (marker line plus an unrelated Agent call gives met) now expects missing.

Security read

The change makes no network calls, reads no new environment variables, widens no permissions and adds no dependencies. The block text now contains an absolute install path. That path is the user's own install location and appears only in the agent's Stop-hook feedback.

…names the installed bin (GST-1242)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits November 3, 2026 16:32
…e call

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…o bash runs it literally (GST-1242)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

E2E Evals: ✅ PASS

[test:paid] VERDICT GREEN — lane gate/pr, attempt 1
  rule 9/9 · behavior 0/0 · judge 3/3 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 0
  wall 4m47s · cost $5.31 known + 1 of 12 trial(s) cost unknown

11 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $5.31 rule/judge cost | reconcile exit: 0

Profile: pr / mode pr; selected behaviors: 9, judges: 3. Deferred to scheduled/release coverage: 35 behaviors and 0 changed prompt files. Deferred checks did not run and receive no PR-pass credit.

Rule and judge shards
Shard Automated result Manual/unscored Executed Reused Status Cost
e2e-qa-callers/skill-e2e-qa-callers--review-exploratory-small-cli 1/1 0 1 0 ✅ $0.72
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-plan-checks 1/1 0 1 0 ✅ $0.9
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-late-input 1/1 0 1 0 ✅ $1.07
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-small-cli 1/1 0 1 0 ✅ $0.9
llm-judge/skill-llm-eval 3/3 0 3 0 ✅ $0.18
e2e/skill-e2e-coverage-audit 1/1 0 1 0 ✅ $0.11
e2e/skill-e2e-test-value 1/1 0 1 0 ✅ $0.16
e2e-qa-callers/skill-e2e-qa-callers--ship-exploratory-unavailable 1/1 0 1 0 ✅ $1.03
e2e-review/skill-e2e-review 1/1 0 1 0 ✅ $0.24
Fail-closed reconciliation
[test:paid] report: 3/3 slices, 10 planned shards, tier=gate, attempt 1
[test:paid] coverage: profile=pr mode=pr; selected E2E=9, judges=3
[test:paid] deferred: 35 broad behaviors, 0 changed prompts without quick live coverage; these are not PR passes
  slice 1  passed             51s  test/skill-e2e-gate-integrity.test.ts
  slice 1  passed             83s  test/skill-llm-eval.test.ts
  slice 1  passed             23s  test/skill-e2e-coverage-audit.test.ts
  slice 2  passed            129s  test/skill-e2e-qa-callers.test.ts#ship-exploratory-late-input
  slice 2  passed             99s  test/skill-e2e-qa-callers.test.ts#review-exploratory-small-cli
  slice 2  passed            104s  test/skill-e2e-qa-callers.test.ts#ship-exploratory-plan-checks
  slice 2  passed            109s  test/skill-e2e-qa-callers.test.ts#ship-exploratory-small-cli
  slice 3  passed             33s  test/skill-e2e-test-value.test.ts
  slice 3  passed            117s  test/skill-e2e-qa-callers.test.ts#ship-exploratory-unavailable
  slice 3  passed             44s  test/skill-e2e-review.test.ts
[test:paid] collector final outcomes: 11 executed, 0 reused; 11 passed, 0 failed, 0 manual accepted (unscored; no score-cache credit) (11 attempt records from 9 collectors; every record counts)
[test:paid] deselected testcases, zero credit (46):
[test:paid]     25  outside the run's case selection
[test:paid]     20  sibling case of a case shard (its own shard runs it)
[test:paid]      1  periodic-tier case (this lane runs gate)
[test:paid] VERDICT GREEN — lane gate/pr, attempt 1
  rule 9/9 · behavior 0/0 · judge 3/3 · quarantined 0 (0 failing the lane)
  SKIPPED 0 · INFRA 0 · INCOMPLETE 0 · unattributed 0 · ACTION REQUIRED 0
  wall 4m47s · cost $5.31 known + 1 of 12 trial(s) cost unknown
[test:paid] exercised-path map (shadow, non-blocking): 5 MAP_GAP line(s) over 9 executed case(s) with recorded commands
  MAP_GAP review-gate-integrity browse/dist/browse: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP ship-exploratory-late-input bin/gstack-review-plan: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP ship-exploratory-plan-checks bin/gstack-review-plan: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP ship-exploratory-small-cli bin/gstack-review-plan: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
  MAP_GAP ship-exploratory-unavailable bin/gstack-review-plan: non-blocking for this PR; the next census refresh widens the map (docs/TESTING_INTERNALS.md#exercised-path-map)
[test:paid] report: every planned shard accounted and passed

Sliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry.

Dispatched narrow screen (gstack-ship-queue ready --screen) of merge commit 692aaeb4fcf813fe7931bd9cf14de4d055cb53d2.

@github-actions github-actions Bot changed the title fix(skill-contracts): agent_dispatch rejects markers; the waive hint names the installed bin (GST-1242) v1.94.36.0 fix(skill-contracts): agent_dispatch rejects markers; the waive hint names the installed bin (GST-1242) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit c1f8bc4 into main Nov 3, 2026
50 checks passed
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.

1 participant