Files
stack/docs/plans/2026-10-19_tester-threads.md

2.5 KiB

Brief: tester threads (scoping)

Gitea #1675. Proposed owner Dewey, reviewer Filbert, gate owner Sage. Starts after row 176 is done; 176 landed as 89af38a83. Line numbers are at origin/refactor 89af38a83 (re-pinned from 835941b7c on 2026-10-20, after rows 175 and 176 moved them). This is a scoping brief. The owner writes the design into the packet, and Sage approves it before any code.

Why

Q173 says agents test the test system end to end as the tester (mos-0870). The Console's chat page and the window's W6/W7 checks need a thread conversation. Every thread verb in packages/bus/src/broker.mjs is human-only today: thread.create (:2295), thread.list (:2321), thread.open (:2335), thread.send (:2342) and thread.messages (:2369) each start with this.#human(s). They record the human as the thread's owner, thread_opens.by and the message's from_role 'human' and from_run 'human-cli'.

What the design has to settle

  1. A tester thread's owner is tester, and a tester sees and opens only threads it owns. The human's thread list leaves tester threads out, or labels them. Pick one and say why.
  2. thread.send from a tester stores from_role 'tester', and from_run is the tester CLI, never human-cli. Row 120's messaging lists have to allow tester to instance. Say whether that is a business-file entry or a broker rule.
  3. Replies on a tester thread route to tester and never to the human's inbox. The human's view shows them as tester traffic.
  4. Whether a tester gets assistant.stop on its own threads only. Never on the human's.
  5. The human.input event on thread.send (:2366) has to say tester, or a tester thread needs its own event kind. Check what the launcher and the runner do with the event first.
  6. The Console's tester listener (row 176) gets /api/chat for tester threads only, and 7332's chat stays the human's. Today startServer refuses chat on the tester listener (packages/webui/src/serve.mjs:442) and serve leaves it null there, so every tester /api/chat write answers 403. Say what replaces that refusal and which mutant proves 7332 still refuses x-mosaic-tester on chat (:454).
  7. DDL: read threads, thread_opens and messages in the migrations for CHECKs before saying no schema change.

Untouched

The row 164 pins (packages/bus/tests/channel-proof.test.mjs:11-19). Row 175's tester writes and row 176's listener, except where point 6 adds chat.

Gate

Set in the design. At least the bus, webui and conversation suites and every scripts/test-*.sh.