fix(update-check): default to swxtchio/gstack fork, not public garrytan/gstack#1
Open
swx-geeter wants to merge 7 commits into
Open
fix(update-check): default to swxtchio/gstack fork, not public garrytan/gstack#1swx-geeter wants to merge 7 commits into
swx-geeter wants to merge 7 commits into
Conversation
Mirrors /codex's three-mode pattern (review / challenge / consult) using the Gemini CLI. Pinned to gemini-3.1-pro-preview at highest available reasoning depth, --approval-mode plan for read-only. Architecturally divergent from Claude (different training paradigm), making gemini valuable as an outside voice — agreement = stronger signal, disagreement = better blind-spot coverage. When /codex is also available, running both gives three-way independent review. Files: - gemini/SKILL.md.tmpl — source template (mirrors codex/SKILL.md.tmpl) - gemini/SKILL.md — auto-generated, regenerate via bun run gen:skill-docs - bin/gstack-gemini-probe — auth/version/timeout helpers (mirrors bin/gstack-codex-probe) Triggers: "gemini review", "gemini challenge", "ask gemini", "consult gemini", "second opinion gemini". Voice aliases: "ask gemini", "google second opinion", "gem in eye". Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
/gstack-upgrade hard-resets the current branch to origin/main, which silently discards customization commits when run from the swxtch branch. This wrapper keeps main as a pure upstream mirror, runs ./setup + migrations, then rebases swxtch on top. Survives running itself: re-execs from a temp copy so the main checkout that removes its own (swxtch-only) file mid-run can't corrupt it. Idempotently maintains a PATH symlink (~/.local/bin/gstack-safe-update -> in-repo script) so a fresh clone is self-bootstrapping; refuses to clobber a foreign file there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
… rebase
The mirror-branch block ran ./setup before `git checkout $CUSTOM_BRANCH`, which
rewrote tracked SKILL.md files and left the mirror dirty — git then aborted the
checkout ("local changes would be overwritten") and stranded the run on `main`
with the custom branch un-rebased. Move ./setup + version migrations + markers
to run AFTER the rebase, on the custom branch, so the mirror stays pristine and
the generated files match the branch we actually end up on.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
…ERM-ignoring CLIs
_gstack_{codex,gemini}_timeout_wrapper ran `timeout <dur> <cmd>`, which sends
SIGTERM only. The gemini node CLI ignores SIGTERM, so a hung review ran 553s
past a 330s cap and locked the calling agent (and even a manual kill of the
launcher left the --max-old-space-size child alive). Add --kill-after=10 so
timeout escalates to SIGKILL 10s after the initial TERM.
Verified: a TERM-ignoring child (`trap "" TERM; sleep 30`) under a 2s wrapper is
now reaped at ~12s (exit 137) instead of running to completion. Applied to both
codex and gemini probes (identical latent bug).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
…w harness Shared helper for /codex, /gemini and fix-and-ship cross-model reviews. Gives reviewers the whole repo (not a diff) in a throwaway worktree off a clean+pushed branch, and makes a hung/flaky reviewer safe: - setsid + `timeout --kill-after` converts a lockup into a bounded exit - stall watchdog kills early when output stops growing - exit-code taxonomy OK/CLEAN/TIMEOUT/CRASH + one bounded retry - PGIDs tracked in an flock'd FILE (survives $()/backgrounding/concurrency), cleanup kills every surviving group then removes the worktree on all paths Tested: hang, stall, crash, retry, concurrent reviewers, in-group grandchild reaping, and PGID-tracking-survives-subshell (the bug that nullified cleanup). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
Wire the cross-model review skills to the gstack-review-sandbox harness so reviewers see the whole repo (not a bare diff) — what stops the confident-wrong "missing/breaking/no-default" false positives. - gemini: add a PREFERRED full-context path to Review + Challenge modes — run tool-enabled (-y) over the whole repo + web inside a throwaway worktree. Gemini's --approval-mode plan disables tools, so full context needs -y; AND GEMINI_CLI_TRUST_WORKSPACE=true (a fresh worktree is "untrusted", where gemini silently downgrades -y to approval-prompt and loses tool access — caught in smoke: without it gemini returns empty → harness reports CRASH). The worktree + timeout + cleanup trap make the tool-enabled mode safe. Diff-only plan-mode path kept as fallback for dirty/unpushed trees. TIMEOUT/CRASH = coverage gap, never a clean pass. - codex: note it already reads the whole repo (-s read-only) and can run via the shared harness for timeout-robust, clean-snapshot review. tmpl-only (generated SKILL.md regenerates via ./setup on landing per gstack discipline). Pairs with the gstack-review-sandbox helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: 308270c8-8e03-4d4c-aeb3-8500e7af43d8
…an/gstack gstack-update-check hard-defaulted its upgrade source to garrytan/gstack@main, so every fork user gets upgrade prompts (and SHA resolution) computed against the public upstream instead of this fork's swxtch branch. Silent only while the two happen to match versions; diverges the moment swxtch pins or holds back. Point REMOTE_URL/REMOTE_REPO and the ls-remote SHA path at swxtchio/gstch@swxtch. GSTACK_REMOTE_URL/REPO env overrides still honored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🤖 Augment PR SummarySummary: Point 🤖 Was this summary useful? React with 👍 or 👎 |
| _REMOTE_SHA="$(echo "$_LSR_LINE" | awk '{print $1}')" | ||
| if echo "$_REMOTE_SHA" | grep -qE '^[0-9a-f]{40}$'; then | ||
| _SHA_URL="https://raw.githubusercontent.com/garrytan/gstack/${_REMOTE_SHA}/VERSION" | ||
| _SHA_URL="https://raw.githubusercontent.com/swxtchio/gstack/${_REMOTE_SHA}/VERSION" |
There was a problem hiding this comment.
_SHA_URL is hard-coded to swxtchio/gstack, so if someone overrides GSTACK_REMOTE_REPO (without also setting GSTACK_REMOTE_URL) the SHA-pinned fetch can consult the wrong repo (or fail) and make the update check inconsistent with the override. Other locations where this applies: bin/gstack-update-check:197.
Severity: medium
Other Locations
bin/gstack-update-check:197
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
bin/gstack-update-checkhard-defaults its upgrade source to the public upstreamgarrytan/gstack, not this fork:Every dev on the fork (branch
swxtch) therefore getsUPGRADE_AVAILABLEprompts — and the ls-remote SHA resolution — computed against the public repo'smain, notswxtchio/gstack@swxtch. Silent only while the two happen to match versions; the moment swxtch pins or holds back, the notifier nags toward (and an upgrade could pull from) the wrong source, over theSWX:customizations.The only current workaround is per-machine
GSTACK_REMOTE_URL/REPOenv vars in each dev's shell profile — easy to miss, doesn't scale to the team.Change
Point the defaults (and the ls-remote branch + SHA URL) at
swxtchio/gstack@swxtch:REMOTE_URL→raw.githubusercontent.com/swxtchio/gstack/swxtch/VERSIONREMOTE_REPO→github.com/swxtchio/gstack.gitgit ls-remote ... refs/heads/main→refs/heads/swxtch_SHA_URL→swxtchio/gstack/${_REMOTE_SHA}/VERSIONGSTACK_REMOTE_URL/GSTACK_REMOTE_REPOenv overrides are still honored (tests/mirrors), so a vanilla-upstream clone can still point at garrytan.Follow-up worth discussing
A more robust version would auto-detect: if the install has a
swxtchremote (or HEAD tracksswxtch/*), derive the source from it and fall back to upstream only when no fork remote exists — so both fork checkouts and vanilla clones are correct without hardcoding. Happy to do that instead if preferred.Test
gstack-update-checknow compares local VERSION againstswxtchio/gstack@swxtch.GSTACK_REMOTE_URL=... gstack-update-checkuses the override verbatim.Surfaced while syncing a dev machine that was 11 commits / one minor (
1.57.7.0→1.58.1.0) behind the fork while correctly on theswxtchbranch, but the notifier was watchinggarrytan/gstack.