← Back to Pull requests

fix: decoded-string secret gate, explicit goal-cut bound and checkpoint prune margin (1/4) #226

Open
unknown opened this pull request with 415 lines diff across 5 files
View on GitHub
unknown unknown commented on Nov 30, 2026 13:49 UTC
Author

Later work left by the reviews of #222–#225: the switch goal cut, the VP-S29 secret gate, and checkpoint prune under a brief clock step.

Chain context

  • Strategy: stacked PRs to main. This PR runs from f700fd1 to 346433b and is first in the chain.
  • main (f700fd1)
     └─ 📍 PR 1/4  fix/checkpoint-restart-final-batch-a  f700fd1..346433b  (282 lines)
         └─ PR 2/4  fix/checkpoint-restart-final-batch-b  346433b..38eeddc  (768 lines)
             └─ PR 3/4  fix/checkpoint-restart-final-batch-c  38eeddc..a5db726  (563 lines)
                 └─ PR 4/4  fix/checkpoint-restart-final-batch-d  a5db726..5785e61  (763 lines)
    

  • Size: 282 changed lines (236 added, 46 removed), within the 400-line budget.
  • What changes

  • Goal cut (scrubbed_goal).

  • - The cut now walks down from the prompt cap to an empty goal, whose scrub always fits. Termination no longer rests on a loop invariant.
    - The comment says that only the authorization rule can grow a cut, by at most 10 bytes. It also explains why a cut inside an authorization value can end the goal at its label.
    - Outputs are unchanged.
  • VP-S29 secret gate.

  • - The gate ran findSecrets on the JSON text, where escapes change what the patterns see:
    - a tab after authorization: failed the gate;
    - a newline before a digest read as a long run;
    - Bearer followed by a tab was missed.
    - It now parses the observation and the summary and scans every decoded string, keys included.
    - findSecrets(text) still covers the brief and the redacted transcript.
  • Checkpoint prune margin.

  • - A clock stepped back for a moment at prune time made the newest checkpoints look future-dated, so prune deleted a recent one before the oldest.
    - An id now counts as future-dated only when it is more than 300 seconds after the current time.
    - A longer rewind still prunes future-dated ids first.

    Checks

  • Suites (whole chain):

  • - cargo test --workspace --all-targets --all-features: 2,204 passed.
    - clippy: clean, also for x86_64-pc-windows-gnu and aarch64-apple-darwin.
    - node --test on the procedures: 427 passed.
  • RED before each fix:

  • - Gate: the two false positives failed with expected: 0, actual: 1, and the missed bearer token with expected: 1, actual: 0.
    - Prune: the test expected old to be deleted, while the old rule deleted a recent checkpoint instead.
  • The goal cut changes no output:

  • - 300,000 near-cap goals are byte-identical to f700fd1, and so are the independent verifier's 228,298.
    - A mutation that stops re-scrubbing each cut fails the new test.
  • Independent verification: no blockers.

  • Native review (risk, resilience and reliability lenses): approved.
  • Risk

  • Gate. It decides whether a VP-S29 observation may be written.

  • - It is now stricter for patterns inside one string.
    - It no longer sees a pattern split across two JSON strings. Every key of the observation is defined in code.
  • Prune deletes stored checkpoints. This is a native review advisory, bounded by the margin: with a step back under 300 s and more than 16 saves inside that window, a save can prune the previous post-step checkpoint before the pre-step ones.
  • Out of scope (later work)

  • A gate test for a secret-named key holding a short plain value (native review advisory).
  • Diff: 415 lines (+311 / -104) across 5 files Reviewer: chatgpt-codex-connector[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.47 = Change Risk (0.68) × (1 − Review Confidence (0.30)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 415 lines diff across 5 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 52% · Reviewer familiarity: 35%
    30%
    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.344
    Sensitive Paths sensitive_paths
    0.068
    Real PR Conversation Timeline
    1 comments
    "Review active on #226"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 30.3% 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: 68.1% (HIGH) · Higher = larger blast radius
    68.1%
    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: 30.3% · Lower = rushed or shallow review
    30.3%
    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: 47.5% · Moderate risk
    47.5%