← Back to Pull requests

feat(freshness): bind work reads and recover original-Turn settlement #5677

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 05, 2026 11:54 UTC
Author

Default freshness keeps a valid result while the original Agent reads current requirements, judges direction and settles the original Turn once. A retained result is readable before it is qualified for a debit; cold CLI recovery must preserve that difference.

本轮将原 PR rebase 到官方 main 225698b31,修复指定 Windows CI 的更新激活夹具兼容,并补齐原回执收尾、deferred 结算后等待及当前 packaged 恢复点击验证。保留默认 freshness、已通过的方向 P1 和批量观察,不删除平台保护。

Current head: ebb8375797936aea79a0f3de04fd007aa30d2e26. The Windows CI source was 1bacd16; its four pip/pipx failures are addressed by the target's existing 372c26d08 fixture repair. This update also closes the integration gap between freshness-protected completion receipts and the target's same-Turn closeout/replan recovery.

Behavior and owning boundaries

  • Keep the original snapshot, checkpoint, completion receipt and typed settlement owner. Ordinary results can carry a deferred checkpoint without a Todo no-followup marker. Closeout now restores only the original receipt's missing read key/defaults and requires its complete fingerprint; actor, lease, evidence and validation changes still fail. The shared replan owner reuses both registered completion-recovery kinds.

  • Deferred work can require recovery of an already admitted Turn without granting new Todo execution. The real File/SQLite test now checks cache invalidation, original identity, post-result read, direction and one debit, then proves a fresh Turn still waits until 2099.

  • Keep Windows archive rejection enforced. Pip/pipx activation fixtures come from the actual package manager. The kernel-lock fixture shuts down the holding interpreter through its own input channel, covering Windows venv redirectors without changing production locking.

  • Preserve complete heartbeat instructions, 320-character scope, all five capabilities and explicit CLI routes. Matched body measurements are 4,850→4,939 characters; the 48-character route extension remains over budget at 5,131. Only measured presentation allowances change; instructions, semantic/line/growth guards and the host hard limit remain.

  • Fix the peer smoke's ignored caller working directory. Its existing successor/review oracles now run from their declared producing workspace.
  • Current validation

    Counts overlap and must not be summed into an outcome or efficiency claim. Runtime production blobs exercised at the terminal-integration snapshot are identical to this head; subsequent changes are validation, image evidence and the target's media smoke.

    | Evidence | Result and scope |
    | --- | --- |
    | Complete native Windows lifecycle CI step | 419 passed / 23 skipped, 512.58s, after rebase and fixture repair; same 15 modules as the failed job. Three extra directory-symlink skips reflect this host's privilege boundary. This precedes the final terminal integration below. |
    | Final terminal/P1 full CLI matrix | 24 passed / 0 skipped, File/SQLite: both closeout routes, 0/1/4 historical completions, blocker recovery and literal executable replan commands with/without validator. Original identity and one debit remain. |
    | Native Windows final terminal CLI | 2 passed / 0 skipped, real File/SQLite same-Turn closeout→review→one debit, 165.48s. |
    | Captured-context, progressive-context, deferred/cache and request-subject parity | 87 passed / 7 explicit native-Codex skips, 224.36s; the deterministic request-subject and dated-wait paths execute. |
    | Full File/SQLite typed authority conformance | 797 passed / 0 skipped, including ordinary/deferred parent receipts, Turn/lifecycle closeout, changed actor/evidence/lease negatives and replay. |
    | Replan, checkpoint and settlement readback | 222 passed / 0 skipped against the final production blobs. Earlier recovery/transport invocations passed 358 and 388 respectively; these retain their earlier sources and overlap. |
    | Heartbeat input and complete route budgets | 24 passed, including the oversized negative; TypeScript, focused Ruff and configured 17-file Linux-platform mypy pass. |
    | Final standard premerge | 6 direct checks, 10 catalog, 8 risk smokes and 1 public-boundary check pass; zero check failures, 130.11s. Overall exit 1 / manual_review_required retains five manual holds and grants no self-merge authority. |

    The final standard run uses the current source's real built Chat bundle, verified by the production manifest/source digests. Earlier native standard validation failed three installer checks; Linux attempts retained a 120-second installation timeout, missing-curl and missing-bundle preparation failures. After environment preparation and the peer-fixture correction the complete final check set passes. No timeout, assertion or manual gate was relaxed. Native-platform mypy's earlier WNOHANG issue remains source-scoped; Linux-platform typing does not certify Windows typing.

    Packaged recovery and visual evidence

    Built source 586882448 is this head's direct parent; the final commit changes only the retained desktop screenshot. The existing packaged browser smoke exercises production owning HTTP/store/controller/checkpoint handlers with deterministic SDK transport and a disposable File backend. Navigation/status uses the existing synthetic shell fixture. No target /loopx response is fabricated.

    Actual clicks/reloads preserve the result and original SDK session, dispatch direction once, debit once and add zero implementation/replay effects. Unavailable-source reread completes a real GET, issues no execution POST, returns to an enabled button and recovers after restoring observation. All four images were inspected. The unrelated artifact list may still be checking during the retained-result frame; it does not certify artifact acceptance.

    !Retained result, current packaged desktop

    !Settled original Turn, current packaged narrow view

    !Unavailable source after completed read-only retry, narrow view

    !Unavailable source, current packaged desktop

    Remaining review and qualification boundaries

    CR2 remains unresolved: #7602 and #7603 are still open. Their Windows containment/private-IO protections remain in this PR's main diff until the independent prerequisites are accepted and merged, then this branch must be replayed. This update neither removes protection nor claims separation complete. Required independent review and exact-head readiness remain.

    An extended report-caller probe exposed an existing direction-continuation gap; one matching real File case also fails on the unchanged published 1bacd16. The interrupted broader run's other failures are not individually reattributed or called passes. Report-caller compatibility remains open in the original integration acceptance. This update does not change the periodic-report execution protocol.

    Whole current-head pytest, a fresh complete real PostgreSQL suite, every production compatibility branch, full agent-consumed prose parity, long/mixed-state conversation journeys and installed adoption remain unqualified. Historical 978/9ca incomplete/failed runs, the old six counterpart failures and earlier source-specific observations remain historical; current successes do not erase them. Historical evaluation runs remain runner-invalid/not score-countable, with complete monetary cost unknown.

    The bounded packaged recovery journey is qualified above; actual model adoption, whole-product user experience and long-horizon effectiveness/efficiency remain not_yet_proven. Installer smokes used disposable homes/releases. No live runtime installation/promotion, merge, paid Host/model call or automation restart occurred. Hosted CI results for this rewritten head remain separate from local validation.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: BigDataDZ Review duration: 81622m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 650 lines diff across 8 files
    0.59
    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%
    44%
    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.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #5677"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.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: 59% (MEDIUM) · Higher = larger blast radius
    59%
    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: 44.7% · Lower = rushed or shallow review
    44.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: 32.6% · Safe to merge
    32.6%