create-pmos 0.678.0 → 0.680.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.678.0",
3
+ "version": "0.680.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,32 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.680.0",
38
+ "at": "2026-11-22T07:44:35.647Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1488,
43
+ "t": "Read a document as a CFO, an engineer and a sceptic (A110)",
44
+ "s": "Read a document as a CFO, an engineer and a sceptic (A110)",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.679.0",
51
+ "at": "2026-11-22T06:54:44.843Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1475,
56
+ "t": "Next milestones labels never overlap, and the strip scrolls apart from the table",
57
+ "s": "/mnt/project-files/milestones-strip/after-1440.png, all 9 milestones from 20 Nov 2026 to 15 Nov 2027 on one width, 0 overlaps (measured from the labels' bounding boxes), no horizontal scroll.",
58
+ "k": "fix"
59
+ }
60
+ ]
61
+ },
36
62
  {
37
63
  "v": "0.678.0",
38
64
  "at": "2026-11-22T06:40:11.793Z",
@@ -350,32 +376,6 @@
350
376
  "k": "new"
351
377
  }
352
378
  ]
353
- },
354
- {
355
- "v": "0.646.0",
356
- "at": "2026-11-20T03:32:31.987Z",
357
- "f": 4,
358
- "prs": [
359
- {
360
- "n": 1428,
361
- "t": "Today is built from the design system's blocks",
362
- "s": "Today is built from the design system's blocks",
363
- "k": "new"
364
- }
365
- ]
366
- },
367
- {
368
- "v": "0.645.0",
369
- "at": "2026-11-20T02:59:30.947Z",
370
- "f": 4,
371
- "prs": [
372
- {
373
- "n": 1427,
374
- "t": "The Viewer card's parts on the PMOS design system, and the Funnel chart kind",
375
- "s": "The Viewer card's parts on the PMOS design system, and the Funnel chart kind",
376
- "k": "new"
377
- }
378
- ]
379
379
  }
380
380
  ]
381
381
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@3d98e8f6
1
+ kernel-source: pmos@c2dc3982
2
2
  assembled: 2026-11-22
3
3
  mode: vendor
@@ -20,4 +20,4 @@ The Work boards draw time in two more places, from the same marks:
20
20
 
21
21
  - **Table timeline** (`pm-gt` inside a Table cell): done bars in leaf (`.b.dn`), now in blue (`.b.nw`), planned in well with a hairline (`.b`), and the today line (`pm-now`, alert). It scrolls sideways with a trackpad, a drag, or Earlier / Go to today / Later; no scrollbar is drawn.
22
22
  - **Milestone** (`pm-dia`): a diamond. Late is alert (`.late`), done is leaf (`.dn`). Milestones less than 8 days apart merge into one numbered mark (`.n`, the number centred in it) that lists them on hover.
23
- - **Date line** (`pm-dline`): the next milestones on one line, each a diamond with its date (mono), its name and what it belongs to. A label that would touch the one before it drops to the next row with a dashed lead. A milestone past the visible range folds into a `+N` mark (`pm-more`) at the right end with its month above it; once the line is scrolled, a matching mark shows at the left end. The line follows the table's scale.
23
+ - **Date line** (`pm-dline`): the next milestones on one line, each a diamond with its date (mono), its name and what it belongs to. Each label has one fixed height: the date with its late badge beside it, then the name and the owner on one line each (cut with an ellipsis; the full words are in its title). A label never touches another: it drops to the first row where it touches none, with a dashed lead, and one near the right end reads to the left of its mark (`flip`). Milestones outside the line's window fold into `+N` marks (`pm-more`) at the ends, each with its nearest month above it. The line keeps its own window, apart from the table's: it opens on today and fits the next ten milestones on the full width, and a scroll on it moves only the line.
@@ -84,14 +84,18 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
84
84
  .pm-dline{position:relative;padding:0 40px 0 8px}
85
85
  .pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
86
86
  .pm-dline .axis .tk{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
87
- .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 86px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
87
+ .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 76px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
88
88
  .pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
89
89
  .pm-dline .ms{position:absolute;top:0;width:0}
90
90
  .pm-dline .ms>.pm-dia{top:12px}
91
- .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 86px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:220px;font-size:13px;line-height:20px}
91
+ .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 76px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:200px;height:68px;font-size:13px;line-height:20px;overflow:hidden}
92
+ .pm-dline .ms.flip .lb{left:auto;right:-6px;align-items:flex-end;text-align:right}
93
+ .pm-dline .ms .lb .hd{display:flex;align-items:center;gap:6px;height:22px}
94
+ .pm-dline .ms .lb .pm-badge{height:20px;padding:0 6px;font-size:12px}
95
+ .pm-dline .ms .lb b,.pm-dline .ms .lb .pm-meta{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
92
96
  .pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
93
97
  .pm-dline .ms .lb .code{font-family:var(--font-mono);color:var(--muted)}
94
- .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 86px + 6px);border-left:1px dashed var(--line)}
98
+ .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 76px + 6px);border-left:1px dashed var(--line)}
95
99
  .pm-dline .ms.late .lb .code{color:var(--alert)}
96
100
  .pm-more{position:absolute;top:20px;display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:none;padding:0;font:inherit;font-size:13px;color:var(--muted);cursor:pointer}
97
101
  .pm-more.r{right:0}.pm-more.l{left:-8px}
@@ -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-22T06:40:08Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T07:44:31Z"}
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-22T06:40:08Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T07:44:31Z"}
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-22T06:40:08Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-22T07:44:31Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.680.0",
4
+ "at": "2026-11-22T07:44:35.647Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1488,
9
+ "t": "Read a document as a CFO, an engineer and a sceptic (A110)",
10
+ "s": "Read a document as a CFO, an engineer and a sceptic (A110)",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.679.0",
17
+ "at": "2026-11-22T06:54:44.843Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1475,
22
+ "t": "Next milestones labels never overlap, and the strip scrolls apart from the table",
23
+ "s": "/mnt/project-files/milestones-strip/after-1440.png, all 9 milestones from 20 Nov 2026 to 15 Nov 2027 on one width, 0 overlaps (measured from the labels' bounding boxes), no horizontal scroll.",
24
+ "k": "fix"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.678.0",
4
30
  "at": "2026-11-22T06:40:11.793Z",
@@ -20,4 +20,4 @@ The Work boards draw time in two more places, from the same marks:
20
20
 
21
21
  - **Table timeline** (`pm-gt` inside a Table cell): done bars in leaf (`.b.dn`), now in blue (`.b.nw`), planned in well with a hairline (`.b`), and the today line (`pm-now`, alert). It scrolls sideways with a trackpad, a drag, or Earlier / Go to today / Later; no scrollbar is drawn.
22
22
  - **Milestone** (`pm-dia`): a diamond. Late is alert (`.late`), done is leaf (`.dn`). Milestones less than 8 days apart merge into one numbered mark (`.n`, the number centred in it) that lists them on hover.
23
- - **Date line** (`pm-dline`): the next milestones on one line, each a diamond with its date (mono), its name and what it belongs to. A label that would touch the one before it drops to the next row with a dashed lead. A milestone past the visible range folds into a `+N` mark (`pm-more`) at the right end with its month above it; once the line is scrolled, a matching mark shows at the left end. The line follows the table's scale.
23
+ - **Date line** (`pm-dline`): the next milestones on one line, each a diamond with its date (mono), its name and what it belongs to. Each label has one fixed height: the date with its late badge beside it, then the name and the owner on one line each (cut with an ellipsis; the full words are in its title). A label never touches another: it drops to the first row where it touches none, with a dashed lead, and one near the right end reads to the left of its mark (`flip`). Milestones outside the line's window fold into `+N` marks (`pm-more`) at the ends, each with its nearest month above it. The line keeps its own window, apart from the table's: it opens on today and fits the next ten milestones on the full width, and a scroll on it moves only the line.
@@ -84,14 +84,18 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
84
84
  .pm-dline{position:relative;padding:0 40px 0 8px}
85
85
  .pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
86
86
  .pm-dline .axis .tk{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
87
- .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 86px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
87
+ .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 76px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
88
88
  .pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
89
89
  .pm-dline .ms{position:absolute;top:0;width:0}
90
90
  .pm-dline .ms>.pm-dia{top:12px}
91
- .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 86px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:220px;font-size:13px;line-height:20px}
91
+ .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 76px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:200px;height:68px;font-size:13px;line-height:20px;overflow:hidden}
92
+ .pm-dline .ms.flip .lb{left:auto;right:-6px;align-items:flex-end;text-align:right}
93
+ .pm-dline .ms .lb .hd{display:flex;align-items:center;gap:6px;height:22px}
94
+ .pm-dline .ms .lb .pm-badge{height:20px;padding:0 6px;font-size:12px}
95
+ .pm-dline .ms .lb b,.pm-dline .ms .lb .pm-meta{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
92
96
  .pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
93
97
  .pm-dline .ms .lb .code{font-family:var(--font-mono);color:var(--muted)}
94
- .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 86px + 6px);border-left:1px dashed var(--line)}
98
+ .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 76px + 6px);border-left:1px dashed var(--line)}
95
99
  .pm-dline .ms.late .lb .code{color:var(--alert)}
96
100
  .pm-more{position:absolute;top:20px;display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:none;padding:0;font:inherit;font-size:13px;color:var(--muted);cursor:pointer}
97
101
  .pm-more.r{right:0}.pm-more.l{left:-8px}
@@ -237,7 +237,7 @@ What each part does:
237
237
  - **What the canvas can do.** The prototype runs in a sandboxed frame. It cannot reach PMOS. The canvas talks to it only to show a screen, point, pin, play and apply your edits.
238
238
  - **Your prototype rules.** After a version renders and before it opens, PMOS checks it against your prototype rules: no device or browser frame, no instructions on the screen, no sample copy, and each rule PMOS learns from your corrections. When a correction is true of every prototype (for example "no device frame"), the chat adds it as a rule (`pmos lab rule add`). PMOS keeps a rule only when it fails a bad example and passes a good one, so a button such as "See the week" is never read as an instruction. A change to one version ("make the alert orange") or a taste ("calmer") never becomes a rule. A version that breaks a rule gets one fix run, given only the lines that broke it. You see only the fixed version, with one quiet line: "PMOS fixed 3 things before showing you this." When the fix does not reach a rule, the version still opens and the line names the rule it breaks. When nothing was fixed, there is no line. Settings › Prototype rules lists the rules with Undo.
239
239
  - **The design critic.** After the prototype rules, a separate read-only session reads the version's desk and phone screenshots and its page against every standing design rule of your product. Each rule is a named check: each numbered principle in your design principles and each rule in your `design-rules.json`. A finding must name the rule it breaks, so the critic reports broken rules, not taste. Its findings go into the same one fix run. After the fix it reads only those rules again, so "PMOS fixed n things" is never claimed unchecked. A critic that cannot run never holds the version. `pmos lab critic` runs it on any screenshots, and `PMOS_CRITIC=off` turns it off.
240
- - **The sceptical reviewer.** Before you share a document, the chat's agent runs `pmos critic <file>`: a separate read-only session reads it as a sceptical reviewer and lists at most 3 hard questions. Each names its lens, quotes the document and gives the smallest fix; a question whose quote is not in the document is dropped. `pmos critic stats` shows how many you called real, and the gaps that repeat across documents.
240
+ - **The sceptical reviewer.** Before you share a document, the chat's agent runs `pmos critic <file>`: a separate read-only session reads it as a sceptical reviewer and lists at most 3 hard questions. Each names its lens, quotes the document and gives the smallest fix; a question whose quote is not in the document is dropped. For a report or an update that goes to leadership, it runs `pmos critic <file> --as all`: the same pass reads it as the CFO (cost, return, the cost of a slip), the engineering lead (can it be built as written, what it waits on, who builds it) and the sceptic, at most 2 questions each. `pmos critic stats` shows how many you called real, for each reader, and the gaps that repeat across documents.
241
241
  - **No time limit.** A version takes as long as the ask needs. While PMOS makes it, the Viewer shows what it is doing now (for example "Building screen 3 of 7"), the steps done, a progress bar and the time so far, with a Stop press. A run that writes nothing for 10 minutes is stuck: PMOS stops it. A version that does not render, that is stuck or that you stop is "not made" with the reason, and the chat says so. The Viewer still opens it: it says why and shows the version it was made from. While a version is being made, a new ask on the same initiative waits: PMOS says what is running.
242
242
  - **Lessons.** Each change 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.
243
243
  - **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).
@@ -188,11 +188,12 @@ PMOS's grill run files with these commands, which refuse outside that run:
188
188
 
189
189
  Before you share a spec, a strategy, a roadmap or a report, PMOS reads it as a sceptical reviewer would and lists the hardest questions that reviewer would ask. Each question names its lens (evidence, outcome, trade-off, scope, risk, owner, contradiction or unverified claim), quotes the words of the document it rests on, and gives the smallest fix. A question whose quote is not in the document is dropped. The chat's agent runs it when you say you are about to share a document. Nothing is sent and the document is not changed.
190
190
 
191
- - `pmos critic <file> [--ws <id>]`: one pass on a markdown, text or HTML document. It prints at most 3 questions, the hardest first. The running PMOS server starts one read-only session.
191
+ - `pmos critic <file> [--as <readers>] [--ws <id>]`: one pass on a markdown, text or HTML document. It prints at most 3 questions, the hardest first. The running PMOS server starts one read-only session.
192
+ - `--as cfo,engineer,sceptic` (or `--as all`) reads the document as those readers in the same pass. Each reader asks at most 2 questions, and each question shows its reader, for example `[cfo · cost-of-delay]`. The CFO asks about cost, return and the cost of a slip. The engineering lead asks if it can be built as written, what it waits on, and who builds it. The sceptic asks the base questions. With no `--as`, the sceptic reads alone. Use `--as all` for a report or an update that goes to leadership.
192
193
  - `pmos critic show <file> [--ws <id>]`: the newest pass on that file, and whether the file changed since.
193
- - `pmos critic lenses [--root <dir>]`: the lenses. Add your product's own reviewer questions in `pmos/review-questions.json` (or `okf/products/<slug>/references/review-questions.json`): `{ "questions": [{ "id", "title", "rule" }] }`. An id that is a base lens replaces it. No server is needed.
194
+ - `pmos critic lenses [--as <readers>] [--root <dir>]`: the lenses. Add your product's own reviewer questions in `pmos/review-questions.json` (or `okf/products/<slug>/references/review-questions.json`): `{ "questions": [{ "id", "title", "rule", "reader" }] }`. `reader` is `cfo`, `engineer` or `sceptic` (none: the sceptic). An id that is a PMOS lens replaces it. `--as` lists those readers' lenses. No server is needed.
194
195
  - `pmos critic label <run> <n> real|noise`: your word on question `n` of a run.
195
- - `pmos critic stats`: the runs, the questions, how many you called real or noise, how many were dropped for a quote not in the document, and the gaps that repeat across documents. When the same gap is in several documents, fix the template or the generator that makes them.
196
+ - `pmos critic stats`: the runs, the questions, how many you called real or noise, how many were dropped for a quote not in the document, the same counts for each reader, and the gaps that repeat across documents. When the same gap is in several documents, fix the template or the generator that makes them.
196
197
 
197
198
  `PMOS_CRITIC=off` turns this critic and the design critic off.
198
199
 
@@ -92,7 +92,7 @@ On a computer, Work is built from the parts of the PMOS design system. The top l
92
92
 
93
93
  - **Where it stands.** One paragraph that says what is happening and why it matters: an initiative past its milestone, with the cause from the record (a Jira ticket that is blocked, a step that waits on you), an initiative that sat in a stage with no dates and for how long, and the next decision point. Press a name to open the initiative. Under it, PMOS shows one suggestion from its open proposals, with **Why**, **PMOS will** (the exact steps), **What changes** and **Based on** (the sources). The pencil opens the initiative so you can change the proposal first, ✓ does it (with Undo), and ✕ drops it. When nothing needs saying, the block does not show.
94
94
  - **Initiatives.** A table with the columns you choose (the tune icon also sorts and filters). Press a column heading to sort by it. The timeline shows done in green, now in blue and planned in grey, with a red line for today. A milestone is a diamond on its initiative's row; a late one is red. Milestones less than 8 days apart are one numbered diamond: point at it to see them. Pick the scale with **Week**, **Month**, **Quarter**, **Year** or **Full**. Move the timeline with the arrows, with a sideways swipe on a trackpad, or by dragging it; the middle arrow goes back to today. A late date has a red badge, for example "8 days late". Closed initiatives fold into one line at the end.
95
- - **Next milestones.** The next five milestones of all initiatives on one line, on the same scale as the table, each with its date, its name and its initiative. Labels that are too close move down a row. A milestone after the end of the line is in the **+N** mark at the right: press it to move the line on. When the line has moved, a mark at the left moves it back. Press a diamond to open the milestone.
95
+ - **Next milestones.** The next ten milestones of all initiatives on one line, each with its date, its name and its initiative. The line has its own time range, apart from the table: it starts at today (or at a milestone that became late in the last 30 days) and ends at the last of the ten, so they all show across the full width without scrolling. Labels never cover each other: a label that is too close moves down a row, and a label near the right end reads to the left of its diamond. Scroll sideways on the line (or drag it) to move only the line. A milestone outside the line is in a **+N** mark at the end: press it to move the line there. After the line moves, the button at the top right puts it back at today. Press a diamond to open the milestone.
96
96
 
97
97
  **Backlog** is the open work outside the sprint, in one rank across initiatives.
98
98
 
@@ -2,10 +2,12 @@
2
2
  /* critic-cli.js — `pmos critic`: before you share a document, the hardest questions a sceptical reviewer would ask (initiative spec-critic;
3
3
  * lib/spec-critic.js, POST and GET /api/spec-critic in lib/routes-spec-critic.js).
4
4
  *
5
- * pmos critic <file> [--ws <id>] one pass through the running server: at most 3 questions, each with its lens, the quoted words and
6
- * the smallest fix. The chat's agent runs it when the PM says they are about to share a document.
5
+ * pmos critic <file> [--as <readers>] [--ws <id>] one pass through the running server: at most 3 questions, each with its lens, the
6
+ * quoted words and the smallest fix. The chat's agent runs it when the PM says they are about to share
7
+ * a document. --as cfo,engineer,sceptic (or all) reads it as those readers, at most 2 questions each
8
+ * (initiative review-lenses-cfo-engineer-sceptic, bet A110); none: the sceptic alone.
7
9
  * pmos critic show <file> [--ws <id>] the newest pass on that file, and whether the file changed since (through the server)
8
- * pmos critic lenses [--root <dir>] the lenses: the base set plus the product's review-questions.json (no server)
10
+ * pmos critic lenses [--as <readers>] [--root <dir>] the lenses: the readers' sets plus the product's review-questions.json (no server)
9
11
  * pmos critic label <run> <n> real|noise the PM's word on question n of a run (no server)
10
12
  * pmos critic stats runs, questions, real, noise, dropped for a missing quote, and the gaps that repeat across documents
11
13
  *
@@ -16,9 +18,10 @@ const SC = require('./spec-critic.js');
16
18
  const COMMANDS = { critic: ['show', 'lenses', 'label', 'stats'] };
17
19
  const USAGE = [
18
20
  'usage: pmos critic <file> [--ws <id>] — before you share a document, the hardest questions a sceptical reviewer would ask',
19
- ' pmos critic <file> [--ws <id>] a markdown, text or HTML document: at most 3 questions, each quoting the document, with the smallest fix',
21
+ ' pmos critic <file> [--as <readers>] [--ws <id>] a markdown, text or HTML document: at most 3 questions, each quoting the document, with the smallest fix',
22
+ ' --as cfo,engineer,sceptic (or all): read it as those readers, at most 2 questions each. None: the sceptic alone.',
20
23
  ' pmos critic show <file> [--ws <id>] the newest pass on that file, and whether the file changed since',
21
- ' pmos critic lenses [--root <dir>] the lenses the critic asks through: the base set plus the product\'s review-questions.json',
24
+ ' pmos critic lenses [--as <readers>] [--root <dir>] the lenses the critic asks through: each reader\'s set plus the product\'s review-questions.json',
22
25
  ' pmos critic label <run> <n> real|noise your word on question n of a run',
23
26
  ' pmos critic stats runs, questions, real, noise, and the gaps that repeat across documents',
24
27
  'A question whose quote is not in the document is dropped. Nothing is sent. PMOS_CRITIC=off turns the critic off.',
@@ -26,12 +29,18 @@ const USAGE = [
26
29
  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; };
27
30
  const one = (v, n) => String(v == null ? '' : v).replace(/\s+/g, ' ').trim().slice(0, n);
28
31
  const plural = (n, w) => `${n} ${w}${n === 1 ? '' : 's'}`;
29
- const fileArg = (args, from) => { for (let i = from; i < args.length; i++) { if (args[i] === '--ws' || args[i] === '--root') { i++; continue; } if (!args[i].startsWith('--')) return args[i]; } return ''; };
32
+ const fileArg = (args, from) => { for (let i = from; i < args.length; i++) { if (args[i] === '--ws' || args[i] === '--root' || args[i] === '--as') { i++; continue; } if (!args[i].startsWith('--')) return args[i]; } return ''; };
30
33
  const pathFor = (f) => (path.isAbsolute(f) ? f : path.resolve(f));
31
34
 
32
- function printQuestions(say, qs) {
35
+ const tag = (q, named) => (named && q.reader ? `${q.reader} · ${q.lens}` : q.lens);
36
+ /** Readers are named on each question when someone other than the sceptic alone read it. */
37
+ const named = (readers) => Array.isArray(readers) && !(readers.length === 1 && readers[0] === 'sceptic') && readers.length > 0;
38
+ const asOf = (args) => { const a = flag(args, 'as'); return a === true ? { ok: false, error: '--as needs readers: ' + SC.READER_IDS.join(', ') + ' (or all)' } : SC.readersOf(a); };
39
+
40
+ function printQuestions(say, qs, readers) {
41
+ const n = named(readers);
33
42
  qs.forEach((q, i) => {
34
- say(` ${i + 1}. [${q.lens}] ${q.question}`);
43
+ say(` ${i + 1}. [${tag(q, n)}] ${q.question}`);
35
44
  say(` quotes: "${one(q.quote, 200)}"`);
36
45
  if (q.why) say(` why it is hard: ${q.why}`);
37
46
  if (q.fix) say(` fix before sharing: ${q.fix}`);
@@ -44,16 +53,24 @@ async function run(argv, { say = (s) => console.log(s), call = null, env = proce
44
53
  if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 2; }
45
54
  const rt = () => require('./state-root.js').defaultRoot({ env });
46
55
 
56
+ const rd = asOf(args);
57
+ if (!rd.ok) { say('✗ ' + rd.error); return 2; }
47
58
  if (sub === 'lenses') {
48
59
  const root = typeof flag(args, 'root') === 'string' ? path.resolve(flag(args, 'root')) : process.cwd();
49
- const K = SC.lensesFor(root);
50
- say(K.added ? `${K.lenses.length} lenses: the base set and ${plural(K.added, 'question')} from ${K.from.join(' and ')}` : `${K.lenses.length} base lenses (add your own in pmos/review-questions.json):`);
51
- for (const l of K.lenses) say(` [${l.id}] ${l.title} ${one(l.rule, 160)}`);
60
+ const K = SC.lensesFor(root, { as: rd.readers });
61
+ const n = named(K.readers);
62
+ const whose = n ? ` for ${SC.readerList(K.readers)}` : '';
63
+ say(K.added ? `${K.lenses.length} lenses${whose}: ${n ? 'the PMOS set' : 'the base set'} and ${plural(K.added, 'question')} from ${K.from.join(' and ')}`
64
+ : n ? `${K.lenses.length} lenses${whose} (add your own in pmos/review-questions.json):` : `${K.lenses.length} base lenses (add your own in pmos/review-questions.json):`);
65
+ for (const l of K.lenses) say(` [${n ? l.reader + ' · ' : ''}${l.id}] ${l.title} ${one(l.rule, 160)}`);
52
66
  return 0;
53
67
  }
54
68
  if (sub === 'stats') {
55
69
  const st = SC.stats(rt());
56
70
  say(`${plural(st.runs, 'critic run')}${st.notRun ? ` (${st.notRun} did not run)` : ''} on ${plural(st.files, 'document')} · ${plural(st.questions, 'question')}: ${st.real} real, ${st.noise} noise, ${st.unlabelled} not labelled · ${st.dropped} dropped for a quote not in the document`);
71
+ if (Object.keys(st.byReader).some((r) => r !== 'sceptic')) {
72
+ for (const r of SC.READER_IDS) { const b = st.byReader[r]; if (b) say(` ${SC.READERS[r].name}: ${plural(b.questions, 'question')}, ${b.real} real, ${b.noise} noise, ${b.unlabelled} not labelled`); }
73
+ }
57
74
  for (const r of st.repeats) say(` the same gap in ${r.files.length} documents: [${r.lens}] ${r.files.map((f) => path.basename(f)).join(', ')}. Fix the template or the generator that makes them.`);
58
75
  return 0;
59
76
  }
@@ -79,19 +96,21 @@ async function run(argv, { say = (s) => console.log(s), call = null, env = proce
79
96
  const x = r.run;
80
97
  say(`${x.at.slice(0, 16).replace('T', ' ')} · run ${x.id}${r.changed ? ' · the document changed since: run it again before you share' : ''}`);
81
98
  if (!x.ok) { say('✗ it did not run: ' + (x.why || 'no answer')); return 0; }
82
- if (!x.questions.length) say('✓ no hard question'); else printQuestions(say, x.questions);
99
+ if (!x.questions.length) say('✓ no hard question'); else printQuestions(say, x.questions, x.readers);
83
100
  return 0;
84
101
  }
85
102
  const f = fileArg(args, 0);
86
103
  if (!f) { for (const l of USAGE) say(l); return 2; }
87
104
  if (typeof call !== 'function') { say('✗ no PMOS server answers: start PMOS, then ask again'); return 1; }
88
- let r = null; try { r = await call('POST', '/api/spec-critic', { path: pathFor(f), ...(wsq ? { ws: wsq } : {}) }); } catch { r = null; }
105
+ const asked = flag(args, 'as') !== undefined;
106
+ let r = null; try { r = await call('POST', '/api/spec-critic', { path: pathFor(f), ...(wsq ? { ws: wsq } : {}), ...(asked ? { as: rd.readers } : {}) }); } catch { r = null; }
89
107
  if (!r) { say('✗ no PMOS server answers: start PMOS, then ask again'); return 1; }
90
108
  if (!r.ok) { say('✗ ' + (r.error || 'the critic did not run')); return 1; }
109
+ const who = named(r.readers) ? SC.readerList(r.readers) : 'a sceptical reviewer';
91
110
  say(r.questions.length
92
- ? `${plural(r.questions.length, 'hard question')} a sceptical reviewer would ask of ${path.basename(r.file)} · run ${r.run}`
111
+ ? `${plural(r.questions.length, 'hard question')} ${who} would ask of ${path.basename(r.file)} · run ${r.run}`
93
112
  : `✓ no hard question on ${path.basename(r.file)} (${r.lenses} lenses) · run ${r.run}`);
94
- printQuestions(say, r.questions);
113
+ printQuestions(say, r.questions, r.readers);
95
114
  if (r.questions.length) say(`Label each: pmos critic label ${r.run} <n> real|noise`);
96
115
  return 0;
97
116
  }
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
  /* routes-spec-critic.js — the sceptical reviewer's routes (initiative spec-critic; lib/spec-critic.js).
3
3
  *
4
- * POST /api/spec-critic { path, ws? } → { ok, run, file, questions, dropped, lenses, added } | { ok: false, error }
4
+ * POST /api/spec-critic { path, ws?, as? } → { ok, run, file, readers, questions, dropped, lenses, added } | { ok: false, error }
5
+ * as: who reads it, 'cfo,engineer,sceptic' | 'all' | a list (none: the sceptic alone); an unknown reader is a 400.
5
6
  * one critic pass on a markdown, text or HTML document: a path relative to the workspace (it must stay inside it) or a full path.
6
7
  * `pmos critic <file>` reaches it with no Origin (D98, like `pmos lab critic`); from a page it needs a page press.
7
8
  * GET /api/spec-critic?path=&ws= → { ok, run: <the newest run on that file> | null, changed } a read; changed: the file differs from
@@ -40,16 +41,18 @@ async function run(ctx, res, b) {
40
41
  const w = wsOf(ctx, typeof b.ws === 'string' && b.ws ? b.ws : null);
41
42
  const d = docOf(w, b.path);
42
43
  if (!d.ok) return fail(ctx, res, d.status, d.error);
44
+ const rd = SC.readersOf(b.as);
45
+ if (!rd.ok) return fail(ctx, res, 400, rd.error);
43
46
  if (SC.off(process.env)) return fail(ctx, res, 409, 'the critic is off (PMOS_CRITIC=off)');
44
47
  let raw = ''; try { raw = fs.readFileSync(d.abs, 'utf8'); } catch { return fail(ctx, res, 400, 'the document could not be read'); }
45
- const K = SC.lensesFor(w ? w.root : '');
48
+ const K = SC.lensesFor(w ? w.root : '', { as: rd.readers });
46
49
  const text = SC.textOf(raw, d.abs);
47
50
  const ask = typeof ctx.specCritic === 'function' ? ctx.specCritic : SC.askVia(ctx.spawnSession);
48
51
  const r = await SC.critique(ask, { lenses: K.lenses, text: raw, file: d.abs });
49
52
  const id = ctx.runtimeDir ? SC.record(ctx.runtimeDir, { from: String(b.from || 'cli'), ws: w ? w.id : '', file: d.abs, sha: SC.sha(text), chars: text.length,
50
- lenses: r.lenses || [], ok: r.ok, why: r.why, questions: r.questions, dropped: r.dropped, ms: r.ms }) : null;
53
+ lenses: r.lenses || [], readers: K.readers, ok: r.ok, why: r.why, questions: r.questions, dropped: r.dropped, ms: r.ms }) : null;
51
54
  if (!r.ok) return fail(ctx, res, r.off ? 409 : 502, r.why);
52
- ctx.json(res, { ok: true, run: id, file: d.abs, questions: r.questions, dropped: r.dropped, lenses: r.lenses.length, added: K.added, from: K.from });
55
+ ctx.json(res, { ok: true, run: id, file: d.abs, readers: K.readers, questions: r.questions, dropped: r.dropped, lenses: r.lenses.length, added: K.added, from: K.from });
53
56
  return true;
54
57
  }
55
58
 
@@ -11,6 +11,12 @@
11
11
  * parse() keeps a question only when it names a known lens AND its quote is found in the document (case, whitespace, quote marks and
12
12
  * markdown emphasis ignored), so the PM never prepares for a question about words the document does not hold. At most 3 (MAX_QUESTIONS).
13
13
  *
14
+ * READERS (initiative review-lenses-cfo-engineer-sceptic, bet A110: a CFO, engineer and sceptic read of 5 real reports on 2 products left
15
+ * unanswered questions in all 15 reader reviews). The PM chooses who reads: `--as cfo,engineer,sceptic` or `--as all`. Each lens belongs
16
+ * to one reader: the CFO (cost, return, cost-of-delay), the engineering lead (feasibility, dependency, capacity), the sceptic (the base
17
+ * lenses). A product question joins a reader with "reader": "<id>" (none: the sceptic). With no reader given, the sceptic reads alone, as
18
+ * before. One run reads for every chosen reader; each reader keeps at most PER_READER (2) questions when several read, 3 when one reads.
19
+ *
14
20
  * THE RUN. One read-only session through the design critic's ask path (lib/design-critic.js askVia, origin `briefing-ask:spec-critic:<key>`,
15
21
  * kind `ask`). The document's text is in the prompt, so the run needs no file. A run that cannot start, times out or answers nonsense
16
22
  * files no questions, and the ledger says it did not run. PMOS_CRITIC=off runs none (the same switch as the design critic).
@@ -19,12 +25,13 @@
19
25
  * it when the PM says they are about to share a document. GET /api/spec-critic gives a page the latest run on a file.
20
26
  *
21
27
  * THE LEDGER. <runtime>/spec-critic.jsonl, append-only: { kind: 'run', id, at, from, ws?, file, sha, chars, lenses, ok, why?,
22
- * questions: [{ lens, title, question, quote, why, fix }], dropped, ms } and { kind: 'label', run, n, label: real | noise, by, at } (the PM's
23
- * word on question n, 1-based; the newest label wins). stats() counts them, and lists a lens flagged in 2 or more documents as a repeat:
28
+ * readers?, questions: [{ reader?, lens, title, question, quote, why, fix }], dropped, ms } and { kind: 'label', run, n, label: real | noise, by, at } (the PM's
29
+ * word on question n, 1-based; the newest label wins). stats() counts them (byReader: each reader's questions, real, noise), and lists a lens flagged in 2 or more documents as a repeat:
24
30
  * the same gap in several documents points at the template or generator that made them.
25
31
  *
26
32
  * BASE · ORIGIN · MAX_QUESTIONS · MAX_CHARS · DOC_RE · off(env)
27
- * questionsOf(json, rel) PURE → [lens] · lensesFor(root) → { lenses, from, added }
33
+ * READERS · readersOf(as) PURE → { ok, readers } | { ok: false, error } · readerList(ids) PURE → 'a CFO and a sceptic'
34
+ * questionsOf(json, rel) PURE → [lens] · lensesFor(root, { as? }) → { lenses, from, added, readers }
28
35
  * textOf(raw, file) PURE → the text the critic reads (HTML without its tags) · norm(s) PURE · sha(text) PURE
29
36
  * promptOf({ lenses, text, file, product? }) PURE → string
30
37
  * parse(answer, lenses, text) PURE → { questions, dropped } | null (null: the answer could not be read)
@@ -38,13 +45,44 @@ const DC = require('./design-critic.js');
38
45
 
39
46
  const FILE = 'spec-critic.jsonl';
40
47
  const ORIGIN = 'briefing-ask:spec-critic:';
41
- const MAX_QUESTIONS = 3, MAX_CHARS = 80000, MAX_RULE = 500, MIN_QUOTE = 6;
48
+ const MAX_QUESTIONS = 3, PER_READER = 2, MAX_ALL = 6, MAX_CHARS = 80000, MAX_RULE = 500, MIN_QUOTE = 6;
42
49
  const DOC_RE = /\.(md|markdown|txt|html?)$/i;
43
50
  const ID_RE = /^[a-z0-9][a-z0-9-]{0,59}$/;
44
51
  const one = (v, n) => String(v == null ? '' : v).replace(/\s+/g, ' ').trim().slice(0, n);
45
52
  const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
46
53
  const off = (env) => DC.off(env);
47
54
 
55
+ /* ── the readers: who reads the document before it is shared ── */
56
+ const READERS = Object.freeze({
57
+ cfo: Object.freeze({ id: 'cfo', name: 'CFO', article: 'a', who: 'the CFO or finance partner who has to fund it and answer for what it costs' }),
58
+ engineer: Object.freeze({ id: 'engineer', name: 'engineering lead', article: 'an', who: 'the engineering lead who has to build it, run it and commit a team to it' }),
59
+ sceptic: Object.freeze({ id: 'sceptic', name: 'sceptic', article: 'a', who: 'the most sceptical senior reader in the room, who has to say yes' }),
60
+ });
61
+ const READER_IDS = Object.freeze(Object.keys(READERS));
62
+ const DEFAULT_READERS = Object.freeze(['sceptic']);
63
+ /** 'all' | 'cfo,engineer' | ['cfo'] | empty → { ok, readers (in reader order) } | { ok: false, error }. Empty: the sceptic alone. */
64
+ function readersOf(as) {
65
+ const given = (Array.isArray(as) ? as : String(as == null ? '' : as).split(',')).map((x) => String(x).trim().toLowerCase()).filter(Boolean);
66
+ if (!given.length) return { ok: true, readers: [...DEFAULT_READERS] };
67
+ if (given.includes('all')) return { ok: true, readers: [...READER_IDS] };
68
+ const unknown = given.filter((x) => !READERS[x]);
69
+ if (unknown.length) return { ok: false, error: `no reader ${unknown.map((x) => one(x, 30)).join(', ')}: the readers are ${READER_IDS.join(', ')} (or all)` };
70
+ return { ok: true, readers: READER_IDS.filter((r) => given.includes(r)) };
71
+ }
72
+ const readerList = (ids) => { const n = ids.map((r) => `${READERS[r].article} ${READERS[r].name}`); return n.length < 2 ? n.join('') : n.slice(0, -1).join(', ') + ' and ' + n[n.length - 1]; };
73
+
74
+ /* ── the CFO's and the engineering lead's lenses ── */
75
+ const CFO = [
76
+ { id: 'cost', title: 'What does it cost?', rule: 'No cost, budget, price, headcount or effort is stated, or a cost is left out on purpose, so the money asked for cannot be judged.' },
77
+ { id: 'return', title: 'What do we get back?', rule: 'No revenue, saving, retention or other value is tied to the cost, or the return has no number and no date.' },
78
+ { id: 'cost-of-delay', title: 'What does a slip cost?', rule: 'A date or a choice between dates is given with no cost of delay, no money at risk and no fallback if it slips.' },
79
+ ].map((c) => ({ ...c, reader: 'cfo', source: 'PMOS reader lenses' }));
80
+ const ENGINEER = [
81
+ { id: 'feasibility', title: 'Can it be built as written?', rule: 'A date, estimate or scope comes before the work it depends on (tests, sign-off, design), or no approach, stack or estimate is named.' },
82
+ { id: 'dependency', title: 'What does it wait on?', rule: 'A team, system, vendor, contract, data or decision the work needs is not named, not confirmed, or has no date.' },
83
+ { id: 'capacity', title: 'Who builds it, with what?', rule: 'No named team, people or effort for the build, or the work is called small or easy with nothing to show it.' },
84
+ ].map((c) => ({ ...c, reader: 'engineer', source: 'PMOS reader lenses' }));
85
+
48
86
  /* ── the base lenses: what a sceptical reviewer asks of any spec, strategy, roadmap or report ── */
49
87
  const BASE = Object.freeze([
50
88
  { id: 'evidence', title: 'What is the evidence?', rule: 'A claim, number, need or user problem stated with no source, data or example behind it.' },
@@ -55,7 +93,8 @@ const BASE = Object.freeze([
55
93
  { id: 'owner', title: 'Who decides, and by when?', rule: 'No owner, no date, or no clear decision or action asked of the reader.' },
56
94
  { id: 'contradiction', title: 'Which part is true?', rule: 'Two parts of the document disagree, or a summary says something its own detail contradicts.' },
57
95
  { id: 'unverified', title: 'Is it real yet?', rule: 'A status, delivery or result is claimed but marked unverified, assumed, or never checked.' },
58
- ].map((c) => Object.freeze({ ...c, source: 'PMOS base lenses' })));
96
+ ].map((c) => Object.freeze({ ...c, reader: 'sceptic', source: 'PMOS base lenses' })));
97
+ const ALL = Object.freeze([...CFO.map((c) => Object.freeze(c)), ...ENGINEER.map((c) => Object.freeze(c)), ...BASE]);
59
98
 
60
99
  /* ── the product's own reviewer questions ── */
61
100
  function questionsOf(json, rel = 'review-questions.json') {
@@ -65,16 +104,21 @@ function questionsOf(json, rel = 'review-questions.json') {
65
104
  const out = [], seen = new Set();
66
105
  for (const q of list) {
67
106
  if (!isObj(q) || !ID_RE.test(String(q.id || '')) || !one(q.title, 120) || !one(q.rule, MAX_RULE) || seen.has(q.id)) continue;
107
+ const reader = q.reader == null || q.reader === '' ? null : String(q.reader).trim().toLowerCase();
108
+ if (reader && !READERS[reader]) continue;
68
109
  seen.add(q.id);
69
- out.push({ id: q.id, title: one(q.title, 120), rule: one(q.rule, MAX_RULE), source: one([q.source, q.date].filter(Boolean).join(', ') || rel, 160) });
110
+ out.push({ id: q.id, title: one(q.title, 120), rule: one(q.rule, MAX_RULE), ...(reader ? { reader } : {}), source: one([q.source, q.date].filter(Boolean).join(', ') || rel, 160) });
70
111
  }
71
112
  return out;
72
113
  }
73
114
  const readOr = (abs) => { try { return fs.readFileSync(abs, 'utf8'); } catch { return null; } };
74
- /** The base lenses plus the product's own reviewer questions (an id that is a base lens replaces it). */
75
- function lensesFor(root) {
115
+ /** The chosen readers' lenses plus the product's own reviewer questions for them (an id that is a PMOS lens replaces it; a product
116
+ * question with no reader keeps the reader of the lens it replaces, else joins the sceptic). No reader given: the sceptic alone. */
117
+ function lensesFor(root, { as } = {}) {
76
118
  const R = String(root || '');
77
- let lenses = BASE.map((c) => ({ ...c }));
119
+ const rd = readersOf(as);
120
+ const readers = rd.ok ? rd.readers : [...DEFAULT_READERS];
121
+ let lenses = ALL.map((c) => ({ ...c }));
78
122
  const from = [];
79
123
  let added = 0;
80
124
  if (R) {
@@ -84,13 +128,21 @@ function lensesFor(root) {
84
128
  const t = readOr(path.join(R, rel)); if (t == null) continue;
85
129
  const qs = questionsOf(t, rel);
86
130
  if (!qs.length) continue;
87
- for (const q of qs) { const i = lenses.findIndex((l) => l.id === q.id); if (i >= 0) lenses[i] = q; else lenses.push(q); added++; }
131
+ for (const q of qs) {
132
+ const i = lenses.findIndex((l) => l.id === q.id);
133
+ const lens = { ...q, reader: q.reader || (i >= 0 ? lenses[i].reader : 'sceptic') };
134
+ if (i >= 0) lenses[i] = lens; else lenses.push(lens);
135
+ if (readers.includes(lens.reader)) added++;
136
+ }
88
137
  from.push(rel);
89
138
  break;
90
139
  }
91
140
  }
92
- return { lenses, from, added };
141
+ lenses = lenses.filter((l) => readers.includes(l.reader));
142
+ return { lenses, from: added ? from : [], added, readers };
93
143
  }
144
+ const readersIn = (lenses) => READER_IDS.filter((r) => lenses.some((l) => (l.reader || 'sceptic') === r));
145
+ const capOf = (readers) => (readers.length > 1 ? PER_READER : MAX_QUESTIONS);
94
146
 
95
147
  /* ── the text ── */
96
148
  /** What the critic reads: an HTML page without its scripts, styles and tags; any other document as it is. At most MAX_CHARS. */
@@ -112,10 +164,23 @@ const sha = (text) => crypto.createHash('sha1').update(String(text || '')).diges
112
164
 
113
165
  /* ── the run ── */
114
166
  function promptOf({ lenses, text, file = '', product = '' }) {
167
+ const readers = readersIn(lenses);
168
+ const about = `${product ? ' about ' + one(product, 80) : ''}${file ? ' (' + one(path.basename(file), 120) + ')' : ''}`;
169
+ const solo = readers.length < 2 ? (readers[0] || 'sceptic') : null;
170
+ const open = solo === 'sceptic'
171
+ ? `You are PMOS's sceptical reviewer. The user is about to share this document${about}. Read it as the most sceptical senior reader in the room would: an executive, an engineering lead, or a finance partner who has to say yes. List the hardest questions that reader would ask, so the user can answer them before sharing. Do not write or change anything.`
172
+ : solo
173
+ ? `You are PMOS's ${READERS[solo].name} reviewer. The user is about to share this document${about}. Read it as ${READERS[solo].who} would. List the hardest questions that reader would ask, so the user can answer them before sharing. Do not write or change anything.`
174
+ : `You are PMOS's review panel. The user is about to share this document${about}. Read it ${readers.length} times, once as each of these readers, and list the hardest questions each would ask, so the user can answer them before sharing. Do not write or change anything.\n` + readers.map((r) => `- ${READERS[r].name}: ${READERS[r].who}.`).join('\n');
175
+ const lensLine = (l) => `[${l.id}] ${l.title} ${l.rule}`;
176
+ const lensBlock = solo
177
+ ? 'The lenses. Each question must name exactly one of these ids:\n' + lenses.map(lensLine).join('\n')
178
+ : 'The lenses, by reader. Each question must name exactly one of these ids; the id says which reader asks it:\n' + readers.map((r) => `${READERS[r].name}:\n` + lenses.filter((l) => (l.reader || 'sceptic') === r).map(lensLine).join('\n')).join('\n');
179
+ const cap = solo ? `At most ${MAX_QUESTIONS} questions, the hardest first.` : `At most ${PER_READER} questions for each reader, the hardest first; a reader with nothing hard asks nothing.`;
115
180
  return [
116
- `You are PMOS's sceptical reviewer. The user is about to share this document${product ? ' about ' + one(product, 80) : ''}${file ? ' (' + one(path.basename(file), 120) + ')' : ''}. Read it as the most sceptical senior reader in the room would: an executive, an engineering lead, or a finance partner who has to say yes. List the hardest questions that reader would ask, so the user can answer them before sharing. Do not write or change anything.`,
117
- 'The lenses. Each question must name exactly one of these ids:\n' + lenses.map((l) => `[${l.id}] ${l.title} ${l.rule}`).join('\n'),
118
- `Rules. At most ${MAX_QUESTIONS} questions, the hardest first. Each question quotes the document's own words it rests on, copied exactly (a few words to one sentence). For something missing, quote the heading or sentence where it should be. A question whose quote is not in the document is thrown away. Give the smallest fix the user can make before sharing, in one line. No praise, no style or grammar notes, no question the document already answers. If a strong reader would ask nothing hard, answer an empty list.`,
181
+ open,
182
+ lensBlock,
183
+ `Rules. ${cap} Each question quotes the document's own words it rests on, copied exactly (a few words to one sentence). For something missing, quote the heading or sentence where it should be. A question whose quote is not in the document is thrown away. Give the smallest fix the user can make before sharing, in one line. No praise, no style or grammar notes, no question the document already answers. If a strong reader would ask nothing hard, answer an empty list.`,
119
184
  'The document:\n<<<DOCUMENT\n' + text + '\nDOCUMENT>>>',
120
185
  'Answer with JSON only: {"questions":[{"lens":"<id>","question":"<the question, as the reviewer would ask it>","quote":"<the exact words>","why":"<why it is hard, one line>","fix":"<the smallest fix>"}]}',
121
186
  ].join('\n\n');
@@ -132,6 +197,8 @@ function parse(answer, lenses, text) {
132
197
  }
133
198
  if (!isObj(o) || !Array.isArray(o.questions)) return null;
134
199
  const byId = new Map(lenses.map((l) => [l.id, l]));
200
+ const cap = capOf(readersIn(lenses));
201
+ const per = {};
135
202
  const doc = norm(text);
136
203
  const out = [], seen = new Set();
137
204
  let dropped = 0;
@@ -145,7 +212,8 @@ function parse(answer, lenses, text) {
145
212
  const k = l.id + '|' + nq;
146
213
  if (seen.has(k)) continue;
147
214
  seen.add(k);
148
- if (out.length < MAX_QUESTIONS) out.push({ lens: l.id, title: l.title, question, quote, why: one(q.why, 240), fix: one(q.fix, 240) });
215
+ const reader = l.reader || 'sceptic';
216
+ if ((per[reader] || 0) < cap) { per[reader] = (per[reader] || 0) + 1; out.push({ reader, lens: l.id, title: l.title, question, quote, why: one(q.why, 240), fix: one(q.fix, 240) }); }
149
217
  }
150
218
  return { questions: out, dropped };
151
219
  }
@@ -164,7 +232,7 @@ async function critique(ask, { root = '', lenses = null, text = '', file = '', p
164
232
  if (answer == null) return { ok: false, why: 'the critic session did not answer', ms };
165
233
  const p = parse(answer, L, T);
166
234
  if (!p) return { ok: false, why: 'the critic\'s answer could not be read', ms };
167
- return { ok: true, questions: p.questions, dropped: p.dropped, lenses: L.map((l) => l.id), ms };
235
+ return { ok: true, questions: p.questions, dropped: p.dropped, lenses: L.map((l) => l.id), readers: readersIn(L), ms };
168
236
  }
169
237
  /** The design critic's ask path with this critic's origin: a read-only `briefing-ask:` run (kind ask). */
170
238
  const askVia = (spawnSession, { timeoutMs } = {}) => DC.askVia(spawnSession, { name: 'spec critic', origin: ORIGIN, ...(timeoutMs ? { timeoutMs } : {}) });
@@ -180,8 +248,9 @@ function record(rt, run = {}) {
180
248
  const id = 'sc-' + Date.now().toString(36) + crypto.randomBytes(3).toString('hex');
181
249
  append(rt, { kind: 'run', id, at: new Date().toISOString(), from: one(run.from || 'cli', 40), ...(run.ws ? { ws: one(run.ws, 80) } : {}),
182
250
  file: one(run.file, 400), sha: one(run.sha, 16), chars: Number.isFinite(run.chars) ? run.chars : null, lenses: (run.lenses || []).slice(0, 40),
251
+ ...(Array.isArray(run.readers) && run.readers.length ? { readers: run.readers.filter((r) => READERS[r]) } : {}),
183
252
  ok: !!run.ok, ...(run.why ? { why: one(run.why, 200) } : {}),
184
- questions: (run.questions || []).slice(0, MAX_QUESTIONS).map((q) => ({ lens: q.lens, title: one(q.title, 120), question: one(q.question, 300), quote: one(q.quote, 400), why: one(q.why, 240), fix: one(q.fix, 240) })),
253
+ questions: (run.questions || []).slice(0, MAX_ALL).map((q) => ({ ...(READERS[q.reader] ? { reader: q.reader } : {}), lens: q.lens, title: one(q.title, 120), question: one(q.question, 300), quote: one(q.quote, 400), why: one(q.why, 240), fix: one(q.fix, 240) })),
185
254
  dropped: Number.isInteger(run.dropped) ? run.dropped : 0, ms: Number.isFinite(run.ms) ? run.ms : null });
186
255
  return id;
187
256
  }
@@ -218,7 +287,7 @@ function label(rt, run, n, lab, { by = 'pm:cli' } = {}) {
218
287
  /** The counts the Checker reads, and the lenses that repeat across documents (the newest run per file counts for repeats). */
219
288
  function stats(rt) {
220
289
  const R = read(rt);
221
- const s = { runs: R.length, notRun: 0, files: 0, questions: 0, real: 0, noise: 0, unlabelled: 0, dropped: 0, byLens: {}, repeats: [] };
290
+ const s = { runs: R.length, notRun: 0, files: 0, questions: 0, real: 0, noise: 0, unlabelled: 0, dropped: 0, byLens: {}, byReader: {}, repeats: [] };
222
291
  const newest = new Map();
223
292
  for (const r of R) {
224
293
  if (!r.ok) { s.notRun++; continue; }
@@ -227,8 +296,10 @@ function stats(rt) {
227
296
  r.questions.forEach((q, i) => {
228
297
  s.questions++;
229
298
  s.byLens[q.lens] = (s.byLens[q.lens] || 0) + 1;
299
+ const b = s.byReader[q.reader || 'sceptic'] = s.byReader[q.reader || 'sceptic'] || { questions: 0, real: 0, noise: 0, unlabelled: 0 };
300
+ b.questions++;
230
301
  const l = r.labels[i + 1];
231
- if (l === 'real') s.real++; else if (l === 'noise') s.noise++; else s.unlabelled++;
302
+ if (l === 'real') { s.real++; b.real++; } else if (l === 'noise') { s.noise++; b.noise++; } else { s.unlabelled++; b.unlabelled++; }
232
303
  });
233
304
  }
234
305
  s.files = newest.size;
@@ -238,4 +309,4 @@ function stats(rt) {
238
309
  return s;
239
310
  }
240
311
 
241
- module.exports = { FILE, BASE, ORIGIN, MAX_QUESTIONS, MAX_CHARS, DOC_RE, off, questionsOf, lensesFor, textOf, norm, sha, promptOf, parse, critique, askVia, file, record, read, latest, label, stats };
312
+ module.exports = { FILE, BASE, READERS, READER_IDS, ORIGIN, MAX_QUESTIONS, PER_READER, MAX_ALL, readersOf, readerList, MAX_CHARS, DOC_RE, off, questionsOf, lensesFor, textOf, norm, sha, promptOf, parse, critique, askVia, file, record, read, latest, label, stats };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.678.0",
3
+ "version": "0.680.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.678.0",
9
+ "version": "0.680.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.678.0",
3
+ "version": "0.680.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -10,9 +10,9 @@
10
10
  * reject". The Suggestion is one of PMOS's open proposals on the initiatives on screen (lib/proposals.js, r.props), the one on the most
11
11
  * urgent initiative first; none open, none drawn.
12
12
  * · Next milestones: a date line (pm-dline) under the Initiatives table with the next 5 milestones of all initiatives, each a diamond, its
13
- * date, its name and its initiative. Close labels drop to a second row with a dashed lead; a milestone past the visible range is a +N mark
14
- * at the right end with its month above it, and once the line is scrolled a matching mark shows at the left end. It follows the table's
15
- * scale (the window the page gives).
13
+ * date, its name and its initiative. A label never touches another: a close one drops to the first free row with a dashed lead, and one
14
+ * near the right end reads to the left of its mark. The strip keeps its own window (dlineWindow), apart from the table's: it opens on
15
+ * today and fits the next 10 milestones on the full width; a scroll on it moves only the strip; the ones outside are +N marks at the ends.
16
16
  * Everything here is pure: the page (pm/premium-board.js) passes the rows and the window and wires the presses by their data- attributes. */
17
17
 
18
18
  export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c]);
@@ -21,7 +21,7 @@ const DAY = 864e5;
21
21
  const SV = (d, n = 16) => `<svg class="pm-ic" width="${n}" height="${n}" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
22
22
  export const I = {
23
23
  star: 'M12 3l1.8 5.4L19 10.2l-5.2 1.8L12 17.4l-1.8-5.4L5 10.2l5.2-1.8z', pen: 'M4 20h4L19 9l-4-4L4 16z', ok: 'M5 12.5l4.5 4.5L19 7.5',
24
- x: 'M6 6l12 12M18 6L6 18', plus: 'M12 5v14M5 12h14',
24
+ x: 'M6 6l12 12M18 6L6 18', plus: 'M12 5v14M5 12h14', fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5',
25
25
  };
26
26
  export const day = (v) => { if (v instanceof Date) return new Date(v.getFullYear(), v.getMonth(), v.getDate()); const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
27
27
  /** "12 Nov", and the year when it is not this year. */
@@ -126,39 +126,73 @@ export function nextMilestones(rows, now = new Date()) {
126
126
  /** Where the labels go: a label that would touch the one before it on its row drops to the next row (with a dashed lead). PURE.
127
127
  * xs: the marks' positions in % of the line; w: a label's width in %. → [row index] */
128
128
  export function stack(xs, w = 18) {
129
- const ends = [], out = [];
130
- for (const x of xs) { let k = 0; while (ends[k] != null && x < ends[k]) k++; ends[k] = x + w; out.push(k); }
131
- return out;
129
+ return place(xs, w).map((p) => p.row);
130
+ }
131
+ /** Where each label goes. A label reads to the right of its mark; one that would pass the line's right end reads to the left of it (flip).
132
+ * A label that would touch any label already on a row drops to the first row where it touches none. Two marks on the same date never
133
+ * share a row. PURE. xs: the marks' positions in % of the line, earliest first; w: a label's width in %; gap: the space kept between
134
+ * two labels in %. → [{ row, flip }] */
135
+ export function place(xs, w = 18, gap = 0) {
136
+ const rows = [];
137
+ return xs.map((x) => {
138
+ const flip = x + w > 100 && x - w >= 0, a = flip ? x - w : x, b = flip ? x : x + w;
139
+ let k = 0;
140
+ while (rows[k] && rows[k].some(([c, d]) => a < d + gap && c < b + gap)) k++;
141
+ (rows[k] = rows[k] || []).push([a, b]);
142
+ return { row: k, flip };
143
+ });
144
+ }
145
+ /**
146
+ * The strip's own window, apart from the table's (Wawan 2026-11-22: "the scroll should be independent from the gantt chart ... as much as
147
+ * possible contained on the full page and no scroll"). It opens on today, or on the earliest milestone that went late in the last 30 days,
148
+ * and ends on the `max`-th milestone ahead, so every one of them shows on the full width with nothing to scroll. off: how far the PM
149
+ * scrolled the strip, in ms. PURE. items: nextMilestones(). → { from, to, fit: the window before the scroll }
150
+ */
151
+ export function dlineWindow(items, now = new Date(), o = {}) {
152
+ const t = day(now), max = o.max || 10, recent = +t - 30 * DAY;
153
+ const near = (items || []).filter((x) => +x.d >= recent).slice(0, max);
154
+ let from = near.length ? Math.min(+t, +near[0].d) : +t;
155
+ let to = near.length ? Math.max(+near[near.length - 1].d, +t) : +t;
156
+ if (to - from < 28 * DAY) to = from + 28 * DAY; // at least four weeks, so close dates still spread
157
+ const pad = (to - from) * 0.02; from -= pad; to += pad;
158
+ const off = +o.off || 0;
159
+ return { from: new Date(from + off), to: new Date(to + off), fit: { from: new Date(from), to: new Date(to) } };
132
160
  }
133
161
  /**
134
- * The date line. items: nextMilestones(); W: the table's window { from, to }; o: { now, shift: how many milestones past the window's start
135
- * were scrolled over (the left mark), title, sub, add: true draws + (New milestone) }. Shows the first 5 inside the window; the rest past
136
- * the right end fold into +N with the month of the first of them above it.
162
+ * The date line. items: nextMilestones(); W: the strip's window { from, to } (dlineWindow); o: { now, title, sub, add: true draws +
163
+ * (New milestone), lw: the line's width in px, max: how many marks to draw (10), moved: the strip was scrolled (draws Fit) }. Shows the
164
+ * first `max` inside the window; the ones before it and past it fold into +N marks at the ends, each with the month of its nearest one.
165
+ * Each +N carries data-at, the start the window moves to when it is pressed.
137
166
  */
138
167
  export function dlineHtml(items, W, o = {}) {
139
- const now = o.now || new Date(), t = day(now), span = +W.to - +W.from || 1;
168
+ const now = o.now || new Date(), t = day(now), span = +W.to - +W.from || 1, max = o.max || 10;
140
169
  const X = (d) => ((+d - +W.from) / span) * 100, P = (x) => Math.max(0, Math.min(100, x)).toFixed(2) + '%';
141
- const before = items.filter((x) => x.d < W.from && x.d >= t), inside = items.filter((x) => x.d >= W.from && x.d <= W.to), after = items.filter((x) => x.d > W.to);
142
- const shown = inside.slice(0, 5), rest = inside.slice(5).concat(after);
143
- // the month ticks along the line, the same as the table's
170
+ const before = items.filter((x) => x.d < W.from), inside = items.filter((x) => x.d >= W.from && x.d <= W.to), after = items.filter((x) => x.d > W.to);
171
+ const shown = inside.slice(0, max), rest = inside.slice(max).concat(after);
172
+ // the month ticks along the line
144
173
  const ticks = [];
145
174
  for (let d = new Date(W.from.getFullYear(), W.from.getMonth(), 1); d <= W.to; d = new Date(d.getFullYear(), d.getMonth() + 1, 1)) if (d >= W.from) ticks.push(d);
146
175
  const step = ticks.length > 8 ? Math.ceil(ticks.length / 8) : 1;
147
- const tk = ticks.filter((_, i) => i % step === 0).map((d) => `<span class="tk" style="left:${P(X(d))}">${esc(MON[d.getMonth()] + (d.getMonth() === 0 ? ' ' + d.getFullYear() : ''))}</span>`).join('');
148
- const nowM = t >= W.from && t <= W.to ? `<i class="pm-now" style="left:${P(X(t))}"><span>${esc(dm(t, now))}</span></i>` : '';
149
- const rowsOf = stack(shown.map((x) => X(x.d)), o.lw ? (180 / o.lw) * 100 : 14); // a label is about 180 px wide
176
+ // a month name too close to today's date gives way to it (two words on one spot read as neither)
177
+ const inNow = t >= W.from && t <= W.to, lwT = o.lw || 1200;
178
+ const tk = ticks.filter((d, i) => i % step === 0 && !(inNow && Math.abs(X(d) - X(t)) * lwT / 100 < 70)).map((d) => `<span class="tk" style="left:${P(X(d))}">${esc(MON[d.getMonth()] + (d.getMonth() === 0 ? ' ' + d.getFullYear() : ''))}</span>`).join('');
179
+ const nowM = inNow ? `<i class="pm-now" style="left:${P(X(t))}"><span>${esc(dm(t, now))}</span></i>` : '';
180
+ // a label is 200 px wide at most (pm-dline .lb), with 16 px kept between two labels
181
+ const lw = o.lw || 1200, at = place(shown.map((x) => X(x.d)), (200 / lw) * 100, (16 / lw) * 100);
150
182
  const marks = shown.map((x, i) => {
151
- const k = rowsOf[i], name = x.m.name || 'Milestone';
152
- return `<div class="ms${x.late ? ' late' : ''}${k ? ' low' : ''}" style="left:${P(X(x.d))};--row:${k}">`
183
+ const { row: k, flip } = at[i], name = x.m.name || 'Milestone', when = dm(x.d, now);
184
+ const say = name + ', ' + when + ', ' + x.r.title + (x.late ? ', late' : '');
185
+ return `<div class="ms${x.late ? ' late' : ''}${k ? ' low' : ''}${flip ? ' flip' : ''}" style="left:${P(X(x.d))};--row:${k}">`
153
186
  // a read-only copy draws the diamond as a mark, not a button: its card can pin a milestone
154
- + (o.ro ? `<span class="pm-dia${x.late ? ' late' : ''}" role="img" aria-label="${esc(name + ', ' + dm(x.d, now) + ', ' + x.r.title + (x.late ? ', late' : ''))}"></span>`
155
- : `<button type="button" class="pm-dia${x.late ? ' late' : ''}" data-ms-pick="${esc(x.r.key)}" data-ms-id="${esc(x.m.id || '')}" aria-label="${esc(name + ', ' + dm(x.d, now) + ', ' + x.r.title + (x.late ? ', late' : ''))}" title="${esc(name + ' · ' + x.r.title)}"></button>`)
156
- + `<span class="lb"><span class="code">${esc(dm(x.d, now))}</span><b>${esc(name)}</b><span class="pm-meta">${esc(x.r.title)}</span>${x.late ? `<span class="pm-badge alert">${days(Math.round((t - x.d) / DAY))} late</span>` : ''}</span></div>`;
187
+ + (o.ro ? `<span class="pm-dia${x.late ? ' late' : ''}" role="img" aria-label="${esc(say)}"></span>`
188
+ : `<button type="button" class="pm-dia${x.late ? ' late' : ''}" data-ms-pick="${esc(x.r.key)}" data-ms-id="${esc(x.m.id || '')}" aria-label="${esc(say)}" title="${esc(name + ' · ' + x.r.title)}"></button>`)
189
+ + `<span class="lb" title="${esc(name + ' · ' + x.r.title)}"><span class="hd"><span class="code">${esc(when)}</span>${x.late ? `<span class="pm-badge alert">${days(Math.round((t - x.d) / DAY))} late</span>` : ''}</span><b>${esc(name)}</b><span class="pm-meta">${esc(x.r.title)}</span></span></div>`;
157
190
  }).join('');
158
- const lo = before.length ? `<button type="button" class="pm-more l" data-wkdl="back" aria-label="${esc(before.length + ' earlier: scroll back')}" title="${esc(before.map((x) => x.m.name).join(', '))}"><span>${esc(MON[before[before.length - 1].d.getMonth()])}</span><b>+${before.length}</b></button>` : '';
159
- const hi = rest.length ? `<button type="button" class="pm-more r" data-wkdl="on" aria-label="${esc(rest.length + ' later: scroll on')}" title="${esc(rest.map((x) => x.m.name + ' · ' + dm(x.d, now)).join('\n'))}"><span>${esc(MON[rest[0].d.getMonth()])}</span><b>+${rest.length}</b></button>` : '';
160
- const rowsN = Math.max(1, ...rowsOf.map((k) => k + 1));
191
+ const lo = before.length ? `<button type="button" class="pm-more l" data-wkdl="back" data-at="${+before[before.length - 1].d - span * 0.8}" aria-label="${esc(before.length + ' earlier: scroll back')}" title="${esc(before.map((x) => x.m.name + ' · ' + dm(x.d, now)).join('\n'))}"><span>${esc(MON[before[before.length - 1].d.getMonth()])}</span><b>+${before.length}</b></button>` : '';
192
+ const hi = rest.length ? `<button type="button" class="pm-more r" data-wkdl="on" data-at="${+rest[0].d - span * 0.05}" aria-label="${esc(rest.length + ' later: scroll on')}" title="${esc(rest.map((x) => x.m.name + ' · ' + dm(x.d, now)).join('\n'))}"><span>${esc(MON[rest[0].d.getMonth()])}</span><b>+${rest.length}</b></button>` : '';
193
+ const rowsN = Math.max(1, ...at.map((p) => p.row + 1));
161
194
  return `<section class="pm-block wk-next" aria-label="${esc(o.title || 'Next milestones')}"><div class="head"><h2 class="pm-h">${esc(o.title || 'Next milestones')}</h2>${o.sub ? `<span class="pm-meta">${esc(o.sub)}</span>` : ''}<span class="sp"></span>`
195
+ + (o.moved ? `<button type="button" class="pm-btn" data-wkdl="fit" aria-label="Show from today" title="Show from today">${SV(I.fit)}</button>` : '')
162
196
  + (o.add ? `<button type="button" class="pm-btn" data-wkdl="add" aria-label="New milestone" title="New milestone">${SV(I.plus)}</button>` : '') + `</div>`
163
197
  + (items.length ? `<div class="pm-dline" style="--rows:${rowsN}"><div class="axis">${tk}</div><div class="line">${nowM}${marks}</div>${lo}${hi}</div>`
164
198
  : `<p class="pm-meta">No milestone ahead yet.</p>`) + '</section>';
@@ -92,14 +92,18 @@
92
92
  .pm-ds .pm-dline{position:relative;padding:0 40px 0 8px}
93
93
  .pm-ds .pm-dline .axis{position:relative;height:20px;font-size:13px;color:var(--muted)}
94
94
  .pm-ds .pm-dline .axis .tk{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
95
- .pm-ds .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 86px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
95
+ .pm-ds .pm-dline .line{position:relative;height:calc(24px + var(--rows,1) * 76px);background:linear-gradient(var(--line),var(--line)) 0 12px/100% 1px no-repeat}
96
96
  .pm-ds .pm-dline .line>.pm-now{bottom:auto;height:34px;top:-8px}
97
97
  .pm-ds .pm-dline .ms{position:absolute;top:0;width:0}
98
98
  .pm-ds .pm-dline .ms>.pm-dia{top:12px}
99
- .pm-ds .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 86px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:220px;font-size:13px;line-height:20px}
99
+ .pm-ds .pm-dline .ms .lb{position:absolute;top:calc(28px + var(--row) * 76px);left:-6px;display:flex;flex-direction:column;align-items:flex-start;gap:0;width:max-content;max-width:200px;height:68px;font-size:13px;line-height:20px;overflow:hidden}
100
+ .pm-ds .pm-dline .ms.flip .lb{left:auto;right:-6px;align-items:flex-end;text-align:right}
101
+ .pm-ds .pm-dline .ms .lb .hd{display:flex;align-items:center;gap:6px;height:22px}
102
+ .pm-ds .pm-dline .ms .lb .pm-badge{height:20px;padding:0 6px;font-size:12px}
103
+ .pm-ds .pm-dline .ms .lb b, .pm-ds .pm-dline .ms .lb .pm-meta{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
100
104
  .pm-ds .pm-dline .ms .lb b{font-size:15px;line-height:24px;font-weight:600}
101
105
  .pm-ds .pm-dline .ms .lb .code{font-family:var(--font-mono);color:var(--muted)}
102
- .pm-ds .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 86px + 6px);border-left:1px dashed var(--line)}
106
+ .pm-ds .pm-dline .ms.low::before{content:"";position:absolute;left:0;top:20px;height:calc(var(--row) * 76px + 6px);border-left:1px dashed var(--line)}
103
107
  .pm-ds .pm-dline .ms.late .lb .code{color:var(--alert)}
104
108
  .pm-ds .pm-more{position:absolute;top:20px;display:flex;flex-direction:column;align-items:center;gap:2px;border:0;background:none;padding:0;font:inherit;font-size:13px;color:var(--muted);cursor:pointer}
105
109
  .pm-ds .pm-more.r{right:0}
@@ -623,8 +623,14 @@ function drawWork(L) {
623
623
  goalGroups: (rows) => (GOALS ? GL.asGroups(rows, GOALS, (rs) => sortInis(pk, rs, lay, INI_ACC)) : null),
624
624
  canMove: (r) => !ROC && !!(r.track && r.acts && (r.acts.stages || []).length > 1) });
625
625
  const W = WV.lastWindow(), vis = WV.filterRows(L, { product: wkProduct, programOf: wkProgOf });
626
- return ST.standsHtml(vis, { sug: !ROC }) + list + (W && WV.read().tl !== false ? ST.dlineHtml(ST.nextMilestones(vis), W, { sub: 'all initiatives', ro: ROC, lw: ($('#ibBody').clientWidth || innerWidth) - 120 }) : '');
627
- }
626
+ if (!W || WV.read().tl === false) return ST.standsHtml(vis, { sug: !ROC }) + list;
627
+ // the Next milestones strip keeps its own window, apart from the table's (Wawan 2026-11-22): it fits the next milestones on the full width
628
+ const NM = ST.nextMilestones(vis), DW = ST.dlineWindow(NM, new Date(), { off: DL_OFF });
629
+ DL_W = DW;
630
+ return ST.standsHtml(vis, { sug: !ROC }) + list + ST.dlineHtml(NM, DW, { sub: 'all initiatives', ro: ROC, moved: !!DL_OFF, lw: ($('#ibBody').clientWidth || innerWidth) - 90 });
631
+ }
632
+ /** How far the PM scrolled the Next milestones strip, in ms (0: it fits from today), and the window it was last drawn with. */
633
+ let DL_OFF = 0, DL_W = null;
628
634
  /** The Suggestion's answers (WorkDS): Yes keeps the proposal (POST /api/proposals/keep, Undo in the toast), No drops it (POST
629
635
  * /api/proposals/drop), the pencil opens the initiative, where its proposals can be changed before they are kept. */
630
636
  async function sugPress(b) {
@@ -647,14 +653,19 @@ async function sugPress(b) {
647
653
  * also press what is under it. */
648
654
  {
649
655
  const body = $('#ibBody'); let drag = null, raf = 0, moved = false;
650
- const pxDays = () => { const W = WV.lastWindow(), x = $('#ibBody .wk-i .wk-bw') || $('#ibBody .wk-tl'); const w = x ? x.getBoundingClientRect().width : 0; return W && w ? (W.to - W.from) / 864e5 / w : 0; };
656
+ // the table and the Next milestones strip scroll apart: each moves its own window (the strip's is DL_OFF, in ms)
657
+ const pxDays = (dl) => {
658
+ if (dl) { const x = $('#ibBody .pm-dline .line'), w = x ? x.getBoundingClientRect().width : 0; return DL_W && w ? (DL_W.to - DL_W.from) / 864e5 / w : 0; }
659
+ const W = WV.lastWindow(), x = $('#ibBody .wk-i .wk-bw') || $('#ibBody .wk-tl'); const w = x ? x.getBoundingClientRect().width : 0; return W && w ? (W.to - W.from) / 864e5 / w : 0;
660
+ };
661
+ const move = (dl, d) => { if (dl) DL_OFF += d * 864e5; else WV.scrollBy(d); };
651
662
  const redraw = () => { if (raf) return; raf = requestAnimationFrame(() => { raf = 0; drawInit(); }); };
652
663
  body.addEventListener('wheel', (e) => {
653
664
  if (curView() !== 'work' || !e.target.closest('.wk-x, .pm-dline') || Math.abs(e.deltaX) <= Math.abs(e.deltaY)) return;
654
- e.preventDefault(); const k = pxDays(); if (!k) return; WV.scrollBy(e.deltaX * k); redraw();
665
+ e.preventDefault(); const dl = !!e.target.closest('.pm-dline'), k = pxDays(dl); if (!k) return; move(dl, e.deltaX * k); redraw();
655
666
  }, { passive: false });
656
- body.addEventListener('pointerdown', (e) => { if (curView() !== 'work' || e.button !== 0 || !e.target.closest('.wk-x, .pm-dline') || e.target.closest('button')) return; drag = { x: e.clientX, k: pxDays() }; moved = false; });
657
- addEventListener('pointermove', (e) => { if (!drag || !drag.k) return; const dx = e.clientX - drag.x; if (!moved && Math.abs(dx) < 5) return; moved = true; document.body.classList.add('wk-drag'); WV.scrollBy(-dx * drag.k); drag.x = e.clientX; redraw(); });
667
+ body.addEventListener('pointerdown', (e) => { if (curView() !== 'work' || e.button !== 0 || !e.target.closest('.wk-x, .pm-dline') || e.target.closest('button')) return; const dl = !!e.target.closest('.pm-dline'); drag = { x: e.clientX, dl, k: pxDays(dl) }; moved = false; });
668
+ addEventListener('pointermove', (e) => { if (!drag || !drag.k) return; const dx = e.clientX - drag.x; if (!moved && Math.abs(dx) < 5) return; moved = true; document.body.classList.add('wk-drag'); move(drag.dl, -dx * drag.k); drag.x = e.clientX; redraw(); });
658
669
  addEventListener('pointerup', () => { if (!drag) return; drag = null; document.body.classList.remove('wk-drag'); if (moved) setTimeout(() => { moved = false; }, 0); });
659
670
  body.addEventListener('click', (e) => { if (moved) { e.stopImmediatePropagation(); e.preventDefault(); } }, true);
660
671
  }
@@ -890,7 +901,8 @@ $('#ibBody').addEventListener('click', (e) => {
890
901
  if (curView() === 'work') {
891
902
  const op = e.target.closest('[data-wkopen]'); if (op) { e.preventDefault(); openIni(rowOf(op.dataset.wkopen), op); return; }
892
903
  const sg = e.target.closest('[data-wksug]'); if (sg) { sugPress(sg); return; }
893
- const dl = e.target.closest('[data-wkdl]'); if (dl) { WV.apply({ kind: 'nav', dir: dl.dataset.wkdl === 'back' ? 'back' : 'on' }); drawInit(); const n = $(`#ibBody [data-wkdl="${dl.dataset.wkdl}"]`) || $('#ibBody [data-wknav="today"]'); if (n) n.focus(); return; }
904
+ // the strip's +N marks and Fit move only the strip, never the table
905
+ const dl = e.target.closest('[data-wkdl]'); if (dl && dl.dataset.wkdl !== 'add') { DL_OFF = dl.dataset.wkdl === 'fit' || !DL_W ? 0 : DL_OFF + (+dl.dataset.at - +DL_W.from); drawInit(); const n = $(`#ibBody [data-wkdl="${dl.dataset.wkdl}"]`) || $('#ibBody .wk-next .pm-more') || $('#ibBody [data-wknav="today"]'); if (n) n.focus(); return; }
894
906
  if (workPress(e)) return;
895
907
  }
896
908
  if (e.target.closest('#fold, [data-mefold]')) { foldOpen = !foldOpen; drawInit(); const f = $('#fold') || $('#ibBody [data-mefold]'); if (f) f.focus(); return; }
@@ -35,7 +35,7 @@ export const VIEW_CONTROLS = [
35
35
  '.wk-hd', '[data-wkspan]', '[data-wkspick]', '[data-wktl]', '[data-wkclosed]', '.wk-i[data-key]', '[data-wkbar] .tg-bar', '[data-wkbar] .wk-bar', '.wk-card', '[data-wkclear]',
36
36
  // WorkDS (initiative work-ds-initiatives): Where it stands' names (open the initiative), the scale tabs, Earlier / Go to today / Later,
37
37
  // Choose columns (the copy's filter and sort), the timeline switch in it, the Next milestones line's +N marks
38
- '[data-wkopen]', '[data-wknav]', '[data-wkmenu]', '.wk-menu [data-wktlsw]', '[data-wkdl="on"]', '[data-wkdl="back"]',
38
+ '[data-wkopen]', '[data-wknav]', '[data-wkmenu]', '.wk-menu [data-wktlsw]', '[data-wkdl="on"]', '[data-wkdl="back"]', '[data-wkdl="fit"]',
39
39
  '#bdFind', '#roFind', '#bdFilter', '.wk-menu [data-wkf]', '.wk-menu [data-wkmore]', '.wk-menu [data-wksortp]', '.wk-menu [data-wksortx]', '.wk-menu [data-wkreset]',
40
40
  // the popup of a row, read only (Part A 4): its close and its edge, Details, a stage's fold, the done and far folds
41
41
  // its path and ← back to the page it came from (the design-system popup, #1432: "Work ›" and "Back to Work") only navigate
@@ -1,7 +1,11 @@
1
1
  {
2
- "_comment": "Sceptical spec critic (initiative spec-critic, bet A330 of the factory line): before a PM shares a document, at most 3 hard questions a sceptical reviewer would ask, each naming its lens and quoting the document (a question whose quote is not in the document is dropped); the product's own review-questions.json; ledger with the PM's real/noise labels and the gaps that repeat across documents (lib/spec-critic.js, lib/routes-spec-critic.js /api/spec-critic, lib/critic-cli.js `pmos critic`). Backend only.",
2
+ "_comment": "Sceptical spec critic (initiative spec-critic, bet A330 of the factory line): before a PM shares a document, at most 3 hard questions a sceptical reviewer would ask, each naming its lens and quoting the document (a question whose quote is not in the document is dropped); the product's own review-questions.json; ledger with the PM's real/noise labels and the gaps that repeat across documents (lib/spec-critic.js, lib/routes-spec-critic.js /api/spec-critic, lib/critic-cli.js `pmos critic`). Backend only. Reader roles (initiative review-lenses-cfo-engineer-sceptic, bet A110): --as cfo,engineer,sceptic, lenses per reader, per-reader caps and stats.",
3
3
  "modules": [
4
- "spec-critic.test.js"
4
+ "spec-critic.test.js",
5
+ "spec-critic-readers.test.js"
5
6
  ],
6
- "seconds": { "spec-critic.test.js": 1 }
7
+ "seconds": {
8
+ "spec-critic.test.js": 1,
9
+ "spec-critic-readers.test.js": 1
10
+ }
7
11
  }