Repository navigation
fix: avoid stale open-span failures after shutdown - #235
Merged
Merged
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Contributor
Author
|
Fixed: completed shutdown diagnostics now determine terminal span failures while preserving execution and cleanup failures. |
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 #234
What Problem This Solves
Kova could finish candidate shutdown and diagnostics export yet fail a run because a required span was open in its earlier snapshot. Finalization reused that snapshot, and the preliminary diagnostics verdict had already changed the record to
FAIL.User Impact
A span that closes before confirmed terminal export is now evaluated from the completed timeline. Truly open required spans and execution, cleanup, or resource-evidence failures remain nonpassing. Existing failure profiling and environment retention decisions are preserved, as are precleanup CPU/RSS samples and thresholds.
Why This Change Was Made
Precleanup evaluation now supplies a provisional status for profiling and retention without changing the execution-owned status. After successful stop/export, finalization reloads only the timeline and updates its collector receipt before evaluating the final record. The earlier timeline is retained through the existing phase schema so rotation cannot discard attribution or historical diagnostic maxima.
This keeps terminal evidence and status ownership in the current lifecycle. It changes no report fields, dependency, configuration option, span-matching rule, or resource policy.
Evidence
The existing OCM transport fixture drives the production runner through collection, confirmed stop, export, destruction, and finalization. With unchanged maintained production code, a matched span closed during stop still produces
FAILwithopenclawOpenRequiredSpanCount=1. The corrected path passes that case.The same fixture covers truly open spans, missing and failed exports, execution and cleanup failures, missing CPU evidence, failure retention, failure profiling, and rotated timelines. A normal
kova run --executereport check verifies completed span serialization while preserving the fixture's genuine startup failure. These are fixture-backed lifecycle checks; they do not claim a new full live-Gateway campaign.Remote syntax/whitespace checks, the transport owner test, and the existing timeline, OCM, and resource selfchecks pass. The existing retention-order and protection assertions were adapted to the provisional-status argument and pass unchanged in purpose. Independent review is clean. The final head passed all Linux Node22/24/26 and macOS Node24 test rows, including package-install smoke tests, plus Website and CodeQL checks.