Completion: sticky finish with evidence fingerprint - #31
tydinjarman wants to merge 1 commit into
Conversation
When core.completion observes the finish thresholds met, it records an evidence fingerprint (the completion-relevant scores, worker count, and verification state). A later assessment whose scores dip below the thresholds -- the noisy idle reassessments semantic scoring produces -- may still finish the run, but only while that fingerprint still holds: no new workers have run and no recorded score has regressed beyond a 0.20 tolerance. If the evidence moves on, the authorization is discarded instead of carried forward, so one transient high score can never permanently authorize finishing after the evidence changes. State is owned by the CompletionResponsibility instance (which persists across evaluation cycles within a run); re-routing responsibilities resets it, failing closed.
JARosen
left a comment
There was a problem hiding this comment.
I do not see a reachable runtime path that consumes the sticky state. It is captured in the same responsibility call that proposes FINISH, and the runtime immediately applies that directive and exits. If a higher-priority directive wins, it either terminates the run or starts another worker, which invalidates the fingerprint.
Please add an end-to-end runtime test demonstrating a real sequence where completion is captured, the run remains active without new work invalidating it, and a later assessment uses the sticky authorization. If no such lifecycle exists, I think this feature should be closed rather than retaining currently unreachable state.
|
Thank you for pushing on this — I traced the full lifecycle through the runtime and agree: there is no reachable path that consumes the sticky state. Closing per your suggestion rather than retaining unreachable state. The trace, for the record:
The existing unit tests pass only because they call |
Supersedes part of #19, per your review: the "sticky completion needs careful semantics" change, rebuilt from current
mainthrough the responsibility architecture, with no helper scripts.What it does
core.completionobserves the finish thresholds met, it records an evidence fingerprint (_StickyCompletion: completion-relevant scores, worker count, verification state) owned by theCompletionResponsibilityinstance.FINISH, but only while the fingerprint still holds: no new workers have run since capture, and no recorded score has regressed beyond a 0.20 tolerance (_STICKY_EVIDENCE_TOLERANCE), withneeds_verificationsimilarly bounded from rising.self._sticky = None) instead of carried forward — one transient high score can never permanently authorize finishing after the evidence changes.FactoryPolicy); responsibility re-routing rebuilds it, which safely resets the sticky state.Validation
tests/test_completion_sticky.py, including the transient-spike-then-evidence-change case; full suite 176 passed,ruff checkclean.builtin.pyin disjoint regions; trivial rebase available on request if merge order creates conflicts.