Address review of two-stop branch
- lca._prefix_profile: anchor the prefix window to the prefix's own first arrival so the A-rate is measured over the prefix span (matches the design intent; no-op for the 0-based canonical pipeline). - cli study tune: label file-originated stops as file_proposal rather than llm_after_veto_budget (the veto never applies to file proposals). - spec.AdaptiveStopSpec: reject stable_checks > max_checks (would make convergence undetectable and silently disable Stop-A). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -376,6 +376,8 @@ def cmd_study_tune(args: argparse.Namespace) -> int:
|
||||
"stop_authorized_by": (
|
||||
"validator"
|
||||
if (is_harness_stop or authorized)
|
||||
else "file_proposal"
|
||||
if proposal_source is not None
|
||||
else "llm_after_veto_budget"
|
||||
),
|
||||
"diagnosis": proposal.diagnosis,
|
||||
|
||||
@@ -373,12 +373,13 @@ def _prefix_profile(
|
||||
length_mode: str,
|
||||
) -> WorkloadProfile:
|
||||
prefix = requests[:index]
|
||||
start = float(prefix[0].arrival_s) if prefix else float(window.window_start)
|
||||
end = float(prefix[-1].arrival_s) if prefix else float(window.window_start)
|
||||
prefix_window = WindowRecord(
|
||||
window_id=window.window_id,
|
||||
trace_path=window.trace_path,
|
||||
trace_type=window.trace_type,
|
||||
window_start=window.window_start,
|
||||
window_start=start,
|
||||
window_end=end,
|
||||
source_payload=window.source_payload,
|
||||
)
|
||||
|
||||
@@ -364,6 +364,11 @@ class AdaptiveStopSpec:
|
||||
raise SpecError(
|
||||
"trace.adaptive_stop.stable_checks and max_checks must be > 0."
|
||||
)
|
||||
if stable_checks > max_checks:
|
||||
raise SpecError(
|
||||
"trace.adaptive_stop.stable_checks must be <= max_checks, "
|
||||
"otherwise convergence can never be detected."
|
||||
)
|
||||
return cls(
|
||||
enabled=enabled,
|
||||
tau=tau,
|
||||
|
||||
Reference in New Issue
Block a user