Skip to content

fix(harness-ops): read local slash-command output in behavior-probes prints cases - #10628

Merged
kyle-sexton merged 4 commits into
mainfrom
host-run/6930-autocompact-live
Oct 28, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
host-run/6930-autocompact-live

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #6930

Summary

The behavior-probes autocompact area had its first live run (criterion 12). On Claude Code 2.1.312, claude -p "/autocompact" printed the window with no model turn, and each of the four cases printed the window it expects. The runner still reported all four as inconclusive, because it read the printed output as a model answer. This PR fixes the verdict, records the run, and points context-guard's reader-contract observation at the cases (step 4).

Fix

  • probe.py: under claude -p, a local slash command's output arrives as an assistant message with model <synthetic>, and the result reports num_turns 0. A result with num_turns 0 now clears the model-turn flag, so the prints verdict reads the result text. A result with no num_turns, or one of 1 or more, keeps today's inconclusive. The dry-run fake now emits the live shape.
  • records.md: record 14 holds the run's basis and the four observed lines. The flag case's source label reads (from settings), so cases match on the window, not on the label.
  • SKILL.md and context-guard reader-contract.md: the "unconfirmed" sentence now gives the observed fact, and the dated observation points at the cases, which also observe a project per-model value beating the project top-level key.

Verification

  • Live: probe.py run --live --area autocompact --max-runs 4 --max-cost-usd 1.0, 4 cases at max_budget_usd 0.25 each. Streams: num_turns 0, cost 0, windows 250k / 400k / 200k / 150k. The verdict was inconclusive for all four before the fix. After the fix, probe.py rejudge on the same saved streams gives pass for all four, with the control chain intact.
  • test_probe.py: 58 tests OK. The new test_local_command_echo_with_no_turns_passes fails without the probe.py change; test_same_shape_after_a_turn_stays_inconclusive guards against passing a real model answer.
  • probe.py validate: 41 cases, 0 problems. Full --dry-run: 41 of 41 pass. probe.test.sh exits 0.
  • Left out: a second live run (the approval covered one; rejudge reads the saved streams); user-scope rows 1 and 2, deferred by the 2026-10-13 owner decision.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 28, 2026 03:15
…prints cases

claude -p runs /autocompact locally and reports it as a <synthetic>
assistant message with a result of num_turns 0. The prints verdict read
any assistant message as a model turn, so the first live run of the
autocompact area reported all four cases inconclusive. Trust a result
reporting num_turns 0, make the dry run emit that shape, record the
passing run as record 14, and point context-guard's reader-contract
observation at the cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 28, 2026 08:22
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-28T08:22:10.805470Z 5a8e27b 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

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 7999f93d3d5d0a56fbc23cb7aa77b316dc72d303: 0 finding(s), 0 as inline comments.

No security findings. critical-findings: 0

I read the whole diff and the PR context. No changed file matches a TRUSTED PATHS glob, and no plugin manifest, trust control, hook, token scope, or merge hold changed.

  • plugins/harness-ops/skills/behavior-probes/scripts/probe.py:385 and :415: a result event with num_turns == 0 now clears model_turn. Only print_verdict reads that flag (probe.py:529 and :537). The prints verdict then falls back to the result text, which is still matched against the case's printed_match and text_match. The input is the stream from the operator's own local claude -p run, so a PR author or other outside party has no way to forge it. The worst a wrong reading can do is turn a probe verdict from inconclusive to pass or fail, and no gate or permission reads that verdict. A case can only run with the flags and tools its CLI_FLAGS and TOOL_LISTS allowlists permit, and none of that changed.
  • The dry-run fake runner and its test add nothing that runs outside the probe.
  • The docs, records.md and the .changes entries are prose only. Nothing in them removes or softens a standing instruction.

Spend: the probe's live run draws on subscription usage and is capped by --max-cost-usd and per-case max_budget_usd. It is not a cost hold.

Manifest items: none were hit.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 7999f93d3d5d0a56fbc23cb7aa77b316dc72d303: 0 finding(s), 0 as inline comments.

No findings.

I read the whole diff (7 files) and the PR context. I checked the probe.py change against parse_stream and print_verdict. I did not run the tests; the "58 tests OK" and the dry-run counts are author-claimed and unverified by me.

  • Verdict fix. A result with num_turns 0 clears model_turn after the loop, so event order doesn't matter. model_turn is read only in print_verdict, so the tool-call verdicts are unaffected. A missing num_turns, or one of 1 or more, still reads as inconclusive. That matches the new guard test test_same_shape_after_a_turn_stays_inconclusive.
  • Closing issue test(harness-ops): add behavior-probes cases for /autocompact window precedence #6930.
    • Criterion 12 (the live run) is met by the host run, recorded in record 16.
    • Step 4 (pointing context-guard's observation at the cases) is met by the reader-contract.md edit.
    • Rows 1 and 2 stay deferred per the 2026-10-13 decision, and the new text says "the user-scope rows have no case yet".
    • Every changed behavior has a test that would fail if it broke.
  • Changelog fragments. Both are bump: patch, which fits a fix and a docs pointer.
  • Manifests. No plugin.json or marketplace.json changes, so no manifest lines apply.
  • Trusted paths. None of the 7 changed files match a trusted-path glob.
  • Spend. The 4-case live run used subscription usage and no real cost. It is already done, and this PR adds no new spend.
  • Minor, not a finding. The PR description says "record 14", but the files and changelog all say record 16, and record 16 is the correct number.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Oct 28, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The pr-unblock lane stopped on this pull request and needs a person: the lane could not resolve every conflict.

  • Reason: unresolved-conflict
  • Resume key: 5a8e27b3434a00a7c83edcaf89c2c656f4aaaa1c (the head the lane stopped on)

To resume, deal with the reason above, remove the needs-human label (and do-not-merge, if set), then dispatch the pr-unblock workflow with pr-number=10628 and activity=resolve-conflicts:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=10628 -f activity=resolve-conflicts

@kyle-sexton
kyle-sexton enabled auto-merge October 28, 2026 14:03
Resolve behavior-probes records.md: main added records 14 and 15
(Skill-tool and preloaded CLAUDE_EFFORT); this branch's autocompact
record, also numbered 14, becomes record 16, and its two citations in
SKILL.md and the changelog fragment follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

The pr-unblock lane escalated this pull request as unresolved-conflict, and that no longer holds at 7999f93d3d5d0a56fbc23cb7aa77b316dc72d303: GitHub reports no conflict with main. pr-merge removed needs-human, so the lanes run on it again. To keep a person on it, add needs-human back: a label a person adds is never removed.

@melodic-automation-lanes melodic-automation-lanes Bot removed the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Oct 28, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit e77f8e9 Oct 28, 2026
56 of 57 checks passed
@kyle-sexton
kyle-sexton deleted the host-run/6930-autocompact-live branch October 28, 2026 15:36
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

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

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/behavior-probes/scripts/probe.py 5 0 0 0 0 0
plugins/planning/surface/exporters.py 0 0 0 0 0 2
plugins/planning/surface/round.py 0 0 0 0 0 1

The run's summary has the full report.

kyle-sexton added a commit that referenced this pull request Oct 28, 2026
Resolve behavior-probes records.md again: #10628 landed the autocompact
record as 16, so this branch's lane-permissions record becomes 17, and
the changelog fragment follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

test(harness-ops): add behavior-probes cases for /autocompact window precedence

1 participant