Skip to content

refactor(ui): plan memory imports from owner receipts - #176729

Merged
steipete merged 1 commit into
mainfrom
solid2/w-zero-memory-import-receipts
Oct 19, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-zero-memory-import-receipts

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Memory Import planning still mirrors owner receipts through a reactive effect.

User Impact

Existing import, reconnect, cancellation and retry behavior is preserved.

Why This Change Was Made

Memory Import planning now consumes the existing Gateway, roster and selection projection notifications from one settled subscription lifetime. A six-field request identity suppresses redundant plans and preserves errors until explicit Refresh. Replace Existing requests its new plan directly.

The refresh preserves main's reconnect contract from #174059: client, connection state, admin access, agent, overwrite and presentation scope remain separate identity facts. Same-client reconnects retain drafts, selections, previews and confirmations; identity or access loss retires protected state. The existing cancellation, same-turn admission, attempted import keys and backfill retirement remain with their owners. Markup, CSS, selectors and the lazy route are unchanged.

Evidence

Exact head: be2868dda8258350799e047382023254bf40342d. Base: 42c86b2ca5ab65f800b36a96513e0349a0e178f5.

Check Result
Frozen install Passed, 1.27 s
pnpm tsgo:ui Passed, 11.31 s
UI-pages test-type leaf Passed, 11.61 s
Memory Import test file, default pinned Bun, one worker 18/18 passed once, 16.51 s command / 10.56 s Vitest
Scoped format / type-aware lint Passed, 0.18 s / 275.44 s
Fresh isolated complete-source Codex review, P0–P3 Scoped-clean; no findings; 177.48 s
Production pnpm deadcode:knip Passed once on exact head, 82.33 s
git diff --check Passed

The focused file covers cold offline load, same-client reconnect preservation, account/recovery identity retirement, late replies, repeated owner notifications, overwrite plans, failure retry, import idempotency, same-turn admission and backfill behavior. It emitted no Solid strict diagnostics; the output contained the existing Vite JSON-import warning and SQLite retirement notice. Lint completed normal package declaration preparation without intervention.

No build, local E2E or screenshot run was added during this refresh: the authored change does not alter boot, rendered DOM, styles or the lazy boundary. Exact-head full PR CI completed; details below.

Pattern and size

Pattern Before After
createEffect 1 0
Controller lifecycle, createRenderEffect, untrack, listeners, queries, manual class assembly, flush, owner escapes 0 0

No measured survivors in the changed production file. Production: 610 → 620 lines (+10); tests: 826 → 880 (+54); two files, 90 insertions and 26 deletions. The production increase is the subscription lifetime and minimum previous-request tuple. No new shared helper, copied reactive owner state, dependency, configuration or schema was added.

Main integration and prior CI

This is a single-commit refresh of prior head 960599c0a6ff1c8e6338a21cc6c8026033bccaad onto current main. #174059 changed both task files, so the conflict was resolved around its reconnect semantics and both files received fresh proof. Main's retirement/access-loss block is byte-identical in the result. Of 27 previously recorded source/context blobs, 22 remain identical and five changed; prior test/review results remain historical rather than being reused for the changed input.

CI 39199208312 failed Control UI pasted text chips > restores pasted text directly from the 390px composer on prior head 960599. The composer retained Keep this draft after keyboard activation. One diagnostic attempt passed the original assertions and did not reproduce the failure; it established no repair. No matching-name baseline failure or inherited-failure qualification is claimed.

The refreshed base includes #176719 (0a0cd892c26), which keeps the restore button mounted across attachment refreshes and strengthens that exact test with a background session update between focus and Enter. This concrete landed change warrants fresh CI; it does not establish the cause or repair of the recorded failure. The exact test now passes on refreshed-head CI; no retrospective causal fix claim is made.

Exact-head CI and inherited performance failure

CI39213544722, attempt1, tested merge 1a18059590ab over main 4278e94e48b2: all UI unit tests, all nine UI E2E shards, both real-Gateway shards, types, lint and security passed. The prior 390px pasted-text restore case passed in1,608 ms. Only control-ui-performance and its downstream gate failed.

The observed new boot JS gzip metric is1,050,257 B at the CI base and1,050,274 B at the tested merge (+17 B), both above the unchanged1,050,000 B absolute cap. Startup is337,186 B gzip, seven JS requests and one CSS request (38,500 B). Chat boot is1,485,614→1,485,630 B. The strict checker separately fails retained authored-base 42c86b2ca5ab for this same metric at1,051,123 B. This qualifies an inherited absolute-threshold failure, not a passing strict gate or equivalent complete bundles. The native inherited-failure route is requested with exact run, merge, job and artifact evidence. No budget changes.

@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-19T07:07:36.301880Z be2868d 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.

@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: 5f2974518d

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

planRequest.cancel();
}
onSettled(() => {
const stops = [gateway, agents, selection].map((source) => source.subscribe(syncPlan));

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.

P1 Badge Keep owner coordination in the reactive projection

Replace this manual subscribe/notify loop: the required Solid refactor checklist explicitly rejects manual subscriptions in views except for ordered event APIs, while these three inputs are already latest-value projections. The page now hand-maintains subscription teardown and synchronization outside Solid's tracked dependency lifecycle, making future dependencies easy to omit; express the plan identity as a tracked projection derivation/effect or move the coordination into an owner instead.

AGENTS.md reference: ui/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

@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 drives memory-import planning directly from Gateway, roster, and agent-selection notifications instead of a reactive memo and effect.

Example: Change the selected agent from research to writer while the research plan is pending.

  • Before: Planning follows the reactive update; stale research results are rejected.
  • After: The notification immediately starts writer planning; stale research results remain rejected.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused lifecycle coverage supports the intended behavior, but the patch introduces a concrete scoped-policy violation and the failed performance check remains unattributed.
Proof confidence 🦐 gold shrimp (3/6) The supplied evidence exercises MemoryImportPage through a DOM harness with mocked Gateway requests; the maintainer-author exemption applies, and no material authority-chain change requires separate final-effect proof.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes
User problem: No visible defect is claimed; the intended benefit is simpler planning lifecycle coordination.
Reason: The maintainer-authored direction is approved, but the implementation must preserve the repository's existing ownership and reactive-lifecycle contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open for a focused repair: its manual subscription loop violates the applicable Solid view policy.

Priority: P3
Reviewed head: 5f2974518d99801948ba16fb245a4fa76f021649

Before merge

  • Keep latest-value planning coordination in the reactive lifecycle (P2) - ui/AGENTS.md requires the Solid refactor checklist, whose manual subscribe/notify exception applies to ordered event APIs. gateway, agents, and selection here are latest-value SourceProjections, and syncPlan samples their current snapshots rather than consuming an event contract. This hunk introduces the prohibited view-owned subscription loop plus manually retained equality state where the existing memo/effect already coordinates these inputs. Restore the equality-gated reactive lifecycle, retaining cancellation, explicit Refresh, and mutation recovery behavior.

Findings

  • [P2] Keep latest-value planning coordination in the reactive lifecycle — ui/src/pages/memory-import/memory-import-page.tsx:161-163

Tests

  • Missing end-to-end proof: No shipped Control UI run exercises agent changes, overwrite changes, failed-plan Refresh, and disposal; supplied coverage uses a mocked Gateway client.
Agent review details

How this fits together

The Control UI memory-import page combines connection, roster, selection, and overwrite settings into Gateway planning requests, then renders plans and coordinates import confirmations.

flowchart TD
  A[Gateway connection] --> D[Memory import page]
  B[Agent roster] --> D
  C[Agent selection] --> D
  D --> E[Page request owner]
  E --> F[Gateway memory planner]
  F --> G[Plan and confirmation UI]
Loading

Technical review

Best possible solution:

Keep equality-gated planning in the existing reactive projection lifecycle and retain createPageRequest as the cancellation owner.

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

No broken user workflow is reported; source inspection establishes the introduced policy violation without claiming a runtime reproduction.

Is this the best way to solve the issue?

Removing an effect does not simplify ownership when it replaces tracked dependencies with manual subscriptions and a second request-identity tuple.

Full review comments:

  • [P2] Keep latest-value planning coordination in the reactive lifecycle — ui/src/pages/memory-import/memory-import-page.tsx:161-163
    ui/AGENTS.md requires the Solid refactor checklist, whose manual subscribe/notify exception applies to ordered event APIs. gateway, agents, and selection here are latest-value SourceProjections, and syncPlan samples their current snapshots rather than consuming an event contract. This hunk introduces the prohibited view-owned subscription loop plus manually retained equality state where the existing memo/effect already coordinates these inputs. Restore the equality-gated reactive lifecycle, retaining cancellation, explicit Refresh, and mutation recovery behavior.
    Confidence: 0.97

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 87425ef92707.

Provenance checked

  • Planning identity and lifecycle changes intended behavior with a stated reason (d64ce70: The Solid migration used owner projections and an equality-gated planning identity while preserving captured targets and uncertain apply recovery.)
  • Cancellation and stale-result publication keeps the original intent (36bd5fa: The shared page-request owner consolidated replaceable reads without transferring mutation or security admission.)
  • Agent and overwrite handlers changes intended behavior with a stated reason (d64ce70: Handlers preserve synchronous mutation state and captured-target checks; this PR reorders resets to accommodate immediate notification-driven planning.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/pages/memory-import/memory-import-page.test.tsx --maxWorkers=1
  • pnpm tsgo:ui
  • git diff --check

What I checked:

PR surface

Source +9, Tests +54. Total +63 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 33 24 +9
Tests 1 56 2 +54
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 89 26 +63

Labels

Label changes:

  • add P3: This is a lifecycle refactor with no established current user-facing failure or urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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 a lifecycle refactor with no established current user-facing failure or urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • 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, 9:26 PM ET / October 19, 2026, 01:26 UTC.

@steipete
steipete force-pushed the solid2/w-zero-memory-import-receipts branch from 5f29745 to 960599c Compare October 19, 2026 04:23
@steipete
steipete force-pushed the solid2/w-zero-memory-import-receipts branch from 960599c to be2868d Compare October 19, 2026 07:03
@steipete
steipete merged commit e82a3c0 into main Oct 19, 2026
101 of 106 checks passed
@steipete
steipete deleted the solid2/w-zero-memory-import-receipts branch October 19, 2026 07:51
@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: S 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