Skip to content

/plan-tune's dream cycle now logs each send of your typed answers to Anthropic (#4617) - #4621

Merged
capy-ai[bot] merged 2 commits into
mainfrom
plan-tune-distill-logs-anthropic-sends
Nov 21, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
plan-tune-distill-logs-anthropic-sends

Conversation

@garrytan

@garrytan garrytan commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

gstack-distill-free-text, which /plan-tune's dream cycle runs, now writes an entry to gstack's send log (gstack-egress list) before it sends your typed answers to Anthropic, and sends nothing if it can't write that entry.
Why: the README promises that every off-machine send is logged, and this was the one sender that skipped it. Reported by @robbiesierra in #4617.
Nothing to do: these sends now show up in gstack-egress list.

What changed
  • The fix. Right before the Anthropic call, the script records the destination host (honoring ANTHROPIC_BASE_URL), how many answers went and the prompt size, using the same shared helper as every other sender. The entry never holds your answer text or your key. A second entry records whether the call succeeded. If the entry can't be written, the script stops with exit 3 before any request, and your answers wait for the next run.
  • The off-machine send test now fails when code calls a model provider (through an SDK, inside a shell script's inline Bun step, or over HTTP) without logging the send first. A new case proves that made-up unlogged senders fail, a logged one passes, and the senders that already log (the second-model review API runner, context-bill --exact, the design image calls and the fixed distill script) still pass.
  • What the sweep found. Besides the distill script, the stricter test flags two developer-only eval scripts, scripts/judge-calibration.ts and scripts/preflight-agent-sdk.ts. Both run only by hand with the developer's own key, import test helpers and send fixed test data, never user data, so they are listed as exempt with that reason.
  • Docs. ARCHITECTURE.md and docs/CONTRIBUTOR_REFERENCE.md now name this send among the ones that stop when they can't be logged, say the test also catches model-provider calls, and list developer-run test and eval tools among its exemptions.
  • Tests. Two new cases run the real script against a local stand-in for the Anthropic API: the log entry must exist when the request arrives and must not contain the answer text or key; with an unwritable log the script must fail, send nothing and leave the answers for later. Both fail on main.

What is sent, consent prompts and telemetry stay as they were.

Why

"gstack-distill-free-text sends my typed /plan-tune answers to Anthropic, but nothing shows up in gstack-egress list" (#4617). Every other off-machine send writes a log entry first; now this one does too, and the test that guards the send log catches the next model-provider call that forgets.

Blast radius

Only bin/gstack-distill-free-text changes behavior. It gains one log write before its one API call and refuses to send when that write fails, which costs nothing because the answers stay queued for the next run. Evidence: script ran against a local stand-in API for success, refused-log and API-500 cases (exit 0, exit 3 with zero requests, exit 1 with an error:500 outcome), and the full free test suite passed in CI at this head.

Pre-Landing Review

No blocking findings. Six notes below the blocking floor; none fixed in this PR:

  • Two test gaps, skipped: the API-failure branch has no automated test (checked by hand, see Exploratory QA), and the new file-level provider check accepts a log call that appears only in a comment.
  • Four notes, listed below.

The second-model review (openai/gpt-6.1-sol) found nothing.

Review notes

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

  • INFORMATIONAL bin/gstack-distill-free-text:203 With a relative GSTACK_STATE_ROOT/GSTACK_HOME the bun child (cwd ROOT_DIR) resolves the egress log under the gstack checkout, not where bash and gstack-egress list look. Same pre-existing break as LOG_FILE_PATH/PROPOSAL_FILE_PATH in that child. Severity Low, Blocks: no.
  • INFORMATIONAL bin/gstack-distill-free-text:243 SDK default maxRetries=2 means one send-log entry can cover up to three HTTP attempts; outcome records only the last. INVESTIGATE. Severity Low, Blocks: no.
  • INFORMATIONAL bin/gstack-distill-free-text:120 --background discards stderr, so the refusal message is invisible in background mode (safe: nothing is sent). Pre-existing for every error in that mode. Severity Low, Blocks: no.
  • INFORMATIONAL test/egress-receipt-wiring.test.ts:328 scanProviderFile counts a log-call mention on a comment or message line as a logged send (same defect as specialist-batched#2).
  • INFORMATIONAL sf-0ddffcb09bd4 security finding, details recorded privately
Exploratory QA

Functional (CLI), isolated temp state, local stand-in for the Anthropic API, made-up key. Pass, 3 of 3 probes:

  • Success: exit 0; the send-log entry was present when the request arrived, with no answer text or key; outcome ok; answers marked distilled.
  • Log can't be written: exit 3 with a message saying nothing was sent, zero requests, answers not marked.
  • API returns 500: exit 1, outcome error:500, answers not marked.

Limit: no live Anthropic call. The SDK retried the 500 twice under one log entry (noted above).

Eval Results

No prompt-related files changed, so evals were skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN

Issues

Fixes #4617

TODOS

No TODO items completed in this PR.

Documentation

Blocked, shipped under a recorded exception (the exception line is in Agent notes). Scope: README.md, ARCHITECTURE.md, CONTRIBUTING.md, CLAUDE.md, AGENTS.md and docs/. The audit flagged that ARCHITECTURE.md and docs/CONTRIBUTOR_REFERENCE.md left out this send, the model-provider check and the developer eval exemptions; those edits are in this PR. docs/privacy.md and plan-tune/SKILL.md.tmpl are current.

Tests
  • bun run test (CI run 44925399107 at this head): 1732 test files passed
  • bun test --timeout=30000 test/egress-receipt-wiring.test.ts test/distill-free-text.test.ts: 21 passed, 0 failed
Agent notes
  • Wiring: the inline bun -e step requires lib/egress-receipt.ts by absolute path (GSTACK_EGRESS_LIB) and calls writeReceipt (sink distill-free-text, bytes: 0, sha256: null because the SDK owns the wire bytes, like memory-ingest and gbrain-sync) before client.messages.create, then writeOutcome with ok or error:<status>. Polarity: fail-closed (exit 3, EGRESS_RECEIPT_FAILED on stderr).

  • test/egress-receipt-wiring.test.ts: PROVIDER_SDK_CALL joins the per-line scanner (TS and shell files); new file-level scanProviderFile requires a receipt marker in any file that imports a provider SDK, or names a provider API host and makes an HTTP call. Distill script added to MODULE_SINKS, POLARITY (fail-closed) and the polarity spot-checks. Two reasoned SCANNER_EXEMPT entries.

  • Security surface: no new network, secrets, permissions, workflows, install scripts or dependencies.

  • Pre-Landing Review: 6 issues — 0 auto-fixed, 2 asked (0 fixed, 2 skipped), 0 deferred, 4 noted

  • REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=4 fixed=0 scope=frozen dispatches=2

  • Gate edits: none detected (12 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

  • Refs GSTA-719

Documentation exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-21 via parent ruling to the /ship subagent for PR #4621 (GSTA-719), option B: parent applied the docs auditor's own proposed edits; the final exemption line was not re-audited; audit attempt budget spent

Approvals

No approvals recorded for branch plan-tune-distill-logs-anthropic-sends.
Plan: exempt: bug fix, plan review skipped (--kind fix, R65)
Plan check: exempt bug fix

🤖 Generated with Claude Code

{
  "schema_version": 1,
  "pr": 4621,
  "head": "1996827003ed6624392f1b711c2b395d16975172",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1732,
      "fail": 0,
      "skip": 0
    },
    "targeted": {
      "pass": 21,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44925399107,
      "attempt": 1,
      "tree": "1eb9e8cbc2228435be614ab27f39a3dfb2268f45"
    }
  ],
  "calls": 18,
  "session_kind": "unattended",
  "run": "gstack-ship-4621",
  "head_tree": "1eb9e8cbc2228435be614ab27f39a3dfb2268f45",
  "product_patch_id": "7eafa4da5439f17e1112afeb00da3502e3f8669c",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 39,
    "rules": "85b3923b1a978e41",
    "base": "bd77c8ccaa373e3a072ef3d9f4839edae16b46f0",
    "registry": "bd77c8ccaa373e3a072ef3d9f4839edae16b46f0",
    "gate_scan": {
      "tagged": 1,
      "head": "1996827003ed6624392f1b711c2b395d16975172"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "risk:security",
      "runtime=39"
    ],
    "risk": [
      "money",
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "pass @1eb9e8cbc222 (8 checks, current for 1996827003ed)",
  "issues": {
    "fixes": [
      4617
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "blocked",
    "scope": "README.md, ARCHITECTURE.md, CONTRIBUTING.md, CLAUDE.md, AGENTS.md and docs/ (audits docs-4621-a1, docs-4621-a2)",
    "exception": {
      "accepted_by": "Captain GStack Minder (GSTA-36)",
      "date": "2026-11-21",
      "via": "parent ruling to the /ship subagent for PR #4621 (GSTA-719), option B",
      "reason": "parent applied the docs auditor's own proposed edits; the final exemption line was not re-audited; audit attempt budget spent"
    }
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 4,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "money",
      "gate"
    ],
    "rules": "b3f6f8b4843c0c30",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "7eafa4da5439f17e1112afeb00da3502e3f8669c",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  }
}

Open in Capy

…Anthropic (#4617)

gstack-distill-free-text now logs each send of typed /plan-tune answers to Anthropic before making it, and refuses to send when it can't. The off-machine send test now fails on model-provider calls that skip the log. Reported by @robbiesierra in #4617.

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

trunk-io Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

… the send-log docs

ARCHITECTURE.md and docs/CONTRIBUTOR_REFERENCE.md now name the /plan-tune dream-cycle send among the sends that stop when they can't be logged, say the send-log test also catches model-provider calls, and list developer-run test and eval tools among its exemptions.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 5152445 into main Nov 21, 2026
52 checks passed
@garrytan garrytan mentioned this pull request Nov 21, 2026
capy-ai Bot added a commit that referenced this pull request Nov 21, 2026
- Habits from nine teams, written into gstack. (#4585)
- Three more habits from teams that run evals. (#4602)
- The /ship conductor trial plan gives its real-problem judge one more attempt on fresh labels after it missed its agreement bar twice, and stops the trial incomplete if it misses again (GST-3003). (#4611)
- The /ship conductor trial plan now stops a trial only at the final remote-gate refusal, gives both arms the same note that the brief overrides team rules, and counts every report the no-gstack arm returns (GST-3003). (#4609)
- The /ship conductor trial plan now ends a trial at the remote gate when its case base isn't main, gives the no-gstack arm a test runner, and audits every trial for exposure to the plan (GST-3003). (#4605)
- The /ship conductor trial plan now runs an uncounted pilot in every arm before its counted trials and takes one planned look at half the cases (GST-3003). (#4587)
- gstack's own use on Capy can be counted, and is kept out of real-use numbers. (#4576)
- Free Tests shards finish closer together. (#4578)
- The weekly test-time recording can land again on its own. (#4581)
- The job-log tree.json step's recommended sleep is long enough for real runners. (#4589)
- Pull requests no longer wait on the Trunk flaky-test upload, and the quick tier's flaky passes now reach Trunk. (#4579)
- Windows Setup E2E finishes sooner on install changes. (#4575)
- Skills no longer stop on Codex when they clean up temp files. (#4612)
- /review on Codex with OpenAI models no longer holds back a review that ran its adversarial pass. (#4622)
- Crew threads on Capy now check in at 500M own tokens, standing threads rotate at 250M and any subagent past 50M gets a look, half the old lines, because Capy's token counts read about half what they did before 2026-11-15. (#4582)
- gstack no longer offers to add a `## Skill routing` section to your project's CLAUDE.md. (#4629)
- The README and docs no longer say gstack makes your agent fix more bugs. (#4598)
- `/eval-plan` now writes eval plans that waste less money. (#4591)
- /cso checks every folder above a source file before it looks at the file, so it never looks through a symlinked folder. (#4592)
- Plan reviews no longer read a /design-review audit summary as the branch's design doc. (#4623)
- Node's built-in test files now run with `node --test` in repos that use vitest or jest. (#4626)
- A quarantined test that the runner skipped now fails the run instead of passing it. (#4590)
- A flaky free test is fixed: the spawnSync overflow check no longer fails about once an hour on CI. (#4613)
- Free Tests runs its shards on 16-core runners. (#4600)
- /office-hours asks for ground truth first. (#4468)
- Every startup session ends with a dated test. (#4468)
- /plan-tune's dream cycle now logs each send of your typed answers to Anthropic. (#4621)
- Landing a ready PR no longer depends on a hand-copied gate decision, and the ready note, release PR and squash message say the right thing. (#4596)
- /ship no longer asks for a fresh review because of a stacked parent that main already had. (#4580)
- Results PRs with large captured agent sessions can be reviewed. (#4574)
- /ship no longer stalls on review notes a reviewer already cleared, counts review rounds the way the review policy reads them, and keeps security findings out of the PR body. (#4595)
- /ship's review readers are now told never to stop processes they didn't start. (#4607)
- /ship's review no longer stops when Capy's own drive sync database grows past 100 MB. (#4606)
- /ship's preflight now honors your repository's time limit for rerunning CI-skipped tests, and tells you when a fresh worktree needs its packages installed. (#4608)
- The slowest free test file is now six files. (#4588)
- Step 11.5 keeps a reviewed head current across base-only merges. (#4577)
- On a Capy install, only the owner's opt-in sends telemetry. (#4597)
- New page: working across agent systems. (#4583)

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

gstack: gstack-distill-free-text sends to the Anthropic API without an egress receipt

1 participant