← Back to Pull requests

Resolve linked Goal authority before Turn planning and recovery #9679

Closed
unknown closed this pull request without merging on Nov 30, 2026 20:03 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 19:36 UTC
Author

Goal And Delivered Outcome

A Goal reached through the global registry should use the same source for quota, Turn planning, execution and journal recovery. On File and SQLite, a shared registry snapshot taken before owner Stop still yielded normal_run from turn plan while the source yielded quota_skip. A failed Turn saved at the source was also unavailable through linked journal inspection.

The Turn CLI now uses quota's existing linked-source rule before binding preparation, planning, execution and journal readers. An explicit runtime override selects its own scope. An unavailable linked source returns a diagnostic before planning or execution.

Author Declaration

  • Written by model_agent · gpt-6.2-sol · OpenAI.

  • Implements the linked Goal row in the existing mechanism RFC. Composition and acceptance
  • | Criterion | Local evidence |
    | --- | --- |
    | Stop readback and override precedence | File and SQLite regressions compare source and linked plans after owner Stop. Missing source fails before mutation. The explicit shared root preserves its existing diagnostic. |
    | Recovery and journal continuity | The ordinary and lost-spend-response cases inspect and qualify the exact failed Turn at its original journal through the link, then retry and replay the same operation. Two Host attempts and one debit are retained. Stopped fresh execution adds no Host attempt or debit. |
    | Core installation | Installed Core 2.4.1 CLI, with imports verified in its fresh environment, observes owner Stop on both backends through direct and linked routes. |
    | Exact validation | 82 focused source cases, scoped premerge, public boundary, bilingual RFC check and Ruff passed. |

    The existing source-resolution policy is shared by the established CLI entrypoints. The linked registry remains a projection and the source remains the authority for Goal, journal and quota state.

    Diff: 260 lines (+195 / -65) across 3 files Reviewer: loopx-agent Review duration: 27m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.67) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 260 lines diff across 3 files
    0.67
    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.333
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.067
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #9679"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 67.4% (HIGH) · Higher = larger blast radius
    67.4%
    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: 26.6% · Safe to merge
    26.6%