Skip to content

Studio hand-over: every note is not sent, sent and not picked up, or picked up; nothing a person submits is lost - #240

Merged
ZLHad merged 6 commits into
mainfrom
claude/studio-handover-trust-59e5a0
Nov 23, 2026
Merged

ZLHad merged 6 commits into
mainfrom
claude/studio-handover-trust-59e5a0

Conversation

@ZLHad

@ZLHad ZLHad commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

The hand-over between a person reviewing in Studio and the agent waiting outside it. The first real film made with Studio lost a batch of twelve notes, said "你的意见交出去了,等着的 agent 正在取" when nothing had been sent, and let one storyboard submission end an older wait too. Fixes A1, A2, A3, A10, A7 and E10 of the first-film review.

The rule

A submission is in exactly one of three states, and Studio, bin/vh status and a waiting agent say the same:

  • not picked up: saved; no agent has it, or a claim on it was never confirmed;
  • picked up: written to an agent and flushed, then recorded with when, which run and which agent program (out/review/feedback/.consumed keeps files as before and adds taken);
  • answered: its REVIEW.md section has a 定了.

A wait hands a note over in two steps:

  1. It claims the note under the existing .consumed.lock. An unconfirmed claim carries the claiming pid and its time.
  2. It writes and flushes the note, and only then confirms it as taken.

What happens when a wait does not get that far:

What happens Exit The note
Killed (KILL) or crashed — Its claim belongs to a process that is gone, so it is no claim: the note stays unread.
TERM, INT or HUP 128 + signal The handler releases this process's claims.
Its output is closed, or a write fails 74 The claims are released.
Started orphaned (its parent already gone) 4 Nothing is handed over.
Timeout or exit 7 3 or 7 Untouched.

In every case the note stays for the next wait and bin/vh status.

Notes written after their round was picked up are a later batch: a submission of their own, labelled as such, handed to the next wait and listed by bin/vh status, never merged into another round. Notes written but never sent on a page the agent has since replaced stay listed as not sent. On the person's click they go to that page's own round, or are dropped.

What changed

  • tools/desk/feedback.py
    • A wait is for one round (its page, or this round's) and writes the round into .listening.
    • It first hands over every submission nobody took or answered, of any round; a later batch says so, and "later" needs a hand-over recorded by this version.
    • New submissions are looked at before the page-changed check. A wait whose page is no longer the one out ends with exit 7, saying nothing came for it, which is now true.
    • The two-step claim (claim, confirm, release), and exit 74.
    • WAIT = 43200 s (12 h; was 7100 s), the one default for desk wait and gate --wait.
  • tools/desk/desk.py, tools/gate.py: the default from WAIT; gate --wait passes its page as the wait's round; exits 7 and 74 in -h.
  • tools/status.py
    • Notes nobody took come before any other next step: next: and the stop's row both name bin/vh desk wait; a new unread: line, and --json review.unread.
    • A later page of a decided gate ① (1b) is waiting_person until answered. Gate ①'s record as bin/vh render and check read it is unchanged.
    • New review.taken (confirmed only), and holder.
  • tools/standing.py
    • "正在取" only for a live wait on the round that is out.
    • notes_late / notes_left, with who picks the notes up.
    • agent_outside: "这支片子开在这个窗口外面的 Claude Code 里;在这里打的字,它收不到。" This says what is known (it is open on the film), not that it is working. Starting an AI here is a second line that asks once more, in those words. The terminal view of bin/vh status leaves this line out.
  • Studio (studio.js, studio.css, new keys in core.js)
    • The column is two parts. What to decide scrolls above. The notes block, "你的意见", sits below it, at most half the column, scrolling on its own, its state line pinned. It shows 还没交 n 条 · 交了 n 条,还没人取 (and who picks them up) · hh:mm 被 Claude Code 取走, and drafts left on a replaced page.
    • Holds from 1280×720 in the three themes and in English. Below that, the part above keeps 6rem and the block shrinks; on a phone the page scrolls, the notes after the rest.
    • On a round already picked up, the button is "补交", said before and after sending.
    • The bar's and the block's counts are one function, notesCount. It counts each whole-film note on its own once the note box keeps several (generalParts from Studio 审片顺手了:意见钉在你停下的地方,放大时时间轴跟着播放头走,"记下"点一次就成,分镜按镜头翻,长段落里点得到具体一镜 #239), else the overall words as one.
  • A10: an option whose gate JSON says needs_note: true asks, when picked with no note, what to change ("回去写" / "就这样交"). bin/vh gate --init writes it on gate ③'s FIX. Nothing is guessed from an option's words; pages without the field never ask. Documented in playbook/01-pipeline.md 审阅页, tools/desk/README.md and tools/schemas/gate.schema.json.
  • agent.js (A7): on a film an outside agent holds, the conversation tab says so. Nothing starts until the person clicks "另起一个 AI".
  • Docs: tools/desk/README.md, playbook/01-pipeline.md 审阅台 (12 h; exit 7; on return or when the host ended a wait, bin/vh status then bin/vh desk wait), skills/open-video-harness/SKILL.md (and the plugin copy), tools/commands.json, the output schemas.

New strings follow the coming word table's direction: the agent by name when known, else "AI"; the step by name; no file names or English states on screen. Existing strings are not reworded.

Checks

Each new check was run against code without the fix, and failed there.

tools/desk/test_agents.py, the handoff group:

  • Gap kills: a wait killed between claiming a note and writing it, by KILL, TERM and INT (a driver that holds show() in the check's own process), and a real bin/vh desk wait whose stdout is closed (exit 74). Afterwards the note is unread, status lists it, the page's state is not "taken", and the next wait hands it over.
  • Two waits held at the claim and released together: exactly one hands the note over. With the lock removed both did.
  • The A3 replay: one submission ends only its own page's wait; a stale wait exits 7.
  • The lost-batch replay: notes_late, next:, 1b waiting on the outline, the next wait hands the batch over at once.
  • A timeout leaves notes unread; "正在取" is never said for a wait on another round.
  • The outside agent is named and called open, not working; Studio's own column agent is not called outside.
  • The conversation tab (node) starts nothing for a film an outside agent holds, until "另起一个 AI".

Against the previous head (11bf99b) the gap and held-claim checks failed on missing functions, not on behaviour. They are checks of the new protocol.

tools/desk/test_page.py (new; Studio in a headless Chrome through page_driver.mjs, from desk_checks; it stops its own desk's process tree):

  • A later batch: what the bar, block and sheet say before and after sending.
  • A10: it asks for a needs_note option and never for "不要改,保持不变,不用重做".
  • Counts: the bar, the block and the rows agree.
  • Drafts on a replaced page: shown, and sent to their own round.
  • Layout: eight notes beside two decisions, four unsure places and three appendices, at 1280×720 and 1440×900, in darkfield, prism and bridge and in English. The state line and the newest note are on screen, apart, inside the column. With the previous CSS at 1280×720 they overlapped.

The handoff group also now ends the stand-in program it builds. The agent column's leftover-adapter check looks at its own desk's process tree, never by name.

Full local tools/ci.sh --committed is green on the head (macOS); shellcheck and pyflakes were run separately on the changed files, clean.

Looked at by eye

On an isolated desk with made-up films and a stand-in outside agent (a small program named claude):

  • At 1440×900:
    • the outside-agent line, and the picked-up state;
    • a later note: bar, sheet, not picked up after sending, picked up after the stand-in's wait took it (the window followed by itself);
    • the conversation tab's ask, and the second AI starting only after "另起一个 AI";
    • A10's ask and "回去写".
  • At 1280×720 and 1440×900: the notes block in the two-part column.

Looked into without a picture

  • Studio's own column agent and holder: every launch path (the app, bin/vh studio, bin/vh gate, a restart) ends in exec python3 …/tools/desk/desk.py, which the match looks for, and ps does not cut the command short when not on a terminal (the check uses a long temp path). After a desk restart, its old agents end with it.
  • Enter, the carry-on button, the space page's new-film box with an outside agent holding the film:
    • Enter and the send button share one path that asks;
    • every carry-on button goes through AGENT.tell, which asks unless the person already confirmed "在这里另起一个 AI" in the column;
    • the space page's box starts a new film, which no one holds.
  • Drafts: they live in the browser, per film and round, so they survive a reload and a new one-time address on the same desk. A desk on another port, or another browser, does not see them, as before. A page replacing theirs no longer hides them (above).

Not looked at

  • The Electron window (only the page in a browser).
  • Phone width.
  • A real Claude Code or Codex outside (a stand-in only).
  • Whether any host still kills background commands after 2 hours: I could not confirm a cap for Claude Code or Codex. If one does, the wait ends like a timeout and the notes stay for the next wait and bin/vh status.
  • Older films: a submission an agent read by hand and decided in the stop's own REVIEW section is listed once as unread after the upgrade (in the change note). Nothing is lost.
  • The column's head still names the round by its stop ("这一站 · 立意" for a 1b outline page): an existing string, left for the word-table round.

Stacked next: the window follows the film's files and opens a stop on what it asks about (A4, A5, B4), in its own draft PR.

…picked up; nothing a person submits is lost

The first real film lost a batch of 12 notes written after their round had been taken, showed "正在取" while nobody would
take anything, and let one storyboard submission end the outline re-review's wait too.

- feedback.py: .consumed records who took what (when, which run, which agent program); a wait claims under the lock, so
  two waits never both hand one submission over; a wait is for one round and ends (exit 7) when its page is no longer
  out; it first hands over every submission nobody took or answered, of any round, a later batch said as such; the
  default wait is 12 h (was 7100 s).
- status.py: notes nobody took come before any other next step (review.unread, an "unread:" line); a later page of a
  decided gate ① (1b) waits for the person; holder says which agent program holds the film and whether outside Studio.
- standing.py: "正在取" only for a live wait on the round that is out; notes_late / notes_left say who picks notes up;
  an agent outside Studio's window is named, with a second AI here only as a confirmed second line.
- Studio: the notes block shows each note's state, pinned above the note box; a taken round's new notes go as a later
  batch ("补交"), said before and after sending; "先改" with no note asks once; the conversation tab asks before it
  starts a second AI on a film an outside agent holds.
- Checks: replays of the lost batch, one submission ending two waits, two waits on one note, a timeout leaving notes,
  the outside agent (test_agents.py handoff); the page in a headless Chrome (test_page.py, page_driver.mjs).
…s out the outside-agent line (the agent reading it is that agent); unread counts only submissions as Studio saves them; the output schemas name the new codes and fields; the notes block's edge uses a theme colour
…each whole-film note its own once the note box keeps several); the agent column's check for adapters left behind looks only at its own desk's process tree, never by name, so two runs of the checks on one machine don't trip each other
…otes block holds from 1280x720; A10 asks only when the page says so

- feedback.py: a hand-over is two steps. claim() writes an unconfirmed claim (pid, when) under the lock; the note is
  written and flushed; only then confirm() makes it taken. A claim whose process is gone is no claim; a signal releases
  this process's claims; a closed or broken output releases them and ends the wait with 74. unread() counts every
  unconfirmed note; taken() only confirmed ones. A wait started orphaned hands nothing over. New submissions are looked
  at before the page-changed check, so exit 7's "nothing was submitted" is true. "late" needs a hand-over recorded by
  this version. One WAIT constant for desk wait and gate --wait.
- status.py: the stop's row and next: name one command, bin/vh desk wait.
- standing.py, agent.js, core.js: an outside agent is "open" on the film, never said to be working.
- Studio: the column is two parts, what to decide scrolling above and the notes block below (at most half the column),
  so the block holds from 1280x720 in every theme and in English; drafts on a page the agent replaced are listed as not
  sent and go to that page's own round, or are dropped, on the person's click; A10 asks only for an option with
  needs_note (gate --init writes it on gate 3's FIX), documented with the gate JSON.
- Checks: a wait killed in the claim-to-write gap (KILL, TERM, INT) and one with a closed output leave the note unread;
  two waits held at the claim and released together hand it over once (fails without the lock); the layout at both
  sizes, three themes, English; drafts of a replaced page; "no change" options never ask; the page check stops its
  own desk's process tree; the handoff group ends the stand-in it builds.
- playbook 01 and the skill: on return, bin/vh status, then bin/vh desk wait; what to do when the host ended a wait.
…r-trust-59e5a0

# Conflicts:
#	tools/desk/static/studio.js
… a lock that is gone as naming nothing (GitHub's macOS runner: the turn ended between the look and the read)
@ZLHad
ZLHad marked this pull request as ready for review November 23, 2026 10:58
@ZLHad
ZLHad enabled auto-merge (squash) November 23, 2026 10:58
@ZLHad
ZLHad merged commit dd4f75f into main Nov 23, 2026
4 checks passed
@ZLHad
ZLHad deleted the claude/studio-handover-trust-59e5a0 branch November 23, 2026 11:30
ZLHad added a commit that referenced this pull request Nov 23, 2026
…s the hand-over PR's last head, which this branch already holds
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