Skip to content

fix(session-flow): commit the threshold derivation and set the hooks.stop_ms and time.active_s thresholds - #11269

Merged
kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-10271-41063048809-1
Oct 30, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-10271-41063048809-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #10271

Summary

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

Commits the 2026-10-30 slice 1 derivation (672 interactive sessions, Claude Code 2.1.283-2.1.312) as audit-sessions/reference/threshold-derivation.md, with per-metric n, median, p90, max and nonzero counts plus the population filter, window and versions. sweep-rules.json's top-level basis points at it. hooks.stop_ms and time.active_s now take its p90 (152 ms and 19372 s). time.active_s gets back the route it had before its threshold was nulled (retro-codify, /session-flow:retro; read at commit 3a3391b). Every other rule's basis now gives the new figures beside the 2026-10-02 spike's, and its threshold is unchanged, because the issue asks only for the two null thresholds.

Not verified

  • python3 -m pytest -q plugins/session-flow/skills/audit-sessions/scripts/tests was not run: this lane's Bash runs only the named wrappers. Left to the PR's CI
  • ci-status green on the PR head is a PR check, left to the PR's CI
  • The issue's jq and grep done-when commands were not run (no jq or grep allowed in this lane). Checked by reading instead: the top-level basis is one line naming threshold-derivation.md once, both thresholds are numbers, and no 'Threshold null until #6077' text remains
  • tidy skipped part of pass 4: the ai-slop detector script (detect.sh) cannot run under this lane's Bash rule, so the markdown lines got a manual rubric read only; passes 1-3 ran and made no edits
  • verify (build and tests) and the class audits beyond the lane's checks could not run here; the PR's CI runs them
  • The thresholds other than the two nulled ones still use the 2026-10-02 spike p90; the new derivation's p90 differs for most of them (for example tokens.sub 546457 against 72347). The issue did not ask to re-set them, so a person decides whether to

Fix

  • plugins/session-flow/skills/audit-sessions/reference/threshold-derivation.md: new; the derivation's population, window, version range, date, per-metric figures and notes (aggregates only, no transcript content)
  • plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json: top-level basis names threshold-derivation.md and says which thresholds come from it; verified 2026-10-30; hooks.stop_ms threshold 152; time.active_s threshold 19372 with route retro-codify and /session-flow:retro; the 'Threshold
  • plugins/session-flow/skills/audit-sessions/scripts/tests/test_sweep.py: the test that pinned both thresholds as null now pins 152 and 19372 and checks that a session above each one is a finding (evidence, and impact in minutes for time.active_s); a comment no longer names hooks.stop_ms as a report-o
  • plugins/session-flow/skills/audit-sessions/SKILL.md: drops 'report-only until re-derived' for the two heuristic metrics and points at reference/threshold-derivation.md
  • .changes/session-flow/fix-10271-threshold-derivation-3f9c1a72.md: new patch changelog fragment

Verification

The runner ran each check from the base copy against 1e7423c:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //github.com/melodic-software/claude-code-plugins/issues /6077#issuecomment-6514809921: the slice 1 derivation by kyle-sexton; n 672 (581 sessions with a Stop run for hooks.stop_ms), time.active_s median 6520.5 p90 19372, hooks.stop_ms median 86 p90 152, and the other rows used
  • read https: //api.github.com/repos/melodic-software/claude-code-plugins/issues /comments/6514809921: the same comment as JSON; max and nonzero columns, the population filter, window 2026-09-28 to 2026-10-30 UTC, 2026-09-14 to 2026-09-27 excluded (38 sessions), Claude Code 2.1.283-2.1.312, the test-j
  • read https: //api.github.com/repos/melodic-software/claude-code-plugins/issues /6077: Step 6 and acceptance criterion 5; gives no route for time.active_s and names only the two nulled thresholds for re-derivation
  • read https: //api.github.com/repos/melodic-software/claude-code-plugins/commits?path=plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json&per_page=100: #7940 (9a3b70d) is the commit that nulled the two thresholds
  • read https: //raw.githubusercontent.com/melodic-software/claude-code-plugins/3a3391b0af1f94871a688e02d6ec1f53ca186ff2/plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json: before #7940, time.active_s had route retro-codify and /session-flow:retro (threshold 26064)
  • .lane/checks/bin/check-changelog-fragments: all 78 fragments valid (run before and after tidy and review)
  • .lane/checks/bin/check-affected: 12 passed, 6 skipped, rest CI-only (run before and after tidy and review)
  • fresh-context review subagent over the whole diff: JSON valid, numbers match the source, no test expected to fail; one finding (the fragment said every rule's basis gives both measurements, which is false for the two re-derived rules) was fixed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41063048809

Left out: the items under Not verified.

Related

#10271

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

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

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

No security findings in the incremental change.

The only change since 1e7423c is two assertions in plugins/session-flow/skills/audit-sessions/scripts/tests/test_sweep.py. They check that RULES["basis"] mentions threshold-derivation.md exactly once, and that reference/threshold-derivation.md exists.

This is test-only code. It reads no untrusted input and touches no token, secret, trust control, merge hold, workflow, manifest or instruction surface. The file matches none of the trusted-path globs.

I read only the incremental diff. The other four files of the pull request were reviewed at 1e7423c, and I did not re-review them. critical-findings: 0. No manifest items were hit. No hold is set, and the change spends no prepaid credit or subscription usage.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 1e7423c592633f72a26293f222f0d5064eb8604c; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 1c9602aacf6821d53819bc003a51901799510ac9: 0 finding(s), 0 as inline comments.

Incremental review of test_sweep.py (since 1e7423c): no findings.

The change adds two assertions to test_rules_are_well_formed. The first checks that the top-level basis names threshold-derivation.md exactly once. The second checks that reference/threshold-derivation.md exists. RULES and SCRIPTS are already defined and imported in the file. I confirmed reference/threshold-derivation.md exists and sweep-rules.json mentions the filename once, so both assertions should pass. I did not run the tests.

The assertions match the issue's done-when criteria. Nothing in the change touches a cost surface.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6x_OJ7
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 1c9602a.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 1d3b909 Oct 30, 2026
44 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-10271-41063048809-1 branch October 30, 2026 14:16
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.

fix(session-flow): commit the threshold derivation and set the hooks.stop_ms and time.active_s thresholds

1 participant