← Back to Pull requests

test(runtime-host): attribute Windows startup stalls #3454

Closed
unknown closed this pull request without merging on Aug 23, 2026 07:02 UTC
View on GitHub
unknown unknown commented on Aug 21, 2026 23:37 UTC
Author

Summary

Preserves bounded structured evidence for Runtime Host election timeout failures.

The diagnostic records the observed startup cut with the exact Candidate PID/attempt identity and exit state, final election elapsed time, endpoint-connected observation, reconcilable election result counters, and the last safe registration summary. Desktop and CLI startup errors include the same bounded JSON.

This PR is diagnostic-only. The Candidate single-flight behavior fix from #3512 is already merged into main; this PR does not change that behavior, the 45-second election deadline, retry/respawn policy, candidate backoff, endpoint behavior, public wire protocol, failure classification, or cleanup ownership.

Refs #3279.

Diagnostic contract

  • Endpoint evidence is written at the connection phase: registration/read/connect failures record false; draining, incompatible, and post-connect handshake failures record true. The internal phase field is stripped from the existing public connection result.

  • totalResults is reconciled by notRegistered + connectFailed + handshakeFailed + connected + deadlineElapsed + otherResults. readyWaitFailed is a separate post-connection phase counter and is intentionally outside that sum.

  • Candidate PID and startup attempt identity are preserved; the latest attempt is reported as running, exited, or unknown with bounded exit code/signal data.

  • The diagnostic never includes the runtime root path or endpoint value.

  • Candidate stderr remains outside this PR because detached launch I/O and lifecycle ownership are unchanged.

  • No Node stress harness is shipped. Packaged Electron evidence remains owned by the existing Release Windows check lane.
  • Scope decisions

    The merged #3512 behavior fix owns per-election Candidate single-flight. This PR retains only its diagnostic observation and regression evidence; it does not reimplement or broaden the behavior fix. Cross-client coalescing, full LaunchLease architecture, detailed phase timestamps, and retry/deadline policy changes remain deferred to #2142 or #3279 follow-up work.

    Verification

    Exact head 8a5a275926f7abef0109b496acd84dc86cae535a, rebased onto main f19eede03a829c226be39f001b2684860a3aa1d5:

  • Runtime Host build and typecheck passed.

  • Maka CLI build passed.

  • npm run lint: 2,583 files, 0 errors.

  • npm run format:check: 1,591 files, 0 changes.

  • ASF header gate: 2,717 covered / 114 excluded.

  • CI planner + Windows harness: 60 passed, 0 failed, 1 privilege-dependent symlink skip.

  • Windows inventory: 3 passed; 63 declarations current.

  • Counter reconciliation and endpoint phase tests passed.

  • Startup-error tests: 6 passed.

  • CLI Runtime Host context: 31 passed.

  • Desktop Runtime Host manager: 22 passed.

  • git diff --check passed.

  • Independent exact-head author-gate: no introduced P0-P2 findings.
  • Local limitations:

  • The full Runtime Host suite was not claimed as a complete local pass: it reached at least 149 passing tests before the known local execution-composition hang/no-output condition.

  • A few forged-handshake tests still show the machine's known Windows endpoint-probe read_eof timing noise; the new root-mismatch writer tests pass 2/2.

  • One existing owned-candidate startup test and two existing host-kernel tests are load/permission-sensitive locally. These are not introduced by this diagnostic diff; authoritative evidence is fresh CI.
  • L3 gate

  • Core CI 32607957602 passed in 11m45s, including the full Runtime Host suite and merged-result checks.

  • Release Windows check 32607957610 passed in 11m38s, including packaging, packaged smoke, pinned upgrade/uninstall, and automatic update end to end without a Candidate storm.
  • Fresh exact-head L3 evidence is green. The remaining gate is normal human review.

    AI use

    Select exactly one:

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Codex implemented the bounded diagnostic, addressed review findings, rebased it after the #3512 behavior fix, removed the exploratory Node stress harness, ran local validation, and used independent author-gate reviews. The commits include Generated-by: Codex trailers.

    Checklist

  • Tests cover the diagnostic boundaries and fail without them

  • Lint, format, typecheck and affected suites pass where locally runnable
  • Does this PR entail a change in behavior?

  • Yes — startup errors now carry bounded diagnostic evidence

  • No
  • Diff: 588 lines (+441 / -147) across 7 files Reviewer: liugddx Review duration: 1885m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 588 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.382
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3454"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.0% (MEDIUM) · Higher = larger blast radius
    50.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.6% · Safe to merge
    21.6%
    Repository