Repository navigation
Plan 3 W13 WP 13.1: a run's ending says what ended it, and a stop time no longer reads DAWN CUTOFF (#1313, #1302) - #1365
Merged
Merged
Conversation
…the toast and the reports say it, and a stop time no longer reads DAWN CUTOFF (#1313, #1302) The engine knew why a run ended and published only an enum: an unsafe stop read "Something interrupted the sequence and it couldn't continue. Check the event log", and a run stopped by its own stop time or its run-length cap was labelled DAWN CUTOFF. Server. _ending_cause builds (end_cause, window_end) once per ending and hands the pair to both the terminal _set_state and _finalize_report, so the state and the stored report cannot disagree. end_cause is words: fixed phrases for an operator's stop, a shutdown, a window boundary and set-aside targets; an exception's own message for unsafe, quality and error, on one line and clipped to 400 characters, led by the class name when the exception is not one of ours and equal to the class name when the message is empty. It never reads SlewRefused.site_detail. window_end names the boundary that closed a dawn_cutoff. abort() takes an optional cause. A complete run publishes no new key, so the golden traces are unchanged. Reports written before the fields load as before. UI. diagnoseFailure takes the cause: with one, the card states it and keeps a keyword rule's fix only when one matches; without one it is the card it was. The classic Monitor and Sequence cards, the new Live card, the plan header and the error toast use it. endReasonMeta takes window_end: STOP TIME, RUN-LENGTH CAP, TARGETS SET, WINDOW CLOSED, and DAWN CUTOFF only for dawn or a report without the field. Both report views draw the cause under the pill for unsafe, error, quality, cooling skip and incomplete. Follow-ups filed: #1357 (the remaining surfaces), #1358 (free exception text reaches every role). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K7CHb44VFtZLGUDLF4us2p
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1313. Closes #1302.
What was wrong
The engine knew why a run ended and published only an enum.
What changes
Server.
_ending_causebuilds(end_cause, window_end)once per ending and hands the pair to both the terminal state and the stored report, so the two cannot disagree.end_causeis words. Fixed phrases for an operator's stop, a shutdown, a window boundary and set-aside targets. For unsafe, quality and error endings it is the exception's own message on one line, clipped to 400 characters; led by the class name when the exception is not one of ours, and equal to the class name when the message is empty.SlewRefused.site_detail. A test plants figures there and scans the state and the report for them.window_endnames the boundary that closed adawn_cutoff: dawn, stop time, run-length cap, targets set.abort()takes an optionalcause. All five callers are operator actions, so the default says "stopped on an operator's request".completerun publishes no new key, so the golden traces are unchanged. A report written before the fields loads as before.UI. With a cause, the failure card states it and keeps a keyword rule's fix only when one matches; without one it is the card it was. The classic Monitor and Sequence cards, the new Live card, the plan header and the error toast use it. The report labels read STOP TIME, RUN-LENGTH CAP, TARGETS SET or WINDOW CLOSED, and DAWN CUTOFF only for dawn or a report without the field. Both report views draw the cause under the pill for unsafe, error, quality, cooling skip and incomplete.
What a viewer can read
The cause for an error ending is the same text the run's log line and
state.detailalready serve to every role, live and from the night log. Nothing new is exposed; one more durable place holds it. Whether a viewer should read free exception text at all is filed as #1358.Tests
test_w13_1_end_cause.py, 22 tests through the real engine (operator stop, shutdown, safety stop, refused slew, error with and without a message, quality, stop time, dawn, run-length cap, complete, the next run, old reports, a viewer principal, the label mirror).end_reason, the report finalizer or a golden trace, and the full UI suite (796 files, 9656 passed). Typecheck clean.Mutants, each from a byte backup and restored byte-identical:
_ending_causereturns nothing for every endingdiagnoseFailureignores the causeendReasonMetaignoreswindow_endOne mutant survives and is accepted: removing the line that drops
end_causeat a non-terminal transition.start()replaces the whole state, so the line is a guard beside the existing one forend_reason; the behaviour itself is asserted bytest_the_cause_does_not_ride_into_the_next_run.Real browser
tools/ui_probe/probe_w13_1_end_cause.pydrove a private simulator server through a real unsafe stop and a real stop-time run. At 1440x900 and 390x844 the classic Monitor card and the new Live card read "Simulated: the cloud sensor tripped." with no event-log advice, both report views show the cause under the pill, and the stop-time run reads STOP TIME. The screenshots were opened and looked at. The classic Sequence view and the plan header are covered by DOM tests only.Follow-ups filed
end_cause) on the remaining surfaces, and letabort()callers name theirs #1357: the recoverable card, the push alert and the health strip still say less than the engine knows;abort()callers could name their cause.🤖 Generated with Claude Code
https://claude.ai/code/session_01K7CHb44VFtZLGUDLF4us2p