← Back to Pull requests

Host type checking #1380

Open
unknown opened this pull request with 344 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 18, 2026 11:33 UTC
Author

<!-- This is an auto-generated description by cubic. -->

Summary by cubic


Adds a host-type-checking feature to monty-proto so a worker can serve type-checked sessions without linking ty. Instead of checking locally, the worker parks each feed and sends a host-internal WorkerEvent.host_type_check carrying everything the check needs; the host runs ty elsewhere and answers with ClientRequest.host_type_check_result, after which the worker either runs the snippet or ends the turn with the typed diagnostics.

  • New Features

  • - monty-wasm-runtime exposes host-type-checking for size-sensitive hosts that build with --no-default-features.
    - monty-type-checking moves ty and its dependencies behind an optional, default-on checker feature so scan_imports is available alone.
  • Both messages are host-internal and never reach a client, so only a host able to answer them may build this way; type-checking wins when both features are enabled.

  • Every host_type_check field is untrusted worker output, so the host must bound the check itself (nesting depth, memory, time); the worker's nesting check and allocator ceiling don't cover it.

  • The wasm component retires on a fatal event, so a worker parked on a HostTypeCheck that a typed export can't answer isn't reused.

  • The new test suite (cargo test -p monty-proto --features host-type-checking --test host_type_checking) plays the answering host, covering stubs, module stubs, dumps, aborts, and protocol violations, and is wired into CI coverage and testcov.
  • <sup>Written for commit 70dc48b0919fc4ab492719ae057f3e2ec210ccb4. Summary will update on new commits.</sup>

    <a href="https://cubic.dev/pr/pydantic/monty/pull/1380?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/pydantic/monty/1380?returnTo=https%3A%2F%2Fgithub.com%2Fpydantic%2Fmonty%2Fpull%2F1380&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>

    <!-- End of auto-generated description by cubic. -->

    Diff: 344 lines (+258 / -86) across 4 files Reviewer: samuelcolvin Review duration: 17530m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.47) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 344 lines diff across 4 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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.350
    Shallow Review Depth shallow_review_depth
    0.344
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #1380"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 47.3% (MEDIUM) · Higher = larger blast radius
    47.3%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 25.2% · Safe to merge
    25.2%
    Repository