Skip to content

refactor(ui): bind Logbook to its bundled view lifetime - #176818

Merged
steipete merged 1 commit into
mainfrom
solid2/w-zero-logbook-lifetime
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-zero-logbook-lifetime

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Logbook observed a reactive connection even though its parent already replaces the bundled-view owner for every connection identity change. Give each keyed Logbook instance a plain initialClient and connect/load once in onSettled; the existing model still owns polling, request retirement, and disposal.

The plugin page keeps its lazy Logbook import and keyed bundled-host boundary. No markup, styles, routes, public plugin SDK, or startup imports change. A disconnected keyed instance receives null even when the Gateway retains its client object.

Evidence

Proof Result
Frozen install Passed
Logbook view tests 2 passed; 21.06 s wrapper wall time
Plugin page lifecycle tests 15 passed; 10.60 s wrapper wall time
Logbook browser tests 4 passed; 18.65 s wrapper wall time
Scoped type-aware lint and format Passed
UI and UI-pages test types Both passed on the refreshed head using the default tsrs wrapper
Independent complete-source review Scoped clean, P0–P2, one pass
Production Knip Passed on refreshed exact head with no findings; 418.9 s command wall time

Before refresh, UI typecheck at base e0a8caae40a14b360f01a4a83772a94283f9df7b plus this diff reported only session-attention.ts:28 TS2724 (missing SidebarProjectionMemo export) and session-attention.ts:180 TS7006 (row implicit any). On that run, both implicated Sidebar files were byte-identical to the base; #176477 owns that repair. Final refresh adopted the main repair, and the previously red type check passed. No baseline rerun or exception is claimed. Plugin-page tests pass while emitting STRICT_READ_UNTRACKED diagnostics; the retained route-effect path was not changed.

No local build or E2E was run under the campaign budget: this page remains lazy, and the change adds no startup import or visual difference. Exact-head PR CI supplies the startup measurement and broad proof below; import inspection confirms no new eager dependency.

Refactor checklist, touched production Before After
Effects 2 1
Controller patterns 0 0
Render effects 0 0
untrack 0 0
Raw listeners 0 0
DOM queries 0 0
Class-string patterns 0 0
Production flush / owner escapes 0 0
Production LOC 601 599
Touched test LOC 274 274

The historical pre-refresh Knip run found one unrelated unused export, src/cli/tagline.ts: TaglineMode; the refreshed main base makes that type local. The final production Knip scan on the refreshed exact head passed with no findings.

Final head 6903b468eabc9dcabd0d90c9d24430dd18ca75a7 is rebased on 707a215d4c609bdba05b6f28a2f63cca5b65b983. All eight reviewed source/test context blobs match the independently reviewed fccf29d1e1a candidate exactly; the green runtime tests and review were reused without reruns. The refresh frozen install passed in 1.2 s. Fresh UI and UI-pages test types and final production Knip passed; the refresh took 472.08 s through evidence finalization (including waiting).

The one surviving effect is ui/src/pages/plugin/plugin-page.tsx:31: route-property admission into the existing owner. Native bridge callbacks are per-property and occur before Solid publishes props, so replacing it directly could admit a mixed plugin/tab identity. Logbook itself has zero effects after this change.

Simplification pass: no helper, new subscription, duplicate connection state, or new test scaffolding; retain the existing lifecycle tests as the primary proof. No leases used.

Inherited CI qualification

Exact-head CI 39198627013 completed for 6903b468eabc9dcabd0d90c9d24430dd18ca75a7. All UI unit, ordinary Control UI E2E, browser-extension, type/lint, security, and strict performance checks passed. The only failed nonaggregate jobs contain these cases:

  • ui-e2e-serial ui/src/e2e/session-pr-reader-lifetime.real-gateway.e2e.test.ts > Session PR readers through a real Gateway > keeps session PR and CI results with the current workspace and reader.

The reader case timed out after 120 seconds. The same exact names and error signatures fail on the latest completed scheduled main run 39205204421, at e3cc361b27cb48b494708891fee8df83e6811946. The actual CI checkout's ordered parents and reconstructed merge tree are verified, and the named failure-source blobs match its base and the scheduled-main head. These are qualified inherited failures; the native inherited-failure/admin route is used without claiming CI green. No failed assertion was weakened and no local E2E rerun was added.

Current-head startup: 337,491 B gzip JavaScript, 7 requests, plus 38,500 B gzip CSS, 1 request. Same-host base/head chat boot: 1,489,890 → 1,489,862 B (-28 B); New Session: 1,049,366 → 1,049,337 B (-29 B). Lazy boundaries are unchanged.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T04:18:32.527453Z 6903b46 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR initializes each Logbook instance once using the connection selected by its existing keyed parent.

Example: Logbook disconnects and reconnects using the same Gateway client object.

  • Before: The parent replaces the view while Logbook also observes reactive connection props.
  • After: The parent replaces the view, and each replacement connects once, receiving null while disconnected.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported refactor with useful retained lifecycle coverage; supplied evidence does not establish shipped-entry-point behavior.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; reported focused tests exercise the real view with mocked RPC, while inspected sidebar media does not exercise Logbook.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No visible malfunction is claimed; redundant connection tracking makes Logbook lifecycle ownership harder to maintain.
Reason: Maintainer direction is established, and the patch removes redundant reactivity while preserving the existing owner, lazy boundary, controls, and polling contract.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored PR makes a focused lifecycle simplification, and no introduced correctness defect was found; failing CI still needs attribution.

Priority: P3
Reviewed head: 4e489541b39315181eda394ff876f94143db4dde

Before merge

  • Complete next step - Classify the failed session-filter, command-palette, and performance checks using matching base evidence or a head-versus-revert comparison, repairing only failures caused by this diff.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped Control UI recording or trace demonstrates Logbook loading, disconnect retirement, and same-client reconnect after this change.
Agent review details

How this fits together

The Control UI plugin page lazily mounts Logbook from Gateway tab descriptors; its model requests activity data, renders cards, and owns polling and request retirement.

flowchart TD
  A[Gateway connection receipts] --> B[PluginPageOwner]
  B --> C[Keyed bundled view]
  C --> D[Logbook initial client]
  D --> E[Logbook model]
  E --> F[Gateway RPC]
  E --> G[Timeline and controls]
Loading

Technical review

Best possible solution:

Keep connection replacement in PluginPageOwner and initialize Logbook once within each keyed lifetime.

Do we have a high-confidence way to reproduce the issue?

This PR proposes a behavior-preserving refactor rather than reporting a reproduced product failure; source confirms the redundant connection observation.

Is this the best way to solve the issue?

The patch is the smallest complete simplification: it reuses the existing keyed lifetime, retains model cleanup, and migrates every direct caller.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 35aa52a55da8.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -2, Tests 0. Total -2 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 12 14 -2
Tests 2 3 3 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 15 17 -2

Labels

Label changes:

  • add P3: This is a small internal lifecycle refactor with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a small internal lifecycle refactor with no intended user-visible behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 18, 2026, 10:55 PM ET / October 19, 2026, 02:55 UTC.

@steipete
steipete force-pushed the solid2/w-zero-logbook-lifetime branch from 4e48954 to 6903b46 Compare October 19, 2026 04:16
@steipete
steipete merged commit a792fa1 into main Oct 19, 2026
98 of 103 checks passed
@steipete
steipete deleted the solid2/w-zero-logbook-lifetime branch October 19, 2026 06:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant