Skip to content

refactor(ui): scope Plugins page state to Solid owners - #173993

Closed
steipete wants to merge 7 commits into
mainfrom
solid2/w-idiom-pages-plugins
Closed

steipete wants to merge 7 commits into
mainfrom
solid2/w-idiom-pages-plugins

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Completes the Plugins page migration away from Lit-style rendering controllers and manually forwarded update notifications.

User Impact

No user-visible behavior change is intended. Catalog browsing, plugin settings, install consent/progress, sign-in, and skill previews retain their existing routes, tags, selectors, focus behavior, and lazy loading.

Why This Change Was Made

Solid owns page/helper lifetimes and local filter/tab state. Icon tiles register their live identity with the existing fetch/cache owner, removing page-wide DOM scans and a mutation observer. Request admission, cancellation, consent identity, and cache authority remain synchronous. The page adopts the shared wizard factory from #173902 and binds help publication to its application-context lifetime.

Evidence

The current head 23d37aee37a688922f2a2caac83fa85cf4f3d5a8 is the second coordinator-authorized recovery refresh, merging main 7cbbf3b94d5f58ce0bc3657cd829865a33a65e3d without conflicts. Plugins source is byte-identical to head 4712dc4c30f20f3869fb9c3944f0575868a5140b, where the fresh UI typecheck, paired builds and strict startup proof below ran. No fresh local type/build/Knip pass is asserted on this mechanical merge; current-head CI supplies broad validation.

The first refreshed run 38905679171 passed every nonaggregate job except Real-Gateway shard 2: Control UI cross-channel automation management with a real Gateway > configured owners and admin chat manage a Telegram-created job while a non-owner cannot. Its chat automation admin-update never reached the fixture provider. That flow does not open Plugins; its QA/Gateway/chat/shared UI inputs equal the tested main parent. This is source-unrelated attribution, not a matching-main-failure claim (the matching main job passed). The native auto recovery refused the failed required check before dispatch.

Proof Result
Changed discovery, consent, preview, and icon tests 36 passed; each selected file run once with one worker. Includes retained-tile slug changes without page refresh, cache retention, and disposal.
UI typecheck; scoped typed lint; formatting Passed at 4712dc4 on byte-identical Plugins source; scoped lint/format passed on the unchanged reviewed implementation
CI repair proof Assertion-safety ratchet passed; 15 page boundary tests and 8 icon tests passed once on the repaired source.
Historical production Knip at 4712dc4 / 163e18f Two inherited findings: SessionWorkspaceRail (Chat) and SynologyChatAccountRaw (Synology Chat). Both files are unchanged and neither symbol is referenced by Plugins; the identical command on pinned base produces byte-identical output. No new ignores.
Independent review Passed; no actionable P0–P2 findings in the final source
Same-machine production build and strict performance Both passed. Startup JS 339,675 → 339,664 B gzip, 7 requests; CSS 38,786 B gzip / 1 request unchanged.
Bounded visual proof Synthetic catalog, settings, and skill-preview states; 1280×900, dark theme. Before/after captures inspected in full; no page errors.
Broad proof Historical ci:full run 38873768329 at c7741882 completed with two source-unrelated failures detailed below. Replacement-head PR CI is pending; the old run is not current-head success. No local E2E suite or parity run.

The first CI run (38870694859) found 23 initializer type assertions introduced by this refactor. The reviewed pre-merge head (c774188268fcf812b385ef7b6b10b19c5aeb297e) replaces them with concrete owner types and removes the synthetic subscription adapter; no baseline allowance or suppression was added. The replacement ci:full run is 38873768329.

Fresh startup raw JavaScript is 1,034,196 B on both sides; Brotli is 315,090 → 315,123 B. Both strict checks report zero violations. Equal raw size does not imply byte-identical emitted assets. The inspected historical screenshot difference is the expected build-stamp footer.

Refactor counts and retained boundaries

Counts cover the 15 touched production files against the pinned main base; retired classes and renamed factories are counted together.

Metric Before After
Production LOC 4,601 4,598
Controller-pattern matching lines (playbook expression) 28 0
createEffect 2 2
createRenderEffect 0 0
untrack 0 0
Raw addEventListener 1 0
DOM selectors, including generic calls 4 4
Hand-built class strings (playbook expression) 0 0
Production flush 0 0
Owner capture/restore calls 0 0

The two effects synchronize route/Gateway ownership and the existing icon fetch/cache owners. A page-owned revision signal invalidates synchronous reads; catalog props derive a fresh shallow snapshot for each revision. Remaining selectors admit shell/modal boundaries, dismiss the install-action custom-element island, and preserve the Firefox focused-input removal workaround. The existing dynamic fallback-class suffix remains inside a structured class array. Test LOC: 1,452 → 1,548.

Historical production Knip findings (superseded by fresh check)

The identical command reported the same five exports on the pinned base and candidate:

  • autoReviewParameters in extensions/autoreview/src/tool.ts
  • prepareCommandLaneClear in src/process/command-queue.ts
  • createCommandPaletteLoading in ui/src/app/app-shell-command-palette-loading.ts
  • ChatPageView in ui/src/pages/chat/chat-page.ts
  • INITIAL_CUSTOM_THEME_IMPORT_STATE in ui/src/pages/config/custom-theme-import-owner.ts

All five declaration files are unchanged by this PR. Neither the old nor new Plugins source references these symbols; removing a Plugins import cannot orphan them. The Config export is being repaired separately in #173992. No ignore or unrelated repair is included here.

Historical CI failures and source attribution at c774188

Run 38873768329, attempt 1, tested merge 476ee644a0f5eb13391e62dd0736acc65fc21cec from main 0b47dd05c63a4f90c9f9ce31fbc1007b57348296 and the reviewed pre-merge PR head c774188268fcf812b385ef7b6b10b19c5aeb297e. Its ordered parents and merged tree are verified. Its complete change from that main parent is confined to Plugins.

  • check-test-types: extensions/codex/src/app-server/session-binding.test.ts lines 465, 466, and 480 call the unbound original names createCodexAppServerBindingStore, createCodexSqliteTestBindingStateStore, and hashCodexAppServerBindingFingerprint after those imports were aliased. The Codex extension and test configuration are unchanged by this PR.
  • checks-ui-e2e (7/9): Control UI new-session page mocked Gateway E2E > a session writer preserves a started first turn until its owned row arrives times out in gateway.waitForRequest. The exact tested flow uses chat/new-session, session rows, controls, reconnect, and abort; it opens neither Plugins nor the command palette that shares PluginArtTile. Chat/new-session, shared UI, fixtures, route/build inputs, and dependencies are identical to the main parent. Plugins remains dynamically loaded.

The previous comparable scheduled main jobs passed; this is direct source-unrelated attribution, not a matching-main-failure claim. The native admin evidence records all failed jobs, the downstream CI gate, nineteen unchanged input trees/blobs, and passing independent security. The owned assertion-safety failure is fixed and passed in this replacement run. CI is not reported as green.

Before: Plugins catalog (synthetic)

After: Plugins catalog (synthetic)

Before: Plugin settings (synthetic)

After: Plugin settings (synthetic)

Before: Skill preview (synthetic)

After: Skill preview (synthetic)

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

clawsweeper Bot commented Oct 16, 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 16, 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-16T13:37:18.965211Z 23d37ae 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces Plugins rendering controllers with Solid-owned factories and registers icon tiles directly with the existing cache owner.

Example: A retained plugin tile changes identity from first to second.

  • Before: The page discovers the changed tile through DOM scanning and mutation observation.
  • After: The tile's registered reactive identity triggers loading the second plugin's artwork.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, scoped migration with inspected rendering evidence and meaningful lifecycle coverage, held by a concrete assertion-safety failure.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected production-build browser screenshots exercise the changed Plugins catalog and settings rendering with synthetic data at 1280×900 in dark mode and show visual parity; source review preserves request and mutation boundaries.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible defect is claimed; the work completes the approved Solid ownership migration while preserving existing Plugins behavior.
Reason: Maintainer direction and the preceding migration support this focused removal of obsolete rendering controllers and DOM observation.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed refactor preserves the existing behavior, but its new state assertions introduce an assertion-safety CI failure.

Priority: P3
Reviewed head: 057741f9d7fe0d5fe49ce09d73b30124be06c5b7

Before merge

  • Declare state types to clear the assertion-safety ratchet (P2) - Replacing typed fields with these initialization assertions introduces non-const assertions without SAFETY comments. The same pattern appears in plugin-discovery.ts and plugins-consent.ts. None has a baseline allowance, so check:assertion-safety rejects this head; the failed baseline job explicitly identifies that check. Declare each state object's type, as the original fields did, rather than widening the baseline.

Findings

  • [P2] Declare state types to clear the assertion-safety ratchet — ui/src/pages/plugins/plugins-page.ts:61-65
Agent review details

How this fits together

The Plugins page consumes route data, Gateway snapshots, and user actions, then renders catalog, settings, consent, sign-in, and preview surfaces while existing owners perform requests and mutations.

flowchart TD
  A[Route and user actions] --> B[Solid page factories]
  C[Gateway and config owners] --> B
  B --> D[Catalog and settings views]
  B --> E[Consent and previews]
  D --> F[Icon cache owner]
  E --> F
Loading

Technical review

Best possible solution:

Keep the owner-scoped refactor and declare the three mutable state objects with explicit types instead of initialization assertions.

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

The introduced assertions deterministically exceed the ratchet's zero allowance for these state objects, and exact-head CI reports assertion-safety failure; no target code or tests were executed.

Is this the best way to solve the issue?

The factories preserve synchronous admission, cancellation, consent identity, and cache ownership while removing the replaced controller wiring; explicit state annotations resolve the identified blocker without changing behavior.

Full review comments:

  • [P2] Declare state types to clear the assertion-safety ratchet — ui/src/pages/plugins/plugins-page.ts:61-65
    Replacing typed fields with these initialization assertions introduces non-const assertions without SAFETY comments. The same pattern appears in plugin-discovery.ts and plugins-consent.ts. None has a baseline allowance, so check:assertion-safety rejects this head; the failed baseline job explicitly identifies that check. Declare each state object's type, as the original fields did, rather than widening the baseline.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7a43e126bba6.

Provenance checked

  • Plugins rendering and route ownership keeps the original intent (8304c4b: Port Plugins rendering to Solid while retaining synchronous domain owners, routes, drafts, and asynchronous connection ownership.)
  • Discovery caching and stale responses keeps the original intent (9f5739a: Retain a successful connection-scoped overview and retire older searches when restoring it.)
  • Consent and plugin mutations keeps the original intent (0dbd5c8: Bind capability acceptance to the reviewed artifact and present one consent decision before granting plugin authority.)
  • Lazy skill previews keeps the original intent (3aa130d: Load the entry first, fetch supporting files on selection, and prevent late responses from changing another preview.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:assertion-safety --base 18cd308
  • pnpm tsgo:ui
  • git diff --check

What I checked:

  • Introduced change and current main: The pinned introduction replaces the Plugins controllers and their host wiring; fetched main retains the original implementation, with no intervening Plugins changes. (ui/src/pages/plugins/plugins-page.ts:47, 057741f9d7fe)
  • Diff-caused assertion ratchet failure: The failed baseline job explicitly reports assertion-safety failure. The new state objects contain non-const assertions without SAFETY comments or baseline allowances; the ratchet counts these assertions. (ui/src/pages/plugins/plugins-page.ts:62, 057741f9d7fe)
  • Ratchet contract: The assertion scanner exempts const, unknown, and documented SAFETY assertions; new files receive no existing-base allowance. The other max-lines and environment-budget annotations concern untouched paths; their full failure attribution remains unverified because hosted log storage was blocked. (scripts/check-assertion-safety-ratchet.mts:156, 057741f9d7fe)
  • Inspected visual evidence: Downloaded before/after catalog and settings screenshots show matching layout and content, apart from the settings build footer. The manifest prepared four images; the additional skill-preview links could not be downloaded because scratch writes were refused. (057741f9d7fe)
  • Existing migration intent: The merged shared-wizard refactor explicitly reserved the remaining Plugins controller cutover for this lane: refactor(ui): own Models rendering with Solid factories #173902. (ui/src/components/wizard-login-controller.tsx:15, 18cd3088f476)
  • Repository policy applied: Read root and UI AGENTS.md and the Solid ownership guidance; no deeper UI instructions or maintainer-notes directory were present. Applied synchronous ownership, complete cutover, lifecycle cleanup, and release-owned changelog rules. (ui/AGENTS.md:1, 057741f9d7fe)

PR surface

Source -2, Tests +96. Total +94 across 23 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 18 1459 1461 -2
Tests 5 351 255 +96
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 23 1810 1716 +94

Labels

Label changes:

  • add P3: This is an internal rendering refactor with no intended user-facing change; the identified repair is a focused static-check fix.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal rendering refactor with no intended user-facing change; the identified repair is a focused static-check fix.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • 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 16, 2026, 4:15 AM ET / 08:15 UTC.

Merge current main without changing the reviewed Plugins implementation. Preserve the 23-file Solid owner migration and its focused proof while refreshing the branch for native stale-head recovery.
@steipete

Copy link
Copy Markdown
Contributor Author

Superseded by #174281, which contains the same reviewed commits and proof. Two native recovery attempts exhausted this PR’s stale-admin admission window. The original intent and captures remain preserved. Closing this duplicate before the replacement lands is necessary because security review requires a single open PR per head and automatically refreshes the remaining PR on closure.

@steipete steipete closed this Oct 16, 2026
@RomneyDa
RomneyDa deleted the solid2/w-idiom-pages-plugins branch October 22, 2026 05:46
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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