fix(deploy-tab-diff): capture-time coverage gate with --allow-uncovered override - #581
Merged
Conversation
…ation Validated 17 load-bearing assumptions (15 verified, 2 falsified) against the script, callers, server source, and tooling. Fixes: - A5(a) falsified: uncovered session-bearing terminals (sessionRef) keep a manually recoverable session post-restart; only the pane/PTY dies. Messaging now truthful; enriched report gains a session=<provider|none> recoverability split (field verified in /api/terminals serializers). - A13(d) falsified: no tsconfig covers test/**, so Task 1's typecheck step was a no-op; replaced with an honest note (vitest esbuild is the only type gate for tests). - Noted the server config globalSetup build cost on first single-file run. Ledger: .worktrees/.the-usual-logs/capture-coverage-gate/load-bearing-ledger.md
…red override (exit 4)
…red in header/usage
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.
Summary
Coverage gate for the deploy-tab-diff safety script. Fixes production issue where
scripts/deploy-tab-diff.sh captureexited 0 even when running terminals were covered by no persisted snapshot pane — the coverage guard only ran inverify, AFTER the restart, when the uncovered PTYs were already dead.Changes
capture-time coverage gate:
capturenow runs the same coverage guard on the state it just fetched and exits with distinct code 4 when uncovered terminals exist, printing an enriched failure report that distinguishes recoverable terminals (have session refs — claude/codex/etc., recoverable via the session ledger) vs unrecoverable (plain shells).Artifact always written first: The capture artifact is written to disk before the guard runs, enabling diagnosis even when the guard fails.
--allow-uncovered override: New flag provides informed-consent override (warns on stderr, exits 0). Users can proceed with restart if they understand the risk.
Shared coverage function: The coverage jq is extracted into a shared
uncovered_terminals()function used by both capture and verify paths (no copy-paste divergence).Documentation updated: Header docs and usage message updated to explain exit 4, coverage gate semantics, and --allow-uncovered.
verify guard unchanged: Defense in depth —
verify's guard remains active as a final safety net.Testing
Files
scripts/deploy-tab-diff.sh: Core gate logic, --allow-uncovered flag, shared functiontest/unit/server/deploy-tab-diff-coverage-gate.test.ts: Comprehensive test coveragedocs/plans/2026-07-29-capture-coverage-gate.md: Implementation planscripts/deploy-tab-diff.shheader: Updated usage docsNote
A pre-existing failure in
terminal-font-settings.test.tsxon main was discovered during testing, not introduced by this change. Also noted: CI does not run the server test suite.