Skip to content

refactor(session-flow): simplify claude_cli and io_streams - #15259

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14730

Summary

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

Simplified plugins/session-flow/scripts/claude_cli.py: parse_claude_version now returns in one conditional expression, and claude_version_at_least drops its temporary variable and early return for one boolean expression. The False/None/tuple cache sentinel semantics the tests rely on (they assign claude_cli._CLAUDE_VERSION_CACHE directly) are unchanged. In io_streams.py, the module docstring had gone stale: it named two callers and said neither imports the other, but tidy_work.py also calls utf8_streams and imports save_point. It is now shorter and accurate. The code there was already minimal. No exported name, signature, output or exit code changed.

Not verified

  • Python test suites (plugins/session-flow/scripts/harness/hop_chain.test.sh, plugins/session-flow/skills/running-retro/scripts/test_observer.py) not executed: the lane runs no interpreter; left to the PR's CI
  • Python lint (e.g. ruff) not run on the two touched .py files: no lint wrapper is available in this lane; left to the PR's CI
  • tidy recorded as skipped: the ai-slop pass ran only the rubric read, because the lane does not permit running detect.sh; all other tidy passes ran and made no edits
  • ci-status green is a PR CI check, left to the PR's CI

Fix

  • plugins/session-flow/scripts/claude_cli.py: parse_claude_version returns tuple(map(int, match.groups())) if match else None; claude_version_at_least ends in return isinstance(_CLAUDE_VERSION_CACHE, tuple) and _CLAUDE_VERSION_CACHE >= floor in place of a temp variable plus early return.
  • plugins/session-flow/scripts/io_streams.py: module docstring shortened; the stale claim that only save_point.py and harness/hop_chain.py use the helper, and that neither imports the other, is gone (tidy_work.py also calls it and imports save_point).
  • .changes/session-flow/work-resolve-issue-issue-14730-42956291613-1-2627d74f.md: new patch fragment from new-changelog-fragment, body ### Changed / - Internal simplification, no behavior change.

Verification

The runner ran each check from the base copy against 202e204:

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

The run reports:

  • check-changelog-fragments: all 19 fragments valid (run before and after the review fix)
  • check-changed-skills: no changed skills, nothing to gate (run before and after the review fix)
  • check-affected: 13 passed, 6 skipped, over 3 changed files (run before and after the review fix)
  • Grep of every reference to the claude_cli and io_streams names under plugins/: callers are harness/hop_chain.py, running-retro observer.py, save_point.py, tidy_work.py, and the tests hop_chain.test.sh and test_observer.py; no exported name changed
  • Fresh-context subagent review of the whole diff: confirmed that return values and types are identical for the False, None and tuple cache states and for the tests' direct cache assignments, that exports are unchanged, and that the fragment matches its siblings; it flagged the first docstring…
  • tidy-diff over the 4 changed hunks: no edits needed in the simplify, comment or residue passes; write-for-humans and the ai-slop rubric read of the fragment found nothing to change
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42956291613

Left out: the items under Not verified.

Related

#14730

Merge-Risk: max=LOW demote=false head=202e2043245fd7bf1e54bdf29368b54c49da55d3 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-review reviewed 202e2043245fd7bf1e54bdf29368b54c49da55d3: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings. I read all 3 changed files in full. None of them is on a trusted path.

plugins/session-flow/scripts/claude_cli.py

  • parse_claude_version: tuple(map(int, match.groups())) if match else None gives the same result as the old early return plus generator, for both a match and no match.
  • claude_version_at_least: the new isinstance(_CLAUDE_VERSION_CACHE, tuple) and _CLAUDE_VERSION_CACHE >= floor returns False for the False and None sentinels and the tuple comparison otherwise, the same as before. The global declaration is still there, and the tests' direct cache assignments behave as before.

plugins/session-flow/scripts/io_streams.py

  • Only the docstring changed. The new wording is accurate: utf8_streams is imported and called by save_point.py, tidy_work.py and harness/hop_chain.py, and each call comes before printing. The old docstring left out tidy_work.py.

Closing issue #14730, acceptance criteria

  • Behavior unchanged: met. No exported name, signature or output changed. The existing tests for these files (hop_chain.test.sh, test_observer.py) would catch a regression in the version gate.
  • Diff edits only the listed files plus a fragment: met.
  • Under 400 changed lines and 15 files: met.
  • Fragment from new-changelog-fragment.sh with bump: patch, ### Changed and "Internal simplification, no behavior change.": met.
  • ci-status green: not something this lane can confirm. It is left to the PR's CI.

Unverified claims: the PR body says tests and lint were not run and that some checks passed. Those statements are the author's and I have not confirmed them; I ran nothing myself.

No plugin manifest changed, there are no prior findings, and no settled threads were provided.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15259 (head 202e204)

No security issues found. I read every hunk of all 3 changed files.

  • plugins/session-flow/scripts/claude_cli.py: a refactor only. Two functions change:

    • parse_claude_version now returns tuple(map(int, match.groups())) if match else None. That gives the same result as the old early return for both a match and no match.
    • claude_version_at_least now returns isinstance(_CLAUDE_VERSION_CACHE, tuple) and _CLAUDE_VERSION_CACHE >= floor. It still returns False when the cache holds the False or None sentinel, and compares the tuple otherwise.

    The subprocess call that runs claude --version is unchanged. So is the argument building in permission_prompts_args. No new input reaches a command.

  • plugins/session-flow/scripts/io_streams.py: only the module docstring changes. No code changes.

  • .changes/session-flow/...md: a new patch changelog fragment, prose only.

None of the changed files matches a trusted-path glob. No trust control, merge hold, token scope, plugin manifest or standing instruction is touched. The PR context file has no embedded directives aimed at the lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 202e204

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-15259-202e2043245fd7bf1e54bdf29368b54c49da55d3, 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 ade35e9 Nov 11, 2026
65 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14730-42956291613-1 branch November 11, 2026 05:29
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit ade35e920bce9fda78a36b299b2cc903f5527128; 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 scripts session-flow plugin code (1 of 2)

0 participants