Skip to content

refactor(session-flow): simplify save_point.py validation helpers (part 1 of 3) - #14896

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14731-42716180480-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14731

Summary

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

Simplified functions that start in the first third of plugins/session-flow/scripts/save_point.py (lines 1-1336 of 4007), with no behavior change. _text_lines drops a no-op rstrip after splitlines. Entry.exempt reads self.text once. _check_rails_block counts ASCII rails only on the failure path that reports them and drops the resume/between and bottom aliases and the pos=0 step. _check_cumulative uses the warn-or-fail dispatch already used elsewhere in the file. validate_doc drops a redundant pred = None. Design choice: only edits that are equivalent for every input were made, because no Python or test run is possible in this lane. Larger restructurings were left alone.

Not verified

  • plugins/session-flow/scripts/tests/test_save_point.py and the rest of the Python test suite were not run: this lane allows no interpreter. Left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • tidy: the ai-slop pass ran its rubric only, because detect.sh and digest-guard.sh are not among the wrappers this lane may run.
  • review-venue.txt was absent, so the review ran locally in one fresh-context subagent instead of the CI code-review lane.
  • Untracked dotfiles in the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) come from the runner environment, not this change, and were left untouched.

Fix

  • plugins/session-flow/scripts/save_point.py: removed the no-op rstrip in _text_lines; Entry.exempt reads text once; in _check_rails_block, ascii_rails is counted only in the failing branch and the between/bottom/pos aliasing is removed; in _check_cumulative, the warn-or-fail branch is collapsed; in…
  • .changes/session-flow/work-resolve-issue-issue-14731-42716180480-1-a59d644b.md: new patch fragment (made by new-changelog-fragment session-flow patch) with ### Changed and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 638475c:

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

The run reports:

  • check-changelog-fragments: all 22 fragments valid (run before and after tidy)
  • check-changed-skills: no changed skills, nothing to gate (run before and after tidy)
  • check-affected: 13 passed, 6 skipped (shellcheck: no shell; typos: not installed; three validate-plugins sub-checks that run tree code; changed-skills: none) over 2 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: no problem found; it confirmed each hunk is equivalent for all inputs, no leftover references to renamed names, and changed lines under 88 characters
  • tidy-diff over the 13 changed hunks: all five passes ran; no further edits (no comments or residue in the listed lines; fragment text is fixed by the issue); the ai-slop deterministic detector was not runnable in this lane, so only the rubric was read
  • Range check: file is 4007 lines, so range 1 is lines 1-1336; edited functions start at 472, 690, 807, 1027 and 1105 (pre-change numbering)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42716180480

Left out: the items under Not verified.

Related

#14731

Merge-Risk: max=MEDIUM demote=false head=638475c6f07e2864808a23a6133355bc6036f447 rubric=8.3.1 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14896

I read every hunk in both changed files and found no security issues.

The PR changes two files:

  • plugins/session-flow/scripts/save_point.py refactors the save-point document validator: _text_lines, Entry.exempt, _check_rails_block, _check_cumulative and validate_doc. Each change only reorders or merges logic inside the validator. None of them touches tokens, secrets, credentials, subprocess or shell calls, network I/O, or file writes.
  • The .changes/session-flow/... changelog fragment is a new prose file with no executable surface.

I checked for these and found none:

  • Trusted paths: neither file matches a listed trusted-path glob.
  • Trust controls: no change to trusted actors, the token broker or lane token scope, the kill switch, merge holds, or anything under .github/actions/.
  • Instruction surfaces: no CLAUDE.md, AGENTS.md, skill, agent, rules or hook files changed, so nothing for the instruction-surface lens.
  • Plugin manifests: no plugin.json or marketplace.json changed, so no manifest lines.
  • Embedded instructions: none in the PR context file.

Whether these refactors keep the validator's behavior identical (for example, removing pred = None in validate_doc's exception handler) is a correctness question for the code-review lane, not a security finding.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk in both changed files. I checked each one against the head file to see whether it behaves the same for every input. I did not run any tests or tools. The test results in the PR body come from its author and I have not checked them.

plugins/session-flow/scripts/save_point.py

  • _text_lines (L472): _universal already turns every \r\n and lone \r into \n, and splitlines() drops the line endings. So no line can end in \r or \n, and the removed rstrip("\r\n") did nothing. Behavior is the same.
  • Entry.exempt (L691-693): text is a property that always returns a str. Reading it once and testing not text gives the same result as == "". Behavior is the same.
  • _check_rails_block (L808-965):
    • ascii_rails is only used inside the failure branch, and a count is truthy exactly when the list was non-empty. Behavior is the same.
    • The rename from resume to between keeps the same meaning. Nothing reads between before the old between, bottom = resume, resume_bottom line.
    • The loop variable bottom is not read anywhere after the loop except the last check, which now uses resume_bottom. That is the value the old code had copied into bottom.
    • pos starts at 1 where the old code did pos = 0, then read between[pos], then pos += 1, with nothing changing pos in between. Behavior is the same.
  • _check_cumulative: (f.warn if pred_soft else f.fail)(...) makes the same call with the same message. Behavior is the same.
  • validate_doc (L1143, L1166-1169): pred is set to None at L1143. If parse_doc raises, the assignment never happens, so the removed pred = None was redundant.

.changes/session-flow/...a59d644b.md: it says bump: patch and its body is ### Changed with "Internal simplification, no behavior change.", as the issue requires.

Closing issue #14731, acceptance criteria:

  • Behavior unchanged: met, by the checks above. Existing tests already cover these paths: the ascii-rails, dropped-entry and malformed-predecessor fixtures under plugins/session-flow/scripts/tests/fixtures/.
  • Only the listed file plus a changelog fragment is edited: met.
  • Within 400 changed lines and 15 files: met.
  • Fragment present: met.
  • Only functions that start in range 1 (L1-1336) are changed: met. The edited functions start at about L472, L690, L808, the _check_cumulative region before L1100, and L1105.
  • ci-status green: I can't check this from here; it is left to the PR's CI.

No security lane findings were in scope. The pull request text contains no embedded instructions.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 638475c

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-14896-638475c6f07e2864808a23a6133355bc6036f447, expires on 2026-12-09.

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 9, 2026
Merged via the queue into main with commit f5d6939 Nov 9, 2026
65 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14731-42716180480-1 branch November 9, 2026 23:54
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

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

File Killed Survived Timeout No coverage Invalid Not run
plugins/session-flow/scripts/save_point.py 5 2 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/session-flow/scripts/save_point.py:693 LCR productive input-gap
plugins/session-flow/scripts/save_point.py:815 UOI productive no-assertion

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit f5d6939aa29697c44c94d83e7faaf7f8a88b9680; 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 save_point.py session-flow plugin code (part 1 of 3)

0 participants