Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# Changelog

## [1.91.17.0] - 2026-10-03

**Checkpoints say whether each next step was run, read or guessed, and `/context-restore` verifies the guesses first.**
**Paid design images are never overwritten, and design skills always show the round you just paid for.**

This wave rebuilds three community PRs from @mvanhorn on current main. A checkpoint's Remaining Work used to read the same whether a step had been run or only inferred, so a resumed session could act on a guess and hit the wrong system (#3004, reported by @tomg65). Running `$D variants` twice into one folder replaced `variant-A.png`, `$D generate --retry` kept only the last image, and skills built boards from fixed `variant-A/B/C` names, so you could pay for images you never saw (#1529, reported by @SakenW).

### What changes for you

- **Remaining Work carries provenance.** Every item starts with `Open.` and ends with how the saving session knows it: `(path run)` with the outcome, `(path read)` or `(path assumed)` for commands, flags, config values and files; `(target state checked)`, `(code read)` or `(path assumed)` for writes. For example:

1. Open. Run the migration check with SWITCH_B=1 against staging. (path assumed)
2. Open. Run bun test test/billing.test.ts. (path run) exit 0

`/context-restore` keeps the saved order but shows item 2 under **Next steps** and item 1 under **Verify first**, and "continue" starts by verifying item 1 read-only instead of jumping to item 2. Checkpoints saved before this release have no markers, so their command, path and write items land under Verify first, with a one-line banner saying so.
- **Nothing paid is lost.** A taken image name gets `-2`, `-3` and so on (`variant-A-2.png`); stderr says `note: <requested> exists; saved to <actual> (existing file kept)` and the JSON reports the real path. Every `--retry` attempt is its own saved image. If saving fails after the API returned the image, the bytes go to a private recovery copy in your temp directory and the message says where; a local write failure never buys a second image.
- **Every image command prints JSON, even on failure**: `requested`, `saved`, `selected`, `failures`, `recovered`. Exit 0 means the result is ready, 2 means nothing was saved, 3 means the run stopped after saving some images.
- **Boards show this round only.** Skills tell you how many of the requested images were saved, write the round's printed paths to `board-images.json`, build the board with `$D compare --images-file`, archive an old `feedback.json` first, and record `approved_path` in `approved.json`, so a later session opens exactly the image you approved. Old letter-only approvals still work. /design-shotgun subagents stage in a fresh temp directory and publish with `gstack-design-claim`, which never overwrites.
- **If you script `$D`,** read paths from the JSON instead of assuming the file name:

out=$($D generate --brief "pricing page" --output designs/pricing.png); rc=$?
img=$(printf '%s' "$out" | jq -r .outputPath)
[ "$rc" -eq 0 ] && $D check --image "$img" --brief "pricing page"

`variants` prints its list in `.paths`; `compare` takes it losslessly with `--images-file paths.json`.
- **Windows console flashes (#1784)** were confirmed fixed on main (v1.91.15.0) by @kaiwulff on a real Windows 11 desktop; this release ships no code for them.

### Itemized changes

#### Fixed
- `/context-save` Remaining Work did not record whether a step was run, read or assumed, and `/context-restore` offered the first item as the next action (#3004). Marker format from #3019 by @mvanhorn, field-tested by @tomg65.
- Design images were silently overwritten by later rounds and `--retry` attempts (#1529). Exclusive-create claim idea from #1737 by @mvanhorn.
- Comparison boards and quality checks read fixed `variant-A/B/C` names or a `variant-*.png` glob and mixed rounds; a stale `feedback.json` could approve a new round.
- `$D` wrote iterate session files to `/tmp`, which does not exist on Windows, so `generate` could not record its session and `iterate` could not find it there; sessions now live in the OS temp directory.
- /setup-deploy reported a failing status command as success (the pipe hid its exit code), matched `cd` anywhere in a workflow as a deploy workflow, and left the merge-method check, Fly `/health` detection and GitHub-Actions-only status command unspecified.

#### Added
- `$D compare --images-file` and JSON-array `--images`, `bin/gstack-design-claim`, `bin/gstack-design-approved`, and `approved_path` in approval records.
- Periodic behavior eval `context-restore-provenance-order` (3-trial panel) and free contract tests for the provenance markers, `$D` persistence and the design-skill path rules.

## [1.91.16.0] - 2026-10-03

**Installing or upgrading gstack never quietly changes another copy, and `./setup --status` shows every install.**
Expand Down
25 changes: 25 additions & 0 deletions TODOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,31 @@
trials per case, apply the CASE_QUARANTINE entry rule instead of chasing one
run at a time. Effort S.

### P2/P3: mvanhorn fix-wave deferrals (filed 2026-10-03, from the autoplan review of the wave)

- **E6 (P2): behavior E2E for design round accounting** — stub `$D` so a
generating step reports `saved` shorter than `requested` (and exit 2 for zero
saved), run /plan-design-review or /design-shotgun against it, and assert the
skill tells the user how many paid images were saved, names the failures and
builds no board on zero saved. `test/design-printed-paths.test.ts` only pins
the marker order; whether the model reports the count is behavior. Context:
#1529. Effort M.
- **E7 (P3): prune or archive unapproved design rounds** — never-overwrite plus
`--retry` attempts and iterate outputs grow
`$GSTACK_STATE_ROOT/projects/$SLUG/designs/` without bound. Add a prune or
archive command for unapproved rounds and attempts (keep anything an
`approved.json` names) and show the design directory size in `$D gallery`.
Context: #1529, eng review. Effort S.
- **E5 (P3): restore verifies assumed items read-only** — `/context-restore`
could check `(path assumed)` and `(code read)` items itself with read-only
commands (file exists, flag is defined, table has a unique key) and report
what it found before offering option A. Context: #3004. Effort M.
- **E4 (P3): real-desktop Windows console smoke for spawn changes** — #1784 was
confirmed fixed on a real Windows 11 desktop by its reporter (v1.91.15.0); CI
can only check that spawns pass `windowsHide`. A smoke that starts browse from
a console-less parent and watches for new visible windows would catch a
regression the static sweep can't. Effort M.

### P2/P3: parallel fix-wave follow-ups (filed 2026-10-02, from the approved fix-wave plan)

- **Agent Skills distribution (#113)** — publish gstack in the Agent Skills
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.91.16.0
1.91.17.0
2 changes: 1 addition & 1 deletion agents-digest/gstack-AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gstack digest v1.91.16.0 — regenerate/re-copy after upgrading gstack
# gstack digest v1.91.17.0 — regenerate/re-copy after upgrading gstack

Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed
for agent hosts without a full skill install. The full skills add workflows,
Expand Down
24 changes: 24 additions & 0 deletions bin/gstack-design-approved
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bun
// gstack-design-approved — print the absolute path of the image an
// approved.json names.
//
// Usage: gstack-design-approved <approved.json>
//
// Prefers approved_path (relative to approved.json's directory). Legacy
// records with only approved_variant resolve to variant-<letter>.png. When the
// named image is missing, exits 1 with "approved image <path> is missing;
// reselect from the board" and never substitutes another image.

import { resolveApprovedImage } from '../design/src/approval';

const file = process.argv[2];
if (!file) {
console.error('Usage: gstack-design-approved <approved.json>');
process.exit(1);
}
const resolved = resolveApprovedImage(file);
if (!resolved.ok) {
console.error(resolved.error);
process.exit(1);
}
console.log(resolved.path);
55 changes: 55 additions & 0 deletions bin/gstack-design-claim
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh
# gstack-design-claim — publish a staged design image without overwriting.
#
# Usage: gstack-design-claim <staged-image> <destination>
#
# Creates <destination> with an exclusive, non-overwriting create (set -C
# noclobber, which opens with O_EXCL). When the name is taken it tries
# <stem>-2<ext>, <stem>-3<ext> ... <stem>-999<ext>, the same rule as
# $D's claimOutputPath (x-2.png bumps to x-2-2.png). Prints the final path.
# On any failure it exits non-zero with problem/cause/fix and leaves the staged
# image in place, so the paid bytes survive. On success the staged copy is
# removed.

set -u

fail() {
printf 'gstack-design-claim: %s\ncause: %s\nfix: %s\n' "$1" "$2" "$3" >&2
exit 1
}

[ "$#" -eq 2 ] || fail "expected 2 arguments, got $#" "usage: gstack-design-claim <staged-image> <destination>" "pass the staged image path, then the destination path"
src=$1
dest=$2

[ -f "$src" ] && [ -s "$src" ] || fail "staged image $src is missing or empty" "the generating command did not save an image there" "use the outputPath the \$D command printed"

dir=$(dirname "$dest")
base=$(basename "$dest")
case "$base" in
?*.*) stem=${base%.*}; ext=".${base##*.}" ;;
*) stem=$base; ext="" ;;
esac

err=$(mkdir -p "$dir" 2>&1) || fail "cannot create $dir; staged image kept at $src" "$err" "make $dir writable or choose another destination"

n=1
candidate=$dest
while :; do
if err=$( (set -C; : > "$candidate") 2>&1 ); then
if err=$(cat "$src" 2>&1 > "$candidate"); then
rm -f "$src"
printf '%s\n' "$candidate"
exit 0
fi
rm -f "$candidate"
fail "cannot write $candidate; staged image kept at $src" "$err" "free disk space or make $dir writable, then rerun"
fi
if [ -e "$candidate" ] || [ -L "$candidate" ]; then
n=$((n + 1))
[ "$n" -le 999 ] || fail "$dest and every name through $stem-999$ext already exist; staged image kept at $src" "999 images already use this name" "choose a new destination name or move older images out of $dir"
candidate="$dir/$stem-$n$ext"
continue
fi
fail "cannot create $candidate; staged image kept at $src" "$err" "make $dir writable or choose another destination"
done
29 changes: 27 additions & 2 deletions context-restore/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,22 @@ checkpoint(s) from another project; only this project's are listed." If it print
`LEGACY_BUCKET`, relay that line. If the chosen file is `ROOT_DIFFERS`, add
"Saved from another checkout of this repository at `{project_root}`." as info.

**Sort Remaining Work by provenance.** Keep every item's original text and saved
order, and drop nothing. Put an item under **Verify first** when it:
- ends in `(path assumed)` or `(code read)`;
- ends in `(path run)` but its text reports a failure;
- has no marker and is a writing step (migration, sync, insert, import, a dialog that
writes) or names a concrete path (a runnable command, CLI flag or switch, config key
or value, or file or directory path).

Every other item goes under **Next steps**: `(path run)` with a successful outcome,
`(path read)`, `(target state checked)`, and unmarked items that neither write nor
name a concrete path. Verifying means read-only inspection: read the file or the
target, or run a command that changes nothing. Checkpoints saved before provenance
markers existed have none, so their concrete-path items land under Verify first. When
the file has no provenance markers at all, print this line above the groups:
`This checkpoint predates provenance markers; items naming commands, paths or writes are listed under Verify first.`

Read the chosen file and present a summary:

```
Expand All @@ -522,7 +538,13 @@ Status: {status}
{summary from saved file}

### Remaining Work
{remaining work items}
{legacy banner line, if it applies}

Next steps
{Next steps items, in saved order, original text}

Verify first (inspect read-only before executing anything)
{Verify first items, in saved order, original text}

### Notes
{notes}
Expand All @@ -540,7 +562,10 @@ After presenting, ask via AskUserQuestion:
- B) Show the full saved file
- C) Just needed the context, thanks

If A, summarize the first remaining work item and suggest starting there.
If A, take the first Remaining Work item in saved order. If it is under Next steps,
suggest starting there. If it is under Verify first, suggest verifying it (read-only)
before doing it or any later item, so a later runnable step never jumps ahead of an
unverified earlier one.

---

Expand Down
29 changes: 27 additions & 2 deletions context-restore/SKILL.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ checkpoint(s) from another project; only this project's are listed." If it print
`LEGACY_BUCKET`, relay that line. If the chosen file is `ROOT_DIFFERS`, add
"Saved from another checkout of this repository at `{project_root}`." as info.

**Sort Remaining Work by provenance.** Keep every item's original text and saved
order, and drop nothing. Put an item under **Verify first** when it:
- ends in `(path assumed)` or `(code read)`;
- ends in `(path run)` but its text reports a failure;
- has no marker and is a writing step (migration, sync, insert, import, a dialog that
writes) or names a concrete path (a runnable command, CLI flag or switch, config key
or value, or file or directory path).

Every other item goes under **Next steps**: `(path run)` with a successful outcome,
`(path read)`, `(target state checked)`, and unmarked items that neither write nor
name a concrete path. Verifying means read-only inspection: read the file or the
target, or run a command that changes nothing. Checkpoints saved before provenance
markers existed have none, so their concrete-path items land under Verify first. When
the file has no provenance markers at all, print this line above the groups:
`This checkpoint predates provenance markers; items naming commands, paths or writes are listed under Verify first.`

Read the chosen file and present a summary:

```
Expand All @@ -196,7 +212,13 @@ Status: {status}
{summary from saved file}

### Remaining Work
{remaining work items}
{legacy banner line, if it applies}

Next steps
{Next steps items, in saved order, original text}

Verify first (inspect read-only before executing anything)
{Verify first items, in saved order, original text}

### Notes
{notes}
Expand All @@ -214,7 +236,10 @@ After presenting, ask via AskUserQuestion:
- B) Show the full saved file
- C) Just needed the context, thanks

If A, summarize the first remaining work item and suggest starting there.
If A, take the first Remaining Work item in saved order. If it is under Next steps,
suggest starting there. If it is under Verify first, suggest verifying it (read-only)
before doing it or any later item, so a later runnable step never jumps ahead of an
unverified earlier one.

---

Expand Down
24 changes: 22 additions & 2 deletions context-save/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,30 @@ Using the gathered state plus your conversation history, produce a summary cover

1. **What's being worked on** — the high-level goal or feature
2. **Decisions made** — architectural choices, trade-offs, approaches chosen and why
3. **Remaining work** — concrete next steps, in priority order
3. **Remaining work** — concrete next steps, in priority order, each marked with
how this session knows it (see the provenance table below)
4. **Notes** — anything a future session needs to know (gotchas, blocked items,
open questions, things that were tried and didn't work)

**Remaining Work provenance.** Every item starts with the status `Open.` and never
with a completion token such as `[done]` or `[executed]`. Then pick its trailing
marker by the first rule that applies:

| # | The item is... | Marker | Use when this session... |
|---|----------------|--------|--------------------------|
| 1 | a writing step (migration, sync, insert, import, a dialog that writes), with or without a concrete path | `(target state checked)` | inspected the target's schema or state (for example the unique key) |
| | | `(code read)` | read the writer but not the target |
| | | `(path assumed)` | inferred the write without reading either |
| 2 | otherwise, names a concrete path: a runnable command, CLI flag or switch, config key or value, or file or directory path | `(path run)` | executed it and observed the outcome; state the outcome in the item (`exit 0`, `failed: <reason>`) |
| | | `(path read)` | read the code or file but did not execute it |
| | | `(path assumed)` | inferred it without running or reading it, however confident |
| 3 | anything else | none | (`Open.` alone) |

Writing steps have their own markers because whether a write is safe to repeat
depends on the target's state, not on the code that writes. Examples:
`Open. Run the suite with CONFIG=staging. (path run) exit 0` and
`Open. Switch B reads config Y. (path assumed)`.

If the user provided a title, use it. Otherwise, infer a concise title (3-6 words)
from the work being done.

Expand Down Expand Up @@ -496,7 +516,7 @@ files_modified:

### Remaining Work

{Numbered list of concrete next steps, in priority order}
{Numbered list of concrete next steps, in priority order. Each item starts with `Open.` and ends with its provenance marker from Step 2, or no marker under rule 3.}

### Notes

Expand Down
24 changes: 22 additions & 2 deletions context-save/SKILL.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,30 @@ Using the gathered state plus your conversation history, produce a summary cover

1. **What's being worked on** — the high-level goal or feature
2. **Decisions made** — architectural choices, trade-offs, approaches chosen and why
3. **Remaining work** — concrete next steps, in priority order
3. **Remaining work** — concrete next steps, in priority order, each marked with
how this session knows it (see the provenance table below)
4. **Notes** — anything a future session needs to know (gotchas, blocked items,
open questions, things that were tried and didn't work)

**Remaining Work provenance.** Every item starts with the status `Open.` and never
with a completion token such as `[done]` or `[executed]`. Then pick its trailing
marker by the first rule that applies:

| # | The item is... | Marker | Use when this session... |
|---|----------------|--------|--------------------------|
| 1 | a writing step (migration, sync, insert, import, a dialog that writes), with or without a concrete path | `(target state checked)` | inspected the target's schema or state (for example the unique key) |
| | | `(code read)` | read the writer but not the target |
| | | `(path assumed)` | inferred the write without reading either |
| 2 | otherwise, names a concrete path: a runnable command, CLI flag or switch, config key or value, or file or directory path | `(path run)` | executed it and observed the outcome; state the outcome in the item (`exit 0`, `failed: <reason>`) |
| | | `(path read)` | read the code or file but did not execute it |
| | | `(path assumed)` | inferred it without running or reading it, however confident |
| 3 | anything else | none | (`Open.` alone) |

Writing steps have their own markers because whether a write is safe to repeat
depends on the target's state, not on the code that writes. Examples:
`Open. Run the suite with CONFIG=staging. (path run) exit 0` and
`Open. Switch B reads config Y. (path assumed)`.

If the user provided a title, use it. Otherwise, infer a concise title (3-6 words)
from the work being done.

Expand Down Expand Up @@ -170,7 +190,7 @@ files_modified:

### Remaining Work

{Numbered list of concrete next steps, in priority order}
{Numbered list of concrete next steps, in priority order. Each item starts with `Open.` and ends with its provenance marker from Step 2, or no marker under rule 3.}

### Notes

Expand Down
Loading
Loading