Skip to content

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

Description

@kyle-sexton

Parent: #6077 (slice 2 of 2). Blocked by #10223 (slice 1).
Runs in: lane. Commits numbers slice 1 already posted; no store needed.

Problem

#6077 acceptance criterion 5: "A committed file gives, per thresholded metric, n, median, p90, population filter, Claude Code version range and date, and sweep-rules.json:3 points at it." Step 6: set the two thresholds that are null on their new definitions (hooks.stop_ms, time.active_s in plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json). Slice 1 posts the derivation on #6077.

Fix

  1. Commit the slice 1 table as plugins/session-flow/skills/audit-sessions/reference/threshold-derivation.md (per metric: n, median, p90, population filter, version range, date; no transcript content).
  2. Point the top-level basis in sweep-rules.json at it, and update each rule's basis numbers that came from the 2026-10-02 spike to the new derivation where the derivation covers them.
  3. Set hooks.stop_ms and time.active_s thresholds to their derived p90 and replace their "Threshold null until fix(session-flow): call thresholds a shipped baseline and compute the recheck trigger #6077 re-derives it" text.
  4. Update scripts/tests/test_sweep.py if a test pins an old number. Version bump and changelog per the session-flow convention.

Done when

  • test -f plugins/session-flow/skills/audit-sessions/reference/threshold-derivation.md exits 0
  • jq -r .basis plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json | grep -c threshold-derivation.md prints 1
  • jq '[.rules[]|select(.metric=="hooks.stop_ms" or .metric=="time.active_s")|.threshold|numbers]|length' plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json prints 2
  • grep -c 'Threshold null until #6077' plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json prints 0
  • python3 -m pytest -q plugins/session-flow/skills/audit-sessions/scripts/tests exits 0
  • ci-status is green on the PR head

Split by the backlog HITL session (2026-10-25, owner rule Q93: split large work before a run picks it up). This was generated by AI.

Activity

  1. added
    needs-triage
    on Oct 26, 2026
  2. github-actions commented on Oct 26, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Decision comment (#10271 (comment) is not it; the decision is #10271 (comment)):

    Decision recorded. The lane's question (which route and suggested skill time.active_s carries once thresholded) is settled by the existing rules, so it is not an intent change. Every per-session main-thread behavior rule in plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json on main routes retro-codify with /session-flow:retro: tokens.main, human.turns, tools.interrupts and edits.churn_per_pr. time.active_s measures the main session's active seconds per session, the same kind of metric.
    [quote truncated; the full decision is at the link]

    That decision settles the one open question: time.active_s carries retro-codify and /session-flow:retro. The blocked-by edge to #10223 was also removed. The remaining work is a bounded edit: commit the derivation file, point basis at it, set the two thresholds, and update tests, version and changelog.

    Automated triage, applied by the lanes App.

  3. added and removed
    needs-triage
    on Oct 26, 2026
  4. added
    status: ready
    on Oct 26, 2026
  5. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane yet: blocker #10223 is not closed by a listed human or a merge.

  6. removed
    status: ready
    on Oct 30, 2026
  7. added
    status: ready
    on Oct 30, 2026
  8. kyle-sexton commented on Oct 30, 2026

    @kyle-sexton
    MemberAuthor

    Removing the blocked-by edge to #10223: it closed as completed (report delivered by the lanes App, our own actor). Admission counts only a listed human's close or a merge, and under the owner's standing direction §10 a hold against our own actors is friction, so this edge no longer holds anything.

  9. kyle-sexton commented on Oct 30, 2026

    @kyle-sexton
    MemberAuthor

    Correction to my previous comment: the blocked-by edge to #10223 stays. Owner decision Q9 (2026-10-29, recorded at .github/actions/check-trusted-trigger/check-trusted-trigger.mjs:401-406 on main) counts a report-delivered close as nothing, because the blocker produced a report, not the change. Whether to re-triage this issue against #10223's report or reopen #10223 as real work is an owner design question; it is on GitHub Support's morning list.

  10. kyle-sexton commented on Oct 30, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. Blocker #10223 closed report-delivered, and its report is the input this issue needs: the slice 1 derivation (per-metric n, median and p90 for every rule in sweep-rules.json) is posted at #6077 (comment). Under the hub's 2026-10-30 decision (re-triage a report-delivered blocker's dependents against the delivered report), this issue is ready on its own criteria:

    • test -f plugins/session-flow/skills/audit-sessions/reference/threshold-derivation.md exits 0
    • jq -r .basis plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json | grep -c threshold-derivation.md prints 1
    • jq '[.rules[]|select(.metric=="hooks.stop_ms" or .metric=="time.active_s")|.threshold|numbers]|length' plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json prints 2
    • grep -c 'Threshold null until #6077' plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json prints 0
    • python3 -m pytest -q plugins/session-flow/skills/audit-sessions/scripts/tests exits 0
    • ci-status is green on the PR head
  11. added
    agent-ready
    needs-human
    and removed
    agent-ready
    on Oct 30, 2026
  12. melodic-automation-lanes commented on Oct 30, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane did not start this issue: it needs a person to make it clearer first.

    Reason: intent

    Why, in the run's own words:

    Once time.active_s has a threshold, which route and suggested skill should its findings carry? Today the rule has "route": null and "suggested_skill": null, and a thresholded rule needs both: test_rules_are_well_formed (plugins/session-flow/skills/audit-sessions/scripts/tests/test_sweep.py:76-80) requires a route in {retro-codify, config-change} and a /-prefixed suggested_skill, and sweep.py:284-285 copies both into every finding. Neither this issue nor parent #6077 (body and comments) names one. Elsewhere in sweep-rules.json routes are set by owner decision (subagents.count and hooks.stop_ms, 2026-10-11). One option, offered only to make the question concrete: retro-codify with /session-flow:retro, like the other per-session main-thread rules (tokens.main, human.turns). hooks.stop_ms already keeps config-change with /harness-ops:audit-performance, so only time.active_s is open. Record the choice as a Decision recorded. comment and the lane can finish the issue: the slice 1 numbers (time.active_s p90 19372 s, hooks.stop_ms p90 152 ms, n 672 / 581, Claude Code 2.1.283-2.1.312, 2026-10-30) are posted and were read in this run.

    What the run says it did not do:

    • Every done-when item (threshold-derivation.md, the basis pointer, the two thresholds, the test update, the version and changelog record) is waiting on the route decision above
    • ci-status on the PR head is left to the PR's CI; no PR was opened

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41058390812

    To retry, answer the question in a comment whose first line is **Decision recorded.**, then remove needs-human and add agent-ready again.

  13. kyle-sexton commented on Oct 30, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The lane's question (which route and suggested skill time.active_s carries once thresholded) is settled by the existing rules, so it is not an intent change. Every per-session main-thread behavior rule in plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json on main routes retro-codify with /session-flow:retro: tokens.main, human.turns, tools.interrupts and edits.churn_per_pr. time.active_s measures the main session's active seconds per session, the same kind of metric. The two owner-set routes (subagents.count, hooks.stop_ms) cover subagent and hook cost, a different kind. Basis: the rule list read from origin/main today; standing direction §1.

    The blocked-by edge to #10223 is removed (owner, 2026-10-30), and the slice 1 derivation is at #6077 (comment).

    • test -f plugins/session-flow/skills/audit-sessions/reference/threshold-derivation.md exits 0
    • jq -r .basis plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json | grep -c threshold-derivation.md prints 1
    • jq '[.rules[]|select(.metric=="hooks.stop_ms" or .metric=="time.active_s")|.threshold|numbers]|length' plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json prints 2
    • time.active_s carries "route": "retro-codify" and "suggested_skill": "/session-flow:retro"
    • grep -c 'Threshold null until #6077' plugins/session-flow/skills/audit-sessions/reference/sweep-rules.json prints 0
    • python3 -m pytest -q plugins/session-flow/skills/audit-sessions/scripts/tests exits 0
    • ci-status is green on the PR head
  14. removed
    needs-human
    on Oct 30, 2026
  15. added
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readystatus: ready

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions