Repository navigation
feat(next): add Labs Artifacts pane - #27264
teamleaderleo wants to merge 2 commits into
Conversation
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
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)
Unclear: CI failed on
Failures:
Matched log linesNot re-run automatically: Written by red: cmux-next crash ratchet; NEW: green on the base b9bb6bb; do not merge until green; see lane-rules Gallery before/after for |
Default changesThis pull request changes 4 defaults at
Needs a review. It passes with an independent review receipt on this commit: a comment or review whose first line is Regenerate the snapshot with |
|
Bead |
|
Found 44 test failures on Blacksmith runners: Failures
...and 34 more test failures. View all on Blacksmith: run 40969403431, run 40969403461, run 40969403446
|
|
Orphaned: no activity for 16 h, and no lane holds a lease on it. Adopted by the orphan sweep: merged |
|
Owned by an agent session · session |
|
Carried on #27823 (this commit with its authorship, rebased onto feat-cmux-next, plus the fixes that make it build and match the platform reads). Review and landing happen there. This PR stays open for its owner to close. |
Carries #27264's Artifacts pane and repairs it so it builds and matches cmux-platform's /v1/artifacts reads: - CmuxNextPages/ArtifactsPageProvider: the page's three ops (tree, file, history) become one checked GET each with the app's bearer; params are allowlisted (ref and path strings, limit 1-100), a refusal becomes the app's own words (signed out, nothing saved, unreachable), a file over 4 MiB comes back without content, bytes that are not UTF-8 as base64. The provider asks labs.previewFeatures on every read, so a restored tab reads nothing once Labs is off. Unit tests cover each of these. - The App wiring sits in StatsPage.swift beside the other preview page (no new App file or type); artifacts.show is palette-only and GUI-only. - The web page imported a module that does not exist and assumed a recursive tree; it now reads the tree a folder at a time (capped at 200 folders), shows it in the shared keyboard tree (ui/Tree), previews HTML in the agent pane's scriptless srcdoc (sandbox=""), and shows a chosen revision's change against its parent with the agent pane's line diff. A parent where the file did not exist reads as added. A reply for a file the person already left is dropped; a refresh keeps the tree. - Strings are localized in all 21 locales (page, native, palette). Tests: webviews/test/artifacts-page.test.ts (8 pass on this head); Tests/CmuxNextPagesTests/ArtifactsPageProviderTests.swift (run on the fleet, not here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1144e1f1f6e83544a4cb
|
Review (codex gpt-6.1-sol high fast, review-router; run by a backlog lander, relayed): BLOCK at ad0fb02
|
|
Superseded by its carry #27823 (this commit rebased onto feat-cmux-next with the build fixes). Closing this copy. |
|
Conflict wave: not resolved. This PR is superseded by its carry #27823 (the author's comment above). I pushed no merge. I did not close the PR; a person can close it. |
…iff (#27823) * feat(artifacts): add Labs read-only artifacts pane Agent-Session: https://cmux.com/deeplink/agent?id=aid-1144e1f1f6e83544a4cb * feat(next): finish the Labs Artifacts page on the platform reads Carries #27264's Artifacts pane and repairs it so it builds and matches cmux-platform's /v1/artifacts reads: - CmuxNextPages/ArtifactsPageProvider: the page's three ops (tree, file, history) become one checked GET each with the app's bearer; params are allowlisted (ref and path strings, limit 1-100), a refusal becomes the app's own words (signed out, nothing saved, unreachable), a file over 4 MiB comes back without content, bytes that are not UTF-8 as base64. The provider asks labs.previewFeatures on every read, so a restored tab reads nothing once Labs is off. Unit tests cover each of these. - The App wiring sits in StatsPage.swift beside the other preview page (no new App file or type); artifacts.show is palette-only and GUI-only. - The web page imported a module that does not exist and assumed a recursive tree; it now reads the tree a folder at a time (capped at 200 folders), shows it in the shared keyboard tree (ui/Tree), previews HTML in the agent pane's scriptless srcdoc (sandbox=""), and shows a chosen revision's change against its parent with the agent pane's line diff. A parent where the file did not exist reads as added. A reply for a file the person already left is dropped; a refresh keeps the tree. - Strings are localized in all 21 locales (page, native, palette). Tests: webviews/test/artifacts-page.test.ts (8 pass on this head); Tests/CmuxNextPagesTests/ArtifactsPageProviderTests.swift (run on the fleet, not here). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1144e1f1f6e83544a4cb * fix(next): give the Artifacts page its own line diff so its bundle needs no shiki The agent pane's diff.ts imports its whole model, which reaches @pierre/diffs and shiki; the pages bundle has no shiki, so build-pages-web.sh failed on the artifacts page. lineDiff.ts is a small LCS line diff with three lines of context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1144e1f1f6e83544a4cb * fix(next): Artifacts page review fixes: passive frames, refresh, API origin - PageDescriptor.passiveFrames: the page's own document may set a frame's srcdoc (WebKit otherwise cancels that load on a non-agent page, leaving the preview blank), and a srcdoc document can neither navigate itself (a clicked link, a meta refresh) nor be replaced by another URL. The Artifacts page opts in. PagePassiveFrameNavigationTests. - A refresh whose tree head moved reads the chosen file and its history again, keeping them on screen meanwhile; an unchanged head reads only the tree. - CMUX_NEXT_ARTIFACTS_API_URL applies only to a platform Worker (https *.debussy.workers.dev) or wrangler dev on loopback, since the bearer goes there; anything else falls back to development. - Query values are percent-encoded whole: URLComponents.queryItems kept & and = as is, so a path like x&ref=y added a param. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(next): Artifacts page review fixes: CEF passive frames, consistent reads - CEF: the shim's srcdoc lockdown (ArtifactContextRestricted) covers the Artifacts page's frames too (IsPassiveFramePageURL), so on Chromium a saved document cannot navigate or load anything but inline media, as on WebKit. cmux_page_path_test.cpp covers it (158 cases pass). The preview frame is keyed by path and commit: a passive srcdoc frame refuses to be replaced, so each document gets a new frame. - The store reads folders, the chosen file and its history at the root tree's commit, so a save landing meanwhile cannot mix two trees. - A failed reload is retried: the next refresh reads the file again until a read at that head succeeds, and choosing the file again retries too. - artifacts.show takes focus only when the run allows a view change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(next): Artifacts page: retry a failed change, parallel folder reads, tree follows selection - A refresh at the same head reads the chosen file again until its newest change has shown too, and clicking the chosen revision retries a change that failed to read. - Folders under the root are read up to four at once (the old loop drained the queue one at a time). - The tree's highlighted row follows the store's choice when a refresh picks another file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(next): Artifacts history shows a change to the file's final newline A last line with no newline after it was the same line as one with, so adding or dropping the final newline read as "did not change the file's text". lineDiff marks such a line while diffing and the page says "No newline at end of file" after it, as git does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(next): Artifacts line diff keeps the no-newline mark out of the text The last line's missing newline was an in-band suffix, so a file whose text ended in that suffix read as having no final newline. Lines are now {text, noNewline} and compare on both. The hunk walk reads each line's next change from one backward pass instead of a scan per line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(next): Artifacts provider tests type-check fast action exports (Mac) failed to emit the test module: ArtifactsPageProviderTests.swift:80 "the compiler is unable to type-check this expression in reasonable time". That was the @test(arguments:) list of (String, JSONValue) tuples built from mixed literals. It is now a typed static [BadParams] of explicit JSONValue cases, and the other literal-heavy arguments and expectations in the file (the expected reads and file, the refusal codes, the override lists) are typed locals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Artifacts: diff line colors as page tokens The design-token ratchet refuses raw colors outside custom property definitions; the added and removed line fills move into two page tokens with the same values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-627034dbf10a04318c5c * fix(artifacts): a failed history read keeps the file preview; binary or too-large revisions show no diff Review findings at 4e5ba0f (router-review BLOCK F1/F2): the file and history reads no longer share one Promise.all, so a history failure shows beside the preview and a refresh retries it; a revision whose side has no text says so instead of diffing it as empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-0b517f2a10c3ba1c8f62 --------- 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)
HOLD: Implementation, remote validation, before/after captures, and exact-head independent review are unfinished.
Adds a read-only Artifacts pane behind Labs preview features, which are off by default. The native host reads the account's
/v1/artifactstree, file, and history endpoints with its existing cmux bearer. HTML previews are being moved onto the existing shared artifact host; Markdown and JSON stay text. History selection compares the selected revision with its parent and shows session, machine, and harness trailers.Leo: “as for the syncing memories and stuff, i think it'd be useful for customers too... we can look at how these guys do artifacts? https://github.com/pierrecomputer/pierre or anything else interesting from them / also this https://www.cloudflare.com/products/artifacts/”
Earlier: “like the claude.ai artifacts but imagine you didnt need to only have it on claude.ai”. On the MVP: “go ahead”.
Reuse and overlap review:
Sandbox and threat notes:
Validation remains incomplete. The first remote check failed in “Prepare full webview tests” before test execution. No compile, screenshot, or sandbox-test receipt is claimed. The initial broad typecheck ignored the new directory and does not validate the pane. The local corrections add the
.gitignoreexception; a subsequent local web check passed, but no fleet/native/browser receipt is claimed.The only HOLD here is this PR's unfinished implementation and validation. No blanket Sidebar or Swift hold applies; remove this WIP HOLD once exact-head SHIP and required evidence are complete.
Before/after screenshots: pending Linux gallery capture. This PR is not ready to land.
Agent session: agent session