Skip to content

feat: gstack-clean reclaims a repo's .gstack scratch and oversized logs, dry run by default (#2627) - #3779

Closed
garrytan wants to merge 15 commits into
mainfrom
capy/gsta226-e2-gstack-clean
Closed

garrytan wants to merge 15 commits into
mainfrom
capy/gsta226-e2-gstack-clean

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3779,
  "head": "28db5dce30512f8e70df01f8c591d71196b2e662",
  "version": "1.92.25.0",
  "base": "main",
  "gate": {
    "clean": {
      "pass": 162,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "9a51a5f526b84f3e7623e4f0e90fb30fe89aa5f1",
  "product_patch_id": "5fef8f8c38794f85da33bf0f294d87940d5b0994",
  "gstack_version": "1.91.379.0",
  "review_depth": {
    "depth": "standard",
    "class": "code",
    "runtime_lines": 475,
    "rules": "150435b0a543019a",
    "base": "f739756389d1fa7ebca2a10d84c97c294bfea4c5",
    "registry": "f739756389d1fa7ebca2a10d84c97c294bfea4c5",
    "gate_scan": {
      "tagged": 0,
      "head": "28db5dce30512f8e70df01f8c591d71196b2e662"
    },
    "reasons": [
      "runtime=475>50"
    ]
  },
  "pregate": "requires-remote cleared @9a51a5f526b8 (1 checks, current for 28db5dce3051)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41299615129",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41299615129",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41299615216",
    "pregate.json/remote_gate: remote-gate tree=9a51a5f526b8 tests=24985"
  ],
  "issues": {
    "fixes": [
      2627
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, BROWSER.md and docs/standalone-binaries.md entries naming .gstack files, browse logs or bin/ commands"
  },
  "review_loop": {
    "passes": 3,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 13,
    "fixed": 9,
    "scope": "frozen",
    "fix_checks": 5
  }
}

What changed

gstack-clean shows what it would reclaim, then frees it with --apply while cookies and the Chromium profile stay

gstack-clean shows what it would reclaim, then frees it with --apply while cookies and the Chromium profile stay.

Why

#2627: a repository's .gstack/ folder only grew (the reporter measured 8.3 MB in six weeks), and the only way to shrink it was deleting the whole folder, which also deletes cookies, the Chromium profile and browser skills. gstack-clean removes only old codex scratch files and trims oversized browse logs, and it changes nothing unless you pass --apply.

Blast radius

The command is new and nothing else calls it. Its writes stay inside <git toplevel>/.gstack, and it refuses outside git, on a symlinked folder, or anywhere near the gstack state root. The only shared edit is four result codes added to lib/result-codes.ts through a new split file, and the copied-install test fixtures now carry that file (script ran: the Ubicloud pregate passed 24624 tests with 0 failed at tree f1b06457f5d3).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Build verdict: E1 BUILD, E2 BUILD low priority (gstack-clean, dry run by default), recommendations A1 C1 D1 F1 H1 B1 G1 E1 I1 “Do it” (Garry (via GStack Minder)) approved the GSTA-226 plan as relayed, every recommendation none
2026-11-01 One single-reviewer fix-check on the post-cap race commits “Rule 23 grant for one single-reviewer fix-check on just the post-cap race commits... If it's clean, finish both.” (GStack Minder (agent:GSTA-36)) approved review pass p5 beyond the cap none
2026-11-01 One fix-check on 01bf5fa (pregate fixture-list fix) “Do it: rule 23 grant for one single-reviewer fix-check on 01bf5fa only” (GStack Minder (agent:GSTA-36)) approved review pass p6 beyond the cap none

Source: gstack-approvals record for capy/gsta226-e2-gstack-clean (display only; not an approval citation).

Summary

People who use the browse daemon and codex reviews collect throwaway files under each repository's .gstack/. gstack-clean previews what it would remove. With --apply it deletes tmp/codex-* files older than 7 days and cuts the five browse logs to their last 256 KB once they pass 1 MB, cutting in place after a line break so a running writer keeps appending. With --audit-days N it also drops audit entries older than N days. It never touches browse.json, session state, the Chromium profile, browser skills or any other tmp/ entry.

It skips symlinks, hard-linked and unreadable logs, files changed in the last hour, browse files while the daemon runs, and tmp/ while codex runs. Right before each change it checks that the folder is still the one it verified and the file still has the inode, size and time it measured. --json prints one versioned object.

Test Coverage

All new code paths have test coverage. test/gstack-clean.test.ts covers the dry run changing no byte or mtime, the exact allowlist on --apply, every refusal, links, hard links, unreadable files, liveness, the in-place cut, audit trimming, --json through a pipe and a reader that closes early, and the exit codes. test/gstack-clean-producers.test.ts classifies every tracked producer of a .gstack/tmp/ entry.

Tests ran: clean 162

Pre-Landing Review

Review found and fixed blocking issues with a failing test first each time. Logs with more than one hard link or that couldn't be read are now left alone, and the cut goes through a no-follow descriptor checked against the measured inode. Output is written synchronously, so --json reaches a pipe whole. Every change rechecks the verified folder and the measured file. The remote pregate then caught copied-install fixtures missing the new result-codes file, fixed in 01bf5fa. CI's freshness check then caught the generated bin/gstack-doctor-components.sh missing the new codes' anchors, regenerated in c3c00d9. A single fix-check on each of those commits found nothing.

REVIEW_LOOP: passes=3 blocking_found=0 deferred=0 noted=13 fixed=9 scope=frozen fix_checks=5

The per-pass rows for this branch were not written to the review log during passes 1 to 5. The loop counts above come from the p1 to p7 review ledgers, each of which verifies clean. Only the last two fix-checks have bound review-log rows (trees 12db1f5f3358 and f1b06457f5d3).

Gate edits: 6 listed, 3 read, 0 findings — 0 kept, 0 restored, 0 open

Review notes

  • Node has no unlinkat or openat, so a parent folder swap between the folder check and the syscall is still possible in a window of microseconds.
  • An interrupt between the write and the truncate during a log cut can still splice the log.
  • A line appended between the final fstat and ftruncate of a cut can be lost.

Issues

Fixes #2627

TODOS

Added: codex templates deleting their own scratch, browse-daemon.log.1, and the gstack-paths TMP_ROOT fallback.

Documentation

Status: updated. One factual table row added; no blockers.

Scope. Candidate e2a (base b95de225, head 8cfec650, branch capy/gsta226-e2-gstack-clean): 7 commits, 11 committed files, nothing staged, unstaged or untracked. Docs that list .gstack/ files, browse log locations or bin/ commands were found by searching all 912 tracked and nonignored doc and template files, then checked against lib/repo-state-clean.ts and browse/src/{server,cli,config,audit}.ts. No banned-terms list on main.

Documentation health:

  • docs/standalone-binaries.md: Updated. Added a gstack-clean row to the standalone CLI table, next to gstack-worktree-audit. It covers the dry-run default and --apply, the fixed allowlist and thresholds, the protected files, the liveness skips, the refusals, --json, exit codes, and a link to the troubleshooting entries.
  • BROWSER.md: Current (edited earlier on this branch). Checked the Capture section against the source: start() in server.ts deletes the console, network and dialog logs, and cli.ts deletes the startup-error log. browse-daemon.log is append mode and only rotates at 10 MB. browse-audit.jsonl is never truncated.
  • docs/troubleshooting.md: Current (edited earlier on this branch). The four GSTACK_CLEAN_* entries match the usage, refusal and exit-code logic.
  • TODOS.md: Current (edited earlier on this branch; not changed by this audit).
  • ARCHITECTURE.md: Current. The logging architecture describes what the daemon writes, which is still append-only. gstack-clean is an outside maintenance tool.
  • README.md: Current. Its standalone-CLI pointer lists examples, not every command.
  • docs/uninstall.md: Current. Full uninstall still removes .gstack on purpose.
  • docs/PROJECT_STRUCTURE.md: Current. The bin/ line is an example list that ends in "etc."
  • docs/state-root.md: Current. Nothing it says conflicts with the new state-root refusal.

Coverage map:

  • gstack-clean (and --apply, --audit-days N, --json): reference in BROWSER.md, docs/troubleshooting.md, docs/standalone-binaries.md and --help. How-to: a short one in the BROWSER.md Capture section. No tutorial. Design explanation only in the code header and the changelog fragment.
  • GSTACK_CLEAN_* result codes: reference in docs/troubleshooting.md.

Documentation debt: common gap. gstack-clean has reference coverage but no stand-alone how-to beyond the BROWSER.md paragraph. That is fine for a small maintenance CLI; /document-generate can fill it if wanted.

Diagram drift: none. The ARCHITECTURE.md logging diagram (CircularBuffer → .gstack/*.log) still matches the code.

Test plan

  • Clean lane (gstack-clean, producers, module-size ratchet, bun entry isolation, state-root ratchet, spawnSync tripwire, gstack-doctor, plan-tune-cathedral, timeline-stop-hook-slug, pr-dependencies, doctor-components): 162 pass, 0 fail
  • Remote pregate on Ubicloud at tree 9a51a5f526b8 (the pushed head, after merging main at f739756): 24985 tests, 0 failed
  • bun run gen:skill-docs --host all then git diff --exit-code: clean

Base merge

main was merged in three times under GStack Minder's rule 19 grants. The first merge, after #3777, conflicted only in TODOS.md, which was resolved by keeping both entries. The second, after train 76 (main fd5fcb4), conflicted where #3775 added lib/result-codes-plan.ts to the same lists this PR extends. Each list now keeps both split files, lib/result-codes.ts keeps both imports, and bin/gstack-doctor-components.sh was regenerated. After that merge test/gstack-clean-producers.test.ts flagged main's new .gstack/tmp/tasks-<phase>-rows.jsonl producer from bin/gstack-tasks, and it is now classified as kept, so gstack-clean never removes it. The receipt carry refused (RECEIPT_CARRY_PRODUCT_CHANGED), so this receipt was written fresh at the merged head. gstack-clean's own code is unchanged since the reviewed tree f1b06457f5d3.

Train 78 then failed on this PR's producer test. #3776 added the prose .gstack/tmp/docs-audit.json: ... at lib/ship-release.ts:233, and the scan, which did not end a name at a colon, read it as docs-audit.json:, although docs-audit.json is already classified. After a third merge of main (f739756, no conflicts), commit 28db5dc adds : to the scan's name terminators, with a case that failed first. No KEPT or SCRATCH entry changed, and a single fix-check found nothing. Over every tracked source, the scan's names differ only by that one stray entry.

garrytan and others added 9 commits November 1, 2026 00:40
…n by default (#2627)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…a no-follow descriptor checked against the evaluated inode

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… elsewhere on the host cannot flake them

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…er group on apply; BROWSER.md says which logs reset at daemon start

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…; test fixes for root, wrapper git and the ps stub

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d file; full writes; EPIPE ends output quietly

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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…b/result-codes-clean.ts

The remote pregate failed 11 cases in gstack-doctor, plan-tune-cathedral and
timeline-stop-hook-slug: each copies an explicit list of lib/result-codes-*.ts
files into a temp install, and lib/result-codes.ts now imports
./result-codes-clean. Same lists GSTA-168 extended for result-codes-eval.

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

trunk-io Bot commented Nov 1, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

garrytan and others added 6 commits November 1, 2026 02:08
…sult codes

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

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

# Conflicts:
#	TODOS.md
…k-clean

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

# Conflicts:
#	bin/gstack-doctor-components.sh
#	lib/result-codes.ts
#	scripts/pr-dependencies.ts
#	test/gstack-doctor.test.ts
#	test/plan-tune-cathedral.test.ts
#	test/timeline-stop-hook-slug.test.ts
…r main added the producer

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… a path names the file (train 78)

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

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Frozen in wave browse-7bde476eb22d (branch wave/browse-7bde476eb22d) at 28db5dc. Push nothing here: a moved head drops this PR from the wave. Fixes go on the wave branch through its integrator.

garrytan added a commit that referenced this pull request Nov 2, 2026
… gained after #3779's base (wave browse)

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

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Frozen in wave browse-20c099776dd6 (branch wave/browse-20c099776dd6) at 28db5dc. Push nothing here: a moved head drops this PR from the wave. Fixes go on the wave branch through its integrator.

garrytan added a commit that referenced this pull request Nov 2, 2026
… gained after #3779's base (wave browse)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot added a commit that referenced this pull request Nov 2, 2026
* feat(loadouts): Opus 5.5 lite loadout with explicit model detection (GSTA-161)

modules/loadouts.json gains the lite loadout (eleven coaching preamble
pieces dropped; upgrade-check and brain-sync kept) and a models map that
sends only claude-opus-5-5 (and its dated snapshots) to it. Detection is
explicit: Capy passes --model to the installer, Claude Code opts in with
./setup --loadout lite; anything unmapped, invalid or unreadable serves full.
The checkout always stays the full render.

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

* docs(loadouts): Opus 5.5 lite, detection order, Capy SKILL_ROOT, setup --loadout; troubleshooting anchors; changelog fragment (GSTA-161)

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

* fix(loadouts): claude_loadout read through CONFIG_BIN; capy skill context ceiling for the --model line (GSTA-161)

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

* fix: pre-landing review fixes (prune keeps a reused loadout folder, GSTACK_LOADOUT_SKILL_ROOT, claude_loadout guard test) (GSTA-161)

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

* fix: pre-landing review fixes (Capy skill passes the model as GSTACK_MODEL so an older installer ignores it) (GSTA-161)

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

* fix: pre-landing review fixes (prune only owned, unused folders; full root from the canonical Claude install; fallback reason and source) (GSTA-161)

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

* docs: loadout source example, install and resolve commands, Capy launch-file note (GSTA-161)

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

* feat(autoplan): --ceo-only runs the CEO review alone with zero questions (GST-537)

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

* fix: pre-landing review fixes

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

* test: classify autoplan-ceo-only in the Codex host metadata

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

* fix: select autoplan-ceo-only on the skills it runs; say it needs Claude Code

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

* test: run autoplan-ceo-only in the marathon lane

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

* docs: changelog entry for /autoplan --ceo-only

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

* test: count the autoplan-ceo-only paid file in the shard inventory

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

* feat: gstack-autoplan next --ceo-only runs the CEO review alone and ends reviewed (GST-537)

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

* fix: budget and close recover a budget-stopped CEO-only run; reviewed is at rest for checkpoints

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

* fix: CEO-only finish leaves owner-only cap items undecided, refuses marker phase flags and a plan at the report path, and replaces ceo-review.md atomically

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

* fix: the CEO-only report-path guard compares real paths and refuses at the finish when the report file is the plan

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

* docs: CEO_ONLY_CONFLICT covers a plan linked to the report path

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

* test(browse): failing-first device and touch tests (GSTA-227 F3, #3058)

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

* fix: the report-path guard keeps the lexical check, skips safe hard links and compares bigint file ids

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

* browse: per-session tabs for parallel agents; tab pins stop moving the shared active tab (#1961)

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

* browse: keep the server.ts tab-pin anchor comment for source guards

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

* feat(browse): per-tab phone emulation and touch input ($B device, tap, swipe, pinch, touch; #3058, GSTA-227 F3)

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

* test: copy lib/result-codes-autoplan.ts into the fixtures that copy the result-code tables, and keep it out of derived closures

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

* docs(qa, aside): touch pointer in /qa, Aside touch recipe verified on Aside 1.26, report Phones row (GSTA-227 F3, #3058)

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

* browse: drop the sessions paragraph from /browse to stay inside the parity cap

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

* changelog: F3 phone emulation and touch entry

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

* browse: hide the ps window in the session harness walk

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

* docs: the decisions.jsonl status list names auto_kept

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

* test(browse): session cap, LRU eviction, headed release and scoped auto-session rows

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

* browse: sessions keep tab <id> picks, sidebar claude stays on the user's tab, pinned rebuild and state load rebind the scope

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

* fix: pre-landing review fixes (touch cancel with no finger held is a no-op)

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

* fix: Step 11 review fixes (headed tab adoption, pinned viewport reset, CLI retry keeps --session, rebuild id remap, --json notice, evicted-session reset, device kept after annotated captures, render opts out of sessions, session: client ids reserved)

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

* fix: headed viewport auto keeps the user's active tab; render's closetab opts out of sessions

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

* docs: sessions, phone emulation and touch in BROWSER.md; session: client ids reserved; TODOS #1961/#3058 shipped

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

* test: copy lib/result-codes-browse.ts into the fixtures that copy the result-code modules

lib/result-codes.ts imports ./result-codes-browse, so fixtures with an explicit
lib list failed with 'Cannot find module'. pr-dependencies lists it with the other
reason-code modules as selection data. GSTA-227

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

* feat: gstack-clean reclaims per-repo .gstack scratch and logs, dry run by default (#2627)

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

* browse: name the Aside touch recipe's coordinates <tap-x>/<tap-y> with a numeric grammar

The generated-bash lint (INV-3) rejected the free-text <x>/<y> placeholders. GSTA-227

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

* fix(clean): leave hard-linked and unreadable logs alone; cut through a no-follow descriptor checked against the evaluated inode

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

* test(clean): tests that expect tmp removal see a quiet ps, so a codex elsewhere on the host cannot flake them

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

* fix(clean): an unlistable tmp/ skips its group; liveness asked once per group on apply; BROWSER.md says which logs reset at daemon start

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

* fix(clean): write output synchronously so --json reaches a pipe whole; test fixes for root, wrapper git and the ps stub

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

* fix(clean): every change rechecks the verified folder and the measured file; full writes; EPIPE ends output quietly

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

* test(clean): the early-close test checks the bin's own exit status

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

* docs: list gstack-clean among the standalone CLIs

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

* test(clean): copied-install fixtures and the dependency list carry lib/result-codes-clean.ts

The remote pregate failed 11 cases in gstack-doctor, plan-tune-cathedral and
timeline-stop-hook-slug: each copies an explicit list of lib/result-codes-*.ts
files into a temp install, and lib/result-codes.ts now imports
./result-codes-clean. Same lists GSTA-168 extended for result-codes-eval.

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

* chore: regenerate gstack-doctor-components.sh for the gstack-clean result codes

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

* qa: fold the touch pointer into the Phases sentence to fit the parity size cap after the main merge

qa's union was 95988 bytes (ratio 1.142 > maxSizeRatio 1.142, train 75). Now 95975 (1.1419). GSTA-227

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

* docs: #3058 troubleshooting 'Fixed in' lines name v1.92.10.0 after the main merge

GSTA-227

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

* test(clean): classify gstack-tasks rows files (tasks-*) as kept, after main added the producer

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

* docs: #3058 troubleshooting 'Fixed in' lines name v1.92.20.0 after the main merge

GSTA-227

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

* fix: pre-landing review fixes (restore the lib/result-codes-plan.ts ratchet row the base merge dropped)

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

* test(clean): the producer scan ends a name at a colon, so prose after a path names the file (train 78)

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

* docs: #3058 troubleshooting 'Fixed in' lines name v1.92.30.0 after the main merge

GSTA-227

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

* outside-voice-api: caller receipts, stop_reason, OpenAI max_completion_tokens

A caller can write its own egress receipt (sink, consent, payload class);
the default stays the outside-voice receipt, so existing callers send and
record the same bytes. The result carries the provider's stop reason, and
an OpenAI request gets max_completion_tokens only when the caller sets an
output limit (GST-537 PR 3).

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

* autoplan gate: item classes and the owner's answer provenance

Gate items carry item_class, ruleKept() names the keep-direction pick, and
answered decision rows record owner_mode, owner_named, rec_hash and
answered_role parsed from the owner's own words (GST-537 PR 3).

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

* autoplan: shadow-mode decider module, frozen prompt and spend accounting

The switch (off by default, fixed at init), the lease, one model call per
gate with a page retry and a truncation retry under one deadline, the
once-per-revision record with its journaled sha256, the 10% audit mark,
and shadow-labeled ledger rows that count against the cap, show as
shadow= on GATE_SPEND and stay out of the per-voice price (GST-537 PR 3).

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

* gstack-autoplan: shadow every published gate, the shadow export, config and docs

Every driver command that prints a gate records the shadow first and
checkpoints after it; answer waits for a live lease and records a dead
one retrospectively; gstack-autoplan shadow exports answered revisions
for taste-replay R2 (SHADOW_BEFORE_ANSWER otherwise); gstack-config
autoplan_shadow / autoplan_shadow_model; gstack-artifact validate checks
the record's hash (GST-537 PR 3).

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

* changelog: shadow mode for the CEO-only decider (GST-537 PR 3)

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

* autoplan shadow: /ship review fixes

- register test/fixtures/shadow-fake-model.ts in FREE_FIXTURES (free-fixtures inventory failed)
- withRunLock: count dead-owner reclaims apart from waitMs iterations, so a long wait can still reclaim
- buildPage: fill the decider template in one pass, so slot names inside the plan stay plan text
- revise regate: the shared publish step prints the GATE and ESCALATE lines once

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

* autoplan shadow: reply files never follow a link; the retry reserves against the current cap

- a model reply is written by temp file and rename, so a link at the reply path is replaced, not written through
- each shadow reservation reads the run's current spend cap, so a budget change during the call is not undone

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

* outside-voice-api: write the egress receipt under the caller's env

callModel resolved the receipt's state root from process.env even when the caller passed env, so the shadow
tests wrote to the real ~/.gstack (the free-suite home-containment guard caught it). The receipt now uses
req.env; the shadow tests give the fake model a private HOME, GSTACK_HOME and GSTACK_STATE_ROOT, and the receipt
test no longer sets process.env to pass.

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

* fix(autoplan): CEO-only runs leave main's open Critical/High finding items to the owner (no decision row)

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

* fix(autoplan): shadow pages carry main's finding items; a finding item is never ceo_eligible

After merging #3767 (main 90a170c), open Critical/High findings are gate items
(item_class finding). The shadow records one row per gate item, so its pages now
include them. A CEO-only run leaves those items to the owner, so their rows are
ceo_eligible false (rule_pick was already null). The shadow fixtures follow
main's gate (items, counts, "Do it" tokens); the two merge adapters follow
main's doNext(out, rest, price) and its per-voice reservation (--estimate-usd).

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

* docs: #3058 troubleshooting 'Fixed in' lines name v1.92.61.0 after the main merge

GSTA-227

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

* fix(investigate): drop the five-phase step procedure (GST-938)

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

* changelog: GST-938 fragment wording

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

* fix(investigate): keep the web-search sanitize guard; update BROWSER.md and docs/skills.md (review pass 1)

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

* changelog: GST-938 wording

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

* test(investigate): pin the web-search guard; changelog size (adversarial review)

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

* test(clean): classify restamp-staging.json, the restamp producer main gained after #3779's base (wave browse)

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

* fix: pre-landing review fixes (wave browse): scoped newtab keeps a concurrent tab switch; shadow validate catches a deleted record; a failed shadow publish is journaled

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

* fix: a failed shadow publish journals under the run lock and never throws (wave browse review pass 2)

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

* docs(unattended): shadow publish failures and the missing-record validate check (wave browse docs audit)

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

* changelog: wave browse integrator fixes fragment

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

* fix: shadow reader dedupes by run folder, so two runs started in the same second both count (wave browse CI free-suite 16)

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

* chore: regenerate doctor result anchors in generator order (wave browse rebuild without #3818)

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

* changelog: name the wave fragment after the rebuilt wave

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 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Landed in wave #3858 as v1.93.0.0 (9d9d4c3), merged from this PR's pin 28db5dc. Integrator changes touching this PR's files: 721cee5 (merge of #3779, resolved by hand: bin/gstack-doctor-components.sh, lib/result-codes.ts, scripts/pr-dependencies.ts, test/gstack-doctor.test.ts, test/plan-tune-cathedral.test.ts, test/timeline-stop-hook-slug.test.ts), a683bb4 (merge of #3817, resolved by hand: bin/gstack-config, bin/gstack-doctor-components.sh), 1349364, f9db102.

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.

Nothing reclaims per-repo .gstack state — browse-audit.jsonl is append-only by design and bin/ has no cleanup verb

1 participant