Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
b22f7a6
fix(careful): warn on chained rm even when the last target is safe
jbetala7 Jun 18, 2026
5d23cca
harden(careful): substitution separators + capital -R recursive flag …
garrytan Jul 10, 2026
9adb8ad
fix(context-restore): prefer the current branch's own checkpoint (#2052)
jbetala7 Jun 19, 2026
0ad9695
fix(gbrain): pass --confirm-destructive on drift re-register (#1985)
jbetala7 Jun 17, 2026
c20e462
harden(gbrain-sources): route drift remove through #1734 guards + rea…
garrytan Jul 10, 2026
c4efc2a
fix(developer-profile): exclude mode:resources rows from SESSION_COUN…
mvann Jul 10, 2026
3d97863
fix(hooks): passThrough() two-branch contract — never emit permission…
garrytan Jul 10, 2026
e0662ea
fix(one-way-doors): unify credential noun net + wire it into the runt…
garrytan Jul 10, 2026
a7a25aa
fix(design): loud integer-flag contract for --count/--retry/--timeout…
garrytan Jul 10, 2026
e742648
fix(gbrain): thin-client state — remote-MCP brains no longer classify…
garrytan Jul 10, 2026
03ea0c8
release: v1.60.0.0 — regen SKILL.md, VERSION, CHANGELOG, TODOS follow…
garrytan Jul 10, 2026
e3e0c66
fix(resolvers): compress --summary-stdin preamble prose to fit parity…
garrytan Jul 10, 2026
1179437
Merge origin/main (v1.60.1.0) into garrytan/gstack-fix-wave
garrytan Aug 7, 2026
7d1b9e9
fix(e2e): office-hours-spec-review turn budget fits the carved skill …
garrytan Aug 7, 2026
c7bf129
fix(e2e): review-dashboard-via session budget survives runner content…
garrytan Aug 7, 2026
61ae980
Merge origin/main (v1.60.2.0) into garrytan/gstack-fix-wave
garrytan Aug 7, 2026
85804bb
fix(e2e): retro-base-branch session budget survives runner contention…
garrytan Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Changelog

## [1.61.0.0] - 2026-07-09

## **Nine guard bugs fixed in one wave.**
## **Every fix ships with a tripwire that proves the guard actually guards.**

This release closes out the silent-failure class across gstack: guards and tools that reported success while doing nothing. Question cards render again on current Claude Code builds. /careful catches chained, substituted, and capital-flag deletes it used to wave through. The design CLI fails loudly on bad flags instead of billing you for a guess. Shared team brains (thin clients) get brain-aware planning instead of silent suppression. Four of the fixes came from community PRs, absorbed with authorship intact and hardened on top.

### The six numbers that matter

Source: this branch's diff against v1.58.5.0. Every new test was first run against the unfixed code and confirmed failing, then confirmed passing after the fix.

| What | Before | After |
|------|--------|-------|
| AskUserQuestion on Claude Code 2.1.89+ | "Tool result missing due to internal error" | card renders |
| `rm -R /`, `rm -rf $(cmd)/node_modules` via /careful | silent allow | ask |
| `design variants --count abc` | 0 variants, exit 0 | exit 1 with usage hint |
| Thin-client team brains | broken-config, brain blocks suppressed | usable, sync stages skip with reason |
| /office-hours SESSION_COUNT | ~2x inflated | exact |
| New tripwire test cases | n/a | 72 |

The first row is the one to feel. The question-card primitive every interactive skill depends on was orphaned on current Claude Code builds: the preference hook emitted `permissionDecision:'defer'`, whose semantics became "pause for external resumption" in CC v2.1.89. The fix is a two-branch pass-through (exact-empty stdout, or additionalContext-only output for plan-tune memory nuggets), plus a corrected protocol reference doc so the mistake cannot be re-learned from our own docs.

### What this means for you

Interactive skills ask you questions again on current Claude Code. Safety guards fail closed: chained deletes, command substitution, capital `-R`, and destructive credential phrasings ("reset my secrets") all reach a human now. If your team runs a shared remote brain, `/sync-gbrain` and brain-aware planning work on thin clients out of the box. Run `/gstack-upgrade` to get all of it. The hook fix arrives with the file update, no settings change needed.

### Itemized changes

#### Fixed

- **AskUserQuestion orphaned on Claude Code 2.1.89+ (#2035, #2006).** `question-preference-hook` pass-through is now exit 0 with exactly empty stdout (or additionalContext-only output for plan-tune memory nuggets), never `permissionDecision:'defer'`. `defer()` renamed `passThrough()`; the protocol contract in `docs/spikes/claude-code-hook-mutation.md` corrected in the same commit; 13 assertions rewritten across 3 test files; the tripwire asserts exact-empty stdout so a garbage write cannot slip past an optional-chained parse. Existing installs pick the fix up via `/gstack-upgrade` (the registered hook shim execs the TypeScript live).
- **/careful chained-rm bypass (#2039).** Contributed by @jbetala7 (PR #2040): the safe-exception shortcut no longer judges a chained command by its last (safe) target. Hardened on top of the anchored full-command whitelist: the flag cluster accepts capital `-R` (the BSD/macOS recursive flag — `rm -R /` warned nowhere before; `rm -Rf node_modules` alone still allows) and safe-target tokens exclude `(` and backtick, so command substitution ending in a whitelisted suffix (`rm -rf $(./wipe-all)/node_modules`) cannot ride the whitelist.
- **/context-restore loading a sibling worktree's checkpoint (#2052).** Contributed by @jbetala7: restore prefers the current branch's own checkpoint over newer sibling-worktree saves (scans 200 newest, partitions by branch frontmatter), and keeps the Conductor handoff fallback when the branch has no checkpoint.
- **/sync-gbrain drift re-register on gbrain 0.42+ (#1985).** Contributed by @jbetala7: the drift remove passes `--confirm-destructive`. Hardened on top: the remove routes through the #1734 data-loss guards (refuses loudly while an autopilot runs), propagates `--keep-storage`, realpath-normalizes drift detection (a symlink alias of the same directory is a match, not drift, the probable cause of the reporter's unmoved-repo drift), and logs old vs new path whenever drift fires.
- **Developer-profile double counting (#2067).** Contributed by @mvann: `mode:"resources"` bookkeeping rows no longer inflate SESSION_COUNT, TIER, or the builder-to-founder nudge; 8 regression tests pin the tier boundaries from both sides.
- **One-way-door credential net: plurals + runtime wiring (#2024).** The credential nouns now match plurals ("reset my secrets" / "rotate the credentials" classify one-way), and the keyword net is wired into the runtime for the first time: `gstack-question-preference --check <id> --summary-stdin` pipes the question text (stdin, never argv, so quotes and newlines survive), and the enforcement hook falls back to the classifier for unregistered ids, so an ad-hoc destructive question with a stored never-ask preference can no longer auto-decide.
- **design CLI silent NaN flags (#2032).** `--count`, `--retry`, and `--timeout` share one loud contract via `design/src/flag-utils.ts`: non-integer input errors with exit 1 ("3.7" is rejected, not truncated), above-max clamps with a stderr warning, and the variants ceiling derives from the style list instead of a magic 7. Previously `--retry abc` made generate a silent no-op and `--timeout abc` killed the serve board at boot.
- **Thin-client brains misclassified as broken (#2051).** New `thin-client` engine state, read from gbrain's own `remote_mcp` config marker before any probe. Usable at every suppression gate (`--is-ok`, gen-skill-docs detection, `gstack-config gbrain-refresh`) while the local sync stages skip with an accurate reason (code indexing runs on the brain server; memory syncs via the remote brain's artifacts pull). The detect JSON reports `gbrain_thin_client: {probed: false}`: config verified, reachability checked at use time where gbrain calls degrade gracefully. detectMcpMode also recognizes gbrain servers registered under variant names or matched by the config's `mcp_url`.

#### Closed as already fixed, with receipts

- #1965 (GBRAIN_PREPARE pooler breakage): `lib/gbrain-exec.ts:86` never sets it; pinned by `test/build-gbrain-env.test.ts:121-142`.
- #1950 (Windows git-bash learnings silently dropped): `bin/gstack-learnings-log:10-15` cygpath fix + stderr surfacing; pinned by `test/bin-windows-bun-import-paths.test.ts`.
- #1964 (slow engines misclassified): `probeTimeoutMs()` honors `GSTACK_GBRAIN_PROBE_TIMEOUT_MS`; timeout classifies usable; pinned by `test/gbrain-local-status.test.ts`.

#### For contributors

- 11 bisect commits; 4 community PRs absorbed with authorship preserved. Contributed by @jbetala7 (#2040, #2054, #2031) and @mvann (#1991). Thank you both.
- 72 new test cases across 9 files, each verified failing against the unfixed code before the fix landed.
- Three follow-ups filed in TODOS.md: wire `design/test/` into CI (all 8 existing files are invisible to every runner today, plus a documented pre-existing timing flake), /context-save worktree-identity hardening (the #2052 residual), and conditional gbrain reindex-in-place gated on the new drift log.

## [1.60.2.0] - 2026-08-07

## **Three free-suite tests fail-proofed against machine drift.**
Expand Down
67 changes: 67 additions & 0 deletions TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,73 @@ a silent mistake breaks all 52 skills. High blast radius — needs its own focus

## Test infrastructure

### P2: Wire `design/test/` into CI (all 8 files are invisible to every runner)

**What:** Add `design/test/` to the `bun test` glob (`package.json:21`) and
`TEST_ROOTS` (`scripts/test-free-shards.ts:32`) after auditing its 8 files for
server-spawning/flakiness (they were plausibly excluded on purpose). While in
there, fix the known timing flake: `variants-retry-after.test.ts` "HTTP-date:
honors a future date with no extra leading exponential" fails ~1-2 in 9 runs
under parallel suite load (verified pre-existing on v1.58.5.0 during the
June 2026 fix wave — wall-clock assertion with a ~2s window).

**Why:** Every test in `design/test/` runs only when someone types the path by
hand — a silent coverage hole, the fix wave's theme at meta-level. The wave's
own design tests went into `test/design-flag-utils.test.ts` to dodge this.

**Pros:** design binary gets CI coverage; kills a latent "we have tests" illusion.
**Cons:** unaudited files may spawn servers or flake; audit first, wire second.

**Context:** Filed from the June 2026 fix-wave eng review (issue 11 + flake
receipts). Start with the audit: which of the 8 files are hermetic? Wire the
hermetic ones, quarantine or fix the rest.

**Effort:** S-M (human ~1d, CC ~30min). **Depends on:** None.

### P2: /context-save worktree-identity hardening (the #2052 residual)

**What:** Persist a stable worktree identity (path hash or worktree name) into
checkpoint frontmatter at save time; `/context-restore` prefers identity match
over branch-name match. PR #2054 (@jbetala7, absorbed in the June 2026 wave)
fixed restore ORDERING (current-branch first), but branch frontmatter is not a
stable worktree identity: same-name branches across clones/remotes, renamed
branches, and detached HEAD can still restore the wrong checkpoint.

**Why:** Closes the residual wrong-checkpoint class entirely instead of the
common case. Codex outside-voice concurred during the wave's eng review.

**Pros:** Eliminates cross-clone checkpoint collisions.
**Cons:** Frontmatter schema change; needs a migration story for old
checkpoints (no-identity checkpoints rank as fallback, like #2054's
no-branch handling).

**Context:** Filed from the June 2026 fix-wave eng review (NOT-in-scope item).
Start at `context-restore/SKILL.md.tmpl` Step 1 + `/context-save`'s frontmatter
writer; mirror #2054's partition logic with identity as the first key.

**Effort:** S (human ~4h, CC ~20min). **Depends on:** #2054 (landed in the wave).

### P3: gbrain reindex-in-place on perpetual drift (conditional — check the drift log first)

**What:** IF the `[gbrain-sources] drift:` stderr line (added in the June 2026
wave) shows drift firing on every sync for some environment, implement #1985's
reporter design: refresh an existing source in place with `gbrain reindex-code`
instead of remove+add (which drops and re-embeds the full index — 768 pages /
6,786 embeddings in the reporter's case).

**Why:** Perpetual drift means paying full re-embed cost every sync. The wave's
`realpathSync` normalization (symlink aliases are a match, not drift) may have
eliminated the drift class entirely — that's why this is conditional.

**Pros:** Avoids repeated embedding spend for affected environments.
**Cons:** Speculative until the drift log produces evidence; reindex-in-place
has its own consistency questions (stale chunks for deleted files).

**Context:** Filed from the June 2026 fix-wave eng review (4A observability).
Trigger condition documented in `lib/gbrain-sources.ts` at the drift log line.

**Effort:** M (human ~1d, CC ~45min). **Depends on:** drift-log evidence from
the wave's `ensureSourceRegistered` logging.
### P1: Free suite exit code is untrustworthy — in-process force-exits mask failures

**Priority:** P1
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.60.2.0
1.61.0.0
2 changes: 1 addition & 1 deletion autoplan/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ If you are looping on the same diagnostic, same file, or failed fix variants, ST

## Question Tuning (skip entirely if `QUESTION_TUNING: false`)

Before each AskUserQuestion, choose `question_id` from `scripts/question-registry.ts` or `{skill}-{slug}`, then run `~/.claude/skills/gstack/bin/gstack-question-preference --check "<id>"`. `AUTO_DECIDE` means choose the recommended option and say "Auto-decided [summary] → [option] (your preference). Change with /plan-tune." `ASK_NORMALLY` means ask.
Before each AskUserQuestion, choose `question_id` from `scripts/question-registry.ts` or `{skill}-{slug}`, then run `printf '%s' "<question summary>" | ~/.claude/skills/gstack/bin/gstack-question-preference --check "<id>" --summary-stdin` (piped summary feeds the one-way keyword net, #2024). `AUTO_DECIDE` means choose the recommended option and say "Auto-decided [summary] → [option] (your preference). Change with /plan-tune." `ASK_NORMALLY` means ask.

**Embed the question_id as a marker in the question text** so hooks can identify it deterministically (plan-tune cathedral T14 / D18 progressive markers). Append `<gstack-qid:{question_id}>` somewhere in the rendered question (the leading line or trailing line is fine; the marker doesn't render visibly to the user when wrapped in HTML-style angle brackets, but the hook strips it). Without the marker the PreToolUse enforcement hook treats the AUQ as observed-only and never auto-decides — so always include it when the question matches a registered `question_id`.

Expand Down
8 changes: 5 additions & 3 deletions bin/gstack-config
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,11 @@ case "${1:-}" in
fi

case "$STATUS" in
ok|timeout)
# "timeout" = slow-but-healthy engine (#1964) — same treatment as
# "ok", matching gstack-gbrain-detect --is-ok and gen-skill-docs.
ok|timeout|thin-client)
# "timeout" = slow-but-healthy engine (#1964); "thin-client" =
# remote-HTTP MCP brain, no local engine by design (#2051) — same
# treatment as "ok", matching gstack-gbrain-detect --is-ok and
# gen-skill-docs.
echo "Detected gbrain v$VERSION (local-status: $STATUS)."
# Render brain-aware blocks INTO the global install so EVERY project's
# Claude sessions get them (other projects read SKILL.md + sections from
Expand Down
22 changes: 14 additions & 8 deletions bin/gstack-developer-profile
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,19 @@ do_read() {
cat "$PROFILE_FILE" | bun -e "
const p = JSON.parse(await Bun.stdin.text());
const sessions = p.sessions || [];
const count = sessions.length;

// SESSION_COUNT / TIER / CROSS_PROJECT / NUDGE must reflect real sessions, not
// resource-tracking events (the Phase 6 auto-append). Without this filter, a
// session's resources entry written immediately after the real session inflates
// the count (bumping TIER), clobbers LAST_PROJECT/LAST_ASSIGNMENT/LAST_DESIGN_TITLE,
// and pushes NUDGE_ELIGIBLE over its threshold from bookkeeping alone.
const realSessions = sessions.filter(e => e.mode !== 'resources');

const count = realSessions.length;
let tier = 'introduction';
if (count >= 8) tier = 'inner_circle';
else if (count >= 4) tier = 'regular';
else if (count >= 1) tier = 'welcome_back';

// LAST_* / CROSS_PROJECT must reflect real sessions, not resource-tracking
// events (the Phase 6 auto-append). Without this filter, a session's
// resources entry written immediately after the real session would clobber
// LAST_PROJECT/LAST_ASSIGNMENT/LAST_DESIGN_TITLE.
const realSessions = sessions.filter(e => e.mode !== 'resources');
const last = realSessions[realSessions.length - 1] || {};
const prev = realSessions[realSessions.length - 2] || {};
const crossProject = prev.project_slug && last.project_slug
Expand All @@ -252,7 +254,11 @@ do_read() {
for (const v of Object.values(signalCounts)) totalSignals += v;
const signalStr = Object.entries(signalCounts).map(([k,v]) => k + ':' + v).join(',');

const builderSessions = sessions.filter(e => e.mode !== 'startup').length;
// Builder-mode design sessions only — the builder->founder nudge is about
// someone who keeps returning to *build*, not startup-mode diagnostics and not
// resources bookkeeping. (Was \`e.mode !== 'startup'\`, which counted resources
// entries and excluded real startup sessions.)
const builderSessions = realSessions.filter(e => e.mode === 'builder').length;
const nudgeEligible = builderSessions >= 3 && totalSignals >= 5;

const resources = p.resources_shown || [];
Expand Down
Loading
Loading