← Back to Pull requests

Recognize nested linked worktrees during peer admission #9678

Open
unknown opened this pull request with 206 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 30, 2026 19:35 UTC
Author

Problem

An Agent can create a valid linked Git worktree beneath the Goal checkout, follow the workspace recovery instruction, and still be asked to move. For a Todo that inherits the Goal repository, quota admission previously treated directory containment as shared-checkout identity. The same worktree passed when placed beside the Goal checkout.

Change

Resolve the current and registered Git top-level paths. Equal roots identify the shared checkout. For distinct roots, compare their Git common directories before admitting the workspace. This uses the existing Git readers and preserves the Goal write-scope and lease checks.

Validation

  • Reproduced the loop on the prior code. The nested worktree returned agent_workspace_repair after relocation while the sibling worktree passed.

  • Exercised the ordinary CLI on File and SQLite. From a nested linked worktree, a Todo without task_repository can claim, write back and settle with its original Turn identity. Retrying settlement appends one spend in total.

  • A normal subdirectory of the main checkout still requires relocation. A linked worktree from a foreign repository still receives repository-specific recovery guidance. A nested same-repository worktree still requires a matching Goal write scope.

  • Local validation includes the focused workspace/settlement tests, Ruff, mypy and the standard diff-selected premerge gate.
  • The 18 focused cases and 41 adjacent workspace and settlement cases passed. The standard gate reported one inherited, nonblocking module-size advisory for loopx/status.py. The exact-scope change-quality receipt is cqr_a05399eb26ad17006bdc.

    Diff: 206 lines (+154 / -52) across 2 files Reviewer: loopx-agent Review duration: 525m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 206 lines diff across 2 files
    0.36
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.319
    Real PR Conversation Timeline
    1 comments
    "Review active on #9678"
    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: 36.4% (MEDIUM) · Higher = larger blast radius
    36.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: 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: 19.4% · Safe to merge
    19.4%