Skip to content

fix: avoid stale open-span failures after shutdown - #235

Merged
shakkernerd merged 2 commits into
mainfrom
ci-kova-terminal-diagnostics
Nov 2, 2026
Merged

shakkernerd merged 2 commits into
mainfrom
ci-kova-terminal-diagnostics

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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 FAIL with openclawOpenRequiredSpanCount=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 --execute report 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.

@clawsweeper

clawsweeper Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 2, 2026
@shakkernerd
shakkernerd merged commit 8bf5c93 into main Nov 2, 2026
14 checks passed
@shakkernerd
shakkernerd deleted the ci-kova-terminal-diagnostics branch November 2, 2026 02:28
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: completed shutdown diagnostics now determine terminal span failures while preserving execution and cleanup failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: evaluate terminal diagnostics after candidate export

1 participant