Repository navigation
refactor(ui): simplify session row and resource ownership - #169044
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 replaces per-field session freshness tracking with whole-row observations and simplifies related Control UI request and resource lifecycles. Example: Session agent:main:descriptor-restore is archived at updatedAt=2, leaves the primary list, and a descriptor reports archived=false at updatedAt=3.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: the prior archive finding is fixed, the simplification has recorded owner direction, and all applicable exact-head checks pass without a remaining actionable finding. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI session capability reconciles Gateway lists, descriptors, history, events, and mutation acknowledgements into scoped rows consumed by the sidebar, chat panes, Activity, and resource discovery. flowchart TD
A[Gateway responses and events] --> B[Shared session capability]
B --> C[Whole row observations]
B --> D[Permission and mutation owners]
C --> E[Sidebar chat and Activity]
D --> E
E --> F[Scoped resource discovery]
Technical reviewBest possible solution: Land the simpler shared owner with its retained identity, permission, compact-row, and write-settlement contracts and documented best-effort display semantics. Do we have a high-confidence way to reproduce the issue? This is an intentional refactor rather than an unresolved bug report; the prior descriptor-restore defect has a focused regression and a verified source repair. Is this the best way to solve the issue? The shared whole-row owner is a reasonable simplification under the recorded direction, with explicit omission handling and separate permission and mutation settlement owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 89564fa3a101. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -988, Tests -2126. Total -3114 across 61 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 (5 earlier review cycles)
Reviewed October 11, 2026, 9:57 AM ET / 13:57 UTC (Revision 6). |
|
Both review findings are addressed in 859d5b7d3cfe23246eb9b7a09d0456b206c4a17b.
The two owner suites pass 24 tests; the original browser regression passes 2/2. Net production reduction is 1,002 lines. The prior failed E2E job was PR-caused, not classified as main-red. The replacement exact-head CI is being watched to completion; cancelled prior jobs are not claimed passing. A single Testbox request is also preparing the selected broad suites. |
2e2b40b to
ea9255e
Compare
|
The descriptor-only archive finding is fixed in f18e08a. Raw descriptor/history reads now pass through the existing timestamp-checked archive observer before final decoration. The new capability-level regression first confirms an archive, removes the row from the primary list, then reconciles a newer restored descriptor. It failed with The conflict with main's dashboard partial-row work is also resolved without restoring field receipts. Prior head ea9255e had fully green CI; the new head's CI is being watched separately. No prior-head result is claimed as current-head green. |
What Problem This Solves
Simplifies Control UI state ownership that had grown around synthetic response-order interleavings.
User Impact
Normal rendered states and features stay unchanged. Unusual same-context read races become best effort; authorization, resource ownership, and ordinary write settlement remain enforced.
Why This Change Was Made
Remove the Control UI's per-field freshness protocol and simplify its read-side callers. Session rows now carry one coherent observation instead of separate source clocks, writer ancestry, read cutoffs, field selectors, certification fences, and captured-notification custody. Acknowledged writes publish directly into matching rows.
This is the second p11 simplification, following #168656. It removes 988 net production lines (+652/-1640 across 27 production files; tests/fixtures/generated files excluded), with the scope coverage log below. The campaign's 500–999 exception applies after the whole-scope implementation pass: retained write/security/order repairs reduced the original 1,026-line cut, rather than padding it to the threshold.
No markup, styles, Gateway wire/config/persisted shapes, dependency, or schema changes. Current permission checks, exact session/agent/resource identity, ordinary write settlement and rollback, compact-row omission/explicit clearing, bounded caches, and measured refresh pacing remain.
Coverage log
The original sharpened provenance audit flipped/narrowed 11 of 15 KEEP groups. Its four retained groups were actual terminal execution/settlement, sandboxed Board authorization, Meetings privacy, and config/draft durability. This follow-up retains those boundaries. The descriptor cache has measured request reduction in #160148; event pacing is retained from #164764.
Best-effort tradeoffs accepted
Evidence
Landed: squash
4d80fd977174c782c3cf59e6264327332d57df8c; ancestry verified onorigin/main. Final source headf18e08a32439d2a9b6043dc995d0207abd2b47f2passed exact-head CI 38144516592, with all required statuses successful and no failed/cancelled checks. The current-head review has zero findings. No admin bypass or CI rerun was used.test/scripts/lint-suppressions.test.ts: 3 passed. No new suppressions, timeout increases, retries or skips.GatewayApprovalEventPublisherV2export. The rebased gate stops on the inherited max-lines failure below; remaining relevant types, cycles, lint and export checks were run directly.currentRowsupplies only a freshness comparator, never returned data; request/result cache keys include the requested agent, and reset clears all descriptor reads. The existing agent-isolation tests passed. No actionable finding remains; the review itself did not report a clean verdict.Testbox attempts produced no remote test result or allocated lease: unsupported direct-provider flags were rejected before allocation, then the corrected preparation was stopped before dispatch when the E2E inventory changed. Local focused proof is recorded; exact-head hosted CI remains the broad Linux gate. The directory-form local session test selector was also stopped during discovery; the explicit 76-file run above supplies the completed scope proof.
Inherited local main failures
Both are reproduced independently on clean main
fd1fd2ce0ef8cb7e9c4074c8f855eff8992a54c2; this PR changes neither path:check-max-lines-ratchet.mts:src/web-search/runtime.test.tsadds a max-lines suppression absent from the baseline.check-deadcode-exports.mts: unusedcaptureAgentRunTerminalWriteContextexport insrc/infra/agent-run-terminal-writes.ts. The full-tree and script scans pass; the production scan reports this same single finding on the candidate and main.The clean-main export control initially lacked its UI dependency link and was rejected as invalid proof; the corrected linked checkout produced the finding above. No CI rerun, baseline relaxation, or suppression was used.
Exact-head CI correction
Run 38129440676 on
bdcbe226ed02c49825602000971040b2ad3b3781failed one test inchecks-ui-e2e (2/4): cached sidebar replay displayed[9,8]children instead of[9]. This was PR-caused, not inherited. ClawSweeper identified the narrow root cause: presentation equality discarded the accepted row's newer sampling time. The correction preserves that whole-row stamp and re-sorts Activity using the merged timestamps it displays. No field clocks or replay protocol returns.Both owner-level regressions failed before and passed after the fixes (24 tests passed). The original cached-replay E2E was restored unchanged and passes 2/2; an intermediate test-only simplification was superseded by the source repair. The cancelled sibling suites remain missing hosted proof; their local/Testbox results and the replacement exact-head CI are tracked before merge. No CI rerun or source-only repush was requested.
The next exact-head run, 38132988483 on
859d5b7d3cfe23246eb9b7a09d0456b206c4a17b, exposed six caller failures in UI unit shard 2. The global-agent approval queue is now cleared at the existing agent transition; its fixture waits for an active initial subscription, not merely a dispatched request. A raw older row cannot replace the confirmed settings rollback value. Activity keeps server order unless merged timestamps require sorting. These are retained security/write/display contracts, not restored generations.A single immutable Testbox pass covered all 1,669 selected UI files: 22,187 passed, 19 failed, six existing skips. It exposed the same caller issues and more tests of retired field/read-clock interleavings. Those tests are removed or narrowed to normal scoped publication; existing access, mutation settlement, and resource checks remain. This is failure-discovery evidence on the prior head, not a claimed green run. The final 88-file local pass above covers every repaired owner and reported caller; final hosted CI is tracked separately.
Conflict-only rebase
GitHub reported
CONFLICTINGafter main introduced dashboard partial rows. Rebased onto5ed6a305669a5619ceb7bdc08936ead5f7f56408, preserving main's new row shape and its four omission/clearing cases. Dashboard rows use the same field-presence rule as compact rows. Three added dashboard rollback cases failed before that integration fix; the final 30-case row/rollback/descriptor run and 72-case affected-owner run pass. The replacement-row validity regression also failed before its one effect check. All seven UI test-type graphs, extension declarations, production UI types, scoped lint and zero-cycle checks pass.The aggregate changed check now passes its early ratchets but reports the inherited duplicate-scan coverage omission for
worker-heap-flag.mjs. The suppression suite reports three inherited entries in untouched state/Solid files. Both failures were reproduced in a clean checkout of the exact rebase base; no ignore, suppression, baseline, or timeout was changed. The new exact head isea9255ed29de71a91eebf9366a6b65256930aa0d; its hosted results supersede prior-head CI, never relabel it.Run 38142146543 on
ea9255ed29de71a91eebf9366a6b65256930aa0dcompleted fully green: 44 successful and 40 skipped check runs, none failed or cancelled. Final review then found that descriptor-only restores also need the existing archive-read observation. This one-line behavior fix and its regression are inf18e08a32439d2a9b6043dc995d0207abd2b47f2. The regression failed before and passes after; its four focused suites pass 73 cases, all affected UI/test types and lint pass, and fresh independent review found no actionable finding. The final head's CI is tracked separately before merge.Supplementary Testbox attempts do not supply passing proof: one command incorrectly compared the carrier commit instead of its verified source tree; a later environment lacked Bun and the E2E command duplicated
configLoader. Those leases are stopped. The earlier immutable broad run and final exact-head hosted CI remain separately identified, without turning failed or cancelled attempts into passes.Visual parity
Inspected synthetic before/after and repeated frames at 1280×900 are byte-identical for New Session, selected Chat, and populated Activity. The attached pairs are from the final rebased tree.