Skip to content

refactor(harness-ops): simplify behavior-probes probe.py - #15244

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14554-42941695595-1
Nov 11, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14554-42941695595-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14554

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified probe.py without changing behavior. Three small helpers now cover the repeated code: with_verdict builds the verdict/note row dicts that were written out 15 times, probe_paths builds the PROBE_WORKDIR/PROBE_CASE_DIR mapping that substitute and the scaffold env both needed, and write_rows replaces the two copies of the results.jsonl writer. fake_runner now builds its init event once, live_runner normalizes stdout once, and rejudge defaults prior once. Row key order, note text, written files and printed output are unchanged. The 11 listed scaffold.sh files and cases/lib/plant-check.py were reviewed and left as they are: each scaffold is already 3 to 20 lines of plain fixture setup, plant-check.py is 46 lines with nothing to remove, and merging the identical scaffolds is the cross-file dedup the issue rules out of scope.

Not verified

  • test_probe.py and probe.test.sh were not run here (the lane runs no interpreter); left to the PR's CI
  • ai-slop detect.sh was not run on the changelog fragment (not an allowed lane command); its one line is the issue's prescribed text
  • review-venue.txt was absent, so a local fresh-context subagent did the review

Fix

  • plugins/harness-ops/skills/behavior-probes/scripts/probe.py: added the with_verdict, probe_paths and write_rows helpers and used them in verdict, print_verdict, run_case, run_suite, substitute and main; build the dry-run init event once in fake_runner; normalize stdout once in live_runner; default…
  • .changes/harness-ops/work-resolve-issue-issue-14554-42941695595-1-55f65025.md: patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 3113bf8:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 11 fragments valid
  • check-changed-skills: behavior-probes PASS, 0 errors (2 warnings about SKILL.md body length and #N citations, both from before this change; SKILL.md was not touched)
  • check-affected: 13 passed, 6 skipped (shellcheck: no changed shell; typos not installed; checks that run code from the checked tree)
  • fresh-context review subagent over the whole diff: no findings; it confirmed row key order, note strings, the results.jsonl format and the names test_probe.py patches are unchanged
  • tidy (code-tidying:tidy-diff) over every changed hunk: all 5 passes ran and made no edits; the AI-writing pass (ai-slop) was a read-through of the fragment only, since the lane cannot run detect.sh
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42941695595

Left out: the items under Not verified.

Related

#14554

Merge-Risk: max=MEDIUM demote=false head=3113bf81b5114763c6804fa1620088cf25f09ecf rubric=8.4.1 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15244 (3113bf81)

No security issues found. I read every hunk of both changed files. Neither matches a trusted-path glob, and neither is a plugin manifest.

plugins/harness-ops/skills/behavior-probes/scripts/probe.py is a refactor that keeps the same behavior. I checked the parts that bear on security:

  • Guards kept, same order: the cli_args_ok allowlist check and the rule that a plant_env case must also be verdict_only (so a planted value is never written to a saved stream) both still run before any scaffold or claude process starts. Each now returns through with_verdict with the same verdict and note.
  • substitute unchanged: it builds the same PROBE_WORKDIR/PROBE_CASE_DIR values through the new probe_paths, and the JSON escaping is the same. The scaffold's child_env gets the same two keys, plus PROBE_LIB and PROBE_MODEL as before.
  • live_runner stdout: dropping the stdout: str = "" pre-assignment is safe. Both branches of the TimeoutExpired handler assign stdout, and any other exception propagates as it did before. stdout or "" now runs once, before the raw-stream write and the split, so what gets written is unchanged.
  • write_rows: in the rejudge branch, results is already bound to args.out / "results.jsonl" at probe.py#L1189, so the output path and format stay the same.
  • Spend: the suite ceiling check (max_runs / max_cost_usd) is unchanged.

.changes/harness-ops/…55f65025.md is a changelog fragment (patch bump) with no security surface.

The PR context contains no embedded instructions aimed at the lane. No prior findings; this is not a blocking-only review.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of both changed files: plugins/harness-ops/skills/behavior-probes/scripts/probe.py and the new changelog fragment. I also read the head code each changed hunk touches.

Behavior-preservation checks (by reading the code; I ran nothing):

  • with_verdict: {**row, "verdict": j, "note": n} gives the same key order as the inline dicts it replaces. The one with an observed key, with_verdict({**row, "observed": "unknown"}, ...), keeps observed ahead of verdict and note, as before. In print_verdict, the "the command printed nothing" + (...) addition stays inside the third argument, so the note text is unchanged.
  • probe_paths: the same two keys, used both by substitute and by the scaffold env, where they are spread ahead of PROBE_LIB and PROBE_MODEL as before.
  • live_runner: dropping stdout: str = "" is safe. Every path that reaches stdout = stdout or "" assigns stdout first (probe.py#L711-L721). Returning stdout.splitlines() instead of list(...) gives the same type.
  • fake_runner: the shared init dict is only serialized, never mutated, so the JSON lines are identical.
  • rejudge: prior = prior or {} behaves the same at both places that use it.
  • write_rows: in the rejudge branch, results is already bound at probe.py#L1189 to args.out / "results.jsonl", the same path as before. The run path writes the same file and prints the same results: line.

Closing issue #14554, acceptance criteria:

  • Behavior unchanged, no renames, no exported names removed: met as far as code reading shows. The PR adds three helpers and removes nothing. The existing test_probe.py / probe.test.sh exercise these paths. The author says they did not run them, and I could not run them either, so CI has to confirm.
  • Diff edits only listed files plus a fragment: met (probe.py and .changes/harness-ops/...).
  • At most 400 changed lines and 15 files: met (about 120 lines, 1 hand-edited file).
  • ci-status green: not visible to this lane.
  • Fragment is bump: patch with ### Changed and "Internal simplification, no behavior change.": met.

Path-scoped rules: .claude/rules/ruff-pin.md matches **/*.py. It governs how linting is run, and nothing in this diff breaks it.

Unverified claims: the PR body's Verification section (fragment and skill checks passing, the review subagent and the tidy pass) is the author's claim, not something I checked.

Embedded text: nothing in the PR context directs the lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 3113bf81b5114763c6804fa1620088cf25f09ecf, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 3113bf8

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-15244-3113bf81b5114763c6804fa1620088cf25f09ecf, expires on 2026-12-11.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit 238d229 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14554-42941695595-1 branch November 11, 2026 03:11
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 238d22914d8b2886c528f6a995558f365d5371a7; later checks count it verified from this comment.

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.

Simplify the behavior-probes harness-ops plugin code (4 of 4)

0 participants