← Back to Pull requests

[SCR-615] Add directory-submit lib and run loop #617

Open
unknown opened this pull request with 224 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 23, 2026 02:04 UTC
Author

Closes #615

What


Adds scripts/directory-submit/ with a shared lib, a ledger writer, a run loop and a README. The lib holds the browser call, ref lookup, packet loader, settings and Gmail reader. The loop stops on the first rate limit and retries failures.

Why


The round 3 helpers lived in /tmp/b3 and would be lost on restart. They also held a personal mailbox address and wrote a per-site CSV through bun. This version reads the packet JSON, takes settings by name from the environment or the secrets file, and writes the fleet ledger directly.

How I verified


Command: python3 run.py stub_e2e against five fake sites in a temp repo and a temp ledger, using a throwaway driver (not committed) that succeeds, fails once, hits a rate limit, and always fails. Results:
  • Run 1: sites a and b filed (b after one retry), c raised RateLimited. c got a blocked row with retry_after 2026-10-23, exit 3, d and e stayed pending.

  • Run 2: only d and e were pending. d filed, e failed and wrote nothing, exit 1.

  • After I moved c's retry date into the past, c was pending again. With --dry-run the ledger file stayed byte-identical.

  • ledger.record refused a note holding password=... and an empty note.

  • lib.packet() loaded all 20 real packets from a pooriaarab/directory checkout with no failures (for example agentsandboxes: name, url, contact, short 112 chars, long 348 chars).

  • A missing setting errors with its name only.

  • Not re-run live: the browser calls need the owner's Chrome, and another agent drives it now. The drivers arrive in the next PR (#616).
    Operator: not applicable - local helper scripts, no user-visible surface and no deployed service.
    Proof: n/a - command output above is the evidence, there is no UI.

    Assisted-by: claude-personal-1:claude-sonnet-5-5

    Diff: 224 lines (+168 / -56) across 2 files Reviewer: claude[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.37) × (1 − Review Confidence (0.42)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 224 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 95% · Reviewer familiarity: 35%
    41%
    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.324
    Real PR Conversation Timeline
    1 comments
    "Review active on #617"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 41.8% 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.9% (MEDIUM) · Higher = larger blast radius
    36.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: 41.8% · Lower = rushed or shallow review
    41.8%
    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: 21.5% · Safe to merge
    21.5%