@mrciphersmith/roomyx 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -13,6 +13,68 @@ patch and never a minor. The rule, the reason, and an audit of the four of seven
13
13
  releases that followed it are in
14
14
  [`docs/roomyx/versioning.md`](docs/roomyx/versioning.md) and decision D-13.
15
15
 
16
+ ## [0.7.2] — 2026-09-10
17
+
18
+ A patch. Found by reading a real room log: the reply structure the log schema
19
+ exists to record was, in the pane that displays it, a number.
20
+
21
+ ### Fixed
22
+
23
+ - **A reply names the participant it answers, instead of a sequence number.**
24
+ The tag read `answer re #4` — a number the client never resolved to a speaker,
25
+ neither in the pane nor in the file `w` writes out. In the log this was
26
+ measured against, four of nine messages reply and two of them answer the same
27
+ message, so two rows rendered as identical, unresolvable tags. The pointer now
28
+ reads `answer -> Inés "..."`, carrying a short clipped quote of the parent.
29
+ - **The kind and the reply pointer no longer vanish when a header is
30
+ collapsed.** Both were drawn inside the header, which is suppressed for
31
+ consecutive turns by one speaker, so a second turn looked exactly like a plain
32
+ continuation. Because the run was computed over the visible list, filtering to
33
+ one participant could also *hide* a tag that was there unfiltered.
34
+ - **`/` finds a row by the text its pointer shows.** The tag is on screen and
35
+ the search haystack did not include it.
36
+
37
+ ### Notes
38
+
39
+ - Rendering only: no MCP tool surface, CLI flag or room-log format changed.
40
+ - The pointer uses an ASCII `->` and `...` rather than `→` and `…`, which are
41
+ East-Asian-ambiguous: their width depends on the reader's terminal, and a
42
+ wrong guess shifts the whole wrapped row.
43
+ - The tripwire in `test/client/wrap-defect.test.ts` is untouched and still
44
+ failing as designed.
45
+
46
+ ## [0.7.1] — 2026-09-10
47
+
48
+ A patch. Found while writing setup prompts for an operator: following the
49
+ bundled skill produced a room that could not be attached to, and nothing said
50
+ why.
51
+
52
+ ### Fixed
53
+
54
+ - **`roomyx serve` refuses a log it cannot read, instead of becoming an
55
+ invisible room.** It used to bind a port, print a room ID and an attach
56
+ command, and only then fail on every tool call. Because the liveness probe
57
+ reads a throwing `room.get_state` as "not this room", `roomyx rooms list`
58
+ answered **"No live rooms"** about a server that was running, and the client
59
+ refused to attach to the id it had just been handed. The log is now read once
60
+ before anything is bound, so the failure is a sentence naming the file and the
61
+ line.
62
+ - **A missing log is a sentence, not a stack trace.** `roomyx serve nope.jsonl`
63
+ printed a raw `ENOENT` with a stack. It now says what is missing and the one
64
+ command that creates it — a typo'd path being the most ordinary way to get
65
+ there.
66
+ - **The bundled `startup-room` skill told dispatchers to keep the transcript in
67
+ markdown, which roomyx cannot read.** The section that added roomyx was
68
+ written without reconciling the format, so an agent following the skill
69
+ produced a `.md` log and a room that would not serve. It now creates the log
70
+ with `roomyx room new` (JSONL) and appends with `roomyx room append --force`,
71
+ and says why `--force` is right there: the dispatcher *is* the single writer
72
+ the guard exists to protect, and roomyx cannot tell that from outside. The
73
+ markdown convention remains, for when roomyx is not available.
74
+ - The skill also now tells the dispatcher to mention `roomyx rooms history` and
75
+ `roomyx-client --archive` when a room ends, so the owner knows a closed room
76
+ can still be reread.
77
+
16
78
  ## [0.7.0] — 2026-09-10
17
79
 
18
80
  A minor, because two things an existing caller relied on changed. The feature is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/roomyx",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "MCP server + terminal UI for startup-room: live room status, chat, per-agent modal, an installable room registry, and skill-sync.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -103,7 +103,7 @@ When the owner says "save this idea" (or a candidate clearly survives enough rou
103
103
 
104
104
  1. Identify the persona profile files to use (e.g. `arena/roles/**/*.md` or a subset). Each profile should already be a neutral biography/expertise sheet — no pre-baked opinions or conclusions (see the project's persona-writing convention if one exists).
105
105
  2. Write the **goal contract** (see above): goal statement, success criteria (default to the 50-criteria rubric for a startup-idea room), and the convergence requirement.
106
- 3. Create the log file with a header: the goal contract in full (not just a one-line goal — include the criteria/threshold so anyone reading the log later can check whether it was actually met), list of participants (name + one-line role), and the ground rule that only the moderator writes to it.
106
+ 3. Create the log. **If roomyx is available, create it with `roomyx room new` (JSONL) — see below.** Otherwise create a markdown file with a header: the goal contract in full (not just a one-line goal — include the criteria/threshold so anyone reading the log later can check whether it was actually met), list of participants (name + one-line role), and the ground rule that only the moderator writes to it.
107
107
  4. Decide the opening framing. If the task is "find something from scratch," say so explicitly and do NOT hand participants a pre-built brief that narrows their options — that biases the room before it starts. The criteria are the bar the eventual candidate must clear, not a hint about what kind of idea to look for.
108
108
  5. If roomyx is available for this project — a `.roomyx/` directory exists, or `roomyx` resolves on `PATH` — start a server for the log so the owner can watch the room live. See **Watching the room live (roomyx)** below. If it isn't available, skip this step and run the session exactly as you would otherwise; nothing here depends on it.
109
109
 
@@ -114,20 +114,54 @@ turns it into something they can watch while it runs, without changing how the
114
114
  room works: it reads the log and serves it, and it never writes to it. The
115
115
  dispatcher stays the log's single writer.
116
116
 
117
- Start the server as part of setup, before the kickoff spawns:
117
+ **The log must be roomyx's own format, not the markdown transcript.** roomyx
118
+ reads JSONL: one `state` header line, then one JSON line per message. A markdown
119
+ file is not readable by it, so create the log with `roomyx room new` and append
120
+ through `roomyx room append` — those two commands are the whole of it, and the
121
+ dispatcher is still the single writer. Use the markdown convention described
122
+ above only when roomyx is *not* available.
123
+
124
+ Create the room and start the server as part of setup, before the kickoff
125
+ spawns:
126
+
127
+ ```bash
128
+ roomyx room new .roomyx/rooms/logs/<topic>.jsonl \
129
+ --goal "<the goal statement>" \
130
+ --criteria "<the threshold, in one line>" \
131
+ --roster "ann:Ann,ben:Ben,cara:Cara"
132
+
133
+ roomyx serve .roomyx/rooms/logs/<topic>.jsonl --port 0
134
+ ```
135
+
136
+ Then append each participant's turn verbatim as it arrives:
118
137
 
119
138
  ```bash
120
- roomyx serve <logPath> --port 0
139
+ roomyx room append .roomyx/rooms/logs/<topic>.jsonl --force \
140
+ --from ann --kind pitch --body "<their actual words>"
121
141
  ```
122
142
 
143
+ **`--force` is required here, and it is correct here.** Without it, `append`
144
+ refuses whenever a live room is serving that log — a guard against a *second*
145
+ writer racing the dispatcher. You are the dispatcher: the single writer the
146
+ guard exists to protect. roomyx cannot tell the two apart from outside, so it
147
+ asks, and this is the case where the answer is yes.
148
+
149
+ `--kind` is one of `pitch`, `question`, `challenge`, `answer`, `vote`, `status`,
150
+ `research`; `--in-reply-to <seq>` records who was being answered. Both are
151
+ optional and both make the transcript far easier to read later.
152
+
123
153
  `--port 0` takes an ephemeral port, so several rooms can run at once without
124
154
  colliding. It prints the bound URL and a short room ID:
125
155
 
126
156
  ```
127
- roomyx serving /abs/path/room.md at http://127.0.0.1:41235/mcp
157
+ roomyx serving /abs/path/room.jsonl at http://127.0.0.1:41235/mcp
128
158
  room ID: r-a1b2c3 — attach with `roomyx-client --room r-a1b2c3`
129
159
  ```
130
160
 
161
+ If `serve` refuses instead, read what it says: it now reads the log before
162
+ binding anything, so "must start with a valid state line" means the file is not
163
+ a roomyx log — most likely a markdown transcript. Create it with `room new`.
164
+
131
165
  **Relay that room ID to the owner in the kickoff confirmation, with the attach
132
166
  command.** That is the whole point of starting it — the owner opens the room in
133
167
  a second terminal and watches the discussion as it happens instead of waiting
@@ -141,6 +175,10 @@ Stop the server with `SIGINT`/`SIGTERM` when the room ends — it removes its ow
141
175
  registry entry on the way out. A server killed outright leaves a stale entry,
142
176
  which is harmless: the next `rooms list` prunes it after a liveness check.
143
177
 
178
+ A closed room is not lost. It is recorded in `roomyx rooms history`, and the
179
+ owner can reread it at any time with `roomyx-client --archive`, so tell them the
180
+ room is in the history when you finish.
181
+
144
182
  ## Kickoff (spawn once per persona)
145
183
 
146
184
  Spawn each participant as a separate `Agent` call (`subagent_type: general-purpose`, tools available as needed — allow `WebSearch`/`WebFetch` if the room is expected to ground claims in reality, not just riff). The kickoff prompt for each must include:
@@ -1,5 +1,7 @@
1
1
  import { BoxRenderable, TextRenderable } from "@opentui/core";
2
2
  import type { RenderContext } from "@opentui/core";
3
+ import { messageTag } from "../transcript";
4
+ import type { ReplyTarget } from "../transcript";
3
5
  import type { MessageEnvelope } from "../../log/types";
4
6
 
5
7
  /**
@@ -23,6 +25,14 @@ import type { MessageEnvelope } from "../../log/types";
23
25
  * The tag stays ASCII on purpose: `↩` and `→` are East-Asian-ambiguous, so
24
26
  * their width depends on the reader's terminal, and a wrong guess shifts the
25
27
  * whole wrapped row.
28
+ *
29
+ * A third defect lived in this file and is kept written down for the same
30
+ * reason: the tag was added *inside* the header, and the header is suppressed
31
+ * for consecutive turns by one speaker — so the second turn lost its kind and
32
+ * its reply pointer, and two materially different messages rendered
33
+ * identically. Whether a header is drawn is a question about the speaker;
34
+ * whether a tag is drawn is a question about the message, and they are not the
35
+ * same question. See D-17.
26
36
  */
27
37
  export const SPEAKER_FG = "#ffffff";
28
38
  export const TAG_FG = "#8a8a8a";
@@ -36,12 +46,8 @@ export interface MessageRowOptions {
36
46
  showHeader: boolean;
37
47
  /** False for the first row, which needs no separating blank line above it. */
38
48
  separate: boolean;
39
- }
40
-
41
- function tagFor(message: MessageEnvelope): string {
42
- return [message.kind, message.in_reply_to === undefined ? null : `re #${message.in_reply_to}`]
43
- .filter((part): part is string => Boolean(part))
44
- .join(" ");
49
+ /** The turn this one answers, already resolved to a speaker by the caller. */
50
+ replyTo?: ReplyTarget;
45
51
  }
46
52
 
47
53
  export function createMessageRow(
@@ -55,12 +61,17 @@ export function createMessageRow(
55
61
  marginTop: options.separate ? 1 : 0,
56
62
  });
57
63
 
64
+ const tag = messageTag(message, options.replyTo);
65
+
58
66
  if (options.showHeader) {
59
67
  const header = new BoxRenderable(ctx, { flexDirection: "row", height: 1 });
60
68
  header.add(new TextRenderable(ctx, { content: fromName, fg: SPEAKER_FG, attributes: 1, height: 1 }));
61
- const tag = tagFor(message);
62
69
  if (tag) header.add(new TextRenderable(ctx, { content: ` ${tag}`, fg: TAG_FG, height: 1 }));
63
70
  row.add(header);
71
+ } else if (tag) {
72
+ // Its own indented line, because there is no header to sit in. The kind and
73
+ // the pointer must not be collapsible with the speaker's name.
74
+ row.add(new TextRenderable(ctx, { content: tag, fg: TAG_FG, height: 1, marginLeft: 2 }));
64
75
  }
65
76
 
66
77
  row.add(
@@ -37,6 +37,12 @@ export class ChatView {
37
37
  private readonly scroll: ScrollBoxRenderable;
38
38
  private readonly ctx: RenderContext;
39
39
  private rosterById = new Map<string, RosterEntry>();
40
+ /**
41
+ * Every message seen so far, by `seq`, so a reply pointer can name its
42
+ * parent. Kept here rather than in `Transcript` because the roster — the
43
+ * thing that turns an id into a name — is here too.
44
+ */
45
+ private messagesBySeq = new Map<number, MessageEnvelope>();
40
46
  private rows: Renderable[] = [];
41
47
  private readonly rosterVisible: boolean;
42
48
 
@@ -112,11 +118,23 @@ export class ChatView {
112
118
 
113
119
  appendMessages(messages: MessageEnvelope[]): void {
114
120
  for (const message of messages) {
121
+ // Resolved before this message is recorded, so a pointer can only ever
122
+ // name an *earlier* turn — the log is append-only and the parent is
123
+ // always already here. That is what lets a tag be known when the row is
124
+ // built and keeps rendering incremental: no drawn row is ever amended.
125
+ const parent =
126
+ message.in_reply_to === undefined ? undefined : this.messagesBySeq.get(message.in_reply_to);
127
+ const replyTo =
128
+ parent === undefined
129
+ ? undefined
130
+ : { name: this.rosterById.get(parent.from)?.name ?? parent.from, body: parent.body };
115
131
  this.appendEntry({
116
132
  kind: "message",
117
133
  message,
118
134
  fromName: this.rosterById.get(message.from)?.name ?? message.from,
135
+ ...(replyTo === undefined ? {} : { replyTo }),
119
136
  });
137
+ this.messagesBySeq.set(message.seq, message);
120
138
  }
121
139
  }
122
140
 
@@ -206,6 +224,7 @@ export class ChatView {
206
224
  // changed.
207
225
  showHeader: this.transcript.startsRun(index),
208
226
  separate,
227
+ ...(entry.replyTo === undefined ? {} : { replyTo: entry.replyTo }),
209
228
  });
210
229
 
211
230
  this.rows.push(row);
@@ -25,6 +25,13 @@ export interface MessageEntry {
25
25
  message: MessageEnvelope;
26
26
  /** Resolved display name, so the model can be searched by what is on screen. */
27
27
  fromName: string;
28
+ /**
29
+ * The turn this one answers, resolved to a speaker by whoever built the
30
+ * entry. Absent when the message answers nothing, or answers a `seq` this
31
+ * log does not contain — and absent means nothing is drawn, which is the
32
+ * point: the number it replaced named nobody (D-17).
33
+ */
34
+ replyTo?: ReplyTarget;
28
35
  }
29
36
 
30
37
  export type Entry = MessageEntry | SystemEntry;
@@ -75,7 +82,7 @@ export class Transcript {
75
82
  const haystack =
76
83
  entry.kind === "system"
77
84
  ? entry.text
78
- : `${entry.fromName} ${entry.message.kind ?? ""} ${entry.message.body}`;
85
+ : `${entry.fromName} ${messageTag(entry.message, entry.replyTo)} ${entry.message.body}`;
79
86
  return haystack.toLowerCase().includes(needle) ? index : -1;
80
87
  })
81
88
  .filter((index) => index >= 0);
@@ -114,11 +121,57 @@ export class Transcript {
114
121
  return this.visible()
115
122
  .map((entry) => {
116
123
  if (entry.kind === "system") return `— ${entry.text} —`;
117
- const tag = [entry.message.kind, entry.message.in_reply_to === undefined ? null : `re #${entry.message.in_reply_to}`]
118
- .filter((part): part is string => Boolean(part))
119
- .join(" ");
124
+ const tag = messageTag(entry.message, entry.replyTo);
120
125
  return `${entry.fromName}${tag ? ` ${tag}` : ""}\n ${entry.message.body}`;
121
126
  })
122
127
  .join("\n\n");
123
128
  }
124
129
  }
130
+
131
+ /**
132
+ * How much of the parent's body the pointer quotes, in code units.
133
+ *
134
+ * A budget rather than a proportion of the pane: the tag sits on one
135
+ * `height: 1` line beside a name, and anything that has to be measured against
136
+ * a live width would make the tag's text depend on the terminal it is drawn in.
137
+ * Code units, not display cells — the same deferral `clip.ts` records for the
138
+ * same reason.
139
+ */
140
+ const QUOTE_CELLS = 24;
141
+
142
+ export interface ReplyTarget {
143
+ /** The parent's resolved display name. Never a sequence number: a number names nobody. */
144
+ name: string;
145
+ /** The parent's body, for the short quote. */
146
+ body: string;
147
+ }
148
+
149
+ /**
150
+ * Cut to size in ASCII.
151
+ *
152
+ * `clip()` — the client's other cutter — marks a cut with `…`, and this line
153
+ * must not: U+2026 is East-Asian-ambiguous, so its width depends on the
154
+ * reader's terminal, and the tag is laid out against the same pane the body
155
+ * wraps in. A quote is context, not content; it does not get to move where a
156
+ * sentence breaks.
157
+ */
158
+ function quote(body: string): string {
159
+ // Whitespace is flattened first: a parent's newline would otherwise put a
160
+ // second line under a tag that is `height: 1`.
161
+ const flat = body.replace(/\s+/g, " ").trim();
162
+ if (flat.length <= QUOTE_CELLS) return flat;
163
+ return `${flat.slice(0, QUOTE_CELLS - 3).trimEnd()}...`;
164
+ }
165
+
166
+ /**
167
+ * The one place the kind and reply tag is spelled.
168
+ *
169
+ * It used to be assembled twice — in `message-row.ts` for the pane, and inline
170
+ * in `toText()` for the export — so the two could disagree about what a message
171
+ * said, and neither was visible to `matches()`. The tag is drawn on screen,
172
+ * which is the whole test of whether a search has to find it.
173
+ */
174
+ export function messageTag(message: MessageEnvelope, replyTo?: ReplyTarget): string {
175
+ const pointer = replyTo === undefined ? "" : `-> ${replyTo.name} "${quote(replyTo.body)}"`;
176
+ return [message.kind, pointer].filter((part): part is string => Boolean(part)).join(" ");
177
+ }
package/src/log/store.ts CHANGED
@@ -27,7 +27,19 @@ function parseLine(text: string, describe: () => string): unknown {
27
27
  export function loadRoomLog(path: string): { state: RoomState; messages: MessageEnvelope[] } {
28
28
  // Editors add a byte-order mark; it is not part of the JSON and it made the
29
29
  // first line unparseable, which made the whole room unreadable.
30
- const raw = readFileSync(path, "utf8").replace(/^\uFEFF/, "");
30
+ let raw: string;
31
+ try {
32
+ raw = readFileSync(path, "utf8").replace(/^\uFEFF/, "");
33
+ } catch (error) {
34
+ // A sentence, not a stack. Every other failure in this function names the
35
+ // file and says what is wrong with it; "no such file" was the one that
36
+ // escaped as a raw ENOENT with a stack trace, and it is the most ordinary
37
+ // mistake there is \u2014 a typo in a path, or a log that has been moved.
38
+ if ((error as NodeJS.ErrnoException).code === "ENOENT") {
39
+ throw new Error(`No room log at ${path}. Create one with \`roomyx room new ${path} --goal "\u2026"\`.`);
40
+ }
41
+ throw new Error(`Cannot read room log at ${path}: ${error instanceof Error ? error.message : String(error)}`);
42
+ }
31
43
  const lines = raw.split("\n").filter((line) => line.trim().length > 0);
32
44
 
33
45
  if (lines.length === 0) {
@@ -2,6 +2,7 @@ import { createRoomMcpServer } from "./index";
2
2
  import type { RoomMcpServerOptions } from "./index";
3
3
  import { serveMcpOverHttp } from "./http-transport";
4
4
  import type { McpHttpTransportHandle } from "./http-transport";
5
+ import { loadRoomLog } from "../log/store";
5
6
 
6
7
  export interface ServeOptions extends RoomMcpServerOptions {
7
8
  /** Defaults to 4319 (specification.md's default). 0 selects an ephemeral port. */
@@ -18,6 +19,20 @@ export type ServeHandle = McpHttpTransportHandle;
18
19
  * is which server a session gets and which port it defaults to.
19
20
  */
20
21
  export async function serve(logPath: string, options: ServeOptions): Promise<ServeHandle> {
22
+ // Read the log once before binding anything.
23
+ //
24
+ // Without this, `roomyx serve` on a log it cannot parse — a markdown
25
+ // transcript, say, which is what the bundled skill used to tell a dispatcher
26
+ // to write — succeeded loudly and then failed silently: it bound a port,
27
+ // printed a room ID and an attach command, and every tool call threw. The
28
+ // liveness probe treats a throwing `room.get_state` as "not this room", so
29
+ // `roomyx rooms list` answered **"No live rooms"** about a server that was
30
+ // running, and the client refused to attach to the id it had just been given.
31
+ //
32
+ // Failing here costs one read and turns an invisible room into a sentence
33
+ // that names the file and the line.
34
+ loadRoomLog(logPath);
35
+
21
36
  return serveMcpOverHttp({
22
37
  createMcpServer: () => createRoomMcpServer(logPath, { onOwnerCommand: options.onOwnerCommand }),
23
38
  commandLabel: "roomyx serve",