create-pmos 0.580.0 → 0.581.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/package.json +14 -20
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +13 -0
- package/workspace/guide/agent-capabilities.md +23 -3
- package/workspace/guide/cli.md +3 -2
- package/workspace/lib/bg-queue.js +5 -2
- package/workspace/lib/grill-runs.js +2 -0
- package/workspace/lib/grill.js +1 -1
- package/workspace/lib/headless.js +8 -2
- package/workspace/lib/idle-lab-engine.js +9 -2
- package/workspace/lib/idle-lab.js +15 -4
- package/workspace/lib/job-graph.js +1 -0
- package/workspace/lib/lab-cli.js +26 -2
- package/workspace/lib/live-round.js +407 -0
- package/workspace/lib/orchestrator-keeprate.js +3 -0
- package/workspace/lib/proposals.js +5 -2
- package/workspace/lib/routes-briefing-premium.js +27 -2
- package/workspace/lib/routes-lab.js +20 -3
- package/workspace/lib/routes-proposals.js +39 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-lab.css +12 -0
- package/workspace/public/pm/cozy-lab.js +42 -7
- package/workspace/public/pm/ini-props.js +7 -3
- package/workspace/run-tests.js +35 -0
- package/workspace/server.js +19 -0
- package/workspace/test-lists/live-round.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.581.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.581.0",
|
|
38
|
+
"at": "2026-11-17T02:30:27.550Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1314,
|
|
43
|
+
"t": "Live round from the initiative chat",
|
|
44
|
+
"s": "Live round from the initiative chat",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.580.0",
|
|
38
51
|
"at": "2026-11-17T02:13:59.003Z",
|
|
@@ -285,25 +298,6 @@
|
|
|
285
298
|
"k": "fix"
|
|
286
299
|
}
|
|
287
300
|
]
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
"v": "0.561.0",
|
|
291
|
-
"at": "2026-11-11T10:53:52.082Z",
|
|
292
|
-
"f": 4,
|
|
293
|
-
"prs": [
|
|
294
|
-
{
|
|
295
|
-
"n": 1292,
|
|
296
|
-
"t": "Canvas registry, batch log, and an experiment record per batch item",
|
|
297
|
-
"s": "Canvas registry, batch log, and an experiment record per batch item",
|
|
298
|
-
"k": "x"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
"n": 1291,
|
|
302
|
-
"t": "Remove work-specific names from the published kit and derive the PM's name per install",
|
|
303
|
-
"s": "Remove work-specific names from the published kit and derive the PM's name per install",
|
|
304
|
-
"k": "fix"
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
301
|
}
|
|
308
302
|
]
|
|
309
303
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-17T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T02:30:24Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-17T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T02:30:24Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-17T02:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T02:30:24Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.581.0",
|
|
4
|
+
"at": "2026-11-17T02:30:27.550Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1314,
|
|
9
|
+
"t": "Live round from the initiative chat",
|
|
10
|
+
"s": "Live round from the initiative chat",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.580.0",
|
|
4
17
|
"at": "2026-11-17T02:13:59.003Z",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "What PMOS does behind the scenes, and what stays yours"
|
|
4
|
-
description: "Every job PMOS runs by itself, what agents apply by themselves with Undo (D106), long-running goals, the team of role agents, the idle lab, and the PM-only acts."
|
|
4
|
+
description: "Every job PMOS runs by itself, what agents apply by themselves with Undo (D106), long-running goals, the team of role agents, the live round, the idle lab, and the PM-only acts."
|
|
5
5
|
timestamp: 2026-11-17
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ This page lists every job, so you know what runs and why. Each row links to the
|
|
|
20
20
|
- **Tested first.** A new version of a job shows nothing until its replay passes: its own known cases, and the guard's own cases (a made-up quote, a missing source, a path outside the repository, a write key). Each of those must be dropped.
|
|
21
21
|
- **Your login, your connections.** A job runs as a background Claude session with your own login, model, profile and connectors. The workspace holds no password or token. `PMOS_HEADLESS=off` sends every job back to a terminal pane.
|
|
22
22
|
- **Lean start.** A job that reads none of your connectors starts with only the tools it uses: no MCP servers, no skills, no settings files and no `CLAUDE.md`. It still runs with your login and your model. This cuts the tokens each run reads by about half or more. A job that reads your connectors starts as before. `PMOS_LEAN_JOBS=off` starts every job the old way.
|
|
23
|
-
- **One queue.** Every background job waits for its turn in one queue. Each minute the jobs go in this order: what is due at a set time (schedules, the morning brief and day check, the data refresh, report schedules), then the Initiative Driver, then the deep drafts (core documents, Your impact, metric drafts and reads, grill, proposals), then the idle work (the Horizon scan, then the idle lab). What you ask for, such as Scan now
|
|
23
|
+
- **One queue.** Every background job waits for its turn in one queue. Each minute the jobs go in this order: what is due at a set time (schedules, the morning brief and day check, the data refresh, report schedules), then the Initiative Driver, then the deep drafts (core documents, Your impact, metric drafts and reads, grill, proposals), then the idle work (the Horizon scan, then the idle lab). What you ask for, such as Scan now, Prepare my day or a live round, starts at once and never waits in the queue.
|
|
24
24
|
- **One run for each initiative.** A background run never starts on an initiative that another background run is working on. It tries again a minute later.
|
|
25
25
|
- **Idle work waits for you to step away.** The idle work starts only when you have not used PMOS for 30 minutes, or in the last hour of your working day if you never stepped away. It also waits when 3 background runs are live, inside quiet hours, and at the spending limit.
|
|
26
26
|
- **Your hours.** Scheduled jobs run inside your working hours and never inside your quiet hours.
|
|
@@ -100,6 +100,7 @@ A loop never sends a message, moves a Jira ticket, merges into a product reposit
|
|
|
100
100
|
| [Expected outcomes](claude-proposes.md) | Once a day. At most 3 drafts a day for each product. | The PRD's success criteria, or the anchored key result | "Expected outcome" under the initiative's ✦. Today when a check is due. | `pmos ai off outcomes`. `PMOS_OUTCOMES=off` |
|
|
101
101
|
| [Metric drafts](claude-proposes.md) | A product with no North Star, the first 14 days of a quarter, a program with no goal, and an initiative that gets a PRD | The last 8 weeks of real readings | The page of that product, program or initiative | `PMOS_METRIC_DRAFT=off` |
|
|
102
102
|
| [Horizon scan](intelligence-okr-goals.md) | Daily by default, at most once a day, the first time you step away after 09:00. Scan now: at most 3 a day. | The public web for your kept watch list, and your repository | Report documents and proposals you approve | Cadence: Off. `PMOS_SCAN=off` |
|
|
103
|
+
| Live round | When you press ✓ on its ✦ ask, or run `pmos lab round`. Three runs at once, 2 minutes at most. | The initiative's name, the product's Intent and its token sheet; a feedback round also reads the last version. | "PMOS prototyped it" or "PMOS improved it" under the initiative's ✦, each version as soon as it renders. | ✕ on its ✦ ask; Undo after ✓ |
|
|
103
104
|
| Idle lab | When you have not used PMOS for 30 minutes. One run at a time, at most 3 results each time you step away. | Prototypes: the initiative's record, PRD and earlier specimens. Scans: public pages only, read through `pmos lab page`, and no repository. | "PMOS prototyped it", "PMOS improved it" and "PMOS scanned for it" under the initiative's ✦. A finding that fits no initiative: Intelligence › Lab. | `pmos ai off idle-lab` |
|
|
104
105
|
| [What you might have missed](claude-proposes.md) | Each Monday, for the week before. It uses no model. | Records only: tasks, dates, initiatives and Jira status | One ✦ in Home's chat, at most 3 items | `pmos ai off drift`. `PMOS_DRIFT=off` |
|
|
105
106
|
| [The story so far](home.md) | Once, when you open a product that has no story yet. At most once a day for each product. | The initiatives, their stages and dates, and the Intent and Goal | "The story so far" on the product page. After that, the weekly report keeps it current. | `pmos ai off story-seed`. `PMOS_STORY_SEED=off` |
|
|
@@ -140,7 +141,7 @@ When you ask an agent session to do a piece of work, it can finish it, including
|
|
|
140
141
|
- `pmos ai log [<job>]`: the last audit lines. Each dropped proposal shows why.
|
|
141
142
|
- `pmos ai off [<job>]` and `pmos ai on [<job>]`: turn every AI job, or one job, off or on. `PMOS_AI=off` in the environment wins over the setting.
|
|
142
143
|
|
|
143
|
-
The AI jobs are `past-repeat`, `decision-memory`, `outcomes`, `descriptions`, `drift`, `rehearse`, `next-prompt`, `sharpen-prompt` and `
|
|
144
|
+
The AI jobs are `past-repeat`, `decision-memory`, `outcomes`, `descriptions`, `drift`, `rehearse`, `next-prompt`, `sharpen-prompt`, `idle-lab` and `live-round` (`pmos ai off live-round` stops new live rounds; one that runs ends by itself). The switch also covers each job in the queue by its queue name: `schedules`, `proactive`, `prepare`, `day`, `refresh`, `reports`, `driver`, `goal-loops`, `finder`, `coredocs`, `milestones`, `propose`, `grill`, `metric-drafts`, `impact`, `metric-reads`, `forecast`, `report-design`, `report-structure`, `team`, `scan` and `idle-lab`. `pmos ai off` with no job stops all of them. Git sync uses no model, so the switch does not stop it. A background run cannot change the switch.
|
|
144
145
|
|
|
145
146
|
## The team of role agents
|
|
146
147
|
|
|
@@ -188,6 +189,25 @@ The run uses only the `pmos lab` commands in the [Command reference](cli.md).
|
|
|
188
189
|
|
|
189
190
|
Not proven yet: the compare view's Production and Design columns stay left out until PMOS shows on your computer that it can render production from the product repository and read the design.
|
|
190
191
|
|
|
192
|
+
## The live round
|
|
193
|
+
|
|
194
|
+
You can ask to see an idea at any moment: alone while you work on an initiative, or with stakeholders in the room. You do not have to step away first.
|
|
195
|
+
|
|
196
|
+
1. **Ask in the initiative's chat.** Say, for example, "show me 3 ways" or "prototype this". PMOS answers with one ✦ under the initiative: "PMOS will show 3 ways", with one line for each direction it chose. Nothing is made yet.
|
|
197
|
+
2. **Press ✓ on that ✦.** PMOS starts three runs at once, one version each. The card shows each version as soon as it opens and renders in a headless browser. A version that is still being made says so. A version that does not render, or that takes more than 2 minutes, shows as "not made" with the reason. A round took about a minute in the dry run on the Mac mini.
|
|
198
|
+
3. **Give feedback in one sentence.** For example, "B, but lead with the risk, fewer rows". PMOS files one ✦: "Round 2 of B: …". Its ✓ makes one new version of B, which reads the last one.
|
|
199
|
+
4. **Compare and keep one.** Press a thumbnail to open the compare view. It shows A, B and C side by side, with each round in History. Press a column to pick it, then ✓ keeps that version as the initiative's kept specimen. ✕ drops a round, and you can say why.
|
|
200
|
+
|
|
201
|
+
What each part does:
|
|
202
|
+
|
|
203
|
+
- **✓, ✕ and Undo.** Undo after ✓ stops a round that is still running and removes its card.
|
|
204
|
+
- **What the run gets.** Each run gets the product's token sheet and the start of its component sheet (or PMOS's own), the initiative's name and the product's Intent. Each version must fit a 390 px phone screen.
|
|
205
|
+
- **What the run can do.** A run can only read and write in its own folder in the runtime folder. It has no shell, no web and nothing that sends. Nothing goes into a product repository before your ✓.
|
|
206
|
+
- **Lessons.** Each feedback sentence, ✓ and ✕ is a Lessons line of the experiment (`pmos artefacts show`). Each version that rendered is a Specimens line. The one you keep is the kept specimen.
|
|
207
|
+
- **The grill runs after the session, not during it.** When you keep a version, the grill runs once on the kept specimen, as the Review step. Its findings wait under the ✦ (D60 as amended on 2026-11-17).
|
|
208
|
+
- **Order.** A live round is step 1 of the queue: what you asked for starts at once. While it runs, the idle lab does not start on that initiative. The idle lab treats a live round as one more round, so the rounds stay in one history.
|
|
209
|
+
- **Without the chat.** `pmos lab round` does the same from a terminal (see the [Command reference](cli.md)).
|
|
210
|
+
|
|
191
211
|
## The idle lab: where its results wait
|
|
192
212
|
|
|
193
213
|
When you step away from PMOS, PMOS can use the idle time to make prototypes and to scan the web for your initiatives. Each result is checked before you see it: a prototype must open and render, and a scan claim must cite a page PMOS read. Nothing is written to a product repository before you press ✓.
|
package/workspace/guide/cli.md
CHANGED
|
@@ -224,13 +224,14 @@ PMOS looks for problems that repeat in a product (your Undos and ✕ reasons, re
|
|
|
224
224
|
|
|
225
225
|
[What PMOS does behind the scenes](agent-capabilities.md) lists each role, what it may write and its rules.
|
|
226
226
|
|
|
227
|
-
### pmos lab: the idle lab
|
|
227
|
+
### pmos lab: the idle lab and the live round
|
|
228
228
|
|
|
229
|
-
The idle lab run uses only
|
|
229
|
+
The idle lab run uses only the first three commands:
|
|
230
230
|
|
|
231
231
|
- `pmos lab page <url>`: a scan run reads one public page. PMOS refuses a private or local address and keeps the page text, so a quote can be checked.
|
|
232
232
|
- `pmos lab file <group> --json -`: a run files one result. It waits until the run ends and the proof passes.
|
|
233
233
|
- `pmos lab status`: in a run, what it filed. Outside a run, this month's idle lab runs and spend.
|
|
234
|
+
- `pmos lab round <initiative> --brief "<what to show>" [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--ws <id>]`: a live round. PMOS starts three runs at once, one version each, and shows each version under the initiative's ✦ as soon as it renders. With `--base B`, PMOS makes one new round of B from the brief. With `--propose`, PMOS files the ✦ ask instead, and your ✓ starts it. A background lab run cannot use this command. See [The live round](agent-capabilities.md).
|
|
234
235
|
|
|
235
236
|
### pmos outcomes: expected outcomes
|
|
236
237
|
|
|
@@ -61,6 +61,8 @@ const STEPS = Object.freeze([
|
|
|
61
61
|
/* id: the queue's job id (also the `pmos ai off <job>` id). ai: false = no model, so the AI off switch does not stop it.
|
|
62
62
|
* A new job also gets a row in lib/job-graph.js (what it reads and writes, and who reads that): job-graph.test.js fails until it has one. */
|
|
63
63
|
const JOBS = Object.freeze([
|
|
64
|
+
// the live round (lib/live-round.js): the PM's ✓ (or `pmos lab round`) starts it at once through the route; it has no tick here
|
|
65
|
+
{ id: 'live-round', step: 1, label: 'Live rounds' },
|
|
64
66
|
{ id: 'schedules', step: 2, label: 'Scheduled skills' },
|
|
65
67
|
{ id: 'proactive', step: 2, label: 'Morning brief and day check' },
|
|
66
68
|
{ id: 'prepare', step: 2, label: 'Day tasks' },
|
|
@@ -143,13 +145,14 @@ function holderOf(sessions, initiative, { except = null } = {}) {
|
|
|
143
145
|
}
|
|
144
146
|
return null;
|
|
145
147
|
}
|
|
146
|
-
/** The initiative an origin names: drive:initiative:<id>, grill:<ws>:<id>:<run>, propose:<ws>:<id>:<run>, idle-lab-proto|idle-lab-scan:<ws>:<id|->:<run>,
|
|
148
|
+
/** The initiative an origin names: drive:initiative:<id>, grill:<ws>:<id>:<run>, propose:<ws>:<id>:<run>, idle-lab-proto|idle-lab-scan:<ws>:<id|->:<run>, live-round:<ws>:<id>:<run>:<key>,
|
|
147
149
|
* team:<ws>:<role>:<id|->:<run>. A role run holds its initiative like any background run, so one run per initiative per role holds a fortiori. */
|
|
148
150
|
function initiativeOfOrigin(origin) {
|
|
149
151
|
const p = String(origin || '').split(':');
|
|
150
152
|
if (p[0] === 'drive' && p[1] === 'initiative') return p.slice(2).join(':') || null;
|
|
151
153
|
if ((p[0] === 'grill' || p[0] === 'propose') && p.length >= 4) return p[2] || null;
|
|
152
154
|
if ((p[0] === 'idle-lab-proto' || p[0] === 'idle-lab-scan') && p.length >= 4) return p[2] && p[2] !== '-' ? p[2] : null;
|
|
155
|
+
if (p[0] === 'live-round' && p.length >= 5) return p[2] || null; // live-round:<ws>:<initiative>:<run>:<key>: the idle lab waits while it runs
|
|
153
156
|
if (p[0] === 'team' && p.length >= 5) return p[3] && p[3] !== '-' ? p[3] : null; // team:<ws>:<role>:<initiative|->:<run>
|
|
154
157
|
return null;
|
|
155
158
|
}
|
|
@@ -158,7 +161,7 @@ function initiativeOfOrigin(origin) {
|
|
|
158
161
|
const ORIGIN_JOB = Object.freeze({ drive: 'driver', grill: 'grill', propose: 'propose', 'metric-read': 'metric-reads', 'metric-draft': 'metric-drafts',
|
|
159
162
|
impact: 'impact', coredoc: 'coredocs', 'core-docs': 'coredocs', 'scan-web': 'scan', 'scan-repo': 'scan', 'scan-suggest': 'scan',
|
|
160
163
|
'scan-research-web': 'scan', 'scan-research-repo': 'scan', 'report-find': 'finder', 'ms-review': 'milestones', 'next-step': 'prepare',
|
|
161
|
-
'idle-lab-proto': 'idle-lab', 'idle-lab-scan': 'idle-lab', team: 'team' });
|
|
164
|
+
'idle-lab-proto': 'idle-lab', 'idle-lab-scan': 'idle-lab', 'live-round': 'live-round', team: 'team' });
|
|
162
165
|
// Runs a chat makes for the PM while they use it, not background work: briefing-ask is the read-only run behind a chat (its suggested next
|
|
163
166
|
// prompt, a quick ask). Wawan, 2026-11-04: the Lab's "What Claude did in the background" listed "chat: next prompt" fourteen times.
|
|
164
167
|
const NOT_BACKGROUND = new Set(['briefing-ask']);
|
|
@@ -33,6 +33,8 @@ const WHY = {
|
|
|
33
33
|
plan: 'Its PRD changed. Check the new plan against the decisions that stand (the decision angle) first, then grill it.',
|
|
34
34
|
monthly: 'The monthly look at running work (late work first, then the initiatives grilled longest ago). Grill it.',
|
|
35
35
|
ask: 'The PM asked for it in the initiative\'s chat. Grill it now: what would make it fail, and what is the next step?',
|
|
36
|
+
// D60 as amended 2026-11-17: the grill does not run during a live round; it runs once on the specimen the PM kept, as the Review step
|
|
37
|
+
kept: 'The PM kept a prototype specimen from a live round. Grill the kept specimen once, as the Review step: open it (the path below), then ask what would make it fail with real users, and what is the next step?',
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
function promptOf(skill, o) {
|
package/workspace/lib/grill.js
CHANGED
|
@@ -52,7 +52,7 @@ const KINDS = new Set(['start', 'voices', 'end', 'snap', 'plan', 'paused']);
|
|
|
52
52
|
const ANGLES = Object.freeze(['premortem', 'redteam', 'voices', 'reframe', 'scope', 'whatif', 'decision']);
|
|
53
53
|
const LABEL = Object.freeze({ premortem: 'Premortem', redteam: 'Red team', voices: 'Voices', reframe: 'Reframe', scope: 'Scope', whatif: 'What-if', decision: 'Earlier decision' });
|
|
54
54
|
const SIMULATED = Object.freeze({ voices: 'Simulated, not evidence', whatif: 'Simulated, not the plan' });
|
|
55
|
-
const WHYS = Object.freeze(['exit', 'forecast', 'move', 'plan', 'monthly', 'ask']);
|
|
55
|
+
const WHYS = Object.freeze(['exit', 'forecast', 'move', 'plan', 'monthly', 'ask', 'kept']); // kept: the PM kept a live round's specimen (lib/live-round.js)
|
|
56
56
|
const MODES = Object.freeze(['full', 'exits', 'off']);
|
|
57
57
|
const VOICES_MIN = 3;
|
|
58
58
|
const RUN_MAX_USD = 2; // one run never spends more than this
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (initiative workspace-headless-jobs; PM decision 2026-10-11: keep Jev, no direct Claude API, background
|
|
4
4
|
* jobs that need no human run headless).
|
|
5
5
|
*
|
|
6
|
-
* kindFor({ agent, origin, skill, env }) → 'notes' | 'skill' | 'ask' | 'drive' | 'scan-web' | 'scan-repo' | 'scan-research-web' | 'scan-research-repo' | 'report-setup' | 'report-find' | 'core-doc' | 'report-design' | 'report-structure-pull' | 'report-sample-fetch' | 'report-structure' | 'report-structure-dry' | 'ms-review' | 'propose' | 'metric-draft' | 'grill' | 'impact' | 'verify' | 'review' | 'improve' | 'metric-read' | 'lab-proto' | 'lab-scan' | 'team' | null (null: open a pane, as before)
|
|
6
|
+
* kindFor({ agent, origin, skill, env }) → 'notes' | 'skill' | 'ask' | 'drive' | 'scan-web' | 'scan-repo' | 'scan-research-web' | 'scan-research-repo' | 'report-setup' | 'report-find' | 'core-doc' | 'report-design' | 'report-structure-pull' | 'report-sample-fetch' | 'report-structure' | 'report-structure-dry' | 'ms-review' | 'propose' | 'metric-draft' | 'grill' | 'impact' | 'verify' | 'review' | 'improve' | 'metric-read' | 'lab-proto' | 'lab-scan' | 'live-round' | 'team' | null (null: open a pane, as before)
|
|
7
7
|
* argsFor(kind, { modelArgs, addDirs, writePaths }) → the argv after `claude` (writePaths: the one render file a report-design job may write;
|
|
8
8
|
* for the skill kind, the folders the run may write in, from skillWriteDirs)
|
|
9
9
|
* skillWriteDirs(skill, { root, scratch }) → the absolute folders a background skill run may write in: its scratch folder and the state folders its skill writes
|
|
@@ -155,7 +155,10 @@ const LAB_PROTO_ORIGINS = Object.freeze(['idle-lab-proto:']);
|
|
|
155
155
|
// role's own `pmos` verbs. No web, nothing that sends.
|
|
156
156
|
const TEAM_ORIGINS = Object.freeze(['team:']);
|
|
157
157
|
const LAB_SCAN_ORIGINS = Object.freeze(['idle-lab-scan:']);
|
|
158
|
-
|
|
158
|
+
// The live round (lib/live-round.js): one specimen of a round the PM asked for (origin `live-round:<ws>:<ini>:<run>:<key>`). Read and Glob (a
|
|
159
|
+
// feedback round reads the last version), and Write only in its own folder, added per run by argsFor (writePaths). No Bash, no web, nothing that sends.
|
|
160
|
+
const LIVE_ROUND_ORIGINS = Object.freeze(['live-round:']);
|
|
161
|
+
const WRITE_DIR_KINDS = Object.freeze(['skill', 'lab-proto', 'live-round']); // kinds whose writable folders the caller names (argsFor writePaths, each folder and what is under it)
|
|
159
162
|
// A background skill run reads untrusted text (Jira, mail, calendar), so it may write only in its own scratch folder and in the state folders its skill writes
|
|
160
163
|
// by hand. Every other write goes through a `pmos` verb, which checks what it writes. The folders are relative to <state>: `pmos/state/` if it exists, else
|
|
161
164
|
// `planning/` (the rule each skill states). A skill not named here writes only in its scratch folder.
|
|
@@ -239,6 +242,8 @@ const TOOLS = Object.freeze({
|
|
|
239
242
|
team: Object.freeze(['Read', 'Glob', 'Grep', 'Bash(pmos team done *)', 'Bash(pmos team status *)', 'Bash(pmos initiative export *)', 'Bash(pmos initiative list *)',
|
|
240
243
|
'Bash(pmos task list *)', 'Bash(git log *)', 'Bash(date *)']),
|
|
241
244
|
'lab-scan': Object.freeze(['WebSearch', 'Bash(pmos lab page *)', 'Bash(pmos lab file *)', 'Bash(pmos lab status)']),
|
|
245
|
+
// The live round run: read the last version (a feedback round) and write ONE specimen in its folder (argsFor writePaths). PMOS proves and files it.
|
|
246
|
+
'live-round': Object.freeze(['Read', 'Glob']),
|
|
242
247
|
// The design run: read and search only. Its one write, the render file, is added per run by argsFor (writePaths). No Bash, no web, nothing that sends.
|
|
243
248
|
'report-design': Object.freeze(['Read', 'Glob', 'Grep']),
|
|
244
249
|
// The link fetch run: Read, and its one write (the text copy of the linked file) is added per run by argsFor. No Bash, no web, no connector tool named.
|
|
@@ -374,6 +379,7 @@ function kindFor({ agent, origin, skill, env } = {}) {
|
|
|
374
379
|
if (IMPROVE_ORIGINS.some((p) => o.startsWith(p))) return 'improve';
|
|
375
380
|
if (METRIC_READ_ORIGINS.some((p) => o.startsWith(p))) return 'metric-read';
|
|
376
381
|
if (LAB_PROTO_ORIGINS.some((p) => o.startsWith(p))) return 'lab-proto';
|
|
382
|
+
if (LIVE_ROUND_ORIGINS.some((p) => o.startsWith(p))) return 'live-round';
|
|
377
383
|
if (TEAM_ORIGINS.some((p) => o.startsWith(p))) return 'team';
|
|
378
384
|
if (LAB_SCAN_ORIGINS.some((p) => o.startsWith(p))) return 'lab-scan';
|
|
379
385
|
if (REPORT_DESIGN_ORIGINS.some((p) => o.startsWith(p))) return 'report-design';
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
*
|
|
41
41
|
* JOB · VERSION · MAX_RESULTS · candidates(input) PURE · nextOf(cands) PURE · promptOf(skill, c, o) PURE
|
|
42
42
|
* readRuns(rt) · appendRun(rt, line, now?) · spentIn(rt, month) · pagesDir(rt, run) · pendingFile(rt, run) · runSpecimenDir(rt, run)
|
|
43
|
-
* pageRef(run, n, line) · guardProposal(entry, { run }) PURE · renderCheck(abs) · ensureReplay(rt)
|
|
43
|
+
* pageRef(run, n, line) · guardProposal(entry, { run }) PURE · renderCheck(abs, { phone? }) · ensureReplay(rt) (phone: also at 390 px, nothing wider)
|
|
44
44
|
* create(deps) → { tick(turn), finish(run, r), active(), status() }
|
|
45
45
|
*/
|
|
46
46
|
const fs = require('fs');
|
|
@@ -248,7 +248,7 @@ function guardProposal(e, { run }) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
/** Open one specimen in a headless browser, with the network shut but the fonts. → { ok, w, h, why? } */
|
|
251
|
-
async function renderCheck(abs, { browser = null } = {}) {
|
|
251
|
+
async function renderCheck(abs, { browser = null, phone = false } = {}) {
|
|
252
252
|
let exe = browser;
|
|
253
253
|
try { if (!exe) exe = require('./find-browser.js').findBrowser(); } catch { exe = null; }
|
|
254
254
|
if (!exe) return { ok: false, why: 'there is no headless browser on this computer to prove it renders' };
|
|
@@ -266,6 +266,13 @@ async function renderCheck(abs, { browser = null } = {}) {
|
|
|
266
266
|
if (!m) return { ok: false, why: 'it has no body' };
|
|
267
267
|
if (errors.length) return { ok: false, why: 'a script error: ' + errors[0] };
|
|
268
268
|
if (m.h < 100 || m.w < 200 || (m.text < 20 && m.els < 10)) return { ok: false, why: `it renders almost nothing (${m.w}×${m.h}, ${m.els} elements)` };
|
|
269
|
+
// phone: the live round's viewport pin (lib/live-round.js; dry run finding a): at 390 px nothing may run wider than the screen
|
|
270
|
+
if (phone) {
|
|
271
|
+
await page.setViewportSize({ width: 390, height: 844 });
|
|
272
|
+
const p = await page.evaluate(() => ({ w: document.documentElement.scrollWidth, h: document.documentElement.scrollHeight }));
|
|
273
|
+
if (p.w > 398) return { ok: false, why: `it is wider than a phone: ${p.w} px at 390 px, so part of it is cut off` };
|
|
274
|
+
return { ok: true, w: 390, h: p.h };
|
|
275
|
+
}
|
|
269
276
|
return { ok: true, w: m.w, h: m.h };
|
|
270
277
|
} catch (e) {
|
|
271
278
|
return { ok: false, why: 'it did not open: ' + one(e && e.message, 160) };
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
* fold(lines) PURE → { props, drops, kept, undone, runs, next, t }
|
|
37
37
|
* looseOpen(F) PURE → the open Lab ✦, newest first
|
|
38
38
|
* labOf({ P, L, extra, now, titleOf }) PURE → the Lab section: { say, loose, record, kept, next } or null (zero is silence)
|
|
39
|
-
* compareOf(P, id, { key, titleOf, proven }) PURE → the compare view: { title, round, say, columns, pins, history } | null
|
|
39
|
+
* compareOf(P, id, { key, titleOf, proven }) PURE → the compare view: { title, round, say, columns, pins, history } | null
|
|
40
|
+
* a live round (data.live, lib/live-round.js) shows its versions side by side instead: A B C, live: true */
|
|
40
41
|
const fs = require('fs');
|
|
41
42
|
const path = require('path');
|
|
42
43
|
const crypto = require('crypto');
|
|
@@ -253,23 +254,33 @@ function compareOf(P, id, { key = '', titleOf = () => '', proven = PROVEN } = {}
|
|
|
253
254
|
const k = p.group === 'improved' ? p.data.base : (specs.find((s) => s.key === key) || specs[0] || {}).key || '';
|
|
254
255
|
const spec = specs.find((s) => s.key === k) || null;
|
|
255
256
|
const file = p.group === 'improved' ? p.data.file : spec && spec.file;
|
|
256
|
-
if (!file) return null;
|
|
257
|
+
if (!file && !(p.group === 'prototyped' && p.data && p.data.live)) return null;
|
|
257
258
|
const round = p.group === 'improved' ? p.data.round : 1;
|
|
258
259
|
const c = (p.data && p.data.compare) || {};
|
|
259
260
|
const cols = [];
|
|
261
|
+
// a live round's first round (lib/live-round.js): its versions side by side, A B C, each one as soon as it renders; a version still
|
|
262
|
+
// being made, or not made, says so in one line (honest state). ✓ keeps the one shown (key) as the kept specimen.
|
|
263
|
+
if (p.group === 'prototyped' && p.data && p.data.live) {
|
|
264
|
+
for (const s of p.data.live.slots || []) {
|
|
265
|
+
if (s.state === 'ok' && s.file) cols.push({ id: s.key, title: s.key + ' · ' + s.title, meta: 'round 1', file: s.file, read: s.dims ? 'rendered at ' + s.dims : '', current: s.key === k });
|
|
266
|
+
else cols.push({ id: s.key, title: s.key + ' · ' + s.title, left: s.state === 'not made' ? 'Not made: ' + (s.why || 'it did not render') : 'PMOS is still making it.' });
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
260
269
|
cols.push(proven.production && c.production ? { id: 'production', title: 'Production', meta: 'main, today', file: c.production.file, read: c.production.read }
|
|
261
270
|
: { id: 'production', title: 'Production', left: 'Left out: PMOS cannot render production from the product repo yet. It shows here once that is proven.' });
|
|
262
271
|
cols.push(proven.design && c.design ? { id: 'design', title: 'Design', meta: 'the design for this screen', file: c.design.file, read: c.design.read }
|
|
263
272
|
: { id: 'design', title: 'Design', left: 'Left out: PMOS cannot read the design from Figma or a canvas yet. It shows here once that is proven.' });
|
|
264
273
|
cols.push({ id: 'prototype', title: 'Prototype', meta: 'round ' + round + (spec ? ' · ' + spec.key : ''), file, read: (p.data && p.data.checked) || '' });
|
|
274
|
+
}
|
|
265
275
|
const shown = new Set(cols.filter((x) => !x.left).map((x) => x.id));
|
|
266
276
|
const pins = (c.pins || []).filter((x) => shown.has(x.vs)).map((x, i) => ({ n: i + 1, vs: x.vs, text: x.text }));
|
|
267
277
|
const history = [];
|
|
268
278
|
for (const r of rounds.slice().reverse()) history.push({ id: r.id, round: r.data.round, at: r.at, state: stateOf(r), meta: r.data.changed || '', current: r.id === p.id });
|
|
269
279
|
if (root) history.push({ id: root.id, round: 1, at: root.at, state: stateOf(root), meta: specs.map((s) => s.key).join(', ') + (specs.length ? ': ' : '') + specs.map((s) => s.title).join(' · '), current: root.id === p.id, keys: specs.map((s) => ({ key: s.key, title: s.title })) });
|
|
270
280
|
const name = titleOf(p.ini) || p.ini;
|
|
271
|
-
const
|
|
272
|
-
|
|
281
|
+
const live = !!(p.data && p.data.live);
|
|
282
|
+
const say = p.group === 'improved' ? 'Round ' + round + ' of ' + k + ': ' + p.data.changed : live ? 'You asked: "' + one(p.data.live.brief, 200) + '"' : (spec ? spec.title + (spec.caption ? ': ' + spec.caption : '') : '');
|
|
283
|
+
return { ini: p.ini, board: p.board || '', id: p.id, sig: PRsig(p), state: stateOf(p), title: name, round, key: k, say, columns: cols, pins, history, ...(live ? { live: true, working: (p.data.live.slots || []).some((s) => s.state === 'working' || s.state === 'proving') } : {}) };
|
|
273
284
|
}
|
|
274
285
|
|
|
275
286
|
module.exports = { LEDGER, GROUPS, TITLES, LOOSE, PROVEN, specimenDir, specimenPath, specimenUrl, result, loose, ledgerFile, readLines, read, append, fold, looseOpen, labOf, compareOf, fmtMs };
|
|
@@ -153,6 +153,7 @@ const JOBS = Object.freeze([
|
|
|
153
153
|
'step 5; one headless run at a time; a lesson is a curated-memory entry with Undo, a harness change only a ✦'),
|
|
154
154
|
q('scan', 'lib/scan-run.js', ['<state>/scan.jsonl'], ['public web']),
|
|
155
155
|
q('idle-lab', 'lib/idle-lab-engine.js', ['<runtime>/idle-lab.jsonl', props], [props]),
|
|
156
|
+
q('live-round', 'lib/live-round.js', [props], [props], 'step 1: the PM\'s ✓ or `pmos lab round` starts it at once; three runs, each file proven before it shows; it also adds Specimens and Lessons lines (lib/artefacts.js)'),
|
|
156
157
|
ai('past-repeat', 'lib/past-repeat.js', [props], ['repo:DECISIONS.md']),
|
|
157
158
|
ai('decision-memory', 'lib/decision-memory.js', [props], ['repo:DECISIONS.md']),
|
|
158
159
|
ai('outcomes', 'lib/outcome-props.js', [props], ['initiative records']),
|
package/workspace/lib/lab-cli.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
* pmos lab page <n> [--from <line>] print a page this run already read, from a line
|
|
7
7
|
* pmos lab file <group> --json <file|-> one result of this run. It waits until the run ends; then PMOS proves it and files it under ✦
|
|
8
8
|
* pmos lab status in a run: what this run filed. Outside a run: this month's idle lab runs and spend
|
|
9
|
+
* pmos lab round <ini> --brief "…" [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--ws <id>]
|
|
10
|
+
* the live round (lib/live-round.js): the running server starts three runs now, or one on B; --propose
|
|
11
|
+
* files its ✦ ask for the PM's ✓ instead (the initiative chat's way)
|
|
9
12
|
*
|
|
10
13
|
* The run verbs need the run's environment (PMOS_LAB_RUN, _KIND, _PENDING, and _PAGES or _SPECIMENS, set by the server); outside a run they
|
|
11
14
|
* refuse. Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent. */
|
|
@@ -14,7 +17,7 @@ const path = require('path');
|
|
|
14
17
|
const dns = require('dns');
|
|
15
18
|
const E = require('./idle-lab-engine.js');
|
|
16
19
|
|
|
17
|
-
const COMMANDS = { lab: ['page', 'file', 'status'] };
|
|
20
|
+
const COMMANDS = { lab: ['page', 'file', 'status', 'round'] };
|
|
18
21
|
const GROUPS = { 'prototype-new': ['prototyped'], 'prototype-improve': ['improved'], 'scan-new': ['scanned', 'scan'], 'scan-improve': ['scanned', 'scan'] };
|
|
19
22
|
const USAGE = [
|
|
20
23
|
'usage: pmos lab page|file|status — the idle lab: PMOS prototypes and scans while you are away; each result waits under ✦ for your ✓',
|
|
@@ -26,6 +29,9 @@ const USAGE = [
|
|
|
26
29
|
' pmos lab file scanned --json - { "title", "why", "claims": [{ "text", "sources": [{ "page": 1, "line": 12, "quote": "<words on that line>" }] }], "refreshed"? }',
|
|
27
30
|
' pmos lab file scan --json - the same, for a finding that fits no initiative',
|
|
28
31
|
' pmos lab status',
|
|
32
|
+
' pmos lab round <initiative> --brief "<what to show>" [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--ws <id>]',
|
|
33
|
+
' the live round: three versions now (one with --base: a new round of B from the brief), each shown',
|
|
34
|
+
' under the initiative\'s ✦ as soon as it renders. --propose files the ✦ ask instead; the PM\'s ✓ starts it',
|
|
29
35
|
'A specimen must open and render; every claim must quote what was read. What is not proven is dropped. Nothing is sent.',
|
|
30
36
|
];
|
|
31
37
|
const flag = (args, k) => { const i = args.indexOf('--' + k); return i >= 0 ? (args[i + 1] === undefined || args[i + 1].startsWith('--') ? true : args[i + 1]) : undefined; };
|
|
@@ -116,13 +122,31 @@ function printPage(say, file, n, from = 1) {
|
|
|
116
122
|
if (end < lines.length) say(`… more from line ${end + 1}: pmos lab page ${n} --from ${end + 1}`);
|
|
117
123
|
}
|
|
118
124
|
|
|
119
|
-
async function run(argv, { say = (s) => console.log(s), env = process.env, stdin, fetchImpl } = {}) {
|
|
125
|
+
async function run(argv, { say = (s) => console.log(s), env = process.env, stdin, fetchImpl, call } = {}) {
|
|
120
126
|
const args = argv[0] === 'lab' ? argv.slice(1) : argv.slice();
|
|
121
127
|
const verb = args[0];
|
|
122
128
|
if (!verb || ['help', '--help', '-h'].includes(verb)) { for (const l of USAGE) say(l); return verb ? 0 : 1; }
|
|
123
129
|
if (!COMMANDS.lab.includes(verb)) { say(`unknown lab command "${verb}" — one of ${COMMANDS.lab.join(', ')}`); return 2; }
|
|
124
130
|
const run = env.PMOS_LAB_RUN, kind = env.PMOS_LAB_KIND;
|
|
125
131
|
|
|
132
|
+
if (verb === 'round') {
|
|
133
|
+
// the live round: the running server starts it (it owns the runs); a background lab run never starts one
|
|
134
|
+
if (run) { say('✗ a lab run cannot start a live round'); return 1; }
|
|
135
|
+
const ini = args[1] && !args[1].startsWith('--') ? args[1] : '';
|
|
136
|
+
const brief = flag(args, 'brief'), base = flag(args, 'base'), dirs = flag(args, 'dirs'), ws = flag(args, 'ws'), board = flag(args, 'board');
|
|
137
|
+
if (!ini || typeof brief !== 'string' || !brief.trim()) { say('usage: pmos lab round <initiative> --brief "<what to show>" [--base B] [--dirs "A: …|B: …|C: …"] [--propose] [--ws <id>]'); return 2; }
|
|
138
|
+
if (base !== undefined && !/^[A-C]$/i.test(String(base))) { say('✗ --base is the key of the version to improve: A, B or C'); return 2; }
|
|
139
|
+
if (typeof call !== 'function') { say('✗ no PMOS server answers: start PMOS, then ask again'); return 1; }
|
|
140
|
+
let by = ''; try { by = require('./actor.js').fromCli({ env }).by || ''; } catch { by = ''; }
|
|
141
|
+
const body = { ini, brief: brief.trim(), ...(base ? { base: String(base).toUpperCase() } : {}), ...(typeof dirs === 'string' ? { dirs } : {}), ...(typeof ws === 'string' ? { ws } : {}), ...(typeof board === 'string' ? { board } : {}), ...(flag(args, 'propose') ? { propose: true } : {}), ...(by ? { by } : {}) };
|
|
142
|
+
let r = null; try { r = await call('POST', '/api/lab/round', body); } catch { r = null; }
|
|
143
|
+
if (!r) { say('✗ no PMOS server answers: start PMOS, then ask again'); return 1; }
|
|
144
|
+
if (!r.ok) { say('✗ ' + (r.error || 'the round did not start')); return 1; }
|
|
145
|
+
if (body.propose) { say(`✓ filed under the initiative's ✦: ${r.said}. The PM's ✓ starts it.`); return 0; }
|
|
146
|
+
say(`✓ round ${r.round.n} started: ${r.round.directions.map((d) => d.key + ' · ' + d.title).join('; ')}. Each version shows under the initiative's ✦ as soon as it renders (2 minutes at most).`);
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
126
150
|
if (verb === 'status') {
|
|
127
151
|
if (run && env.PMOS_LAB_PENDING) {
|
|
128
152
|
let lines = [];
|