← Back to Pull requests

feat(runtime-host): add durable event-wait observation #6113

Closed
unknown closed this pull request without merging on Oct 17, 2026 03:03 UTC
View on GitHub
unknown unknown commented on Oct 15, 2026 07:44 UTC
Author

Summary

PR1 introduced durable wait records. This PR adds an internal Host manager that observes those waits and persists condition outcomes without invoking the work model.

  • Define source adapters for authoritative reads, optional notifications, and snapshot or history reconciliation. Initial reads, polling, notifications, and restart recovery use the same verification path.

  • Bound observation with deadlines, attempt budgets, concurrency limits, backoff, and shared Retry-After. Persist checkpoints and source limits so restarting does not reset them.

  • Preserve cancellation, immutable results, and lease enforcement across timeouts, late callbacks, storage failures, and shutdown. Extend the existing SQLite and independent memory stores, migrating workflow schema 13 to 16 while retaining existing records.
  • With fake adapters, this covers discovering a wait, observing an already-satisfied or changing condition, recording the result, and recovering after restart. Production source integrations follow in later PRs; tool yield, Goal continuation, and successor admission belong to PR3.

    Refs #5926 — PR2: Host observation and condition management.
    Design context: Discussion #5920 — Condition-driven waiting and wake-up.

    Verification

  • Rebuilt core, storage, and runtime-host; their typechecks passed.

  • Passed 368 targeted tests covering contracts, provider parity, migrations, Session bundle isolation, observation, cancellation, and recovery.

  • Passed Biome checks for all 13 changed files and git diff --check.

  • Passed three additional controlled-clock scenarios with finite storage failures: all 36 waits resolved, with no observed read-spacing or shared Retry-After violations.
  • Full repository checks and Desktop E2E were not run. Production adapters and PR3 execution admission are outside this PR's validation scope.

    AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex assisted with implementation, tests, regression fixes, and review. The commit includes a Generated-by: OpenAI Codex trailer.

    Checklist

  • Tests cover the change and fail without it

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

  • Yes — described under Summary above

  • No
  • Diff: 307 lines (+230 / -77) across 3 files Reviewer: Astro-Han Review duration: 2599m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 307 lines diff across 3 files
    0.40
    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%
    60%
    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.343
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6113"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 40.2% (MEDIUM) · Higher = larger blast radius
    40.2%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.9% · Safe to merge
    15.9%
    Repository