@mrciphersmith/roomyx 0.3.0 → 0.5.0
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 +173 -0
- package/README.md +53 -13
- package/package.json +5 -4
- package/src/bin/launch.mjs +68 -0
- package/src/bin/roomyx-client.mjs +8 -0
- package/src/bin/roomyx.mjs +4 -0
- package/src/bundled-skills/startup-room/SKILL.md +177 -47
- package/src/cli/args.ts +155 -0
- package/src/cli/specs.ts +16 -0
- package/src/cli.ts +313 -150
- package/src/client/components/status-bar.ts +12 -0
- package/src/client/index.ts +78 -24
- package/src/client/mcp-client.ts +9 -0
- package/src/client/owner-prompt.ts +92 -0
- package/src/log/write.ts +80 -0
- package/src/mcp-management/server.ts +38 -97
- package/src/server/http-transport.ts +149 -0
- package/src/server/serve.ts +13 -86
- package/src/cli/seed.ts +0 -73
|
@@ -1,66 +1,196 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: startup-room
|
|
3
|
-
description:
|
|
3
|
+
description: Runs a persistent multi-persona discussion/brainstorm room cheaply — each persona is spawned once as a named subagent and kept alive across turns via SendMessage (so it remembers its own history instead of re-reading the whole transcript every time), every message is broadcast to every participant (not just @-addressed ones), participants self-moderate against tunneling too deep into one narrow thread, and the full dialogue is logged verbatim to a shared markdown file the participants never write to directly. The room is goal-driven, not round-driven: it runs until an explicit, measurable goal is met (by default, for startup-idea rooms: find an idea, score it against a 50-criteria rubric, and reach participant convergence) or the owner stops it — not until some fixed number of turns has elapsed. Use whenever the user wants several persona/character subagents (founders, experts, interview personas, judges) to discuss, debate, brainstorm, or interview each other over multiple rounds toward a concrete goal, especially when they've asked for this to be done without burning tokens by re-pasting the whole conversation into a fresh agent each round.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Startup Room
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
steps that make a room observable while it runs. It is not the startup-room
|
|
10
|
-
methodology itself — persona design, the goal contract, scoring, convergence
|
|
11
|
-
and the rest live in the skill this text is meant to join.
|
|
8
|
+
A reusable pattern for running a multi-agent "room" — several distinct persona subagents holding a real, evolving group conversation toward an explicit goal — without the token cost of re-sending the full transcript to a brand-new agent every turn.
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
target; it does not merge into it. If you already maintain a fuller
|
|
15
|
-
`startup-room` skill, treat this as text to fold into your Setup/Kickoff
|
|
16
|
-
section by hand, not as a file to overwrite it with. roomyx backs up whatever
|
|
17
|
-
it replaces to `<target>.bak-<timestamp>` and refuses to write at all without
|
|
18
|
-
`--yes`, but a backup is a way to recover from the wrong move, not a reason to
|
|
19
|
-
make it.
|
|
10
|
+
## Why this exists
|
|
20
11
|
|
|
21
|
-
|
|
12
|
+
The naive approach (spawn a fresh `Agent` call each turn, pasting the entire cumulative transcript into the prompt so the agent has context) burns tokens quadratically: transcript size × number of remaining turns. This skill fixes that by keeping each persona as one long-lived agent that remembers its own history natively, and only ever receiving the *delta* (what's new since it last spoke).
|
|
22
13
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
## The goal contract (mandatory)
|
|
15
|
+
|
|
16
|
+
A room without an explicit, checkable goal degenerates into an open-ended chat that never actually concludes anything — this was an observed failure mode, not a hypothetical. Every room must be created with:
|
|
17
|
+
|
|
18
|
+
1. **A goal statement** — what the room is *for*, in one sentence (e.g. "find a startup idea and defend it" / "pick the best of these 3 architectures" / "interview this candidate and reach a hire/no-hire call").
|
|
19
|
+
2. **Explicit, measurable success criteria** — a checklist or scoring rubric the candidate output must pass, decided *before* spawning participants, not invented after something looks good. See **Goal type: find & defend a startup idea** below for the default criteria set this skill ships with for that specific goal; other goal types need their own criteria stated up front the same way.
|
|
20
|
+
3. **A convergence requirement** — passing the criteria on paper is not enough; the room's own participants must explicitly agree the candidate is the pick. A high score with participants still arguing is not a completed goal.
|
|
21
|
+
|
|
22
|
+
The room is **goal-driven, not round-driven**: there is no fixed number of rounds. It keeps looping — search, propose, defend, score, converge — until either (a) a candidate passes the criteria *and* the room converges on it, or (b) the owner explicitly stops the room (out of patience, budget, or a decision that no candidate is good enough). Running out of obvious new ideas without reaching (a) is a legitimate status to report honestly — it is not a signal to quietly lower the bar or declare victory on a candidate that didn't actually pass.
|
|
23
|
+
|
|
24
|
+
## Roles in this pattern
|
|
25
|
+
|
|
26
|
+
- **The dispatcher** — you (the orchestrating Claude instance). Your job is transport, not judgment: relay deltas, append to the log, spawn new participants when told to. You never let participants write to the shared log file themselves; you are the only writer. This is a deliberate safety choice: it guarantees nothing gets deleted or corrupted by a subagent, and it lets you enforce formatting and catch a participant going off the rails before it's committed to the record. See **Dispatcher discipline** below — this role is narrower than it sounds, and it is easy to accidentally overstep it.
|
|
27
|
+
- **The participants** — one persistent named subagent per persona. They decide everything substantive: what to research, whether an idea is good, when to pivot, who should speak next, when to converge. This is the actual point of the room — if you (the dispatcher) are making these calls instead of them, the room has stopped being a room.
|
|
28
|
+
- **The session owner** — the human running the session. They can inject an instruction at any point (a veto, a new constraint, a topic to explore, a request to add participants, a reminder like "we're a small startup"). See **The owner-injection channel** below for how this differs from a participant's suggestion.
|
|
29
|
+
- **The log file** — a single markdown file (e.g. `<project>/brainstorm/<topic>-room.md`) that is the append-only source of truth for the whole session.
|
|
30
|
+
|
|
31
|
+
## Dispatcher discipline (the easiest way to break this pattern)
|
|
32
|
+
|
|
33
|
+
The dispatcher's job looks like a moderator's job but is actually much narrower. In practice, the strongest pull is to start *directing* — assigning specific research questions to specific participants, synthesizing conclusions before the room has, deciding which candidate to pursue next. Every one of these is a real failure mode observed in practice, not a hypothetical:
|
|
34
|
+
|
|
35
|
+
- **Don't assign research tasks.** Relay the delta ("here's what happened since your last turn") and stop there — let the participant decide whether to research, argue, ask someone else a question, or pass. Composing a specific question for them to answer ("please check X, Y, Z") is you doing their job.
|
|
36
|
+
- **Don't synthesize verdicts for them.** If Grace and Elena need to independently converge on whether an idea survives, let their own words do that — don't write "the room concludes X" until participants have actually said so.
|
|
37
|
+
- **Don't pick the next direction.** If the room hits a fork (which candidate to pursue, whether to pivot), relay the fork to participants and let them argue it out — including disagreeing with each other. Your log entries should record who decided what, not you deciding on their behalf.
|
|
38
|
+
- **Do relay a stalled thread's obvious next question** (e.g. "Grace asked Sam a direct question, he hasn't answered yet — send it to Sam") — this is transport, not judgment, because the question already exists in the transcript.
|
|
39
|
+
- **Self-check each turn:** if your message to a participant contains a specific instruction they didn't ask for and no one in the room raised, you've drifted from dispatcher into director. Rewrite it as a neutral delta + open prompt.
|
|
40
|
+
|
|
41
|
+
This discipline was learned the hard way mid-session: the dispatcher spent several rounds assigning bespoke research questions to each participant, effectively running the investigation *for* the room. The session owner corrected this explicitly ("не ты их направляешь, они сами друг друга... в этом смысл"). The fix held for the rest of the session and produced better, more surprising results — participants caught things a directed investigation would have missed (e.g. one participant refusing to trust their own confident technical claim until a colleague pressure-tested it).
|
|
42
|
+
|
|
43
|
+
## The owner-injection channel
|
|
44
|
+
|
|
45
|
+
The session owner is not a participant, and their messages are not "just another opinion" to be relayed on equal footing — they carry standing authority the room cannot vote down. When the owner sends an instruction mid-session, handle it distinctly from ordinary dispatch:
|
|
46
|
+
|
|
47
|
+
- **Vetoes are final, not negotiable.** If the owner says a direction is closed (e.g. "this is too heavy for a small startup, drop it"), relay it as a closed decision to the participant(s) working that thread — not as a question for them to weigh in on. They can react (and often will, gracefully — e.g. proposing what to do instead), but the veto itself isn't up for debate.
|
|
48
|
+
- **Constraints apply retroactively and going forward.** A reminder like "we're a small startup" should be relayed to whoever is currently evaluating open candidates, framed as: re-assess what you already found under this lens, not just apply it to future ideas.
|
|
49
|
+
- **New topics/scope changes come from the owner, not from you.** If the owner says "look at IT trends broadly, not just AI," that reframing is theirs — relay it as their explicit ask, don't quietly narrow or widen scope yourself.
|
|
50
|
+
- **Requests to add participants** are handled via the mid-session spawn pattern below.
|
|
51
|
+
- **The owner can edit the goal contract itself** (tighten/loosen the threshold, add a "must also" criterion, change the goal entirely) — this is a goal-injection, distinct from a veto on content. Relay it to the room as an authoritative update to what "done" means, and re-run the scoring/convergence check under the new terms if a candidate was already mid-evaluation.
|
|
52
|
+
- **Status requests ("what's happening in the room?") get a real status, not a decision.** Report what's been found, who's arguing what, what's still open — do not use the opportunity to steer. If the owner explicitly asks "which should we pursue," that's their call to make (possibly by asking the room, via you), not yours to answer.
|
|
53
|
+
- **Owner instructions may also arrive over roomyx.** If you started a room server and attached a dispatcher handler to it, a veto / constraint / add-participant / goal-edit posted through `room.post_owner_command` is an owner injection exactly like one typed in chat — same standing authority, same handling as above. It reaches you as a command to act on; roomyx itself never writes to the log.
|
|
54
|
+
- **Do not ask the owner "what should we do next" as your default move.** Once the room's goal is set, keep it running and report status; only surface a genuine fork to the owner if it's a decision only they can make (scope, budget, willingness to accept a risk) — not a decision participants should be making themselves.
|
|
55
|
+
|
|
56
|
+
## Mid-session participant addition
|
|
57
|
+
|
|
58
|
+
The room doesn't have to be fully cast before it starts. To add a participant partway through:
|
|
59
|
+
|
|
60
|
+
1. Write their persona profile file first if it doesn't exist yet (same neutral-biography convention as the rest of the roster — see the project's persona-writing convention if one exists).
|
|
61
|
+
2. Spawn them with a **condensed** recap of what's happened so far (not the full transcript — summarize the arc: what's been explored, what's been killed and why, what's currently live) plus the full current roster (names + one-line role of everyone, including the other new joiners arriving alongside them).
|
|
62
|
+
3. Give them the same broadcast/self-moderation rules as original participants, and ask for an opening reaction — they should react to the *substance* of what's happened, not just announce themselves. A good new joiner brings a genuinely different angle (a different market, a different domain, a skeptical read on an existing thread) rather than restating what's already been said.
|
|
63
|
+
4. Log their contribution like anyone else's, and update the roster reference in the log file header.
|
|
64
|
+
|
|
65
|
+
This works well for deliberately broadening a room's perspective (e.g. a US-centric room that needs non-US market voices) — inject 2-3 new participants at once with an explicit ask to bring the missing angle, not just "join the discussion."
|
|
66
|
+
|
|
67
|
+
## Goal type: find & defend a startup idea (default criteria)
|
|
68
|
+
|
|
69
|
+
This is the default, ready-to-use goal type for this skill. When the owner asks to "find a startup idea," "find and defend an idea," or similar, use this criteria set unless they specify otherwise or the project has its own rubric file (check for one, e.g. `<project>/ideas/scoring-rubric.md`, and prefer it if present and more current — the list below is the portable default this skill carries so it works standalone in any project).
|
|
70
|
+
|
|
71
|
+
**Goal statement:** find a startup idea, and defend it until it (a) scores ≥60-70% on the 50-criteria rubric below, and (b) every active participant explicitly backs it as the room's pick.
|
|
72
|
+
|
|
73
|
+
**The 50-criteria rubric** — score each 0-10, sum out of 500, report as a percentage. Threshold: **60-70% (300-350/500)** to be "seriously considered." Below that is a real fail, however good the idea sounds in conversation.
|
|
74
|
+
|
|
75
|
+
**A. Боль и спрос (pain & demand) — 1-8**
|
|
76
|
+
1. Боль подтверждена цифрами, не догадкой · 2. Частота возникновения боли · 3. Острота боли (цена НЕ-решения) · 4. Размер затронутой аудитории · 5. Боль растёт со временем (тренд) · 6. Осознаваемость боли самим страдающим · 7. Стоимость текущего обходного пути · 8. Источник данных о боли независим от продавца идеи
|
|
77
|
+
|
|
78
|
+
**B. Рынок и конкуренция — 9-16**
|
|
79
|
+
9. Конкуренция реально пуста после жёсткого поиска · 10. Качество существующих решений · 11. Защитимость (не скопируют за спринт) · 12. Риск, что крупный игрок зайдёт намеренно · 13. Фрагментация рынка · 14. Траектория конкурентов (растут/буксуют) · 15. Издержки переключения клиента · 16. Временное окно возможности имеет чёткую дату, не расплывчатое "скоро"
|
|
80
|
+
|
|
81
|
+
**C. Экономика — 17-24**
|
|
82
|
+
17. Готовность платить подтверждена, не гипотетична · 18. Реалистичный ценовой потолок на клиента · 19. Размер адресного рынка именно для этой ниши · 20. Юнит-экономика (CAC/LTV хотя бы оценочно) · 21. Повторяемость дохода (подписка vs разовая) · 22. Ясность модели ценообразования · 23. Устойчивость маржи к росту стоимости входов · 24. Скорость цикла продажа→первый доход
|
|
83
|
+
|
|
84
|
+
**D. Реализуемость — 25-32**
|
|
85
|
+
25. Соло-подъёмность MVP (недели vs годы) · 26. Технический риск/предсказуемость · 27. Зависимость от партнёрств/данных третьих лиц · 28. Скорость получения рыночной обратной связи · 29. Требуемая доменная экспертиза · 30. Зависимость продаж от личных связей/доверия · 31. Доступность данных для AI-компонента (если применимо) · 32. Реалистичная оценка времени до первой сделки
|
|
86
|
+
|
|
87
|
+
**E. Риски — 33-40**
|
|
88
|
+
33. Регуляторный/юридический риск минимален · 34. Независимость от чужой платформы/API · 35. Риск изменения политики платформы/вендора · 36. Ответственность/репутационный риск при ошибке · 37. Чувствительность к макроэкономике/сезонности · 38. Личный юридический риск для фаундеров · 39. Геополитическая/юрисдикционная хрупкость · 40. Риск единой точки отказа
|
|
89
|
+
|
|
90
|
+
**F. Дистрибуция и рост — 41-46**
|
|
91
|
+
41. Можешь ли ты реально продать именно в этот сегмент · 42. Тёплый путь к первому платящему клиенту · 43. Виральный/реферальный потенциал · 44. Founder-market fit · 45. Повторяемость GTM на новые сегменты/страны · 46. Готовое сообщество/экосистема, на которую можно опереться
|
|
92
|
+
|
|
93
|
+
**G. Долгосрочная устойчивость — 47-50**
|
|
94
|
+
47. Защитимость за пределами первого узкого клина · 48. Опциональность расширения в смежные звенья цепочки · 49. Ценовая власть со временем · 50. Реалистичный путь к экзиту, или устойчивость как bootstrap-бизнеса
|
|
95
|
+
|
|
96
|
+
**How to run the scoring gate:** see **Scoring & convergence protocol** below — do not treat "the room seems to like this idea" as equivalent to a passed gate.
|
|
97
|
+
|
|
98
|
+
## Archiving a finding mid-session
|
|
99
|
+
|
|
100
|
+
When the owner says "save this idea" (or a candidate clearly survives enough rounds to be worth keeping regardless of whether the room keeps exploring), write it to a dedicated file *outside* the raw transcript — e.g. `<project>/ideas/<idea-name>.md` — with: the core pitch, the "why now" trigger, the strongest supporting evidence with sources, the competitive landscape found, open questions still unresolved, and which participants found what. Do this instead of letting the idea's evidence live only buried in a long transcript. Then explicitly tell the room to keep going — archiving isn't the same as concluding, and a room that just landed a good finding is prone to a "victory lap" where everyone relaxes instead of continuing to search (one participant in practice named this risk explicitly and it's worth watching for).
|
|
101
|
+
|
|
102
|
+
## Setup
|
|
103
|
+
|
|
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
|
+
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.
|
|
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
|
+
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
|
+
|
|
110
|
+
## Watching the room live (roomyx)
|
|
111
|
+
|
|
112
|
+
A room's transcript is a file the owner can only read after the fact. roomyx
|
|
113
|
+
turns it into something they can watch while it runs, without changing how the
|
|
114
|
+
room works: it reads the log and serves it, and it never writes to it. The
|
|
115
|
+
dispatcher stays the log's single writer.
|
|
116
|
+
|
|
117
|
+
Start the server as part of setup, before the kickoff spawns:
|
|
26
118
|
|
|
27
119
|
```bash
|
|
28
120
|
roomyx serve <logPath> --port 0
|
|
29
121
|
```
|
|
30
122
|
|
|
31
123
|
`--port 0` takes an ephemeral port, so several rooms can run at once without
|
|
32
|
-
colliding.
|
|
124
|
+
colliding. It prints the bound URL and a short room ID:
|
|
33
125
|
|
|
34
126
|
```
|
|
35
|
-
roomyx serving /abs/path/room.
|
|
127
|
+
roomyx serving /abs/path/room.md at http://127.0.0.1:41235/mcp
|
|
36
128
|
room ID: r-a1b2c3 — attach with `roomyx-client --room r-a1b2c3`
|
|
37
129
|
```
|
|
38
130
|
|
|
39
|
-
Relay that room ID to the owner in the kickoff confirmation,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
131
|
+
**Relay that room ID to the owner in the kickoff confirmation, with the attach
|
|
132
|
+
command.** That is the whole point of starting it — the owner opens the room in
|
|
133
|
+
a second terminal and watches the discussion as it happens instead of waiting
|
|
134
|
+
for your status reports. `roomyx rooms list` shows what is actually running;
|
|
135
|
+
each entry is confirmed with a real call, not just read out of the registry.
|
|
136
|
+
|
|
137
|
+
Attaching, detaching, or closing that terminal does nothing to the room. If the
|
|
138
|
+
owner never attaches, the session is unaffected.
|
|
139
|
+
|
|
140
|
+
Stop the server with `SIGINT`/`SIGTERM` when the room ends — it removes its own
|
|
141
|
+
registry entry on the way out. A server killed outright leaves a stale entry,
|
|
142
|
+
which is harmless: the next `rooms list` prunes it after a liveness check.
|
|
143
|
+
|
|
144
|
+
## Kickoff (spawn once per persona)
|
|
145
|
+
|
|
146
|
+
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:
|
|
147
|
+
|
|
148
|
+
- Instruction to read their own profile file and fully embody that character.
|
|
149
|
+
- The room's goal, stated neutrally, **and the concrete success criteria/threshold** — participants should know from turn one what "the room succeeded" actually means (e.g. "we're looking for an idea that would score ~300+/500 on the 50-criteria rubric and that all of us would personally back — not just something that sounds exciting").
|
|
150
|
+
- The full initial roster (names + one-line role of every other participant), so they know who they're in the room with.
|
|
151
|
+
- **The broadcast rule, stated explicitly:** "You will receive updates containing everything said by every participant since your last turn — not just messages addressed to you. Read all of it. You may address someone specifically with @Name, but @-addressing is just a convention for clarity in the transcript, not an access filter — you already see everything regardless."
|
|
152
|
+
- **The self-moderation instruction, stated explicitly:** "You and the other participants are jointly responsible for not letting the discussion tunnel too deep into one narrow technical thread too early. If you notice this happening — including in your own last message — say so and propose broadening back out. Anyone can call this out, not just a designated moderator persona."
|
|
153
|
+
- Whether real web research is expected/required this round (say so plainly; don't leave it ambiguous).
|
|
154
|
+
- Ask for their opening contribution (a pitch, a reaction, a question — whatever fits the room's stated purpose).
|
|
155
|
+
|
|
156
|
+
Capture the `agentId` (or assigned name) returned by each spawn — this is what you'll use with `SendMessage` for every subsequent turn. Log each opening contribution to the file, in dialogue form (`**Name:** their actual words`), as it comes in.
|
|
157
|
+
|
|
158
|
+
## Turn loop
|
|
159
|
+
|
|
160
|
+
For each subsequent turn:
|
|
161
|
+
|
|
162
|
+
1. Decide whose turn it is. Options: round-robin, or reactive (whoever was just @-mentioned or most directly challenged goes next), or "whoever has something to add" if you asked participants to signal that. Mix these — a real room isn't strictly round-robin.
|
|
163
|
+
2. Compose the delta: only the messages posted since that participant's last turn (typically: everything since you last messaged them). Do not re-paste anything they already said or already received — they remember it.
|
|
164
|
+
3. Send it via `SendMessage` to their `agentId`/name, with a short prompt: "Here's what's happened since your last turn: [delta]. Your turn — react, build, refute, research, or pass."
|
|
165
|
+
4. Append their reply verbatim to the log file, prefixed with their name.
|
|
166
|
+
5. Report to the session owner after essentially every substantive exchange, not just every few turns — in practice, "frequent" means after each participant's reply that adds something new, not on a fixed cadence. Use real quotes from the transcript, not paraphrases, so the owner can judge the room's reasoning quality directly. If the owner has explicitly asked for frequent updates, treat that as the floor, not a suggestion to pace yourself against.
|
|
167
|
+
|
|
168
|
+
**Mechanical note:** `SendMessage` to a previously-spawned agent runs it in the background and returns immediately; the agent's reply arrives later as a separate task-notification event, not as this tool call's return value. Don't block waiting for it — end your turn, and act on the reply when the notification arrives. Multiple participants can be messaged in parallel this way; their replies will arrive as separate notifications, in whatever order they finish.
|
|
169
|
+
|
|
170
|
+
## Scoring & convergence protocol
|
|
171
|
+
|
|
172
|
+
Once a candidate has survived enough open debate that participants seem to be converging on it, do not declare the goal met on vibes. Run an explicit gate:
|
|
173
|
+
|
|
174
|
+
1. **Formal scoring pass.** Either assign the full criteria list to one rigorous participant to walk through point-by-point with justification and sources (as has worked well in practice — one skeptical persona producing a full numbered scorecard), or split the criteria groups across 2-3 participants for independent scoring. Log the score, the percentage, and whether it clears the threshold — verbatim, including the reasoning per group, not just the final number.
|
|
175
|
+
2. **If it fails the threshold:** this is real, useful information, not a setback to paper over. Report the score and the weakest groups honestly, then relay back to the room: does this get refined (same idea, address the specific weak criteria) or abandoned (back to search)? That's the room's call, not the dispatcher's.
|
|
176
|
+
3. **If it clears the threshold:** run an explicit convergence turn — ask each active participant a direct, individual question: "This idea scored X% against the criteria. Do you personally back it as the room's pick — yes, no, or yes-with-reservations?" Collect actual individual answers, not a paraphrased summary.
|
|
177
|
+
4. **The goal is only met when both conditions hold**: score ≥ threshold *and* the room has converged (unanimous, or an owner-defined quorum if the owner has said unanimity isn't required). A high score with an unresolved direct challenge between two participants (e.g. one hasn't answered another's pointed question yet) is not convergence — relay the open question and wait for it to resolve.
|
|
178
|
+
5. Once met, write the final archive entry (see **Archiving a finding mid-session**) explicitly noting the score and that convergence was reached, and report completion to the owner as the goal being achieved — not just "an idea was found."
|
|
179
|
+
|
|
180
|
+
## Loop until the goal is met
|
|
181
|
+
|
|
182
|
+
There is no fixed "end of session" — the room's natural rhythm is: search → propose candidate(s) → open debate → (repeat until something looks worth formally testing) → scoring & convergence gate above → either goal met (stop) or gate failed (loop back to search/refine, goal contract unchanged unless the owner edits it).
|
|
183
|
+
|
|
184
|
+
Within that loop, still close individual rounds cleanly so status is checkable at any point:
|
|
185
|
+
- An explicit "where do things stand" turn (ask each active participant for a one-line current position) if a natural pause point is hit before a formal scoring gate is warranted, or
|
|
186
|
+
- A moderator-written synthesis that honestly reports non-convergence/non-consensus if that's what happened — do not manufacture a fake consensus, and do not let a partial or informal sense of agreement substitute for the actual gate above.
|
|
187
|
+
|
|
188
|
+
Formalize any intermediate outcome (a short brief, not the raw transcript) if it's meant to feed into a next round — raw transcripts are expensive to re-read; briefs are cheap. This is separate from, and does not substitute for, the formal scoring/convergence gate required to declare the goal met.
|
|
189
|
+
|
|
190
|
+
## Things to avoid
|
|
191
|
+
|
|
192
|
+
- Do not let a "kill the same idea seven ways" cycle run past the point of diminishing returns — if independent participants converge on the same verdict from different angles, stop and move on rather than collecting a ninth confirmation.
|
|
193
|
+
- Do not silently switch a room's stated task (e.g. "adversarially test idea X" quietly becoming "keep re-litigating idea X forever" instead of pivoting to searching for a new idea once X is dead) — check back against the room's actual stated goal each round.
|
|
194
|
+
- Do not give participants write access to the shared log file, even read-only tool access that could be misused — the moderator relays and appends, always.
|
|
195
|
+
- Do not declare the goal achieved without running the explicit scoring & convergence gate above — "the room seems excited about this" or "several participants like it" is not the same as a passed threshold plus an actual individual yes from everyone.
|
|
196
|
+
- Do not quietly lower the threshold or narrow the criteria because nothing is passing — if the room is genuinely stuck, report that honestly to the owner as a status (goal not yet met, here's why) rather than softening the bar to manufacture a win.
|
package/src/cli/args.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One argument grammar for the whole CLI.
|
|
3
|
+
*
|
|
4
|
+
* There were two hand-rolled scanners with different semantics, and between
|
|
5
|
+
* them they produced this, measured against the published 0.4.0:
|
|
6
|
+
*
|
|
7
|
+
* roomyx serve --port 0 room.jsonl → served a file literally named "--port"
|
|
8
|
+
* roomyx serve --help → STARTED A SERVER
|
|
9
|
+
* roomyx serve room.jsonl --port → port 1, because Number(true) === 1
|
|
10
|
+
* roomyx serve room.jsonl --port abc → NaN, so a silent ephemeral port
|
|
11
|
+
* roomyx skills sync --dryrun → unknown flag, silently ignored
|
|
12
|
+
* roomyx --help → usage on stderr, exit 1
|
|
13
|
+
*
|
|
14
|
+
* Every one of those is the same defect: a scanner that never decided what a
|
|
15
|
+
* flag *is*, so it could not tell a value from a positional, a typo from an
|
|
16
|
+
* option, or a number from a boolean. Declaring the flags fixes the whole
|
|
17
|
+
* class, which is why this is a spec-driven parser rather than six patches.
|
|
18
|
+
*
|
|
19
|
+
* It matters beyond tidiness because an agent is a first-class user of this
|
|
20
|
+
* CLI, and the first thing an agent does with an unknown command is ask for
|
|
21
|
+
* `--help`.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export type FlagType = "string" | "number" | "boolean";
|
|
25
|
+
|
|
26
|
+
export interface FlagSpec {
|
|
27
|
+
type: FlagType;
|
|
28
|
+
describe: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type FlagSpecs = Record<string, FlagSpec>;
|
|
32
|
+
|
|
33
|
+
export type FlagValues = Record<string, string | number | boolean>;
|
|
34
|
+
|
|
35
|
+
export interface ParsedArgs {
|
|
36
|
+
positionals: string[];
|
|
37
|
+
flags: FlagValues;
|
|
38
|
+
/** True when `--help`/`-h` appeared. Callers print help and exit 0. */
|
|
39
|
+
help: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Thrown for anything the caller should report and exit 1 on. */
|
|
43
|
+
export class ArgError extends Error {}
|
|
44
|
+
|
|
45
|
+
/** Levenshtein, for "unknown flag --dryrun; did you mean --dry-run?". */
|
|
46
|
+
function distance(a: string, b: string): number {
|
|
47
|
+
const rows = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array<number>(b.length).fill(0)]);
|
|
48
|
+
for (let j = 0; j <= b.length; j++) rows[0]![j] = j;
|
|
49
|
+
for (let i = 1; i <= a.length; i++) {
|
|
50
|
+
for (let j = 1; j <= b.length; j++) {
|
|
51
|
+
const substitution = rows[i - 1]![j - 1]! + (a[i - 1] === b[j - 1] ? 0 : 1);
|
|
52
|
+
rows[i]![j] = Math.min(rows[i - 1]![j]! + 1, rows[i]![j - 1]! + 1, substitution);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return rows[a.length]![b.length]!;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function suggest(unknown: string, known: string[]): string | undefined {
|
|
59
|
+
let best: { name: string; d: number } | undefined;
|
|
60
|
+
for (const name of known) {
|
|
61
|
+
const d = distance(unknown, name);
|
|
62
|
+
if (!best || d < best.d) best = { name, d };
|
|
63
|
+
}
|
|
64
|
+
// Two edits is close enough to be a typo and far enough not to be noise.
|
|
65
|
+
return best && best.d <= 2 ? best.name : undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function parseArgs(argv: string[], specs: FlagSpecs): ParsedArgs {
|
|
69
|
+
const positionals: string[] = [];
|
|
70
|
+
const flags: FlagValues = {};
|
|
71
|
+
const known = Object.keys(specs);
|
|
72
|
+
let help = false;
|
|
73
|
+
let sawTerminator = false;
|
|
74
|
+
|
|
75
|
+
for (let i = 0; i < argv.length; i++) {
|
|
76
|
+
const arg = argv[i] as string;
|
|
77
|
+
|
|
78
|
+
if (sawTerminator || !arg.startsWith("--")) {
|
|
79
|
+
if (arg === "-h" && !sawTerminator) {
|
|
80
|
+
help = true;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
positionals.push(arg);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (arg === "--") {
|
|
88
|
+
sawTerminator = true;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const eq = arg.indexOf("=");
|
|
93
|
+
const name = (eq === -1 ? arg.slice(2) : arg.slice(2, eq)).trim();
|
|
94
|
+
const inlineValue = eq === -1 ? undefined : arg.slice(eq + 1);
|
|
95
|
+
|
|
96
|
+
if (name === "help") {
|
|
97
|
+
help = true;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const spec = specs[name];
|
|
102
|
+
if (!spec) {
|
|
103
|
+
const hint = suggest(name, known);
|
|
104
|
+
throw new ArgError(
|
|
105
|
+
`Unknown flag --${name}${hint ? `. Did you mean --${hint}?` : "."}` +
|
|
106
|
+
(known.length > 0 ? `\nKnown flags: ${known.map((f) => `--${f}`).join(", ")}` : ""),
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (spec.type === "boolean") {
|
|
111
|
+
if (inlineValue !== undefined && inlineValue !== "true" && inlineValue !== "false") {
|
|
112
|
+
throw new ArgError(`--${name} is a switch and takes no value (got "${inlineValue}").`);
|
|
113
|
+
}
|
|
114
|
+
flags[name] = inlineValue !== "false";
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// A value is required, and the next argv entry is only a value if it does
|
|
119
|
+
// not look like a flag. `--port --host x` must fail rather than quietly
|
|
120
|
+
// read `--host` as the port.
|
|
121
|
+
let raw = inlineValue;
|
|
122
|
+
if (raw === undefined) {
|
|
123
|
+
const next = argv[i + 1];
|
|
124
|
+
if (next === undefined || next.startsWith("--")) {
|
|
125
|
+
throw new ArgError(`--${name} needs a value.`);
|
|
126
|
+
}
|
|
127
|
+
raw = next;
|
|
128
|
+
i++;
|
|
129
|
+
}
|
|
130
|
+
if (raw === "") {
|
|
131
|
+
throw new ArgError(`--${name} needs a value.`);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (spec.type === "number") {
|
|
135
|
+
const value = Number(raw);
|
|
136
|
+
if (!Number.isFinite(value)) {
|
|
137
|
+
throw new ArgError(`--${name} needs a number (got "${raw}").`);
|
|
138
|
+
}
|
|
139
|
+
flags[name] = value;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
flags[name] = raw;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return { positionals, flags, help };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Renders a spec as the flag table a `--help` prints. */
|
|
150
|
+
export function renderFlags(specs: FlagSpecs): string {
|
|
151
|
+
const names = Object.keys(specs);
|
|
152
|
+
if (names.length === 0) return "";
|
|
153
|
+
const width = Math.max(...names.map((n) => n.length));
|
|
154
|
+
return names.map((n) => ` --${n.padEnd(width)} ${specs[n]!.describe}`).join("\n");
|
|
155
|
+
}
|
package/src/cli/specs.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FlagSpecs } from "./args";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The client's flags, in one place because two entry points take them: the
|
|
5
|
+
* `roomyx-client` binary and `roomyx client`. They were two hand-rolled
|
|
6
|
+
* scanners with different semantics, which is how a bare `--registry` came to
|
|
7
|
+
* resolve to the empty string in one of them and to `true` in the other.
|
|
8
|
+
*
|
|
9
|
+
* This module deliberately imports nothing but a type, so `roomyx --version`
|
|
10
|
+
* does not pay for loading the TUI renderer.
|
|
11
|
+
*/
|
|
12
|
+
export const CLIENT_FLAGS: FlagSpecs = {
|
|
13
|
+
room: { type: "string", describe: "Attach to a specific live room by id" },
|
|
14
|
+
connect: { type: "string", describe: "Attach to an explicit MCP URL; the registry is not consulted" },
|
|
15
|
+
registry: { type: "string", describe: "Registry file (default .roomyx/rooms/registry.json)" },
|
|
16
|
+
};
|