← Back to Pull requests

A start scope can cover the whole estate #450

Closed
unknown closed this pull request without merging on Nov 13, 2026 20:22 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 17:57 UTC
Author

Summary

  • all_repositories: bool on a RecordingStartScope: the principal's recording (and, since #449, approval) authority covers every registered repository, not only the listed repository_ids. _in_start_scope and the approve door's grant check both honor it; the assets stay the gate either way — and a fleet-wide order (no repository) stays a person's release: f5819f0d (the round-2 guard) requires a non-null repository before either grant branch, so not even an estate-wide scope releases one.

  • Found live on integration: the platform ServiceAccount's grant is a ~2,000-UUID snapshot that drifts as the portfolio grows — the auto-approval loop (traust-security/traust-foundry#58) was refused on every awaiting order whose repository postdated the list. The flag is the durable fix; the deployed config carries a refreshed list until this lands.

  • Depends on the contracts schema flag: traust-security/traust-contracts#149 (in review). This PR's tests build scopes directly (no config-file load), so it is green against the current pin; the deployable combination is both merged and core's pin moved. The Config.from_file regression for the real YAML path is in (f5819f0d), strict-xfail — it fails the suite the moment a pin-bump makes the key loadable, so the pin move cannot forget the YAML path.
  • Tests

  • test_an_estate_wide_scope_covers_every_repository — a repository no snapshot lists is covered, while an unlisted asset is still refused.

  • test_a_serviceaccount_does_not_approve_a_fleet_wide_order — parametrized over the flag: not even an estate-wide scope releases a fleet-wide order (the round-2 guard's regression; the estate-wide variant fails on the pre-fix code).

  • test_an_estate_wide_recording_start_scope_loads_from_deployment_yaml — the deployment-YAML path, strict-xfail against the current contracts pin (the dependency above).

  • test_plan_refuses_an_order_for_an_unregistered_repository — the boundary under the review's third finding: an order cannot exist for an unregistered repository (the table's foreign key refuses the UUID at plan), so a grant — estate-wide or listed — enumerates registered repositories only.

  • Full suite: 14301 passed, 2 skipped, 1 xfailed (the YAML tripwire).
  • 💘 Generated with Crush

    Diff: 284 lines (+213 / -71) across 3 files Reviewer: chubirka Review duration: 144m
    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 · 284 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.338
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #450"
    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: 39.7% (MEDIUM) · Higher = larger blast radius
    39.7%
    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.7% · Safe to merge
    15.7%