Repository navigation
refactor(gateway): simplify metadata and catalog lifecycles - #168690
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR simplifies Gateway metadata refresh, catalog scheduling, session notifications, setup retries, and request-authority bookkeeping. Example: A second sign-in retry arrives while the first retry is cancelling an unfinished sign-in.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a justified simplification with explicitly accepted tradeoffs, and no actionable defect was found in the introduced changes. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway RPC handlers consume published model, plugin, session, and caller facts, prepare bounded projections or catalog results, and deliver responses or authorized mutations through their existing lifecycle owners. flowchart TD
A[Gateway RPC request] --> B[Caller and target authority]
B --> C[Metadata and catalog owners]
C --> D[Bounded preparation and scheduling]
D --> E[Current visibility and effect checks]
E --> F[Response or native mutation]
D --> G[Publication and shutdown settlement]
Technical reviewBest possible solution: Land the smaller existing owners with retained authority and settlement contracts once the required landing gates pass. Do we have a high-confidence way to reproduce the issue? This is a deliberate refactor; source and supplied proof support the refresh-coalescing improvement and retained effect-boundary behavior, with no target code executed during this review. Is this the best way to solve the issue? The smaller existing owners fit repository policy, and the publication-registration repair preserves required settlement without restoring the removed wrapper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c6d71fae0ed1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -530, Tests -1300. Total -1830 across 33 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 10, 2026, 11:28 PM ET / October 11, 2026, 03:28 UTC (Revision 5). |
91964e6 to
a873351
Compare
Final-effect authority proof for a873351The requested additional proof is complete without changing the candidate or weakening a guard. Binding to real persistence: The first test carries an admitted caller through Representative bounded observations from the run: {"phase":"reset","mode":"revoked","registryLive":false,"gatewayLive":false,"admittedLive":false,"closureCount":1,"pendingCount":0,"transcriptChanged":false,"rpcOk":false,"authorityError":true,"rowChanged":false,"sessionPreserved":true}
{"phase":"reset-committed","registryLive":true,"gatewayLive":true,"admittedLive":true,"closureCount":0,"pendingCount":0,"transcriptChanged":true,"rowChanged":true,"sessionPreserved":true}
{"phase":"reset-after-close","registryLive":false,"gatewayLive":false,"admittedLive":false,"closureCount":1,"pendingCount":0,"transcriptChanged":true,"rpcOk":false,"authorityError":true,"executionCalls":0}Binding to native transport: a task-local script on the same asserted HEAD initialized the real {"proof":"native-fork-wire","revoked":false,"forkFramesReceived":1,"rejected":false}
{"proof":"native-fork-wire","revoked":true,"forkFramesReceived":0,"rejected":true}This is synthetic loopback protocol proof, not a live-account or real Codex-process claim. The transport and request admission implementation are real. No provider request, credential, real conversation or external endpoint was used. The existing fork source-incarnation, creator/sandbox, transaction authority and storage tests remain separate coverage; the removed upstream-link freshness test is not being restored as authority. The reviewed final-effect callbacks remain in place. Please evaluate this evidence against the requested binding-to-writer and binding-to-wire concerns; no source head changed. |
|
@clawsweeper re-review The requested final-effect proof is now recorded in #168690 (comment) and the PR body: live admitted request binding through real SQLite/transcript writers, plus allowed/revoked fork requests through the real native client and a loopback WebSocket transport. The reviewed head remains |
|
🦞👀 Re-review progress:
|
Let in-flight catalog reads finish across registry reactivation while retaining current caller visibility, provider execution authority, disconnect handling, and shutdown settlement. Config and registration changes still invalidate subsequent requests. Remove map-identity checks around captured usage entries: displaced refreshes cannot overwrite their replacement. Keep all usage-cache behavior tests and remove only epoch/reactivation-only catalog cases. Best-effort tradeoffs accepted: rare mid-read registry/context replacement can return the original catalog, and epoch-only reactivation may retain a bounded stale page until refresh. Provenance: #138674 addressed slow-host delivery; #159457 added bounded stale catalog results.
Remove synthetic-only supersession, per-step and per-provider fairness, event tombstone, request-container identity, and fork freshness machinery. Keep current authorization at effects, ordinary shutdown settlement, measured caches, global resource bounds, and config CAS. Coalesce refresh bursts into one pending operation plus a follow-up flag; the new regression demonstrated 128 redundant captures before this repair. Remove only tests of retired mechanisms and retain publication, privacy, failure and shutdown contracts. Best-effort tradeoffs accepted: in-flight metadata and upstream forks retain their prepared selections; intermediate notifications coalesce; slow catalog sources may hold a bounded slot. Provenance and coverage are recorded in the lane ledger and PR body. No public shape, schema, retention, permission or dependency change.
a873351 to
b09cf7a
Compare
…#168690) Remove synthetic metadata supersession, catalog fairness/freshness, setup retry, and duplicate mutation checks while preserving current effect authority, bounded resources, public contracts and ordinary publication/shutdown settlement. Accept best-effort mid-read configuration changes and slow-provider contention; the PR records provenance and each accepted tradeoff. Net production: -530 LOC. Focused tests, affected types, suppression audit and both cycle checks pass. Exact-head CI 38108100245 passes; no rerun or admin exception was needed.
Current candidate and proof status
Final exact-head CI 38108100245 is green, including the aggregate CI, security and dependency gates. The earlier source-contract, SDK, canonical fixture and lint failures do not recur. One duplicate PR-context workflow was cancelled when the PR body update superseded it; its replacement passed on the identical head. No CI reruns or green-only pushes were used.
Head after the second conflict-only rebase:
b09cf7ae6f38b16f418f6263fc11e827d879a9ec, based oncfcb7bda177. Net production reduction is now 530 lines; tests/support are 1,300 lines smaller. The sole conflict was metadata refresh: main removed a duplicate facts capture for fleet performance; the simplified path already captures once per coalesced refresh, so it retains that improvement without restoring generations. Affected types, both cycle checks and suppression audit pass; fresh metadata proof passes 37/37 (549.50s local wrapper wall including the suppression shard; 368.99s metadata Vitest wall).Publication settlement was repaired before landing. All 34 originally cancelled CI suites have terminal Testbox results (28 passes, 6 failures); the two lane-caused failures are repaired, and the remaining canonical-cache, SDK-budget and lint failures are attributed below. Those results belong to the original tested merge, not this rebased head. Earlier incomplete attempts below are historical records, superseded by this terminal accounting. The refreshed Gateway-methods type graph passes, runtime cycles are zero, and the suppression audit passes 3/3. The clean-main registered SDK surface command passes as well. Final exact-head hosted CI remains the landing gate.
What Problem This Solves
Reduces the ongoing complexity of Gateway metadata, catalog listing, notifications, and setup by removing machinery that only guarded synthetic interleavings.
User Impact
Features, Gateway payloads, configuration, persistence formats, credential checks, and sandbox policy stay intact. Rare changes during an in-flight read are best effort: callers can receive the prepared result or a retryable failure, and the next request refreshes it. Slow catalog scans keep their slot rather than yielding between pages; the existing response budget still returns cached or pending results.
No schema, durability, retention, permission, dependency, or configuration changes.
Why This Change Was Made
The provenance audit distinguishes human actual-use reports from agent/maintainer PR descriptions and synthetic race tests. Most of the removed mechanisms had only the latter evidence. The smaller owners retain ordinary shutdown settlement, current authorization at effects, bounded queues/caches, and the measured lazy-metadata and catalog-cache improvements.
Net production reduction: 530 lines against the branch base, excluding tests and test support; tests/support are separately 1,300 lines smaller. Test deletions remove only the corresponding synthetic paths; independent privacy, publication, failure, and shutdown coverage remains.
Best-effort tradeoffs accepted
Evidence
Reviewed candidate:
b09cf7ae6f38b16f418f6263fc11e827d879a9ec. Two conflict-only rebases preserve main's worker-prepared runtime ownership, formatted event errors, and single-capture metadata refresh. The conflict-resolved metadata owner is byte-identical to the independently reviewed pre-rebase candidate.thread/forkframe; revocation during awaited preparation sends zero. This is synthetic protocol proof, not a live account or deployed Gateway claim. Those authority modules are unchanged by the repair/rebase.Original exact-head CI tested merge
b429c1eff7ff658dacce8c6df860e8066f1b0ffb(sourcea873351c3417a36ad3ef1e4a48ab62feef894352).check-source-contractsfailed on duplicateresolveChannelDmPolicyexports in two unchanged channel files; the identical failure reproduced on clean main97e81ce0d5d96449449b545b80fb0c989c591c78. The aggregate gate failed downstream and 34 jobs were cancelled.Every cancelled suite was subsequently executed on that immutable merge, using two sequential Testbox leases, now stopped: 38096290073 and 38101073221. 28 passed; six retained failures are individually attributed:
7cc1ca64798; the two initiating cases pass on clean main5ff4d101c72.5ff4d101c72. The Linux-only test itself was not run on macOS.Passing replacement proof covers build, 85 Control UI tests, browser extension E2E, package boundaries, nine ratchets, production types, all selected core/root/extension/script test types and all other selected Node rows. Setup-only browser mode and missing-Bun failures were corrected without changing source or weakening guards; only unstarted groups were then run. Old-merge results are reused only for unchanged inputs, never described as final-head hosted CI. No CI rerun or green-only push was requested.
Coverage ledger: every original KEEP row re-evaluated