Repository navigation
Conversation
The design the owner approved from a prototype panel on 2026-11-13: one tool in to-human whose handler forks the session to write one HTML page per session, a per-machine server reached over tailscale serve, a shipped base with notes the human checks off, PANEL_LOCALE, and the rule line. The engine trials' findings are in Surprises & Discoveries. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
The human is shown a written panel by the call's row and a notification, with the session told by hook context instead of woken; the fork edits a draft the server publishes at its end; the server is the only writer of a panel's records; proxied requests are known by the forwarding headers, since tailscale serve passes a client's Host through; a content policy on every response; a call during a run is refused; tailnet exposure is asked for by PANEL_REACH. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
The guard refuses a secret's handle at tool.call, before devcloud's hook restores it; publishing cuts what navigates or names another host by itself (a refresh meta, a foreign link, a base), which the content policy does not govern; a look names the publication it saw, and a first look during a rewrite is reported to the session; hook context is added to a tool call's result and to a prompt's input. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
to-human/panel/server.py: one server per machine on 127.0.0.1:$PANEL_PORT (4777) that serves every session's panel and the base, the only writer of a panel's records (one lock, whole-file writes); its command line (serve, ensure, open-panel, publish) is a client that starts it detached (double fork, setsid) and replaces an older version. Who may ask is decided by the forwarding headers (a proxied request carries exactly one owner's Tailscale-User-Login; a local one a local Host), POSTs need JSON and an own Origin, control requests a token from server.json (0600). Every response carries the content policy; the page gets a nonce'd script with its publish time and checked notes. Publishing cuts <meta http-equiv>, <link> but a base stylesheet, and <base>, read as a browser tokenizes a tag, everywhere, to a fixpoint. PANEL_REACH=tailnet maps the port with tailscale serve (sudo -n where refused), in a background refresh no request waits on. to-human/panel/base/: panel.css (from the approved prototype), panel.js (notes in the margin or under their block, the count and the jump, checks and looks reported, one reload on a publish keeping the scroll, English and Korean), starter.html, GUIDE.md. Tests: to-human/tests/panel (unittest, stub tailscale and sudo; run by the to-human-mods gate) and live-base-check.sh (playwright-cli, by hand). Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…E on notes in list items The tests load server.py with bytecode writing off, so no __pycache__ lands in the plugin; /control/health answers the spec's three fields; GUIDE.md says where a note goes when its mark is in a list item or a table cell. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…ors) R1: a failed, timed-out or malformed `tailscale serve status` lookup is "unknown", not "no": the reach is local and nothing is configured; only a lookup that answered and shows nothing on the port (no Web host, no TCP forward) lets the server run `serve --bg`. R2: a tag the draft leaves open is cut whatever it holds so far, its open attribute counted, since the served page's next text would close it. The server's script is preceded by a guard, `<!--"'>-->`: an empty comment where the parser is in the body or head, and where a draft left it inside a start tag or a comment, the quotes and `>` that close it first, so the script's nonce can never become an attribute of the draft's own tag. R3: a filesystem failure at a cold start (an unwritable configuration directory) is the command line's one stderr line and exit 1, not a traceback. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
… window.PANEL (R5) The guard's `-->` closed a head comment that names </head> early, so the rest of the comment showed in the body. The guard goes: the script is put before the first </head> exactly as the spec says, and a draft tag left open that swallows it cannot carry its nonce (CSP3: an element with `<script` in an attribute is not nonceable). Tags left open are still cut. Where the script lands inside such a comment it does not run. panel.js took that as a page with no publish time and reloaded on every poll; it now takes the first /written answer as the shown page's time, reports the look with it, and draws every note, a checked one included, until the next update. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…thout it (R6, R7) The script is appended at the very end of the page's source, always: the end of a well-formed page stands outside every comment, tag and raw-text element, where a textual </head> may stand inside a comment. panel.js, linked defer, runs after it. panel.js no longer adopts the first /written answer when window.PANEL is absent (it could adopt a newer publication than the one shown, and carried no checked list): on a page left open at its end, where the script is inert, it draws the notes and neither polls, reloads nor reports a look. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
mcp__to-human__present opens the panel through server.py, spawns a fork of the session with the standing prompt and the brief, and returns at once. A guard registered apart from the handler holds the fork to reading and to writing its draft; plan mode is refused at the spawn, where the engine stamps the parent's mode. The fork's turn.complete publishes the draft, turns the call's row from writing… to the address (or not written and why), notifies, and leaves FINISHED or FAILED as hook context for the main loop's next tool result or prompt. The run's record, the rows' states and the notices live in $.state, so a module that starts over mid-run still guards the fork and hears its end. Session start runs server.py ensure, unawaited. The registered agents withhold the tool; panel.js's header says the server's script is appended at the page's end. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…pawn allowed The engine runs a plugin's $.agent.spawn as an Agent tool call and checks it as any call: in plan and auto mode the check asked, and the present call waited on a permission dialog. The guard's tool.check now allows the Agent call this plugin raised for its panel fork; plan mode is refused at the handler from the mode the engine reports (a prompt's, a switch's), since a fork inherits it and cannot write there. Versions: to-human 0.10.0, doperpowers 7.221.0. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Scenarios main (acceptance 1-6, 8-10, 14, the ensure replacement, the billed tokens and the idle fork), guard (7 in one permission mode, with --locale ko for 6), plan (7's refusal) and stay (the fork on the owner's models). Each runs in an isolated configuration directory with its own PANEL_PORT, panel server and tmux socket; it spends model calls, so no suite runs it. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
… and the guard's refusal Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…origin (M2 review) Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
The guard fails closed: the ids of every fork the module spawned are kept in $.state apart from the record and outlive it; each key is read back on its own and read again after a failure, and written only once read; past the ids, the agent list names this plugin's panel forks; a subagent's call whose agent cannot be placed is refused. A notice rides only the model's main-loop result, not a plugin's own call. The BUSY check holds the run it read, so a fork ending meanwhile no longer throws. The record gains startedAt and phase: kept publishing before publish, so a module that starts over publishes again and counts a committed page written. BUSY and GUARD_REFUSAL as Interfaces words them. The test harness's continuation replays a settled result and every hook failure is held to none unexpected; the live check gains acceptance 5 (unseen) and the lookalike Agent call. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…n it was taken The kept fork ids have no cap, and while they are unread an agent the list does not name is refused (a closed panel fork is absent from it too). Each keep takes its keys' readiness with its snapshot, so a write queued before the record was read back cannot store a stale record over it, and it says whether the record was written: the fork's publishing phase is kept before publish or the run is closed as not written (its record could not be kept). Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
… background subagent's call An edit can anchor several notes (the owner models anchored one per changed place), so check 4 checks off one note by its id and looks for that one; a subagent the session ran in the background may call present after the turn's end, so check 14 waits for its result. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…models Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
The standing prompt and its {checked} line take Interfaces' new wording;
GUIDE.md's note section says one change is one note at its first place,
every other place marked with its id, and deleting a checked note deletes
every mark of it. open-panel holds a checked note while its aside or any
of its marks remains. live-base-check shows the base's side: one note with
three marks drawn once at its first mark, all highlighted, counted once,
cleared by one check that holds on a reload, and the check kept until the
last mark goes.
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…ever many marks it has Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
… requests the transcripts record wire_replay.py rebuilds the exact request a session sent from its transcript (api-request records, blobs and rows), one line at a time; the eval swaps in an arm's style and CLAUDE.md line, offers the present tool, and runs each turn on its own model and effort until it reaches the human. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…cumented (doperpowers 7.222.0, to-human 0.11.0) The style says when a session puts something on its panel; to-human's CLAUDE.md carries the present tool, its fork, its guard, the panel server and the haiku limit; whats-inside, the README and the plugin descriptions name the tool. The replay skips a turn whose model's plan is spent and tallies the step each run reached the human at. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…spent plan The replay's counts over all twenty turns: under the rule 8 of 30 warranted runs call present (designs 7 of 9, decisions 1 of 12, revisions 0 of 9) and 0 of 30 routine; the control, 0 of 20. Each run is shown by the step it reached the human at, with the runs whose report talks about the replay listed. The harness no longer retries a 429, and an out-of-plan refusal skips the rest of the process's turns. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…log and beside it For the ruling on what counts as a warranted decision: per run of w1-w4, the dialog's questions and options, the message beside it and its structure, and whether it called present. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…ed; relabelled bar Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…econd round, and an exact rebuild The style carries the design's RULE as reworded: a design put for approval, a decision the ask dialog cannot carry (beside the question), findings about to be corrected or restated a third time; a decision the dialog carries stays text. Its round over the 20 turns, relabelled by the human's ruling: warranted 11 of 21 call present (designs 9 of 9, w3 2 of 3, revisions 0 of 9), the text side 0 of 36, w2 apart 0 of 3. The harness resumes by repetition, not by turn, so a plan spent midway leaves the remaining repetitions to run; a spent plan stops every worker's next request, and the run it cut short is recorded as skipped. The rebuild matches a tool-result message in the order its results were sent and with a Skill call's loaded body, so all 20 turns now rebuild byte for byte; the eval report gives what the earlier rounds substituted and how it bears on their counts. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
A former panel fork stays held, but its Write or Edit of the open run's draft passed the check, since the guard compared only the path. A late call of an old fork could overwrite the new run's draft, which the new fork's end then published. The draft write is now allowed only for the open run's fork while it writes. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…cuts no publish Two servers on different PANEL_PORTs over one configuration directory both served its panels under their own Panels.lock, and the second overwrote server.json. The server now holds the panels directory's server.lock (flock) for its life; a second one refuses with one line, and a command whose PANEL_PORT is not the running server's is refused naming its port. A shutdown (the version replacement) did not wait for its handlers, so a publish cut between the page and its record left written null and a retry answered published false. The server now lets the requests in flight answer, takes Panels.lock and exits holding it, and lets go of the directory before the port. A publish records its time before it replaces the page, and a page the draft matches with no publish recorded is published. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
…run on the exact rebuild Each turn's request as it ran was compared with its byte-exact rebuild: eleven identical, four differing only in block order (kept), five missing a Skill call's loaded body (w4, w5, w6, w8, r10), re-run three times each under the final rule. The counts did not move: designs 9 of 9, w3 2 of 3, revisions 0 of 9, the text side 0 of 36. The replaced runs stay beside them, marked as run on an approximate rebuild; acceptance 15 is recorded from the corrected counts. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
… spent plan stops a retry too The decontaminated text side is 0 of 31 (11 clear cases). send() checks the spent-plan flag before every attempt, not only before a run's next request. The report's summary says the counts are content-complete, with the four turns kept on a reordered message named, and separates the second wording's measured skill-body re-run from the first wording's unmeasured one. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
The draft write checked the module's own record of heard ends, which a reload empties, so a restored run already in phase publishing let its fork, resumed before the reconciliation, write the draft. The write now also needs the run's phase to be writing. Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 931ae2ddb8
ℹ️ 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".
| post('seen', { written: panel.written }).catch(() => { | ||
| told = false; | ||
| }); |
There was a problem hiding this comment.
Retry failed look reports while the page stays visible
If the initial /seen request fails transiently, resetting told does not cause another attempt: look() is called only at startup and when the tab becomes visible, while successful polling never calls it. A human who keeps reading in the same visible tab can therefore remain recorded as never having seen the panel. The next open-panel then supplies an incorrect seen value to the fork, which can omit change notes for content the human actually read. Retry pending look reports during polling or schedule a bounded retry after failure.
Useful? React with 👍 / 👎.
| const open = run | ||
| if (open !== null && (await isRunOpen($, open)) && run?.agentId === open.agentId) { | ||
| return { deny: BUSY(open.address) } |
There was a problem hiding this comment.
Reset session-owned panel state when the conversation is cleared
If the human runs /clear while a panel fork is still running, the new conversation's present call is refused as busy with the previous conversation's address. /clear changes the session ID without restarting the plugin module, as handled explicitly in sminos/hooks/mods/bridge.tsx:2029–2038, but this module neither resets its session-owned state nor compares open.session with the current session before this check. The previous run's eventual notice also enters the new conversation through the unscoped notices queue. Handle the conversation transition or scope runs and notices by session, while retaining the historical fork IDs needed by the guard.
Useful? React with 👍 / 👎.
| tailnet = self.server.reach.tailnet_origin() | ||
| if tailnet: | ||
| own.add(tailnet) | ||
| return origin in own |
There was a problem hiding this comment.
Normalize default ports before comparing browser origins
With PANEL_PORT=443 and tailnet exposure, the page opens, but every browser POST for checking a note or reporting a look receives 403. Reach.tailnet_origin() includes the explicit :443, whereas browsers serialize the same HTTPS origin without its default port, so this string comparison rejects legitimate same-origin requests. Calling these handlers with an authenticated forwarded request and Origin: https://host.example.ts.net reproduces the rejection. Normalize the allowed origins, or omit default ports when constructing them, so this accepted port configuration supports the panel's interactions.
Useful? React with 👍 / 👎.
…11.1) Every request of the fork goes out at FORK_EFFORT (medium) whatever the session's, by a turn.step rewrite of each of its steps; a model without effort is sent none. The prompt cache does not key on effort: a request at medium read the whole prefix one at high had cached (opus-5-5, fable-5-2), and the fork's first request read and wrote the same amounts with the session at medium and at xhigh. live-present-check takes --effort and checks the fork's requests went out at medium. Sminos-Session: present-panel-feature#b4d10f41 (doperpowers on macbook)
…lated home installs A kept run held ~356 MB, 331 of them the claude build the isolated home installs for itself; 48 runs filled 16 GB of /tmp. The spec's one cited fork transcript moves to ~/.local/share/present-panel/m2/evidence/. Sminos-Session: present-panel-feature#b4d10f41 (doperpowers on macbook)
This adds the panel: one more way for a to-human session to reach its human. The session calls
mcp__to-human__presentwith a brief and keeps working. A fork of the session writes one HTML page per session in the background. A local server serves the page, behindtailscale servewhenPANEL_REACH=tailnetis set. When the page is written, the call's row in the report shows its address and a notification is raised. Changes since the human last looked show as notes with a check button. The rule for when to use it is in theto-humanstyle.Design and decision history:
docs/doperpowers/specs/2026-11-13-present-panel-design.md. Execution report:docs/doperpowers/specs/2026-11-13-present-panel-report.md. The rule's evaluation:docs/doperpowers/specs/2026-11-13-present-panel-eval.md.Versions: to-human 0.8.2 → 0.11.0, doperpowers 7.220.0 → 7.222.0. The message tool's contract and the style's
maws-to-human-contractare unchanged.Not to merge before the designing session's go-ahead. After the merge, the designing session edits the owner's two files: the rule line in
~/.claude/CLAUDE.mdandPANEL_REACHin~/.claude/settings.json. It also stops the prototype's static server on port 4777.Validation Evidence
Every CI gate on the final head:
ci-gateon 931ae2d →GREEN, 20 of 20 gates pass. https://github.com/SSFSKIM/doperpowers/actions/runs/43586228608Panel server (M1, acceptance 4 and 10 server halves, 11):
python3 -W error::ResourceWarning -m unittest discover -s to-human/tests/panel→Ran 73 tests … OKon 070921a. No server file changed after that commit.The base in a browser:
bash to-human/tests/panel/live-base-check.sh→ all checks pass on 070921a. The checks cover:meta,dns-prefetch,<!-->): no script runs, nothing loads, no navigation, and no request leaves the machine;Kit tests (M2, acceptance 14's offer rules, the guard):
bash to-human/tests/mods/run.sh→ 374 pass, 0 fail on ea7303d.Eval harness logic:
python3 tests/output-styles/test-present-eval.py→ 17 of 17 on 360860e.Versions:
scripts/bump-version.sh --since origin/main→to-human 0.8.2 -> 0.11.0,doperpowers 7.220.0 -> 7.222.0.Acceptance 1–10 and 14, live:
python3 to-human/tests/mods/live-present-check.pywas run in an isolated config dir with its ownPANEL_PORT. M3's re-run onclaude-fable-5-2passed every item:main,unseen,guardin default / acceptEdits (Korean) / auto / bypassPermissions / dontAsk, andplan. On haiku (M2) every item passed in at least one run. Acceptance 3, 4, 5 and 8 are judged on fable, as ruled in the spec's Decision Log, because haiku forks are this version's declared limit.Acceptance 12 and 13, live, devcloud host
dc-c53-g1a-980a: run in M1 and again in M3.PANEL_REACH=tailnet(mapped undersudo -n), opened in the MacBook's browser, and a check made there reached the host'sstate.json.Host: 127.0.0.1:<port>, with a forged login, and/control/healthwith a made-up token.Acceptance 15, the rule's replay (
tests/output-styles/to-human-present-eval.py, each turn's recorded request, on its own model and effort):presentThe result: met for designs, for the decision the dialog cannot carry, and on the text side; not met for revisions. Under the designing session's terms, set before the round, the rule ships as worded and the revision gap is a ticket (Residue). The eval report lists 11 clearly contaminated runs, ones that tell the human about the replay; removing them changes no verdict.
Unresolved Review Findings
to-human/hooks/mods/present.tsx, the run's record after the spawn: the record is written to$.statein the first step after$.agent.spawnreturns. A module reload that lands inside that microsecond window would come back without the record, leaving that fork unguarded. Left as is: the window is one await, and closing it means persisting a reservation before the spawn, which the spawn's denial path would then have to unwind. (M2 executor's self-review.)to-human/panel/server.py, shutdown wait: a client that sends headers and then stalls its body can delay a version replacement by up to 3 s, the in-flight wait. Left: bounded, and the alternative cuts an in-flight publish, which is the defect the wait fixed. (Final fixer's concern.)server.py, cold start: proxied requests are refused (403) until the first tailnet identity refresh settles, about 0.1 s and at most 5 s with a stalledtailscale. Left: failing closed is the intended posture, and local requests are unaffected. (M1 executor.)server.py,Published.removedlabels: a tag left open at the draft's end is cut whatever its attributes, but labelled by kind, so an open<meta charset=…is reported asmeta http-equiv. Left: the cut is right and only the label is coarse.automode, live: on fable the guard scenario's fork attempted nothing off-limits inauto, so that live run did not exercise the guard. The guard's code does not depend on the mode; the kit tests cover it, and it was exercised live in the other four modes.Residue
/base/*returns 404 for already-open pages until a session starts on the newer plugin andensurereplaces the server. Confirmed live thatensureat session start does replace an older server; the gap is the time before any session starts.Sminos-Session: present-panel-design#b4d10f41 (doperpowers on macbook)