Skip to content

gstack-upgrade works again after you disable skills (#4704) - #4743

Merged
capy-ai[bot] merged 5 commits into
mainfrom
upgrade-works-with-disabled-skills
Nov 23, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
upgrade-works-with-disabled-skills

Conversation

@garrytan

@garrytan garrytan commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

If you turned off skills with gstack-config set disabled_skills ..., every gstack-upgrade stopped with "tracked files changed: SKILL.md". It now upgrades, and your skills stay off afterwards.
Why: gstack has to keep itself up to date without a person cleaning up after its own setup.
Nothing to do.

What changed

Setup rewrites the router file SKILL.md in the gstack checkout to leave out skills you disabled (or the plan-mode preamble, with plan_mode_preamble off). The upgrade's safety check saw that rewrite as your own edit and refused.

Now bin/gstack-upgrade renders the router fresh for your current settings and compares. Only when SKILL.md is the one changed file, its file mode is unchanged, and its bytes match that fresh render exactly, does the upgrade treat it as gstack's own. It checks the bytes again under the setup lock, puts the committed file back for the fast-forward, and renders the router again right after, so the disabled skills stay off.

Anything else still refuses exactly as before. That includes an edit on top of the rendered router, a router rendered for an old setting, a staged or mode-changed SKILL.md, or any other changed tracked file. If the fast-forward fails, the router is rendered again only if it wasn't edited after the restore (a sub-second race remains; see Review notes). If the render after the update fails, the upgrade prints a fix and leaves the reinstall pending.

Why

The bug report (#4704) showed every scheduled upgrade failing for anyone who disables a skill, and the next setup making the file dirty again. Two fixes were possible. One was to teach the upgrade's dirty check to recognise the generated router. The other was to move the per-install router out of the git checkout. The first is much smaller and keeps the safety check in force, because the exception is narrow (one file, exact bytes from the same generator and settings relink uses) and fails closed on any mismatch. Moving the router would touch setup, relink and every host's install layout, which this fix does not need.

Blast radius

Only bin/gstack-upgrade changes behaviour, and only when SKILL.md is the sole changed tracked file. For everyone else the dirty check runs exactly as before. setup, gstack-relink and gstack-config are unchanged. The check runs Bun and the router generator from the checkout, only after confirming every other tracked file is clean.

Test Coverage

New test/gstack-upgrade-rendered-router.test.ts (9 cases, skipped on Windows), written first and failing on main 45e33b5 (2 of its first 6 cases failed with "tracked files changed: SKILL.md"). It builds a throwaway gstack remote and clone in a temp folder, sets disabled_skills through the real gstack-config and gstack-relink, then upgrades. It covers the upgrade passing and the router staying rendered (plain and --ff-only-no-reinstall), plan_mode_preamble off, a failed fast-forward, and five refusals: a user edit on the rendered router, an edit with nothing disabled, a mode change, another tracked edit, and a router rendered for an older setting.

Documentation

Status: current. The docs match the change, so no edits were needed.

Scope: the committed diff against base 45e33b5 (bin/gstack-upgrade, docs/troubleshooting.md, changelog.d/upgrade-works-with-disabled-skills.md, test/gstack-upgrade-rendered-router.test.ts), plus a search of the authored docs and templates for gstack-upgrade, disabled_skills and "tracked files changed".

Documentation health

  • docs/troubleshooting.md: current. The UPGRADE_REFUSED entry (#upgrade-refused) already explains the rendered router SKILL.md exemption.
  • changelog.d/upgrade-works-with-disabled-skills.md: current (read only; changelog files are owned by the parent).

Coverage debt: bin/gstack-upgrade has a new stderr warning ("could not render the router for disabled_skills again ...") that no troubleshooting entry covers. No diagram drift.

Tests

  • bun test test/gstack-upgrade-rendered-router.test.ts test/gstack-upgrade-bin.test.ts test/relink-disabled-router.test.ts test/bun-entry-isolation.test.ts test/gstack-config-defaults.test.ts: 67 pass, 0 fail at b48d1fa
  • bun run typecheck:test: no new diagnostics
  • Full free test suite in CI at b48d1fa: green (run 45194763944). The first CI run at 9ea8aa5 (run 45190505632) failed one config-key census test in test/gstack-config-defaults.test.ts; b48d1fa fixed it.
  • Repro by hand on main 45e33b5: gstack-config set disabled_skills qa-only,careful, ./setup --host claude, then bin/gstack-upgrade --ff-only-no-reinstall exited 3 with "tracked files changed: SKILL.md"

Review notes

Below the blocking floor, recorded and not fixed in this PR:

  • An edit saved to SKILL.md during the roughly 0.2 second router render after the update could be overwritten by that render. Only gstack's own generated file is at risk.
  • If the fast-forward is refused and the router render after it also fails, the committed full router stays in place while the upgrade reports nothing changed. Disabled skills stay listed until the next setup or relink.
  • A router generator that keeps failing ends with the full router in place after the pending reinstall clears. Nothing is lost.
  • No test forces the router render after the update to fail.
  • After a failed post-update render under --ff-only-no-reinstall, the pending-reinstall marker stays until a plain gstack-upgrade runs, so --check reports a pending reinstall.
  • A stale render still gets the general "commit or move those changes" hint; bin/gstack-relink is the better fix there.
  • bin/gstack-capy-session's own dirty checks (lines 177, 238) still count the rendered router; the upgrade itself now works, so this only changes which fix it prints.

Open in Capy

Agent notes

Plan: exempt: s1
Ruled note: bin/gstack-upgrade:244:outside-voice at b48d1fa ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-23-notes-ruling) at 2026-11-23T14:26:25.255Z: an edit saved during the ~0.2 s post-update render could be overwritten; below the floor, nothing lost (approval a-6c18778792b5)
Ruled note: bin/gstack-upgrade:319:outside-voice at b48d1fa ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-23-notes-ruling) at 2026-11-23T14:26:25.347Z: a refused fast-forward plus a failed re-render leaves the committed router while saying nothing changed; below the floor, nothing lost (approval a-fe066fc7f491)
Ruled note: bin/gstack-upgrade:323:outside-voice at b48d1fa ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-23-notes-ruling) at 2026-11-23T14:26:25.431Z: a generator that keeps failing ends with the full router after the pending reinstall clears; below the floor, nothing lost (approval a-ddc6b671a365)
GST-3542.

Fixes #4704

{
  "schema_version": 1,
  "pr": 4743,
  "head": "b48d1fad3b84494a604faa0535f8b4725c263d92",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 67,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 22,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/gstack/ship-4704b",
  "head_tree": "47bcdcf16103dff9162e7c33fc4c9cdc43136fc5",
  "product_patch_id": "d800c7a31f0bc0f349448da8ce0a61ee5f706056",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 53,
    "rules": "33831f8248a814fd",
    "base": "a3ecfd530df3c78c2d60e92b6488586a75e0ff91",
    "registry": "a3ecfd530df3c78c2d60e92b6488586a75e0ff91",
    "gate_scan": {
      "tagged": 0,
      "head": "b48d1fad3b84494a604faa0535f8b4725c263d92"
    },
    "reasons": [
      "risk:security",
      "runtime=53"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @47bcdcf16103 (8 checks, current for b48d1fad3b84)",
  "requires_remote": [
    "pregate.json/remote_gate: remote-gate tree=47bcdcf16103 tests=39138 skipped=2 runs=45194763944/1 profiles=ci-reuse/free-tests heads=b48d1fad3b84 verified=2026-11-23T15:05:09.766Z"
  ],
  "issues": {
    "fixes": [
      4704
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md; docs/troubleshooting.md upgrade-refused entry already current"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 6,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 8
    }
  },
  "review_round_grants": [
    {
      "kind": "extra-round",
      "head": "b48d1fad3b84494a604faa0535f8b4725c263d92",
      "pr": 4743,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "one read-only full review of the final head after the round cap, no fix round (R51)",
      "at": "2026-11-23T14:14:16.496Z",
      "approval": "a-e254296b23eb"
    }
  ],
  "ruled_notes": [
    {
      "finding": "bin/gstack-upgrade:244:outside-voice",
      "head": "b48d1fad3b84494a604faa0535f8b4725c263d92",
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "an edit saved during the ~0.2 s post-update render could be overwritten; below the floor, nothing lost",
      "at": "2026-11-23T14:26:25.255Z",
      "approval": "a-6c18778792b5",
      "relayed": "GSTA-36:2026-11-23-notes-ruling"
    },
    {
      "finding": "bin/gstack-upgrade:319:outside-voice",
      "head": "b48d1fad3b84494a604faa0535f8b4725c263d92",
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "a refused fast-forward plus a failed re-render leaves the committed router while saying nothing changed; below the floor, nothing lost",
      "at": "2026-11-23T14:26:25.347Z",
      "approval": "a-fe066fc7f491",
      "relayed": "GSTA-36:2026-11-23-notes-ruling"
    },
    {
      "finding": "bin/gstack-upgrade:323:outside-voice",
      "head": "b48d1fad3b84494a604faa0535f8b4725c263d92",
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "a generator that keeps failing ends with the full router after the pending reinstall clears; below the floor, nothing lost",
      "at": "2026-11-23T14:26:25.431Z",
      "approval": "a-ddc6b671a365",
      "relayed": "GSTA-36:2026-11-23-notes-ruling"
    }
  ],
  "gate_dispositions": []
}
{"head":"b48d1fad3b84494a604faa0535f8b4725c263d92","run":"ship-4704","mark":"abandoned","by":"lane GSTA-808","reason":"review rounds at cap; Captain ruled one read-only full review of the final head in a new run"}

garrytan and others added 4 commits November 22, 2026 14:09
…sabled skills (#4704)

setup renders the tracked root SKILL.md in place for disabled_skills, and the upgrade's dirty check read that as a local edit. The upgrade now leaves SKILL.md out of the check only when its bytes equal a fresh render for the current config, restores the committed bytes for the fast-forward and renders the router again after it. Any other edit still refuses.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
gstack-upgrade checks the router's bytes again under the setup lock before it restores the committed file, and the tests cover plan_mode_preamble=off and a fast-forward that fails after the restore.

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/specialist-batched#2 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The router is rendered for comparison only when it is the one dirty path, a mode change still refuses, a failed fast-forward never renders over an edit made after the restore, and a failed post-update render leaves the reinstall pending.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Review-Finding: p1/outside-voice#3 reader=outside-voice
Review-Finding: p1/outside-voice#4 reader=outside-voice
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>
@trunk-io

trunk-io Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…he config key census stays clean

test/gstack-config-defaults.test.ts counts every literal 'gstack-config get <key>' as a key that needs a DEFAULTS entry; disabled_skills has none, and gstack-relink reads it through a variable. No behaviour change.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit c4cfe6d into main Nov 23, 2026
86 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 24, 2026
- `/ship` now tells you what to change when GitHub refuses a push for email privacy. (#4748)
- The release gate's /cso check accepts the low-confidence hypotheses /cso now reports. (#4753)
- /cso reports every security finding the code supports instead of dropping most of them. (#4739)
- /cso can search the whole repository in one call, and a daily report now lists its low-confidence hypotheses. (#4742)
- A first version's plan and try-it message now open with the owner's own words, and the build is tried the same way he will try it before he is asked. (#4759)
- A first version's public export now keeps out the owner's short quotes and his reasons to leave something out, and a phone first-use check installs a build the cloud phone can actually run. (#4772)
- Three intermittent test failures are fixed. (#4745)
- Free Tests runs its shards on 8-core runners again. (#4749)
- A land that waits on an earlier CI run now decides on what that run actually did. (#4763)
- Landing a PR no longer starts a new CI run when one for the same merged code is already running or has passed. (#4760)
- /ship no longer misses a file-mode change from main on files whose names start with `:`. (#4774)
- make-pdf keeps quotes in alt text, link titles and raw HTML attributes inside the attribute, so a Markdown file can no longer add an `onerror`, `onload` or `javascript:` link that runs in the print browser. (#4761)
- Posting a PR body that lists earlier /ship runs no longer stops for a phone number that isn't there. (#4747)
- A first version's public export now catches a short owner quote whose padding or quote marks are encoded. (#4778)
- A first version's public export now also keeps out a short owner quote written with spaces just inside its quote marks. (#4776)
- Posting a PR body that lists earlier /ship runs no longer stops for a card number that isn't there. (#4751)
- /ship no longer asks for an extra reader when you merge the base branch next to code that was already reviewed. (#4754)
- /ship no longer plans narrow re-checks after a fix. (#4741)
- /ship can't quietly gain new refusals. (#4740)
- `gstack-upgrade` no longer refuses to run after you disable skills. (#4743)
- The free test suite splits its shards from this week's recorded test times. (#4744)
- gstack now writes up a failed or shelved attempt before closing it. (#4735)

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.

gstack-upgrade refuses to run after setup applies disabled_skills (SKILL.md marked as changed)

1 participant