Repository navigation
view shell live code: a patch carries new Swift files - #35705
Conversation
|
Review (codex, router-review): SHIP at 31046ce Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 1. They land as checklist items in this PR's one follow-up tracking issue in this repo ( SHIP at 31046ce Visual verdict: no images; Leo tries the build Checked the focused unit tests: 12 pass. Follow-ups:
|
|
Found 1 test failure on Blacksmith runners: Failure
|
…changed since the build inject.sh links, besides the files named, every Swift file the running Debug build never compiled and every file newer than that build, so a new view in a new file applies live and a repeat patch holds all of the new code. live_apply.py no longer counts a new Swift file as a rebuild (an entry point still is). The live-code-shell measurement adds a new-file step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-45fddab7397278d38551
…try-pr names new files as live Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-45fddab7397278d38551
…eckout path with a space works SwiftPM quotes or escapes such a path in ViewShell.build/sources; the exact-path match then took every file, main.swift included, for a new one (a fleet Mac under /Library/Application Support). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-45fddab7397278d38551
SwiftPM's sources list quotes paths its own way (single quotes for a path with a space); the object file per source in ViewShell.build needs no parsing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-45fddab7397278d38551
ea2424a to
476a2ad
Compare
|
Review (codex, router-review): SHIP at 476a2ad Reviewer: codex gpt-6-astra high, fast tier. Follow-ups: 2. They land as checklist items in this PR's one follow-up tracking issue in this repo ( SHIP at 476a2ad Visual verdict: no images; Leo tries the build
Focused Follow-ups:
|
|
Pictures of the new-file step (generation 3, the green dot from Agent session: agent session |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
|
…ve_apply finds @main among other attributes (#35861) Review follow-ups of #35850 (rebind ignored a refused mprotect) and #35705 (`@MainActor @main` was counted live). Agent-Session: https://cmux.com/deeplink/agent?id=aid-45fddab7397278d38551 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Leo (2026-11-04): "Couldn't we architect stuff to make everything more amenable to hot swappage? Bridge better api better thin the layer nicer / Idk how well we can pre prepare stored properties/function signatures/deal with files"
This is the "new files" piece of that: a new Swift file no longer forces a rebuild of the view shell. In the 8,315-PR sample, 41% of the PRs that needed a rebuild added a file.
What changes
Prototypes/ViewShell/inject.sh: besides the files named, the patch now links two kinds of file:ViewShell.build): a new file;It prints
also X.swift (new since the build | changed since the build)for each one. So a new view in a new file, used from an edited file, links inside the patch. Each repeat patch holds all of the new code, so callers never keep an earlier patch's copy of the new file.main.swiftandLiveCode.swiftstill refuse. With no Debug build at.build/debug(orCMUX_VIEW_SHELL_BUILD), the patch holds only the files named, as before, and the script says so.scripts/cmux-next/live_apply.py(try-pr's classifier): an added Swift file no longer counts as a rebuild. An addedmain.swiftor@mainis the exception and counts asnew entry point. New types in existing files keep their rebuild reason.scripts/measure/live-code-shell.sh: a new step 3 writesLiveCodeProbeDot.swift, hasBadge.swiftuse it, and injects naming onlyBadge.swift. The stored-property step becomes step 4.result.jsongainsnew_file_editandnew_file_edit_to_pixels_s.Docs: the view shell README ("Live code") and
docs/cmux-next/hot-reload.md.Verification
python3 -m unittest scripts/cmux-next/tests/test_live_apply.py: 12 tests pass, including the new-file test and the@mainone.scripts/measure/live-code-shell.shwas run at this head and at its base (4546c99a, which has the view shell live code: repoint already-bound symbol pointers, so a patch changes what draws #35850 pointer fix but the oldinject.sh). Both ran on the same machine. Rendered badge widths at 2×:LiveCodeProbeDot.swiftused by Badge.swift; only Badge.swift nameddlopen … symbol not found … LiveCodeProbeDot…also LiveCodeProbeDot.swift (new since the build), 283 px with the dot, 1.26 s from edit to pixels@StateViewShell.build/<name>.swift.o). An earlier version read SwiftPM'ssourceslist, but that list quotes a path with a space, which made every file look new.Part of manaflow-ai/cmuxterm-hq#7066.
🤖 Generated with Claude Code
Agent session: agent session