← Back to Pull requests

I02: prediction envelope for a naturalist that predicts interventions #135

Closed
unknown closed this pull request without merging on Nov 02, 2026 00:21 UTC
View on GitHub
unknown unknown commented on Nov 01, 2026 22:33 UTC
Author

What


A prediction-envelope bench for the naturalist tooling, built on the existing proposer code (tools/lib/propose.ts) rather than a parallel stack:
  • Fixed evidence envelope (registered frame samples, census series, config, allowed intervention menu).

  • Structured prediction schema (subject/time, direction, readout, intervention, confidence, abstain) and a host validator that accepts only menu interventions and rejects malformed or out-of-menu proposals.

  • Deterministic baseline proposers: fixed rule, numeric-only trend, shuffled-evidence control.

  • Scoring: Brier, directional accuracy, coverage/abstention, invalid counts.

  • Known-mechanism fixtures with outcomes from paired sim-ref CPU replays (lesions/feeds/wounds/drains); whole-history dev/test splits, no window leakage.

  • Prediction/outcome JSONL, comparison table, static HTML report of failed and successful predictions, and a typed model-proposer adapter seam (unrun).

  • CLI: tools/predict.ts. Frozen protocol and v0 results under experiments/prediction-envelope/; plan, evidence and review under docs/prediction-envelope-2026-11-01/.
  • Why


    Report section "I02 - A naturalist that predicts interventions" in /Users/nicholas/develop/browser-life-backlog-run-2026-11-01/docs/simulation-research-2026-11-01/report.md and its Agent execution contract; coordinator decision log (/Users/nicholas/develop/browser-life-backlog-run-2026-11-01/docs/backlog-run-2026-11-01.html) decisions D1, D3, D7. No model calls, no dynamics change: RULE_VERSION and golden pins untouched.

    Checks


    Run locally after rebasing onto origin/main (head bc9e6bc0):
  • pnpm typecheck, tsc -p tools/tsconfig.prediction.json, deno check tools/predict.ts: clean

  • pnpm vitest run tools/test/prediction: 9 files, 107 tests passed

  • v0 regenerated (EXPLORATORY, 32 families, 192 cases, about 5 minutes); all eight canonical.sha256 digests verify

  • Full pnpm test -- --maxWorkers=2: 4276 passed, 8 timeouts under load in unrelated files (sim-ref shape and takeover, runner cells, lineage, lab execution); all five files pass alone (85 tests)
  • Reviews


    Sol 6.1 xhigh plan, source, fix and cohort reviews (F1-F3 CLOSED; second follow-up: no P1, one P2 and two P3, fixed); raw outputs and dispositions are in docs/prediction-envelope-2026-11-01/REVIEW.md.

    Not in this PR


    Any model proposer run or paid API call, lab/Field notes integration, deploys, physics changes, preregistration edits. Not a held-out confirmation: the dev and test families were inspected, so v0 stays EXPLORATORY; a confirmation needs fresh families under a dated amendment.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added a command-line workflow for generating and validating prediction evaluations, with reproducible results and HTML comparison reports.
    Evaluation reports include prediction scores, measured outcomes, and diagnostics; exploratory results are clearly distinguished from confirmed results.
    Documentation
    * Added evaluation protocol, evidence, and review notes, including the limits of the current test results and requirements for confirmation.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 413 lines (+309 / -104) across 5 files Reviewer: treetopdevs Review duration: 108m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 413 lines diff across 5 files
    0.45
    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.361
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #135"
    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: 44.9% (MEDIUM) · Higher = larger blast radius
    44.9%
    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: 17.7% · Safe to merge
    17.7%