Skip to content

refactor(ui): pair page resources with Solid lifetimes - #179161

Closed
steipete wants to merge 22 commits into
mainfrom
solid2/w-s2-pages-c-lifecycles
Closed

steipete wants to merge 22 commits into
mainfrom
solid2/w-s2-pages-c-lifecycles

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Solid 2 checklist

Native TypeScript AST census on exact base 97d54bbd14bb and signed head ba4eb582332c; 16 logical production modules, 5,878 → 5,899 LOC (+21). Counts describe these touched modules; the named owners retain the remaining work.

Item Before → after and disposition
Native handlers Conditional intrinsic bindings 0 → 0; separate handler changes are in #179118.
Lifecycle onCleanup 14 → 2, so 12 removed; onSettled 12 → 20. Setup returns paired teardown.
Async reads Existing Debug section-state map 1 → 1 here; #179755 owns its native async migration. Archive's native reads remain intact; synchronous owners retain authority, cancellation, polling, and URL-driven retirement.
Mutations action 1 → 1, createOptimistic 3 → 3; existing mutation authority remains.
Code splitting lazy 1 → 1; existing deferred page/overlay boundaries remain.
State shape createSignal 25 → 23, createStore 2 → 4; local Debug history and Meetings drafts use store mutations; RPC snapshots remain request-owned.
JSX Manual createComponent 4 → 0; Activity, its route adapter, and Debug use JSX.
Context Throw-only wrappers 0 → 0.
Sibling loading Loading 2 → 2, Errored 2 → 2, Reveal 0 → 0; existing boundaries remain.
Owner APIs createRoot, getOwner, runWithOwner each 0 → 0.

createEffect remains 4, createMemo remains 21; render effects, untrack, and flush remain 0. The two retained cleanup calls belong to the Meetings request primitive and PluginPage's synchronous authorization owner.

What Problem This Solves

Several page resources split setup from teardown, while Activity and Debug construct Solid content manually. Debug history and Meetings input drafts copy local collections for each update.

User Impact

Page listeners, timers, subscriptions, and native element registrations release with the lifetime that acquired them. Activity keeps its host tag, selectors, route owner, and lazy boundary. Debug keeps event-log updates, timestamp deduplication, its 90-sample history cap, and its lazy overlay boundary. Meetings retains unrelated drafts and URL-equal clears.

Why This Change Was Made

Component setup returns its cleanup through Solid 2 onSettled. Synchronous request primitives and PluginPage's authorization owner retain their existing cleanup. Activity and Debug use JSX; Activity's existing state and live route effect stay in activity-page.tsx, while activity-route.tsx receives router props and owns shell layout behind the existing lazy route. The plain host type lives in the central JSX declarations. Git recognizes the page rename, so the existing effect allowance carries without adding an allowance. Debug history and Meetings drafts use store mutations; RPC snapshots remain owned by their request owner.

Evidence

Current signed head 23cd0dd0d82ddc628ea1649af6dc74dae9a55362 adds only failure diagnostics to the existing HTML publication test on top of ba4eb582332c. Its production, configuration, build inputs, and all other tests are byte-identical to that revision. The production metrics, census, and captures below retain their exact original source attribution. The pre-click snapshot starts without awaiting it; only a failing original click/poll assertion awaits and publishes its scalar facts.

Signed head ba4eb582332cc9b37d13e4e7de6e96bf6bb1d8c1 merges official main 97d54bbd14bb20748d850eb7de8c185ea56c5181 after GitHub reported an actual conflict. The three conflicting validation files take exact main blobs: hourly planning #180088, integration/source-owner budgets #180097, and optional Subagents metadata attachment #179958. Those supersede this branch's corresponding earlier repairs. All retained authored blobs match the independently reviewed 6601f5ef7a48 revision, and the integration received source review.

The retained unit/test-support repair checks the executor's effective child resource environment instead of a retired mixed-membership serial heuristic. It preserves independent selected-file, configuration, ownership, timing-key, and wide-row worker-budget assertions. Only include-file transport is omitted from resource comparison. Main's integration/source-owner repair does not update these unit cases.

Archive #179912 retains authority over native archive reads and immediate request cancellation; this PR supplies the local draft store and paired component lifecycle. Official #179775 owns profile registration, #179885 owns worker-budget behavior, and #179879 owns obsolete Activity route metadata removal.

Proof Result
Current UI types Exact ba4eb582 pnpm tsgo:ui passes (6.018 s). Frozen installs pass on both compared checkouts.
Production dead-code check Exact ba4eb582 pnpm deadcode:knip passes (197.470 s); no ignores added.
Production pair startup: 325,389 → 325,370 B (-19 B); chat: 1,442,960 → 1,442,934 B (-26 B); new: 1,020,426 → 1,020,402 B (-24 B). Build0/0; strict base/head/pair 0/0/0; requests unchanged True; CSS unchanged True. Same machine, Node 26.12.0/pnpm 12.12.1, timestamp, branch, and build options; actual commit/build ID retained per head. Base/head build time 31.609/35.541 s.
Directly affected planner unit cases Exact ba4eb582: 4/4 selected cases pass in one pinned-Bun invocation (92.30 s Vitest / 97.973 s total): precise ownership/timing for Blacksmith, GitHub, and hybrid, plus the >96-test E2E/plugin worker-budget case. Existing caps and timeouts are unchanged. Material imported inventory changes were audited; no dependency-equality reuse is claimed.
HTML diagnostic checks UI types pass; focused typed lint passes after correcting a local-name collision; format and diff checks pass. Independent diagnostic P0–P2 review is scoped-clean; final timing and early recorder corrections received separate source review. One prior lint invocation stopped in unrelated package declaration preparation before reaching lint; its existing timeout remains unchanged.
Independent review Six complete independent P0–P2 partitions and final source verification are scoped-clean. The later one-line hourly fixture repair also received a complete scoped-clean review before main superseded it. Retained authored blobs are unchanged; exact-main conflict resolutions were separately inspected.
Reused owner proof Meetings and summaries 36/36 (57.96 s Vitest / 82.372 s total), including drafts, pagination, permission retirement, cancellation, and summary lifecycle. Unchanged Activity 11/11 at 05465955 and profile 15/15 at 7deadab7 retain original-head attribution.
Current CI Exact signed 23cd0dd0d82ddc628ea1649af6dc74dae9a55362 39714034729, attempt 1, completed successfully at 2026-10-22 03:13:50 UTC: 63 passed, 23 skipped, no failed or cancelled jobs. Every UI shard and both real-Gateway jobs passed with ci:full present. This passing run does not establish the cause of the earlier HTML counter failure.
Previous-head CI Exact ba4eb582 39706837688 completed with 60 successful jobs and two failing names: the HTML publication counter remained 0 after Count, and sidebar reorder timed out focusing Reorder Beta. HTML passed on completed scheduled main 39707038848, so no inherited exception was claimed. The current head passes both cases.
Prior CI, not waived c6fee165 39701616890 completed with 60 successful jobs and two failing names: hourly main cap and sidebar reorder. Main now owns the hourly correction. Sidebar correction landed separately as #180167 (superseding #180108). Neither old failure is a waiver for this head.
Visual evidence Exact base/head captures pass (7.42 s baseline / 7.71 s head), zero page errors. All four full frames inspected and synthetic-only. Activity PNGs are byte-identical; expanded Debug has the same visible geometry and content apart from the canonical footer commit label. Node is used only for Playwright; unit tests use pinned Bun.

The HTML failure investigation retains two exact 97d54bbd14bb baseline attempts. The first stopped during cold-worker setup at the existing no-output watchdog; after canonical worker preflight, the second reached Gateway setup but timed out at the existing 60-second readiness limit. Neither reached a browser assertion, so neither proves inheritance. The uploaded CI artifact contains only public app/frame-depth diagnostics; no click trace or screenshot was uploaded. A focused test-only diagnostic follow-up records scalar document identity, handler, counter, and geometry facts around the unchanged Count action, only when it fails. It does not claim a fix or change any assertion, timeout, cap, or product behavior.

The net contribution is 25 files, +237/−149 against actual base 97d54bbd14bb. The production increase pairs setup and teardown, expresses the route adapter in JSX, and replaces local collection copies with draft mutations. No dependency, planner policy, cap, timeout, ignore, or runtime owner is added.

Prior-head CI and production evidence

At 7deadab7b44f, CI 39689422469, attempt 1, finished with 57 passing jobs, 4 failures, and 23 skips. Primary failures were the hybrid precise-owner assertion, hourly 80/79 cap, and optional Subagents metadata visibility wait. The hourly error reproduced on exact old base 40a236fe under CI runtime policy; the hybrid baseline timed out and one unchanged Subagents replay passed. Those results do not establish inherited-failure exceptions for the replacement head. Initial repair tests exposed an include-file comparison defect, which was corrected before this revision. Some wide/source-owner local cases timed out and an attempted UI replay stopped during artifact setup; neither supplies an assertion verdict. No timeout, guard, or cap was changed.

At 96928a67676b, CI 39668063809, attempt 1, completed with 59 successful jobs and 23 skipped. All UI units, both real-Gateway jobs, security-fast, lint, production/test types, and ratchets passed. The planner shard passed 77/77 file tests and 81/81 shard tests. Its earlier planner expectation correction is now superseded by official main #179885.

The sole failed nonaggregate job was the mixed-attachment gap assertion at chat-responsive.e2e.test.ts:462:25, expected −875.6875 px to be greater than 4 px. The case, error, and frame matched completed main 39671240295 / job 119469897530; test, renderer, and stylesheet blobs matched the actual tested PR merge 6f31d9f0f9a4056913fbc1278d6552e2d08155d8. This is prior-head evidence, not current-head CI. The newer completed main run 39679539559 passes the attachment case, so its earlier exception is retired.

The be3bdd50e999 / 96928a67676b production pair had gzip deltas of startup +10 B, chat −41 B, new −25 B; both builds, both strict checks, and paired strict check exited 0. Request counts and CSS metrics were unchanged. This remains historical comparison evidence.

The one exact-case heading replay on actual base 97504783 built its fixture successfully, then exited 143 at the normal 300-second no-output watchdog without an assertion result. It supplies no passing or inherited-failure proof and was not repeated.

Earlier local planner attempts stopped at the normal setup watchdog without an assertion result; they were not passing proof or evidence of baseline inheritance. Existing untracked-read and polling diagnostics remain visible. Historical exact-126b168d8fdc production Knip passed; it is not relabeled as a current-head result.

Visual proof

Inspected synthetic production captures at 1366×900, fixed time, light Claw theme, and reduced motion. Before: 97d54bbd14bb; after: ba4eb582332c. Each mock Gateway matches its actual build ID. Activity is byte-identical to the already-published image, so those exact assets are reused. Debug images below are from the new builds.

Before: synthetic Activity

After: synthetic Activity

Before: synthetic expanded Debug

After: synthetic expanded Debug

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

clawsweeper Bot commented Oct 21, 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 21, 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-22T03:12:33.238401Z 23cd0dd 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@steipete
steipete enabled auto-merge (squash) October 21, 2026 07:44
@steipete
steipete disabled auto-merge October 21, 2026 07:54
@clawsweeper clawsweeper Bot added the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Oct 21, 2026
Keep the route-to-request-owner effect in the original Activity page and the router props and shell layout in a lazy JSX adapter. Declare the plain host tag in the canonical JSX types.

This restores the verified TypeScript-to-TSX rename without changing the controller guard or allowances. The native page test loads the production route and preserves live route updates, host identity, and cleanup.
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR scopes page resource cleanup to Solid lifetimes, fixes conditional account-usage registration, and converts Activity and Debug rendering to JSX.

Example: The retained profile openai:one changes from OAuth to api_key.

  • Before: Its usage control disappears from the DOM but remains registered for page refreshes.
  • After: Removing the control releases its registration; restoring OAuth registers the replacement control.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused ownership repair with meaningful regression coverage and visual parity, but incomplete broad-validation attribution.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected synthetic Activity and Debug captures establish presentation parity, while registration disposal is covered by the reported mounted regression.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Changing a retained OpenAI profile from OAuth to an API key leaves its detached usage control in the page refresh registry.
Reason: The maintainer-authored direction addresses a concrete ownership defect and follows the established Solid lifecycle contract without changing product defaults or public APIs.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored PR fixes a current registration leak and preserves existing page ownership; no concrete introduced defect was found, but exact-head CI still needs failure attribution.

Priority: P2
Reviewed head: e42e10846debea014fdb6c6047838e4881820f31

Before merge

Findings

None.

Tests

  • Missing end-to-end proof: The supplied browser captures do not exercise OAuth-to-API-key replacement or resource teardown; those behaviors are supported by mounted regression tests.
Agent review details

How this fits together

Control UI pages consume Gateway and configuration owners, render their projections, and register mounted controls; Solid lifetimes release presentation resources while existing synchronous owners retain request admission and cancellation.

flowchart LR
  A[Gateway and configuration owners] --> B[Page request owners]
  B --> C[Solid page projections]
  C --> D[Mounted page and conditional children]
  D --> E[Control registrations and listeners]
  D --> F[Lifetime cleanup]
  F --> E
Loading

Technical review

Best possible solution:

Keep conditional registrations with their children and pair page resources with existing Solid lifetimes while preserving synchronous request retirement and lazy routes.

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

Current-main source exposes the retained-row cleanup mismatch, and the PR reports a base-red/head-green mounted regression; this read-only review ran no tests.

Is this the best way to solve the issue?

The repair uses the correct conditional owner, retains existing request authority, and adds no competing state owner or unnecessary production machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4da6f62dbe6f.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +17, Tests +52, Other 0. Total +69 across 25 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 17 132 115 +17
Tests 5 59 7 +52
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 8 8 0
Total 25 199 130 +69

Review metrics

Metric Value Why it matters
Production versus test LOC Production net +17 lines; tests net +52 lines. The modest production growth pairs lifetimes and declares the lazy JSX adapter; test growth covers conditional registration, retained route identity, and settled reconnect history.

Labels

Label changes:

  • add P2: The current registration leak and page lifecycle cleanup have a limited UI blast radius without an established urgent user-facing outage.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • 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:

  • P2: The current registration leak and page lifecycle cleanup have a limited UI blast radius without an established urgent user-facing outage.
  • 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.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 21, 2026, 6:03 AM ET / 10:03 UTC.

Resolve the required plugin-page import conflict while retaining main's
native lazy bundled-view loader and the page lifecycle's paired iframe
theme setup and cleanup. Preserve the current consent icon subscription
owner alongside its image callback retirement guard.

UI types, targeted lint, formatting, controller ratchets, and diff checks
pass. The focused plugin and consent test attempt hit the normal setup
watchdog before assertions. The earlier managed-media recap CI failure
remains unresolved; this conflict integration does not claim to fix it.
Resolve the shared Solid intrinsic-element insertion conflict by retaining both Activity and Cron scratch hosts. Runtime files in the lifecycle change remain identical to the previously green head.

Validation: UI typecheck, focused typed lint, formatting, controller ratchets, diff hygiene, and independent P0-P2 review passed. Runtime and bundle evidence remains attributed to its original head; fresh PR CI validates the integrated candidate.
Preserve conditional account-usage teardown and settled row registration.
Retain main's late-mount regression, serial planner helper, and renamed
Claws English registration.
Selected jobs can combine parallel groups from different full-plan owners.
Compare bounded job execution metadata with the selected canonical owner,
while preserving independent full-plan group policy and precise E2E coverage.

The direct selection checks retain singleton normalization semantics.
Production planner behavior is unchanged.
Merge official main with the corrected Usage export fixture activity window.
Preserve the reviewed lifecycle cleanup and selected planner owner checks.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96928a6767

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

loader: (_context, { location }) => sessionActivityRouteLocation(location),
component: () =>
import("./activity-page.ts").then((module) => ({
import("./activity-route.tsx").then((module) => ({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the stale-build test for the renamed lazy chunk

Changing the dynamic-import facade to activity-route.tsx changes Vite's lazy entry from activity-page-*.js to activity-route-*.js, but ui/src/e2e/control-ui-stale-build-reload.e2e.test.ts still searches only for /^activity-page-.*\.js$/. Whenever this release-only test runs, it will throw “Production build did not emit the Activity lazy chunk” before exercising stale-build recovery; update its asset lookup as part of this route split.

AGENTS.md reference: AGENTS.md:L48-L51

Useful? React with 👍 / 👎.

Merge official main effective worker-budget validation and route export fixes.
Preserve the Activity lazy JSX adapter and scoped lifecycle resource ownership.
Supersede the earlier planner expectation correction with the canonical
executor-budget proof; retain only the Activity source-path update.
Adopt the official provider usage registration owner and its stronger retained-row regression from #179775. Remove the superseded profile contribution while preserving the remaining page lifecycle, Activity JSX, Debug history, and Meetings draft changes.
Merge official main while preserving Archive request ownership and the
Lifecycle draft store and paired component teardown. Replace stale planner
test composition assumptions with effective child resource assertions,
and wait for the loaded Details body in the Subagents fixture.

Preserves Activity route state, existing host tags, Debug history, Meetings
drafts, cancellation, permissions, and the existing lazy boundaries.
Keep the reviewed child-environment resource contract when main retires the
older serial-projection heuristic. Every net authored file remains identical
to the fully reviewed Lifecycle candidate; official main is merged directly.
@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #180378, now merged as 841b90f and verified on main. The replacement carries the retained page lifecycle/JSX work, refreshed exact-source proof, and a green full UI CI run.

This PR's native review was pinned to state schema 30 while shared landing state uses schema 31. The replacement also avoided the stale worktree administrative-path failure. The confirmed-cancelled outcome and native metadata remain preserved; no binding, schema, or administrative directory was rewritten.

@steipete steipete closed this Oct 22, 2026
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. extensions: qa-lab P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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