Files
jason.woltje 4ff4f44c98 lead: commit researcher's untracked evidence (1406 files: queue-101 queue-105 queue-128 queue-134 queue-143 queue-148 queue-183 queue-228)
Unclaimed files left in the canonical checkout. Inventory: canonical-cleanup-inventory.md (commit-as-evidence groups). detect-secrets scan clean on 2026-11-02: hits are sha256 pins, git object ids, test sentinels already in tracked tests and unit-file lines.
2026-11-02 15:05:14 -06:00

6.3 KiB
Raw Permalink Blame History

Row 183 (#1681): chat.mjs names the transport it is given (N2)

Seat: Researcher (owner). Reviewer: Dewey. Gate owner: Sage. Brief: docs/plans/2026-10-20_tester-thread-follow-ups.md, "Brief: chat.mjs names the transport it is given (N2)", blob 3459e01c33 at 5a8c1340c. Claimed at queue rev 2143 (2026-10-20, researcher-183-start-1). Base: 5a8c1340c. Built in a detached scratch worktree off that commit. Nothing is committed or pushed. No credential, live store, unit or ~/.mosaic file was touched. No behavior changes: the same inputs are accepted and refused as before, only the text differs.

The change (2 files)

Path Change
packages/webui/src/chat.mjs header comment (:1-4) and the TypeError text (:10)
packages/webui/tests/chat.test.mjs one new test at the end of the file
  1. Header comment. It said chat is "the single seam between Console chat operations and the current human transport". It now says the transport "it is given" and names both callers: the signed-in listener (packages/webui/src/cli.mjs, chat = createChat({ call }) over the human transport) and the row 176 tester listener (row 177, createChat({ call }) over TESTER_CLI). The second comment line (no browser-selected verb, tenant, owner, capability or class crosses the seam) is unchanged.
  2. TypeError. chat needs a human transport is now chat needs a bus transport function. The condition (typeof call !== 'function') is unchanged. The new text says what is wrong (call is not a function) and does not name a transport kind.

README decision: no change

packages/webui/README.md never uses either old phrase about the chat seam ("the current human transport" as the seam's name, or "chat needs a human transport"). Its human-transport mentions are about the reads and writes of the signed-in listener, and the two lines about chat are accurate as written:

  • :932 "Chat uses the existing human transport; a later channel-module conversion has its own brief (sage-0724)." This is the main listener's chat section (row 129) and is true: that listener passes the human transport.
  • :954-960 "Its chat (row 177, #1675) is the tester's own. The chat calls the bus through TESTER_CLI ..." This is the tester listener's section and already says the tester transport.

The brief says to fix the README "if it repeats either phrase about chat"; it does not, so it is untouched and the file stays out of the manifest (row 178 also edits it, so leaving it avoids a rebase).

Rechecks at build time (5a8c1340c)

  • No test reads either old string. grep -rn "human transport\|chat needs\|current human transport\|seam" packages/*/tests scripts/test-*.sh finds only unrelated "human transport" comments in cli, webui send/instances/project-file/bus/chat tests (test names and comments, none asserting the chat TypeError) and unrelated "seam" uses (bus web.test, conversation flows). One webui test name (chat.test.mjs, "configured Console process injects chat through its existing human transport") says the phrase in its title, about the signed-in Console process; it asserts nothing on the text and is left as is because that Console does use the human transport.
  • chat.mjs is imported by packages/webui/src/cli.mjs, packages/webui/tests/{chat,channel-chat,tester-fixture}.test.mjs/.mjs only (grep -rn "chat\.mjs" packages scripts roles contracts).
  • No sha256 pin on chat.mjs. The only hash-reading webui test is editor-provenance.test.mjs, which hashes the editor's vendored files.
  • No scripts/test-*.sh reads a webui path. scripts/test-land-work.sh has the strings webui / via-webui as data only. The slot gate is therefore the webui suite alone; Sage's landing gate still runs every suite.

The new test and its mutant

Test (chat.test.mjs, last test): createChat({ call }) with undefined, null, a string, a number, {} and [], and createChat({}), each must throw a TypeError whose message is exactly chat needs a bus transport function; createChat with an async function still builds a chat with a projects function. The exact-text assert is what the mutant needs.

Mutant M1 (mutants/): put the old text back (chat needs a human transport). The new test has to fail.

Unslotted run (my slip, recorded at Sage's ask, sage-1189)

Before I asked for the slot I ran node --test tests/chat.test.mjs once, singly, in the scratch worktree at about 2026-10-20T04:30:20Z (the test file's mtime is 04:30:18Z, the run was in the same command, and the patch freeze is 04:30:27Z). Result 23 tests, 23 pass, 0 fail. That file spawns the Console child process (configured Console process injects chat through its existing human transport). I did not run the busy check first and I had not been granted the slot. No other run happened before the slot. Next time I ask first, including for a single file that spawns a child.

Results

Slot run (sage-1193, granted 2026-10-20T04:39:09Z; busy check clear, exit 0, before and after). Candidate manifest verified (sha256sum -c) before the suite and after the mutant; digest of the manifest file e9339f28c27f93331a69217e726f45d16401b33c463c3048133b2f07cd445d35, patch sha256 418ee1856156661f163dd25c1834a2eb6d4b6c919979aa4bbe5ded85f52f2088. Script: /mnt/storage/scratch/researcher/q183/run.sh (scratch).

  • Webui suite (suites/webui.txt, node --test tests/*.test.mjs in packages/webui, rc=0), 2026-10-20T04:39:22Z to 04:40:18Z. Counts from an awk sum over the ℹ lines: 260 tests, 259 pass, 0 fail, 1 skipped, 0 cancelled. The new test passed (log line 61).
  • Row 178's own SESSIONS line (Rocko, 04:18:39Z) also reports "1 esbuild skip" in its webui run. The one skip is the editor test "rebuilding from the source gives the same bytes": it needs esbuild 0.28.2 and the checkout has 0.28.1, and its own message says MOSAIC_REQUIRE_EDITOR_BUILD=1 turns the skip into a failure. I did not set that variable. I did not run it on a base without this change; the change touches no editor file, so I read it as not caused by this row.
  • Mutant M1, old text back (mutants/mutants.out, mutants/M1.chat.test.log), 04:40:19Z: tests/chat.test.mjs 23 tests, 22 pass, 1 fail; the failing test is the new one, with actual: TypeError: chat needs a human transport. KILLED. chat.mjs restored and checked OK.
  • No Docker, no scripts/test-*.sh (none reads a webui path; Sage's landing gate runs every suite).