refactor(desktop): move Task Entry controller below AppShell - #4491
refactor(desktop): move Task Entry controller below AppShell#4491chihumyum wants to merge 2 commits into
Conversation
de29c32 to
3f5931e
Compare
|
@Astro-Han This PR is now rebased onto current Exact head: Automated update from OpenAI Codex on behalf of the PR author. |
a320a82 to
8a59de8
Compare
8a59de8 to
f22555b
Compare
|
Rebased onto current Local verification on this head with Node 24: Desktop The description now states that the performance table comes from a synthetic harness rather than a running instance. Automated update from Claude Code on behalf of the PR author. |
f22555b to
2e104af
Compare
|
Rebased again onto current On the previous head's CI run, the Same local verification on this head with Node 24: desktop Automated update from Claude Code on behalf of the PR author. |
2e104af to
3b37afd
Compare
|
Rebased onto Posted by Claude Code on behalf of the PR author. |
3b37afd to
3dc2ee8
Compare
|
Rebased once more onto Posted by Claude Code on behalf of the PR author. |
3dc2ee8 to
f8c057f
Compare
|
Rebased onto
Exact head: @Astro-Han this is the next one in the chain after #4315, whenever you have time. |
Generated-by: OpenAI Codex
The controllerOwners guard from apache#4315 requires the component AppShell mounts to own the controller call, so TaskEntryRoot now calls useTaskEntryController itself and memoizes the render prop on the shell projection, which keeps the frame bail-out the inner provider used to provide. The public entry exports the projection type so AppShell no longer derives it from component props, and the boundary assertions the guard now proves are dropped.
f8c057f to
0151abc
Compare
|
Rebased onto |
Summary
TaskEntryRoot/TaskEntryProviderthe sole production owner ofuseTaskEntryControllerThis is the controller-scope follow-up to the Task Entry feature slice from #3723.
Refs #4582 (supersedes #3439)
Performance evidence
I measured the pure controller-only remote-directory handoff that previously re-rendered the AppShell-owned frame. This is a same-process alternating A/B benchmark with a synthetic 2,000-leaf shell frame, 20 warmups, and 120 paired trials per run. The table reports each run's median:
actualDurationThat is 99.95% fewer rendered fibers, 93.8% lower React render duration, and 92.4% lower synchronous JS wall time for this isolated update. All 360 paired trials favored the scoped owner.
This does not measure the full create-task/pause/IPC/Runtime Host chain and is not a claim that the entire application is 92% faster. The percentages come from a synthetic 2,000-leaf frame in a same-process harness, not from a running Maka instance, so they demonstrate the scope mechanism rather than an in-app gain; the deterministic render-scope test is the contract. The benchmark scaffold was temporary and is not included in the production diff. The permanent deterministic test proves the scope boundary without timing: the same real controller handoff leaves the shell and unrelated frame at zero renders and wakes only the Host reader.
Review focus
The generic
controllerOwnersregistry is still under review in #4315, so this branch does not duplicate that checker. Against currentmain, exact Task Entry tests pin the sole controller call site, the only deep importers, the public/testing split, and the absence of controller/Host/Workspace ownership in AppShell. If #4315 lands first, this PR should be rebased and Task Entry registered in that generic policy.The latest rebase resolves AppShell, Task Entry public-entry, and generated architecture-ledger conflicts against
main@b714a3921. Task Entry now uses one namespace public-entry import, so the updated root ratchet improves rather than grows: AppShell import specifiers186 → 185, and the obsoleteuseTaskEntryController: 1hook inventory entry is retired.Verification
Exact head:
8a59de8fd5ac7d230513ce1a993ccd141e95765cnpm run rebuild— full production build, including renderer entry and third-party notice checksnpm --workspace @maka/desktop run test:dist— 1,969/1,969 passednpm run check:renderer-architecture -- --base upstream/main— 71/71 checker fixtures and real checkout passednpm run check:app-shell-hooks— 41 hooks / 77 call sites passednpm run astryx:surface-inventory— 244 files, 1 exclusionnpm run astryx:surface-inventory:test— 15/15 passednpx knip --workspace apps/desktopnpm run typecheck --workspace @maka/desktop -- --pretty falsenpm run lintnpm run format:checkgit diff --check upstream/main...HEADgit merge-tree --write-tree upstream/main HEADAI use
Select exactly one:
Tool(s) and scope: OpenAI Codex designed and implemented the controller ownership boundary, added the architecture/render-scope tests, built and ran the temporary benchmark, resolved the current-main conflicts, audited remote overlap, and prepared this PR. The commit includes a
Generated-by: OpenAI Codextrailer.Checklist
Does this PR entail a change in behavior?