Skip to content

Phase 4c: the editable re-run panel - #456

Merged
neuromechanist merged 20 commits into
feature/issue-429-epic-browser-executionfrom
feature/issue-433-phase4-rerun-panel
Sep 23, 2026
Merged

neuromechanist merged 20 commits into
feature/issue-429-epic-browser-executionfrom
feature/issue-433-phase4-rerun-panel

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

The editable re-run panel, this release's way to keep tinkering (ADR 0010: a hosted notebook is deferred to #453). Each run the assistant recorded in a reply gets "Edit and run": the reader edits the code inline and runs it in the SAME warm runtime and namespace, so the variables the assistant made are there.

  • The reader's consent is the click. A reader's run skips the permission gate the model's code goes through, and runs under the same egress seal, limits, deadline and Stop. It sends nothing to the server and is not added to what the model is sent. Its result shows inline, labeled "This run is yours. The assistant has not seen it.", and is kept with the reply's runs across a reload.
  • Private by enforcement, not by label. get_full_output answers a reader's run id exactly as it answers an unknown one, so the model cannot read the reader's output or learn the run exists. What the run leaves in the shared namespace is visible to later runs, the assistant's included, and the docs say so.
  • One run at a time, and each Stop stops its own. A reader's run is refused while the assistant's call is running or queued; an assistant call that arrives during a reader's run waits for it rather than failing. The reader's Stop cancels only the reader's run, and the tool panel's Stop only the assistant's call.
  • Kept in the workspace as the reader's run: the manifest and notebook.ipynb mark it so.
  • Save failures are shown, for every run: a failed workspace save is carried as its own field and rendered to the reader even when the run succeeded, while the model still reads the note on assistant runs.
  • NEMAR's execute_code description tells the model the reader can edit and re-run, so it can suggest that for a one-line change. docs/community-browser-runtime.md and the design note describe the panel.

Test plan

  • In headless Chrome on the NEMAR page against the live archive: the assistant's read of nm000103 returned (4, 500) in uV with its figure; "Edit and run" with channels=[0, 1] returned (2, 500) with its own figure, labeled as the reader's; the console was clean.
  • test-controller.js 144 and test-widget-tools.js 222 (real widget, real controller, real runtime over the test worker): Run clicked for real and its result landed and saved; a reader's run that crashes and one that times out; Cancel after a completed run; Stop from the widget; Run disabled while the runtime boots; a double click runs once; both Stop buttons visible at once, each stopping only its own; get_full_output refusing a reader's run id with the unknown-id answer.
  • Every other Bun suite green, including test-workspace.js 81 and test-worker-core.js 190; the bundle check is current. chrome.js on real IndexedDB: the workspace write page (40 checks, including reader's runs) and the read-after-reload page (14). pytest: all pass except test_version_shows_version fails locally and passes in CI, because rich colorizes on a TTY #434.
  • Mutation-checked, each caught: both busy refusals, the local marker, targeted Stop in both directions, the get_full_output refusal, the booting branch, and the double-click guard (two independent layers).
  • Reviewed locally by three Sonnet agents; the findings and what was done are in a comment below.

Part of #433 and epic #429.

@neuromechanist

Copy link
Copy Markdown
Member Author

Local review, and what was done with each finding

Three Sonnet reviewers: code, concurrency and security; tests; errors and docs. Every finding was addressed.

Code and security

  • The two Stop buttons shared one cancel(). With an assistant call queued behind a reader's run, the reader's own Stop targeted the assistant's call: the reader's run kept going, and the assistant's call was later answered "the reader declined" for code the reader never saw. Stop is now targeted: cancel() for the assistant's call, cancelLocal() for the reader's run. A test with both visible at once reproduces the original bug under mutation.
  • get_full_output could read a reader's run by its call id, which follows a public pattern, breaking "the assistant has not seen it". The runtime marks a reader's runs and answers their ids with exactly the unknown-id answer.
  • Verified clean: nothing of a reader's run reaches any request (every fetch path traced); transient editor state is never saved; the controller's busy state is always cleared; escaping and the drift whitelist.

Tests

  • Nothing clicked Run in the widget: making the result append a no-op passed every suite. Run and Stop are now clicked for real against a real controller and runtime.
  • A reader's run that crashes and one that times out; Cancel after a completed run (the run happened, and Cancel closes the editor); Stop from the widget; Run while the runtime boots (that branch was dead to every suite); a double click.
  • The three guards the implementation did not mutate were mutated in review, and each is caught.

Errors and docs

  • A workspace save failure on a successful run was invisible to the reader, and for a reader's run to everyone. It is now carried as its own field and rendered for every run.
  • A generic "Unable to save conversation" overwrote the specific message the history save had already shown; it now only logs.
  • A defensive catch around the reader's run, so a future failure cannot leave "Running your code..." up forever.
  • "Nothing the model is later shown changes" overstated it: the reader's run shares the namespace. The docs and comments now say exactly what is enforced.
  • Phase labels in comments were removed.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://feature-issue-433-phase4-rer-demo.osc.earth
Branch feature/issue-433-phase4-rerun-panel
Commit 3666865

This preview will be updated automatically when you push new commits.

@neuromechanist
neuromechanist merged commit e6a6206 into feature/issue-429-epic-browser-execution Sep 23, 2026
14 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-433-phase4-rerun-panel branch September 23, 2026 17:42
neuromechanist added a commit that referenced this pull request Sep 23, 2026
…docs (#460)

* Mark what the design note built differently

Architecture, Sequence, Server changes and Phasing now carry as-built notes for the two-run transport: no interrupt(), no checkpointer, and a parked call closed out on next use. The NEMAR adoption row names eegprep-lean and python_browser, and the caps table gains the per-reply run cap.

* Tidy ADR 0010 and the adopter guide

ADR 0010 names #456 instead of a phase label and says prerequisite 3 needs nemar-cli only off osc.earth. The guide gains the per-reply run cap, spells out URL, OPFS and the File System Access API, and drops double-hyphen dashes.

* Add the browser-execution changelog entry

* fix: remove XMLHttpRequest from worker global

* test: check ResultStatus matches tool_results.py

* test: check workspace cap prose vs constants

* test: assert frontend-tests job parity in CI

* ci: smoke-test the runtime wheel route

* Drop a double-hyphen dash from the guard

Comment only; the guard source is bundled, so the bundle and its integrity pin are rebuilt.

* Say XMLHttpRequest is removed, not shimmed

* Read ResultStatus across wrapped lines

The drift test matched a single line, so a formatter-wrapped Literal would have failed it loudly. It now reads up to the closing bracket. Checked with a wrapped Literal (passes) and a Python-only status (fails).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant