Skip to content

fix(session-flow): call thresholds a shipped baseline and compute the recheck trigger - #9963

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-6077-40182274884-1
Oct 25, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #6077

Summary

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

audit-sessions no longer describes its sweep thresholds as this machine's own: SKILL.md, the README and go-faster's area text now call them a shipped reference baseline. sweep.py now computes each metric's store p90 using collect.py's _percentile rule. It reports the p90 beside the threshold in JSON and markdown, and marks baseline_stale when the p90 exceeds stale_p90_factor (1.5) times the threshold. The mark is advisory and leaves the exit code unchanged. The trigger is pinned one-sided in sweep-rules.json, matching the issue's acceptance criterion ("p90 exceeds 1.5x its threshold"); a threshold of 0 fires on any p90 above 0. Re-deriving the thresholds needs a real transcript store, which this CI run does not have, so the derivation file and the two null thresholds are left as remaining work.

Remaining work

  • Re-derive the thresholds from a real interactive-session store (excluding 2026-09-14 to 2026-09-27), including the null hooks.stop_ms and time.active_s on their new definitions, and decide on purpose whether the baseline includes the testing test-judge Stop hook. Commit the derivation summary beside
  • Carried from #6074: run a sweep over a re-collected store and confirm no record has active time above its wall clock and hooks.stop_ms reads a max-based per-stop wait. This also needs a real store.

Not verified

  • pytest over plugins/session-flow/skills/audit-sessions/scripts/tests/test_sweep.py was not run directly. This lane allows no interpreter, and check-affected's output does not say whether its 10 passing checks include these tests. Expected values were checked by hand in review. Left to the PR's test
  • check-affected skipped typos (not installed), changed-skills and three validate-plugins sub-checks (they run code from the checked tree), and listed CI-only checks (portability-lint, line-citations, evals-quality and others). Left to the PR's CI.
  • No web page was read; the change makes no new external claim.
  • The issue's two 2026-10-04 answers (one-sided trigger; re-derive from the current interactive store) are not runner-marked decisions. The one-sided reading was built because the issue's own acceptance criterion says 'p90 exceeds 1.5x its threshold'. Re-derivation was not attempted.

Fix

  • plugins/session-flow/skills/audit-sessions/scripts/sweep.py: load_rules validates and returns stale_p90_factor. New p90 (collect.py's _percentile rule) and baseline_stale helpers. Each metrics row carries p90, threshold and baseline_stale, and data carries stale_p90_factor. The markd
  • plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json: the basis calls the thresholds a shipped reference baseline whose basis numbers are not from the swept store. The recheck trigger is pinned one-sided, including the threshold-of-0 case. Adds stale_p90_factor: 1.5.
  • plugins/session-flow/skills/audit-sessions/reference/canaries.json: the basis names its own population (104 sessions on one reference machine), distinct from the threshold spikes.
  • plugins/session-flow/skills/audit-sessions/reference/store-layout.md: documents the new v1 metrics fields (p90, threshold, baseline_stale, data.stale_p90_factor) and that the mark is advisory.
  • plugins/session-flow/skills/audit-sessions/SKILL.md: the description, Step 2 and the Boundary section call the thresholds a shipped reference baseline. Step 2 says the stale-baseline mark is advisory and leaves the exit code unchanged.
  • plugins/session-flow/README.md: the audit-sessions summary says a shipped reference baseline and mentions the store p90 and the stale-baseline mark.
  • plugins/session-flow/skills/audit-sessions/scripts/tests/test_sweep.py: exact-dict asserts updated for the new fields. New tests: the pinned one-sided trigger; p90 matching collect._percentile; a 10-session fixture where human.turns p90 22 > 1.5x14 is marked and tools.denials p90 40 <= 1.5x27
  • plugins/performance/skills/go-faster/reference/areas.md: the how-you-work area's source and no-data reason say "the shipped threshold(s)" instead of "this machine's" (found by review, same claim the issue fixes).
  • .changes/session-flow/fix-6077-thresholds-shipped-baseline-3b7e19c4.md: minor fragment (Added: store p90 and stale-baseline mark; Fixed: threshold wording and basis labels).
  • .changes/performance/fix-6077-thresholds-shipped-baseline-9d24a6f1.md: patch fragment for the go-faster wording.

Verification

The runner ran each check from the base copy against 6e9e8ef:

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

The run reports:

  • .lane/checks/bin/check-changelog-fragments: All 3 changelog fragment(s) under .changes/ are valid.
  • .lane/checks/bin/check-affected: 10 passed, 6 skipped over 10 changed files; the rest are listed as CI only.
  • .lane/verify/bin/cant-fail-scan --file plugins/session-flow/skills/audit-sessions/scripts/tests/test_sweep.py --check: PASS, 43 test blocks, no gating findings.
  • Fresh-context review subagent over the whole diff: no code or test-arithmetic bugs (checked every new expected value by hand) and no consumer breaks (load_rules and build_data have no other callers; go-faster reads only findings, window.sessions and the exit code). Five doc findings, all fixed: stal
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40182274884

Left out: the items under Not verified.

Related

#6077

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

Copy link
Copy Markdown
Contributor

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

No security issues found in PR #9963 at 6e9e8ef.

critical-findings: 0

  • Scope read: I read the whole diff and the PR context. The PR context carries no embedded instructions.
  • Trusted paths: No changed file matches .github/standards/trusted-actors/**, .github/actions/check-trusted-trigger/**, **/CODEOWNERS or **/.gitmodules.
  • Manifests: No plugin.json or marketplace.json changed, so no manifest <field> lines apply.
  • Instruction surface: The SKILL.md, areas.md and README edits reword threshold descriptions. They add one advisory presentation note: say that findings on a stale-baseline metric may flag normal use. No rule, block list or allowlist is deleted, narrowed or softened, so nothing is left without enforcement. I did not read the instruction exception register, because no standing rule was removed.
  • Code (sweep.py):
    • The new p90 and baseline_stale helpers do pure numeric work over already-loaded store records.
    • stale_p90_factor comes from the bundled sweep-rules.json, and load_rules type-checks it and requires 1 or more.
    • Nothing new reads untrusted input, runs a command, touches a path or handles a secret.
    • The markdown report adds only numbers, metric names from the fixed rule set, and fixed strings.
    • The stale mark is advisory and the exit code is unchanged, so it gates nothing.
  • Spend: The change adds no paid resource or billing surface.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 6e9e8ef554b9569c9d277fc53e90ceae9a746d09: 0 finding(s), 0 as inline comments.

No findings. I read the full diff (10 files) and the PR context; I ran nothing.

  • Logic. p90 in sweep.py matches collect._percentile. baseline_stale is one-sided and returns false for a null p90 or null threshold. Degraded rows get p90: null and baseline_stale: false. load_rules validates stale_p90_factor and rejects bools, strings, and values below 1. The only call sites of load_rules and build_data in the diff are the ones updated.
  • Consumers. audit-sessions.test.sh and evals.json don't depend on the old metric-row shape or the markdown table columns. The new fields are additive within schema v1, as store-layout.md says.
  • Tests. The tests cover the new fields and the pinned trigger. They also cover the factor validation and the markdown stale line. I checked the 10-session fixture arithmetic by hand: human.turns p90 22 is above 21 and tools.denials p90 40 is not above 40.5. I did not run pytest. The PR body says the author didn't either.
  • Closing issue. The PR says "Refs: fix(session-flow): call thresholds a shipped baseline and compute the recheck trigger #6077" and the context file has no closing-issue section, so there were no acceptance criteria to check. The PR's remaining work (re-deriving thresholds from a real store) is disclosed there and is not part of this diff.
  • Manifests. No plugin.json or marketplace.json changes, so no manifest <field> lines apply. The changelog fragments carry bump: minor for session-flow, which fits an additive report field, and bump: patch for performance, which fits a wording fix.
  • Trusted paths. None of the changed files match the trusted-path globs.
  • Cost. No billing change. The change adds no model or lane spend.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 6e9e8ef554b9569c9d277fc53e90ceae9a746d09.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit a1102be Oct 25, 2026
40 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-6077-40182274884-1 branch October 25, 2026 10:36
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.

0 participants