Skip to content

feat: autoplan shadow mode records a hidden model prediction at each gate (GST-537 PR 3) - #3817

Closed
garrytan wants to merge 33 commits into
mainfrom
gsta215-ceo-only-shadow
Closed

garrytan wants to merge 33 commits into
mainfrom
gsta215-ceo-only-shadow

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3817,
  "head": "16db02a13f143cee232a0abb03ca7e911b41e69f",
  "version": "1.92.50.0",
  "base": "main",
  "gate": {
    "typecheck": {
      "pass": 0,
      "fail": 0,
      "skip": 0
    },
    "shadow": {
      "pass": 217,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "5261f53e79632ebeeef5d59f771d9a8c76fbb6c5",
  "product_patch_id": "2abd976ce6816e63c3890e27bd70cdd1fad217e2",
  "gstack_version": "1.92.50.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 1076,
    "rules": "97c1e5fe49607f73",
    "base": "dd9834d44d2650818cb6d8e17c57f795cb56bf98",
    "registry": "dd9834d44d2650818cb6d8e17c57f795cb56bf98",
    "gate_scan": {
      "tagged": 0,
      "head": "16db02a13f143cee232a0abb03ca7e911b41e69f"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "runtime=1076"
    ],
    "risk": [
      "money"
    ]
  },
  "pregate": "requires-remote cleared @5261f53e7963 (1 checks, current for 16db02a13f14)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41396870448",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41396870448",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41396870291",
    "pregate.json/remote_gate: remote-gate tree=5261f53e7963 tests=25835"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/unattended.md (bfb878e69: finding item class, never ceo_eligible); the rest of docs/, README.md, AGENTS.md, CLAUDE.md, autoplan/DRIVER.md.tmpl and the changelog.d fragment as audited current at ab36e935f"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 4,
    "deferred": 0,
    "noted": 17,
    "fixed": 6,
    "scope": "frozen",
    "fix_checks": 2,
    "rounds": 4,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "baeb8f7ef7da92d0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "2abd976ce6816e63c3890e27bd70cdd1fad217e2",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  },
  "carry": {
    "from": "bfb878e6912fd91a69894a11b271abe6b350ea35",
    "reason": "stack parent gsta215-ceo-only-driver landed + base merge + test-only change + release metadata",
    "product_patch_id": "2abd976ce6816e63c3890e27bd70cdd1fad217e2",
    "changed_paths": [
      "product:.github/workflows/free-durations-record.yml",
      "product:.github/workflows/windows-free-tests.yml",
      "product:.github/workflows/windows-setup-e2e.yml",
      "product:.github/workflows/windows-smoke.yml",
      "product:.gstack/pregate.json",
      "product:.gstack/ship-policy.json",
      "product:AGENTS.md",
      "metadata:CHANGELOG.md",
      "product:CONTRIBUTING.md",
      "product:TODOS.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-restamp",
      "product:bin/gstack-ship-queue",
      "product:bin/gstack-ship-receipt",
      "product:captain/templates/slot-call.md",
      "product:capy/skill/gstack/SKILL.md",
      "metadata:changelog.d/gsta215-ceo-only-driver.md",
      "product:docs/TESTING_INTERNALS.md",
      "product:docs/captain.md",
      "product:docs/pregate.md",
      "product:docs/recommended-harness.md",
      "product:docs/review-policy.md",
      "product:docs/ship-policy.md",
      "product:docs/skills.md",
      "product:docs/troubleshooting.md",
      "product:lib/factory-scorecard.ts",
      "product:lib/result-codes-release.ts",
      "product:lib/review-collect.ts",
      "product:lib/review-depth.ts",
      "product:lib/review-pass.ts",
      "product:lib/review-risk.ts",
      "product:lib/review-targeted.ts",
      "product:lib/ship-bin-common.ts",
      "product:lib/ship-queue-dispatch-ci.ts",
      "product:lib/ship-queue-land-lock.ts",
      "product:lib/ship-queue-land.ts",
      "product:lib/ship-queue-train-cli.ts",
      "product:lib/ship-queue-train-gate.ts",
      "product:lib/ship-queue-train-land.ts",
      "product:lib/ship-queue-train-record.ts",
      "product:lib/ship-queue-train-verify.ts",
      "product:lib/ship-queue.ts",
      "product:lib/ship-release.ts",
      "metadata:package.json",
      "product:scripts/harness-version.json",
      "product:scripts/lib/ci-history.ts",
      "product:scripts/lib/shard-jobs.ts",
      "product:scripts/lib/windows-curation.ts"
    ],
    "merge_commits": 1,
    "range_diff": "1:  7cf44db6d =  1:  7cf44db6d feat(autoplan): --ceo-only runs the CEO review alone with zero questions (GST-537)\n 2:  8f9670372 =  2:  8f9670372 fix: pre-landing review fixes\n 3:  45352544d =  3:  45352544d test: classify autoplan-ceo-only in the Codex host metadata\n 4:  81863772a =  4:  81863772a fix: select autoplan-ceo-only on the skills it runs; say it needs Claude Code\n 5:  303bdc68a =  5:  303bdc68a test: run autoplan-ceo-only in the marathon lane\n 6:  ce100cbbe =  6:  ce100cbbe docs: changelog entry for /autoplan --ceo-only\n 7:  e56602051 =  7:  e56602051 test: count the autoplan-ceo-only paid file in the shard inventory\n 8:  483d84c5b =  8:  483d84c5b feat: gstack-autoplan next --ceo-only runs the CEO review alone and ends reviewed (GST-537)\n 9:  42dbaed9e =  9:  42dbaed9e fix: budget and close recover a budget-stopped CEO-only run; reviewed is at rest for checkpoints\n10:  ba50ed9b1 = 10:  ba50ed9b1 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\n11:  bce4b77fa = 11:  bce4b77fa fix: the CEO-only report-path guard compares real paths and refuses at the finish when the report file is the plan\n12:  e24eab7fb = 12:  e24eab7fb docs: CEO_ONLY_CONFLICT covers a plan linked to the report path\n13:  767865d78 = 13:  767865d78 fix: the report-path guard keeps the lexical check, skips safe hard links and compares bigint file ids\n14:  75327a83c = 14:  75327a83c test: copy lib/result-codes-autoplan.ts into the fixtures that copy the result-code tables, and keep it out of derived closures\n15:  83037a29e = 15:  83037a29e docs: the decisions.jsonl status list names auto_kept\n16:  9cf405191 = 16:  9cf405191 fix: pre-landing review fixes (restore the lib/result-codes-plan.ts ratchet row the base merge dropped)\n17:  91cc4faf4 = 17:  91cc4faf4 outside-voice-api: caller receipts, stop_reason, OpenAI max_completion_tokens\n18:  aaa637ea4 = 18:  aaa637ea4 autoplan gate: item classes and the owner's answer provenance\n19:  0e179ea4e = 19:  0e179ea4e autoplan: shadow-mode decider module, frozen prompt and spend accounting\n20:  aec80b10a = 20:  aec80b10a gstack-autoplan: shadow every published gate, the shadow export, config and docs",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "7e122fe5b06fa827a9c4c7d826b4b95f616a935d"
    ]
  }
}

What changed

docs/unattended.md gains a Shadow mode section: off by default, one hidden model call per gate, recorded before the owner answers

docs/unattended.md gains a Shadow mode section: off by default, one hidden model call per gate, written down before the owner answers.

Before/after as text

Before: docs/unattended.md had no Shadow mode section (base 9cf4051). After: an 81-line "### Shadow mode" subsection under "## CEO-only runs" covering the switch, the model and its cost, the decider prompt, the reply contract, when it runs, the lease, the record, the 10% audit mark and the reader.

Why

Garry approved shadow mode and picked a model decider for it ("Do it", PR 3 gate). Once the CEO-only mode decides on its own, Garry only sees what it holds back, so its mistakes become invisible. Taste-replay round 2 (R2) needs the mode's predictions lined up against Garry's real answers, recorded before he answers. This PR records them and changes nothing about how gates reach him.

Blast radius

Shadow mode is off by default, and the model call, the shadow folder and its spend are all gated on run.shadow.enabled, which is set once at init and stored in run.json (read: lib/autoplan-shadow.ts shadowSwitch; tested in test/autoplan-shadow-driver.test.ts "off by default: no SHADOW line, run.json says off, and no shadow folder at the gate"). Some shared code changed for everyone. Every gate-printing command now goes through one publish step in bin/gstack-autoplan, withRunLock gained an optional wait, buildGate stamps an item class, answer stores the owner's reply shape, and callModel takes an optional receipt and output limit and now writes its egress receipt under the caller's env. The existing autoplan, revise, run-lock and receipt suites pass on this tree (bun test, listed under Test plan).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-01 Approve the plan "Shadow mode and a 10% audit for the CEO-only decider (GST-537 PR 3)" (autoplan run run-20261101001306, 3 decisions) “Do it” (Garry Tan, relayed by agent:jam_01M69HKBK0FV2CKVC2HN34D9NN) approved the reviewed plan (sha256 ec1173ad074b), every recommendation taken none
2026-11-01 Approve the plan "Shadow mode and a 10% audit for the CEO-only decider (GST-537 PR 3)" (autoplan run run-20261101001306, 5 decisions) “Do it” (Garry Tan, relayed by agent:jam_01M69HKBK0FV2CKVC2HN34D9NN) approved the reviewed plan (sha256 ec1173ad074b), every recommendation taken none
2026-11-01 Approve the plan "Shadow mode and a 10% audit for the CEO-only decider (GST-537 PR 3)" (autoplan run run-20261101001306, gate_rev 4 carried forward from gate_rev 3, 1 decisions) “Do it” (Garry Tan (words from gate_rev 3, relayed by agent:jam_01M69HKBK0FV2CKVC2HN34D9NN), carried forward by gstack-autoplan) approved the reviewed plan (sha256 ec1173ad074b), every recommendation taken none

Source: gstack-approvals record for gsta215-ceo-only-shadow (display only; not an approval citation).

Summary

GST-537 PR 3, stacked on #3767 (which stacks on #3743). Plan: autoplan run run-20261101001306 (plan-active.md, status complete), approved by Garry.

  • Shadow decider. autoplan/shadow-decider.md is a frozen prediction prompt. It shows the reviewers' recommendation as a labeled input, not a rule, and ends with R2's output contract. lib/autoplan-shadow.ts builds one page per gate (the reviewed plan's Implementation plan, cut to 40,000 characters, plus every gate question as rendered), makes one model call with one retry for a malformed or truncated reply, and records one row per question in shadow/ceo-only.r<rev>.jsonl. Each row carries the prompt's sha256, the model, the free keep-direction pick (rule_pick) and a 10% audit mark.
  • When it runs. Every driver command that prints a gate (next, submit, close, resume, revise, run, check) claims a lease under the run lock, makes the call with no lock held, then publishes the record under the lock before it prints the gate. A failure prints SHADOW: failed <code> and never blocks the gate or the answer. If a crash leaves a lease behind, answer records the shadow first and marks its rows retrospective.
  • Spend. Each call is reserved against the run's --spend-cap under its own ledger id labeled shadow, settled at actual usage, and shown in GATE_SPEND. It's kept out of GATE_REC_COST's per-voice price.
  • Owner provenance. Each answered decision row now records how the owner answered (owner_mode, owner_named, answered_role, the rec_hash answered against), parsed from his own words.
  • Reader and config. gstack-autoplan shadow exports the joined rows for gstack-evals, refusing SHADOW_BEFORE_ANSWER and CEO_ONLY_NO_GATE. gstack-config registers autoplan_shadow (on/off, default off) and autoplan_shadow_model (default claude-opus-5-5). gstack-artifact validate checks the shadow records privately, and nothing shadow-related reaches the public export, gate render or owner brief.
  • Review fixes in this ship. The new fake-model fixture is registered in FREE_FIXTURES. withRunLock counts dead-owner reclaims separately from wait iterations. The decider template is filled in one pass, so slot names inside a plan stay plan text. A revise that regates prints GATE once. Reply files are written by temp file and rename, so they never follow a link. The retry reservation reads the current cap. The egress receipt is written under the caller's env, which is what kept the tests out of the real ~/.gstack.

Security read (CREW)

This PR adds one network call, reads API keys, and writes a new egress receipt. All three happen only when shadow mode is on.

  • The network call. One model call per gate (plus at most one retry), made only when autoplan_shadow is on. It's off by default: a crew turns it on with gstack-config set autoplan_shadow on, or a single run with GSTACK_AUTOPLAN_SHADOW=1. It's needed because R2 has to measure a model's prediction of the owner's answer, written before he answers. The free keep-direction rule matched the reviewers' recommendation on all 215 past decide items, so it can't measure anything.
  • What it sends. The reviewed plan's Implementation plan (cut to 40,000 characters) and the gate questions: titles, options, the recommendation and its basis, and the one-line summaries and severities of the findings each question came from. The model needs exactly that to predict the owner's pick. It doesn't get the rest of the run, the review transcripts, or any file outside the plan.
  • The key read. It reads ANTHROPIC_API_KEY or OPENAI_API_KEY for the configured model's family (the existing apiKeyFor in lib/outside-voice-api.ts), because the call goes straight to the provider's API on the user's own key. With no key for that family, shadow mode reports SHADOW: off (no API key ...) and makes no call. The key is never logged or written to the record.
  • The receipt. Before each send, callModel writes a content-free egress receipt with sink autoplan-shadow, payload class plan-and-gate and the byte count and sha256 of the body, into the run's own state root. That way every plan that leaves the machine is on the audit trail, separate from the outside-voice sink. This ship also fixed the receipt so it uses the caller's env instead of process.env.

Crew step

Turn it on for Garry's crews with gstack-config set autoplan_shadow on. This is a config step in the crew install, outside this repo. R2's collection window starts at the first recorded row on a crew gate, not at this merge: check for one SHADOW: recorded line on a real gate before counting days.

Paid smoke (sample shape, not an agreement claim)

Opus 5.5 over the newest 20 answered archived gates from the crew drive checkpoints (61 were eligible). Results: ~/.capy/work/gsta215/smoke/results.json on the lane machine. I recomputed every number below from that file.

  • Cost: $0.782 total, $0.039 per gate. Median latency 6.8 s.
  • 20/20 pages parsed clean, 97/97 items valid, 0 truncated, every action decide.
  • 8/97 picks differ from the recommendation, and the same 8 differ from rule_pick.
  • On this small sample the model matched the owner's recorded answer on 77/97 items, and the recommendation matched on 79/97.

This is the shape of the sample, not a claim about agreement. Most of those owner answers were one-word "Do it" replies relayed after the recommendations changed, so they say more about the relay than about Garry's taste. R2 owns the real measurement.

Conflicts with PR 1 and PR 2

Test Coverage

Coverage audit (audit only, Sonnet 5.5 low): 16 of 18 changed paths tested (89%), value-weighted 89%; 13 rated ★★★, 3 rated ★★. The two gaps are both in bin/gstack-config: no CLI test for the autoplan_shadow on/off value guard, and none for its defaults/list rows. autoplan/shadow-decider.md is covered (its sha256 is pinned in test/autoplan-shadow.test.ts), so the deterministic audit's flag there is a false positive.
Tests: 1590 → 1592 test files at the merge base vs HEAD (+2 new files). This ship added four tests to test/autoplan-shadow.test.ts, and each one fails on the code before its fix: slot names in the plan text, a link at the reply path, a cap moved during the call, and the receipt written under the caller's env.

Pre-Landing Review

Depth: full (gate class, 1058 runtime lines; targeted reader class: money). Pass 1 read the whole diff (batched testing/security/state-machines specialist, Red Team, coverage and QA audits). Pass 2 read the whole diff again from the merge base, with the Step 11 voices: native adversarial (Opus 5.5), cross-family outside voice (GPT-6.1 Sol) and the targeted money reader. Then one fix-check plus the targeted reader on the last fixes. After review, CI caught the shadow test writing a real egress receipt under the runner's home; the repair (ab36e93, callModel writes its receipt under the caller's env) got its own fix-check on the touched hunks and their callers, which found nothing. That's the one fix-check the review log counts. Every brief and output was verified against the ledger (VERIFY: clean briefs=10 outputs=10).

REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=17 fixed=6 scope=frozen fix_checks=2 dispatches=8
Gate edits: none detected (5 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review (openai/gpt-6.1-sol): request changes on four findings. Two are fixed in this PR (the reply symlink write and the stale-cap retry); two are open below.

Fixed: free-fixtures inventory (would fail free-tests), dead-owner reclaim after a long lock wait, one-pass template fill, the duplicate GATE line on a revise regate, reply files never following a link, the retry reserving against the current cap, and the receipt env (CI repair).

Open at the review cap (named, not fixed)

The outside voice marked these two as blocking, so the tool records them as blocking. My read is that both are below the floor: neither fails a test, breaks a running gate, or loses a recorded prediction. They're listed here per the two-round cap for a follow-up.

  • CRITICAL (reader label) lib/autoplan-shadow-reader.ts:86: validation checks only the shadow records present on disk, so deleting a journaled record passes. It's a tamper-detection gap, since the journal still holds the hash.
  • CRITICAL (reader label) lib/autoplan-shadow.ts:410: a crash between linking the record and journaling it leaves a record that recovery never reconciles, and gstack-artifact validate reports ARTIFACT_STALE for that run. The window is two adjacent statements.

Pass 1 items left as notes

  • lib/autoplan-shadow.ts:418: a publish that can't retake the run lock keeps its lease and journals nothing (raised four times; see the Review notes below for the re-pay consequence).
  • lib/gate-list.ts:230: replyShape's rec_except branch has no test.
  • lib/autoplan-shadow.ts:316: the egress receipt's consent reads autoplan_shadow on even when GSTACK_AUTOPLAN_SHADOW=1 turned shadow on.
  • bin/gstack-autoplan:197: autoplan/DRIVER.md doesn't mention that gate commands can now wait for the shadow call.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL bin/gstack-config:1 Coverage audit: no CLI test for the autoplan_shadow on|off value guard or its defaults/list rows.
  • INFORMATIONAL lib/autoplan-shadow.ts:419 No test for publish's RUN_LOCKED branch; the lease stays and answer waits then re-pays.
  • INFORMATIONAL test/autoplan-shadow.test.ts:250 The deadline test asserts wall-clock bounds with under a second of margin; may flake on loaded runners.
  • INFORMATIONAL bin/gstack-autoplan:197 Gate commands and answer can take up to ~2.5 min with shadow on; a 120 s harness timeout can kill them and the rerun re-pays.
  • INFORMATIONAL lib/autoplan-shadow.ts:155 claimShadow shadows a carry-check gate (check_pending) that check may carry without asking the owner.
  • INFORMATIONAL lib/autoplan-shadow.ts:420 A locked or internal publish failure keeps the lease and journals nothing.
  • INFORMATIONAL lib/autoplan-shadow.ts:150 recommend after the record changes the gate the owner sees; the same gate_rev is not shadowed again.
  • INFORMATIONAL bin/gstack-autoplan:362 run never prints the SHADOW on/off line.
  • INFORMATIONAL lib/autoplan-shadow-reader.ts:53 One corrupt run aborts the whole --runs export.
  • INFORMATIONAL lib/autoplan-gate-cost.ts:84 GATE_REC_COST's at-most figure excludes the shadow page a rec reopen would trigger.
  • INFORMATIONAL lib/autoplan-shadow.ts:311 A narrower window remains: budget writes spend.json before run.json, so a retry reserve in that gap restores the old cap until the next reserve.
  • INFORMATIONAL lib/autoplan-shadow.ts:419 A publish that loses the lock lets later gate commands re-claim and re-pay the same gate_rev with no bound per revision.

Exploratory QA

Verdict: pass, with 3 of 12 smoke probes used, in an isolated fixture with an empty HOME and no API key. GSTACK_AUTOPLAN_SHADOW=1 next with no key printed SHADOW: off (no API key for claude-opus-5-5 (ANTHROPIC_API_KEY)) and still prepared the gate. shadow --out <run> --json on a run with no printed gate exported an empty set. Not run: a live SHADOW: recorded call (it needs a key and spend), and the answer, retrospective and spend-cap paths by hand. The driver tests cover those against a local fake model.

Design Review

No frontend files changed, so design review was skipped.

Eval Results

No paid evals ran in this ship. The shadow prompt is new and isn't read by any existing eval; the paid smoke above was run before /ship, under the plan's $10 cap.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The approved plan is plan-active.md in autoplan run run-20261101001306; the reviewers read the diff against it, and the Conflicts section above is updated to the built code.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. No documentation edits were needed at ab36e93. At bfb878e, docs/unattended.md adds finding to the shadow record's item classes and says a finding item is never ceo_eligible. #3767's docs came in with the merge and were audited on #3767.

Scope: base 9cf4051 to head ab36e93 on gsta215-ceo-only-shadow (8 commits, 26 files); the candidate selected no staged, unstaged or new files. Checked the egress receipt change in ab36e93 (lib/outside-voice-api.ts now writes the receipt under the caller's env) against every doc that describes the egress ledger or the shadow receipt.

Documentation health:

  • docs/unattended.md: Current. The shadow-mode section's sink, consent, token limits, deadline, plan cut and audit mark match lib/autoplan-shadow.ts.
  • docs/troubleshooting.md: Current. The SHADOW_BEFORE_ANSWER entry matches the reader.
  • docs/privacy.md: Current. The receipt location and audit commands are still accurate; shadow mode is not listed (see debt).
  • ARCHITECTURE.md, CLAUDE.md, docs/CONTRIBUTOR_REFERENCE.md, BROWSER.md: Current. The ledger path ~/.gstack/security/egress.jsonl under the state root is unchanged by ab36e93.
  • changelog.d/gsta215-ceo-only-shadow.md: Current. The "caller's own egress receipt" line is still accurate.

Documentation debt:

  • ⚠️ Autoplan shadow mode: reference in docs/unattended.md, docs/troubleshooting.md and gstack-config comments, but docs/privacy.md (explanation) doesn't list it as an opt-in send of plan text to a model provider. Its "three kinds of network traffic" line predates it. This is a privacy wording decision, so it was not edited.
  • gstack-egress grants doesn't show autoplan_shadow (or codex_reviews). That's a code gap that predates this branch.

Diagram drift: none found.

Test plan

  • bun run typecheck: exit 0
  • Shadow lane at bfb878e (test/autoplan-shadow, autoplan-shadow-driver, egress-receipt-wiring, outside-consent, outside-runner-contract, plan-review-report-recording, trial-cause, autoplan-driver, autoplan-ceo-only-driver, free-fixtures), private HOME: 217 pass, 0 fail; the real egress.jsonl is unchanged
  • Remote pregate (Ubicloud), tree 2f6b4973: 25,371 tests, 0 failed ($0.10)
  • macOS and Windows free tests at ab36e93: Free Tests, Windows Free Tests
  • CI repair: free-tests run 41342558875 at d5bf543 tripped the home-containment guard because the shadow test's model call wrote an egress receipt under the real home. ab36e93 fixes callModel to write the receipt under the caller's env, and the receipt-override test fails on the old code. With HOME pointed at a temp dir, the real ~/.gstack/security/egress.jsonl was unchanged after the run.

Merge of #3767's head (1bb983c, after main 90a170c)

Under the GSTA-36 grant, #3767's new head was merged once (a119b08), keeping both sides in the six conflicted files: bin/gstack-autoplan (main's price and spend handling in run, this PR's shadow publish step and answer wrapper, #3767's CEO-only refusal, and main's --words-by), lib/autoplan-ceo-only.ts, lib/autoplan-gate.ts, lib/gate-list.ts, lib/headless-artifacts.ts and lib/outside-voice-api.ts.

Main now adds a gate item for each open Critical or High finding (item_class: finding). The shadow records one row per gate item, so its pages now include those items. bfb878e sets ceo_eligible to false for finding items, because a CEO-only run leaves them to the owner (rule_pick was already null). It also adds finding to the item classes in docs/unattended.md and updates the shadow fixtures to main's gate. Every assertion not about the item set or the counts is unchanged.

CARRY: refused (RECEIPT_CARRY_PRODUCT_CHANGED), rebind under GSTA-36 grant 2026-11-01. The receipt was rewritten at bfb878e after a remote pregate on tree 7e122fe5b06f (25676 tests, 0 failed, $0.09). Free Tests run 41378688616 and Windows Free Tests run 41378692842 cleared the remote lanes.

One scoped fix-check covered the resolution hunks plus bfb878e. One targeted money reader read the whole diff at bfb878e. Neither found anything at the blocking floor, and each left one note, not fixed here:

  • INFORMATIONAL lib/autoplan-shadow-reader.ts:62 (fix-check): the reader's fallback for a row with no shadow record recognizes a finding item only by item_class. So a gate written before this merge, which has no item_class, exports a CEO-phase finding item as ceo_eligible: true. Follow-up: also test gateItem.finding or the |finding origin.
  • INFORMATIONAL lib/autoplan-shadow.ts:319 (targeted, money): when a dispatched shadow call fails, it settles unknown in spend.json, which keeps the ledger and cap correct. But it never reaches replies, so the journal, the export rows and the SHADOW: usd= line under-report that call. Follow-up: track every dispatched attempt.

Merge of main dd9834d (v1.92.61.0, after #3767 landed as 924ac4d)

After #3767 landed, this PR was retargeted to main and merged main dd9834d once (16db02a) under the GSTA-36 rule 19 grant. Where #3767's squashed hunks met their pre-squash copies, the resolution takes main's side. Train 84's additions (doctor anchors, troubleshooting text, module-size entries) are kept beside this PR's own. #3767's landed changelog fragment is dropped. git diff dd9834d 16db02a13 --numstat equals the reviewed diff git diff 1bb983c0b bfb878e69 --numstat line for line. A scoped fix-check on the merge found NO FINDINGS. The receipt carried from bfb878e, after a remote pregate on tree 5261f53e7963 (25835 tests, 0 failed, $0.08). Free Tests run 41396870448 and Windows Smoke run 41396870291 cleared the remote lanes.

garrytan and others added 30 commits October 31, 2026 19:19
…ons (GST-537)

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>
…ude Code

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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nds reviewed (GST-537)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… is at rest for checkpoints

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…arker 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>
…t the finish when the report file is the plan

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>
…inks and compares bigint file ids

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he result-code tables, and keep it out of derived closures

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>

# Conflicts:
#	test/eng-finding-retry-budget.test.ts
…a215-ceo-only-driver

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/fixtures/module-size-ratchet.json
#	test/gstack-doctor.test.ts
#	test/plan-tune-cathedral.test.ts
#	test/timeline-stop-hook-slug.test.ts
…atchet row the base merge dropped)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n_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>
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>
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>
…ig 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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
- 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>
…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>
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>
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>

# Conflicts:
#	autoplan/DRIVER.md
#	bin/gstack-autoplan
#	docs/unattended.md
#	lib/headless-artifacts.ts
#	scripts/resolvers/autoplan-driver.ts
…items to the owner (no decision row)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan and others added 2 commits November 2, 2026 02:05
…o gsta215-ceo-only-shadow

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

# Conflicts:
#	bin/gstack-autoplan
#	lib/autoplan-ceo-only.ts
#	lib/autoplan-gate.ts
#	lib/gate-list.ts
#	lib/headless-artifacts.ts
#	lib/outside-voice-api.ts
…m 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>
@capy-ai
capy-ai Bot changed the base branch from gsta215-ceo-only-driver to main November 2, 2026 05:14
@trunk-io

trunk-io Bot commented Nov 2, 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

…sta215-ceo-only-shadow

Rule 19 grant (GSTA-36, 2026-11-02). #3767's squashed hunks take main's side; train 84
additions keep both sides (doctor anchors, module-size entries, troubleshooting).
The landed #3767 changelog fragment is dropped.

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 16db02a. Push nothing here: a moved head drops this PR from the wave. Fixes go on the wave branch through its integrator.

@capy-ai

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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

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 16db02a. 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), a0dcb82, eeab6b1, 87b7414, 29d413c, f9db102.

@capy-ai capy-ai Bot closed this Nov 2, 2026
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.

1 participant