Skip to content

Keep checking custom skill contracts that still list the removed test-after-edit item (GST-2811) - #4439

Merged
capy-ai[bot] merged 4 commits into
mainfrom
keep-custom-contracts-with-removed-item
Nov 17, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
keep-custom-contracts-with-removed-item

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

If you wrote your own skill whose contract still lists check_after_last_edit, the optional Stop hook now skips only that item and keeps checking the rest, where before the whole contract read as invalid. This keeps the #4428 removal from switching off a custom skill's other checks.

Nothing to do. Until you delete the item, the hook prints a SKILL_CONTRACT_SKIPPED line naming the file and the item.

What changed
  • validateContract (lib/skill-contract.ts) skips an item of the removed kind and records one warning for it. A contract whose only items use that kind is still invalid, because nothing would be left to check, so the hook lets the stop through and prints its usual error line.
  • The Stop hook and gstack-skill-contract check print the warning on stderr each time they read such a contract.
  • Tests: a parse test for a mixed contract, a Stop-hook test where a custom skill with both items still blocks on its missing report and prints the warning, and a check test that the warning prints once while the other items are still checked.
  • The routing doc describes the new behavior. A new changelog entry corrects the unreleased Stop the optional Stop hook checking for a test after the last edit (GST-2811) #4428 entry, which says such a contract becomes invalid. That landed entry is left as it is, because landed entries are never edited.
Review notes (below the blocking floor, not fixed here)
  • lib/skill-contract.ts:127 A skipped item's id is not counted when checking for duplicate ids, so a hand-written contract that repeats an id is accepted or rejected depending on item order. No check result is lost.
  • hosts/claude/hooks/skill-contract-stop-hook.ts:70 The warning repeats on every Stop and goes only to stderr, not to the hook log, so many users won't see it. The file's header comment still says the hook prints one stderr line only when it fails open.
  • bin/gstack-skill-contract:72 Two stderr writes end their template string with a literal line break instead of \n. The output is the same.
  • changelog.d/keep-custom-contracts-with-removed-item.md:1 The unreleased Stop the optional Stop hook checking for a test after the last edit (GST-2811) #4428 entry contradicts this one. The new entry now says it corrects it, so whoever writes the release notes can drop the older sentence.
Checks
  • Full free suite: carried from CI at the pushed head (see the receipt).
  • Focused: the contract, Stop-hook, descriptions and route suites; typecheck and the test typecheck ratchet; parity, module-size and gen:skill-docs freshness. A negative control showed the new check test fails when the warning loop is removed.
  • Smoke, 3 probes on the current tree, all passing: the hook on a mixed custom skill (exit 0, blocks only on the missing report, one SKILL_CONTRACT_SKIPPED line); a contract made only of the removed kind (exit 0, lets the stop through, one SKILL_CONTRACT_STATE_ERROR line); check on the mixed skill (exit 1, only the report missing).
Agent notes

Follow-up to GST-2811 that Garry asked for. Thread GSTA-574 for Captain GStack Minder. gstack: ok 1.99.5.0 for=ship.

Review: two rounds on the final tree aa985f67. Round 1 (specialist, adversarial, second-model review from openai/gpt-6.1-sol) found nothing blocking; its one test-gap was fixed. Round 2 reran the specialist on the frozen tree because round 1's record was logged after its fix landed; it found the changelog contradiction above.

Documentation

Status: current. No permitted doc needed a change. One wording problem in a CHANGELOG fragment is left to /ship because fragments are protected (see decisions).

Scope: 99256a86..34260f58 on keep-custom-contracts-with-removed-item (3 commits, 7 files) plus the unstaged edit to changelog.d/keep-custom-contracts-with-removed-item.md. Nothing is staged and there are no new files. Audited every doc that mentions skill contracts: docs/skill-routing-and-contracts.md, docs/install.md, docs/skill-gates.md, the contract block in review/SKILL.md.tmpl, and both related changelog.d fragments. Checked them against lib/skill-contract.ts, bin/gstack-skill-contract, hosts/claude/hooks/skill-contract-stop-hook.ts and lib/changelog-fragments.ts.

Documentation health:
  docs/skill-routing-and-contracts.md  Current (already documents the skipped check_after_last_edit item, the SKILL_CONTRACT_SKIPPED stderr line from the Stop hook and `check`, and that a contract with only removed-kind items is invalid; matches validateContract and both callers)
  docs/install.md                      Current (hook summary unaffected)
  docs/skill-gates.md                  Current (contract-hook references unaffected)
  review/SKILL.md.tmpl                 Current (its contract uses no removed kind)
  changelog.d/keep-custom-contracts-with-removed-item.md  Not edited (protected CHANGELOG source): facts match the code, but "the entry above" will be wrong once fragments are folded
  CHANGELOG.md                         Current (latest section 1.99.5.0 matches VERSION; not edited)
  TODOS.md                             Current (searched for this change, no related item; not edited)

Coverage:

  [entity]                                   [reference]                         [how-to]                         [tutorial] [explanation]
  SKILL_CONTRACT_SKIPPED stderr line         ✅ docs/skill-routing-and-contracts  ✅ (the line says delete the item) ❌         ✅
  contract with only removed-kind items      ✅ docs/skill-routing-and-contracts  ❌                               ❌         ❌

Documentation Debt

  • Common gap: SKILL_CONTRACT_SKIPPED appears only in the schema paragraph. It is a warning with no exit code, so a reader who scans "Exit codes and errors" for SKILL_CONTRACT_* lines won't find it there (reference).
  • Common gap: the exit 5 entry still gives only "an unsupported version or an unknown kind" as examples. The new every item uses a removed kind error is not named there. The list says "such as", so it is still accurate (reference).

Diagram drift: none. ARCHITECTURE.md doesn't mention the contract checker.

Not run (outside ship-owned scope): Steps 5, 7 and 8, the cross-model doc review, and Step 9. Banned-terms check: none (there is no .gstack/banned-terms.json on main).

Approvals

Approved: yes (record r-57c55ee7b920). The full approval record stays private.
Plan: exempt: bug fix (follow-up to GST-2811 that Garry asked for; a failing-first test covers it)
Plan check: exempt bug fix

{
  "schema_version": 1,
  "pr": 4439,
  "head": "3f4b015a2cb7495ca7f61a4cd71dbe7a06f9acd7",
  "version": "1.99.5.0",
  "base": "main",
  "gate": {
    "tests": {
      "pass": 1678,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "tests",
      "run": 44078120482,
      "attempt": 1,
      "tree": "722986862aaa73a8a5b50dcbecf3a666e2bba07d"
    }
  ],
  "session_kind": "unattended",
  "run": "ship-20261117T111621-7ff938",
  "head_tree": "722986862aaa73a8a5b50dcbecf3a666e2bba07d",
  "product_patch_id": "1fb060d6f32950291daafc38ba2becacb65f0c7f",
  "gstack_version": "1.99.5.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 29,
    "rules": "66e5174161eecc2c",
    "base": "99256a8631d90c6d363408f037b87fbec1577890",
    "registry": "99256a8631d90c6d363408f037b87fbec1577890",
    "gate_scan": {
      "tagged": 0,
      "head": "3f4b015a2cb7495ca7f61a4cd71dbe7a06f9acd7"
    },
    "reasons": [
      "runtime=29"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @722986862aaa (8 checks, current for 3f4b015a2cb7)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44078120482/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44078120482/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44078104112/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=722986862aaa tests=37418 skipped=105 runs=44078120482/1 profiles=ci-reuse/free-tests heads=3f4b015a2cb7 verified=2026-11-17T12:47:22.084Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md and docs/ against 99256a86..34260f58 plus the changelog fragment"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 2
    }
  },
  "gate_dispositions": []
}

…ed test-after-edit item

The Stop hook used to treat such a contract as invalid and check none of
its items. It now skips only that item, warns with a line naming the file
and item, and checks the rest.

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

trunk-io Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 17, 2026 11:26
…er edited

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Test that gstack-skill-contract check warns about a removed-kind item and checks the rest.

Review-Finding: p1/specialist-batched#1 reader=specialist-batched
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 17, 2026 12:49
@capy-ai
capy-ai Bot merged commit e8c8625 into main Nov 17, 2026
82 of 83 checks passed
@garrytan garrytan mentioned this pull request Nov 17, 2026
capy-ai Bot added a commit that referenced this pull request Nov 17, 2026
- /autoplan's approval page no longer hides a reviewer's product objection behind "keep your direction". (#4431)
- Every skill that loads the shared preamble, on every host, now says to ask a question once and to check a file before handing it over. (#4383)
- The Captain manuals now name the `Failed or skipped:` and `Also changed:` lines that READY and lane reports carry. (#4432)
- gstack's shell locks hold again on Ubuntu 26.04, where `mkdir` reports success when another process won the race (GST-2247). (#4262)
- `test/gstack-lock-race.test.ts` runs the old pattern and the helper against a PATH shim that behaves like uutils 0.8.0 `mkdir`, so it runs on any runner image: the old pattern lets two of four racers win, the helper admits exactly one in each of 60 races and never overlaps across take, hold and release loops, and parallel `gstack-config` writers keep every key. (#4262)
- Windows Setup E2E now runs when `bin/gstack-lock.sh` changes. (#4433)
- Claude Code's skill list now says when to use each gstack skill, so Opus loads /review and /plan-eng-review when a request fits. (#4387)
- A pull request's merge head can no longer keep its `/ship` receipt without a full review. (#4365)
- `/ship` now counts review rounds per pull request, and the head that merges always gets a full review. (#4360)
- /ship's documentation audit no longer accepts a passing result when an earlier line from the same audit said "blocked". (#4434)
- /ship's documentation audit no longer spends an attempt when the audit child writes text after its result. (#4285)
- The README lists the two new guides, and the install doc counts its hooks right. (#4403)
- docs/releases.md now says the stable release cut treats a failed commit status as red and a pending one as still going, as it has since #4257. (#4436)
- /ship's `finish --docs-requested` now accepts a docs fix when the audit named the file with a line number. (#4437)
- Document the `.gstack/approval-classes.json` schema, `gstack-approval-classes` CLI commands, and owner approval citation format in `docs/ship-policy.md#approval-classes`. (#4355)
- `/eval-plan` now runs four result checks instead of leaving them to judgment. (#4384)
- The /review coverage-audit eval no longer fails a run that really read the source file when zsh stops a command line at an `echo ====` separator. (#4364)
- Sixteen in-repo documentation links reach their section again. (#4394)
- gstack agents now open every status report with what failed, what they didn't verify and what else they changed. (#4273)
- Two new short guides. (#4380)
- A skill you wrote whose contract still lists `check_after_last_edit` keeps the rest of its contract. (#4439)
- The ship policy guide now explains how to merge any pull request with `gstack-ship-queue land`, even in a repository with one maintainer. (#4377)
- /ship's test step runs a large unit suite on Linux. (#4426)
- Every skill that loads the shared preamble, on every host, now says never to print a whole environment, git config or process table. (#4382)
- Pull requests from /ship now open with at most three plain lines, and every merge lands as one commit titled with the PR title. (#4438)
- `gstack-pr-wait`, `gstack-ci-gate` and the release cut no longer call a commit green while a check on it failed. (#4257)
- `gstack-runaway` now says what a thread's cold and empty wakes cost, not just how many there were (GST-2770). (#4385)
- The optional Stop hook no longer checks for a test run after the last edit, and /verify asks for it in plain words instead. (#4428)
- /ship's test step says when it ran out of time, and you can set its budget. (#4429)
- The remote test command no longer puts every file on one command line. (#4429)
- The stable release no longer waits on the nightly Windows tests (GST-2815). (#4400)
- Ubicloud fan-outs can no longer overshoot the vCPU limit, and owners no longer delete each other's VMs. (#4430)
- hono is pinned to 4.13.16, which fixes five advisories the weekly OSV scan found in 4.13.13 (gstack#4406). (#4408)
- `package.json` overrides (#4408)
- `test/dependency-security.test.ts`: the lockfile floor check now covers `hono >= 4.13.16`. (#4408)
- The nightly Windows test run finishes again. (#4409)
- A short write-up checklist in ETHOS.md. (#4381)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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