Skip to content

/cso finish no longer closes an audit after a refused submit (GST-3504) - #4692

Merged
capy-ai[bot] merged 2 commits into
mainfrom
fix/cso-finish-after-refused-submit
Nov 22, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
fix/cso-finish-after-refused-submit

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

When the /cso helper refuses a submission, finish now keeps the audit open and asks for a corrected submit, instead of closing it and losing the evidence.
Why: an eval session hit exclusions must be an array, ran finish in the same command, and its corrected resubmit was then refused because the audit had closed.
Nothing to do for users; finish still closes the audit once the audit deadline passes.

What changed
  • submit writes submission-refused.json in the run directory when the helper refuses input for a running audit before its deadline. A later accepted submit removes it.
  • finish refuses with PREREQUISITE while that marker exists and the deadline has not passed, and names the refused message. After the deadline it closes the audit and adds the gap "A refused submission was never resubmitted: ".
  • New test in test/cso-cli.test.ts drives the compiled launcher: refused submit, blocked finish, inspect still reports remainingSeconds, corrected submit, finish; then a second audit whose deadline has passed finishes with the gap. It fails on main at the blocked-finish step.
Why

A refused submit followed by finish closed the audit, so the corrected resubmit had nowhere to land and the evidence was lost. Keeping the audit open until a submit is accepted, or until the deadline, keeps that evidence.

Blast radius

Only the /cso helper's submit and finish commands (lib/cso/cli.ts). Audits with no refused submit behave as before. An audit whose last submit was refused now needs one accepted submit, or the deadline, before finish closes it.

Documentation

Scope: the diff from ef72e41 to fix/cso-finish-after-refused-submit (lib/cso/cli.ts, test/cso-cli.test.ts and the new changelog fragment), plus the /cso docs that mention submit or finish (cso/SKILL.md.tmpl, cso/SKILL.md, docs/cso-scanners.md, docs/cso-release-qualification.md). No staged, unstaged or untracked changes were present.

Result: docs are current. The changelog fragment matches the new behaviour: finish refuses to close an audit whose last submit was refused until the deadline passes, then closes it and records the refused submission as a gap. No other doc contradicts this, and no files were edited.

Debt: cso/SKILL.md.tmpl line 98 ('make one correction, then finish partial') doesn't say that finish waits for the deadline if that correction is also refused. Clarifying it is a small, optional follow-up that needs a template edit and regeneration.

Tests
  • Focused tests cso (bun test test/cso-cli.test.ts test/cso-cli-lifecycle.test.ts): pass, tests_ran=35, at 54ddf89.
  • The new test fails on main at the blocked-finish step and passes on this branch.
  • CI runs the full suite.
Exploratory QA

Five probes against the compiled launcher on a throwaway fixture repo. Required checks pass: a refused submit is recorded, and finish then refuses and leaves the audit running. Optional probe 005 shows that an empty {} submit clears the marker and lets finish close before the deadline; that is review note lib/cso/cli.ts:1530 below, under the blocking floor. The QA tool's overall verdict is fail because of that probe.

Review notes

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

  • INFORMATIONAL lib/cso/cli.ts:1543 resume after the deadline marks the run interrupted, so finish skips the refused-submission marker and closes without the gap
  • INFORMATIONAL lib/cso/cli.ts:1402 recordRefusedSubmission swallows a lease failure; a submit refused for a busy lease leaves no marker
  • INFORMATIONAL lib/cso/cli.ts:1530 any accepted submit, even {}, clears the refused marker (duplicate of specialist-batched#1)
  • INFORMATIONAL lib/cso/cli.ts:1394 pre-lock JSON-shape refusal can race a concurrent valid submit and leave a stale marker; a resubmit clears it
  • INFORMATIONAL lib/cso/cli.ts:1563 marker file is left in the run directory after finish (redacted, 0600, unread once finished)
Agent notes
Agent notes
  • Second report in GST-3504 (inspect omitting remainingSeconds) does not reproduce on main: a daily run with --budget 600 returns remainingSeconds from inspect (539 at the first call), and the existing run-clock test pins it. The new test also checks it after a refused submit. The eval's session transcripts were not available to compare.
  • Local: bun test test/cso-cli.test.ts 32 pass, test/cso-cli-lifecycle.test.ts 3 pass, format:cso:check and typecheck clean.
  • Scope Check: CLEAN. Intent: /cso finish must not close an audit after a refused submit. Delivered: refused-submit marker, finish refusal before the deadline, gap after it, one failing-first test, one changelog fragment.
  • Review: specialist-batched (testing, security, state-machines, red-team) and adversarial-native, one full pass at 54ddf89. Fix-First skipped specialist-batched#1 (any accepted submit clears the marker; below the floor, a design choice). Five adversarial findings, all Low and Blocks: no, recorded as notes above.

Approvals

Plan: exempt: bug fix with a failing-first test (GST-3504)

Pre-Landing Review: 1 issue — 0 auto-fixed, 1 asked (0 fixed, 1 skipped), 0 deferred, 0 noted
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Open in Capy

{
  "schema_version": 1,
  "pr": 4692,
  "head": "d0cdbaf76e57e1816e92b4d1baf198fe9aea68ca",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "cso": {
      "pass": 35,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 21,
  "session_kind": "unattended",
  "run": "ship-4692-r1",
  "head_tree": "baeeeb95d1fa541b373c6e93a092b1fef89016c1",
  "product_patch_id": "1a5e104b985aa07a7febaf94c0b2bf0a2fb113ff",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 37,
    "rules": "630fd3101899e28e",
    "base": "0b4f0ceeec19fef62480db6c8eb00c4015380a39",
    "registry": "0b4f0ceeec19fef62480db6c8eb00c4015380a39",
    "gate_scan": {
      "tagged": 0,
      "head": "d0cdbaf76e57e1816e92b4d1baf198fe9aea68ca"
    },
    "reasons": [
      "runtime=37"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @baeeeb95d1fa (8 checks, current for d0cdbaf76e57)",
  "requires_remote": [
    "pregate.json/remote_gate: remote-gate tree=baeeeb95d1fa tests=38833 runs=44996806817/1 profiles=ci-reuse/free-tests heads=d0cdbaf76e57 verified=2026-11-22T07:25:06.125Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, cso/ and docs/ (/cso docs that mention submit or finish), plus the changelog.d fragment"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 5,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "dispatches": {
      "specialist": 1
    }
  },
  "gate_dispositions": []
}

A refused submit now leaves a marker in the run directory. finish refuses while the audit is running and the deadline has not passed, and after the deadline it closes the audit with the refused submission listed as a gap. A later accepted submit clears the marker.

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit 5b88fa8 into main Nov 22, 2026
66 checks passed
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