Skip to content

Refuse agent words on owner-only autoplan answers - #4201

Merged
capy-ai[bot] merged 1 commit into
mainfrom
refuse-agent-words-on-user-challenges
Nov 9, 2026
Merged

capy-ai[bot] merged 1 commit into
mainfrom
refuse-agent-words-on-user-challenges

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

An agent's own words can no longer settle a user challenge at the /autoplan gate. Only the owner's words can, and the gate stays open until they arrive.

What changed

  • gstack-autoplan answer now refuses, with OWNER_REPLY_REQUIRED, a reply given in an agent's own words (--words-by agent:<id>) that would choose a uc approval item not already settled at this revision. That covers rec, as-is and explicit uc tokens. The error names each item and asks for the owner's words, and nothing is written.
  • The agent can still answer the d items in its own words and leave the uc items to the owner.
  • A new shared predicate, agentWords in lib/gate-list.ts, replaces the inline words_by checks in lib/approval-citations.ts and lib/autoplan-carry.ts, so the rule lives in one place.
  • docs/unattended.md, docs/troubleshooting.md and the OWNER_REPLY_REQUIRED summary describe the new case.

Why

Only the owner may settle a user challenge or a round-cap approval. Before this change, an agent that answered with --words-by could choose one on its own authority, and the gate recorded it as settled. Carry-forward and plan citations already refused agent words; the answer path did not.

Blast radius

The change touches only gstack-autoplan answer when --words-by names an agent. Owner replies, carried answers and agent answers to d items behave as before. A Captain that relays the owner's words without --words-by is unaffected.

Documentation

Status: current. The branch's docs already describe the change, and none needed edits.

Scope: 10 committed files selected by the candidate at base 68b1d05 and head 2edd0c2; nothing staged, unstaged or untracked. Docs that mention --words-by were searched across the tracked tree.

Documentation health:

  • docs/unattended.md: Current. It describes the uc refusal for agent words, which matches answerGate.
  • docs/troubleshooting.md: Current. The OWNER_REPLY_REQUIRED entry covers the new case and matches lib/result-codes.ts.
  • changelog.d/refuse-agent-words-on-user-challenges.md: Current, and accurate against the code.
  • crew/docs/captain.md: Current, and consistent with the change.
  • autoplan/DRIVER.md: Current. It is consistent, but see the coverage debt below.

Coverage debt: The answer line in autoplan/DRIVER.md doesn't say that --words-by replies can't settle uc items. It is prompt prose, so it is left to the parent.

Diagram drift: None.

Pre-Landing Review

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

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

The review ran once on this head with the full panel the plan picked for gate code: a batched specialist (testing, security, state machines), the Red Team, a native adversarial reader, an outside voice (openai/gpt-6.1-sol) and a targeted money reader. No finding met the blocking floor, so no fix round ran.

Open notes

These are below the blocking floor and are not fixed here. The skipped test gap is a decision made under the crew's spend cap, recorded for GSTA-433.

  1. The refusal paths for the round-cap items cap_blocker and cap_delta, and their "is a round-cap approval only the owner can settle" message, have no test. The third new test also branches on whether d1 exists, so it does not pin which agent-decidable item was answered.
  2. cap_deferred is a d item, so an agent's own words can still grant another review round through d<n>b, and an agent-worded earlier d choice is later applied as by human. Which items are owner-only is outside this change; it goes to the Captain as a follow-up.
  3. Agent-settled uc rows recorded before this change still stand and carry forward, because finishGate and the earlier-choice map in answerGate ignore words_by. New answers cannot create such rows.
  4. An owner's uc-only reply can complete a gate whose p1 answer is still in the agent's words. That fails closed later at plan citations and carry-forward.
  5. The owner-words boundary still depends on the agent declaring --words-by. An agent that passes its own text as --owner-reply is recorded as the owner. This predates the change.
  6. Two other settle paths are not fixed here: the per-item carry in finishGate, whose confirm-round rows carry settled_by, and gstack-gate decisions --reply, which records no provenance.

Exploratory QA

Two smoke probes on this head both passed: the owner-only refusal tests and the adjacent --words-by authorship tests in test/autoplan-carry.test.ts. The cap paths named above were not probed.

Test results

  • Focused tests at this tree: 503 ran, 503 passed, across eight files.
  • CI carry: free-tests run 42586540995 at this exact tree, 36760 tests.
  • The macOS jobs of that run and the windows-smoke run 42584174699 cleared the remote checks.

APPROVALS_RENDER: redacted (repository visibility public); gstack-approvals list shows the full record

Approvals

No approvals recorded for branch refuse-agent-words-on-user-challenges.
Plan: exempt: bug fix
Plan check: exempt bug fix

Agent notes
{
  "schema_version": 1,
  "pr": 4201,
  "head": "2edd0c28336e3f10f9e9af233e260e3314209aaf",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 503,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "3d821e88341a5ae7a52153884011237d42379123",
  "product_patch_id": "1a24b438a5ac89756da339eed9f771af559161e6",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 22,
    "rules": "66e5174161eecc2c",
    "base": "350d4196c3444d81590d36cc2d8752be71cf19b6",
    "registry": "350d4196c3444d81590d36cc2d8752be71cf19b6",
    "gate_scan": {
      "tagged": 0,
      "head": "2edd0c28336e3f10f9e9af233e260e3314209aaf"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "runtime=22"
    ],
    "risk": [
      "money"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @3d821e88341a (8 checks, current for 2edd0c28336e)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/42586540995/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42586540995/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42584174699/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=3d821e88341a tests=36760 skipped=90 runs=42586540995/1 profiles=ci-reuse/free-tests heads=2edd0c28336e verified=2026-11-09T09:06:39.392Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (140 docs files hashed; 10 changed files selected)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "1a24b438a5ac89756da339eed9f771af559161e6",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

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

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

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