feat(rectification): segment-gain order on by default up to 61 minutes after the health-focus fix; records and replay evidence (BUG-1143, BUG-1144)
Independent Staging Quality Gate / validate (push) Successful in 13m28s
Independent Staging Quality Gate / publish (push) Successful in 3m31s

The 77-case persisted replay after the BUG-1143 fix keeps every truth segment
at both 21 and 61 minutes with segment order on, so the default envelope moves
from 21 to 61 minutes. Bug numbers follow staging (BUG-1142 was taken).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-10-01 13:15:36 +08:00
co-authored by Claude Opus 5.5
parent 564eede340
commit f1a169cb93
10 changed files with 242241 additions and 14 deletions
@@ -64,13 +64,13 @@ export function orderProbesBySegment(input: {
}
/**
* Production default for segment-gain probe order (BUG-1143). The 77-case persisted replay
* (2026-10-01) gained head hits with no lost truth segment at windows <= 21 minutes; at 61
* minutes it lost truth segments, traced to the health-focus write failure (BUG-1142), so the
* default stays at 21 until that replay is rerun. "off" disables; "on" keeps the research
* envelope used by the persisted replay harness.
* Production default for segment-gain probe order (BUG-1144). 77-case persisted replay
* (2026-10-01, after the health-focus write fix BUG-1143): at 21 and 61 minutes it gained
* D9/D10 head hits with every truth segment kept (76/76). Before that fix the 61-minute cell lost
* truth segments, which is why the first cut stopped at 21. Wider windows were not replayed.
* "off" disables; "on" is the research envelope used by the persisted replay harness.
*/
export const SEGMENT_ORDER_DEFAULT_MAX_WINDOW = 21;
export const SEGMENT_ORDER_DEFAULT_MAX_WINDOW = 61;
export const SEGMENT_ORDER_RESEARCH_MAX_WINDOW = 61;
export function segmentOrderEnabledFor(windowMinutes: number | null | undefined, flag: string | undefined): boolean {
@@ -277,7 +277,7 @@ export function persistableFocusDomain(domain: string | null | undefined): strin
* the table only accepts education/career/relationship/relocation/finance/health/family/other,
* while planner domains include health_pressure and occupation (BUG-672). A raw
* health_pressure on a distinguish focus failed the check constraint, the write was
* swallowed and the session ended early (BUG-1142).
* swallowed and the session ended early (BUG-1143).
*/
export function focusTargetDomain(followup: Pick<MethodFollowup, "intent" | "domain">): string | null {
return persistableFocusDomain(followup.domain)