Skip to content

fix(harness-ops): apply the Claude Code 2.1.325 sandbox and mid-turn handoffs - #17615

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/16035-claude-code-2-1-325-handoffs-part-2
Nov 20, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/16035-claude-code-2-1-325-handoffs-part-2

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #16035

Summary

Part 2 of the Claude Code 2.1.325 handoffs. It delivers the host-run items that
#17591 left: items 2 and 3
(sandbox probe record and fixtures) and item 5 (observability turn count). It records the host
evidence for item 17 (inventory native-drift note), which stays open. The read marker in
docs/upstream/claude-code.md does not move: see Remaining.

Fix

  • Items 2 and 3 (2.1.325-096, -097): behavior-probes record 8 now says sandboxed Bash follows
    the normal permission flow unless sandbox.autoAllowBashIfSandboxed is true. The two auto-mode
    sandbox cases set it in their settings.json, the remedy the handoff names. A pass in auto mode
    cannot tell an auto-allow from a classifier allow, so a new default-mode pair measures the
    default: default-mode-write-denied (sandbox only, expect deny) with its control
    default-mode-write-autoallow-runs (auto-allow on, expect ran). The pair is there because
    records.md holds that "a record whose case cannot be rerun is a memory, not a record", and the
    corrected claim is about the default.
  • Item 5 (2.1.325-060): /harness-ops:observability items stops counting a message sent
    mid-turn as a turn. item-rollup.sql reads delivery.mode and leaves mid_turn rows out of the
    turn count; a prompt with no delivery.mode still counts. item-rollup.sh help, SKILL.md and
    the eval expectation say so, and the test fixture gains a mid-turn event that leaves item A at 2
    turns.
  • Item 17 (native drift): recorded as a Probes row marked not settled. On a host the extraction
    reports degraded, not broken. The lane's note carried no CLI version, so the lane's own
    extraction read nothing, and that cause is still open. The same drift key recurs in
    #17555 (2.1.329), where a
    host run also finds the built-in tools lane broken.
  • docs/upstream/claude-code.md: two Corrected rows (325-096/097 behavior-probes, 325-060
    observability) and one Probes row (inventory). The 325-060 docs-lag row stays, because the
    monitoring-usage page still names no delivery.mode.
  • Two harness-ops changelog fragments.

Verification

  • Sandbox probes, live, Claude Code 2.1.329, 2026-11-20: the tracked pair as it stood on main
    passed (run --live --area sandbox). The four cases passed from a copy whose settings, prompts and
    expected outcomes match this commit byte for byte (run --live --cases <copy>, 4 runs, one
    attempt each); only claim and tag text was reworded afterwards. In default mode, sandbox alone was
    denied as needing approval and auto-allow on ran. The network case still fails inside the sandbox
    with a sandbox_violations note, not a permission denial. 2.1.325 itself is no longer installed
    on the host that ran these.
  • On this branch: probe.py validate 87 cases, 0 problems; run --dry-run --area sandbox 4 pass;
    probe.test.sh 102 tests OK.
  • OTEL store, one read-only pass over the hot logs: user_prompt events with
    delivery.mode mid_turn appear on every release from 2.1.325 to 2.1.329, 156 of 8741 events.
    Each one shares its (session.id, prompt.id) with an ordinary prompt event, and ordinary prompts
    carry no delivery.mode. Dropping mid_turn rows and counting distinct prompt keys both give
    8585 turns.
  • item-rollup.test.sh: 33 cases, 0 failed (duckdb branch ran). With the filter removed, the new
    fixture fails 2 cases: item A counts 3 turns.
  • Inventory: inventory.py --self-check exits 3 (degraded) on CLI 2.1.328. With --binary
    2.1.329 it also exits 3, with the builtin_tools lane broken: the Edit canary is absent.
  • scripts/check-affected.sh: 19 passed, 1 skipped.

Related

  • #16035: the handoff issue.
    This PR names items 2, 3, 5 and 17.
  • #17591: part 1, merged.
  • #17555: 2.1.329 handoffs,
    the same inventory drift key.
  • #15693: 2.1.323 handoffs,
    which gate the read marker.

Remaining

  • Item 7 (audit-permission-grants, 2.1.325-106): out of scope for this PR.
  • Item 8: #17591 changed the
    text. The engine change to audit_skill_visibility.py waits on the owner's design decision.
  • Item 17: not settled. The release lane's extraction read no binary; its cause and the 2.1.329
    built-in tools lane go with
    #17555.
  • Read marker (docs/upstream/claude-code.md lines 19-22): not moved. The rows for items 7, 8
    (the engine change) and 17 are not final, and
    #15693 is still open.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 20, 2026 01:39
…handoffs

Items 2, 3 and 5 of #16035, and the host evidence for item 17.

- behavior-probes record 8: sandboxed Bash follows the normal permission
  flow unless sandbox.autoAllowBashIfSandboxed is true. The two auto-mode
  sandbox cases set it, and a default-mode pair measures the default. A
  2.1.329 live run passed all four.
- observability items: a user_prompt event marked delivery.mode mid_turn
  belongs to the running turn, so the turn count leaves it out. The test
  fixture gains a mid-turn event that keeps item A at 2 turns.
- docs/upstream/claude-code.md: Corrected rows for 325-096/097 and
  325-060, and a Probes row for the inventory drift note, not settled.

Refs: #16035

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgf4hSWe3ViMaDA9Fp9
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 20, 2026 07:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T07:06:00.023569Z d9a4301 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44692251789

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed d9a43017a9dd8681556de7717abfda2c45d17f1a: read 19 of 19 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

This pull request does three things:

  • Sandbox probes: it changes the harness-ops behavior-probes sandbox test cases and record 8.
  • Turn count: the observability items rollup no longer counts user_prompt events marked delivery.mode mid_turn as turns.
  • Docs: it adds rows to docs/upstream/claude-code.md and two changelog fragments.

What I checked:

  • Sandbox probe settings. Three case settings.json files now set "autoAllowBashIfSandboxed": true, and one new case sets { "sandbox": { "enabled": true } }. They live under plugins/harness-ops/skills/behavior-probes/cases/sandbox/. They are test inputs for probe.py run --live, not a .claude/ settings file or a plugin manifest. Claude Code does not load them into an operator's or installed user's session, and no lane token or credentialed workflow reads them. The setting therefore widens no trust control and no installed default.
  • Turn count (item-rollup.sql). The new delivery.mode value is read with cc_attr and only compared to the fixed string 'mid_turn' in IS DISTINCT FROM. It never reaches the shell or a dynamic SQL string. The query stays read-only and reads no cost data.
  • item-rollup.sh and its test. Only help text, a printed header line and a test fixture change. No variable is interpolated in a new way.
  • docs/upstream/claude-code.md. It matches a trusted-path glob, so I read its whole change. It adds three data rows (two Corrected, one Probes) and changes no read marker or gate input.
  • Instruction text. No standing instruction is deleted or weakened. The SKILL.md and evals text only describe the new turn-count rule.
  • Untrusted text. The pull request description and the issue text contain no text aimed at this review lane.

There are no manifest lines and no uncovered rules.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed d9a43017a9dd8681556de7717abfda2c45d17f1a: read 19 of 19 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read all 17 files on the to-read list. The two copies listed in identical.txt are byte-identical to their first paths, and their paths (case prompt.md and settings.json fixtures) don't change what the content does.

What the PR changes (Refs #16035, items 2, 3, 5, plus a record for 17):

  • Sandbox probes (record 8):
    • The two auto-mode sandbox cases now set sandbox.autoAllowBashIfSandboxed: true, and their claims and tags say so.
    • A new default-mode pair measures the default itself: default-mode-write-denied expects deny, and its control default-mode-write-autoallow-runs expects ran.
    • The new expect.json files use the same control, docs, requires and target shapes as the existing cases. records.md record 8 now states the corrected claim, its basis and the 2.1.329 table.
  • Observability items turn count:
    • item-rollup.sql reads delivery.mode into ev, carries it through the e CTE, and filters with delivery_mode IS DISTINCT FROM 'mid_turn'. A prompt with no delivery.mode (NULL) still counts.
    • The test fixture adds a mid_turn user_prompt for item A and keeps the expected value at 2 turns. The fixture's event() helper (item-rollup.test.sh:47-50) appends the extra attribute through ${5:+,$5}, the same way the existing cost_usd row does.
    • The item-rollup.sh header still has the same number of lines, so usage()'s sed -n '2,17p' range is unaffected. SKILL.md, evals.json and the report header line now describe the new count.
  • docs/upstream/claude-code.md: two Corrected rows and one Probes row (item 17, marked not settled). The read marker is unchanged, as the PR says.
  • Changelog fragments: two harness-ops fragments, both bump: patch, which fits fixes.

Loosened checks: none.

  • The item-rollup test's expected value is unchanged, and the added fixture row makes the test stricter: without the filter, item A counts 3 turns.
  • The auto-mode sandbox cases add autoAllowBashIfSandboxed, but each claim is reworded to that condition. The default behavior that the old settings would have hit is now measured by the new default-mode pair, so no expected outcome is weakened.

Loosened-check verdict: fail (default; the prompt had no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The prompt had no loosened_check_decision_record: line either, so I did not check the citation requirement.

Closing issue: the PR context has no ## Closing issue section (the PR only references #16035), so I checked no acceptance criteria.

Not independently verified: the live probe runs, the OTEL store counts (156 of 8741 events), the probe.py validate and test-suite results, and the inventory self-check exit codes are the author's claims. I had no shell and ran none of them.

No manifest or userConfig changes. No cost or spend surface.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 5ac9fa2 Nov 20, 2026
77 checks passed
@kyle-sexton
kyle-sexton deleted the fix/16035-claude-code-2-1-325-handoffs-part-2 branch November 20, 2026 07:31
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 0%; mutation score 0%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/observability/scripts/item-rollup.sh 0 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/observability/scripts/item-rollup.sh:13 other unclassified none
plugins/harness-ops/skills/observability/scripts/item-rollup.sh:14 other unclassified none
plugins/harness-ops/skills/observability/scripts/item-rollup.sh:120 SBR unclassified none

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant