create-pmos 0.778.0 → 0.780.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 +35 -36
- 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 +34 -0
- package/workspace/guide/agent-capabilities.md +3 -2
- package/workspace/guide/cli.md +3 -2
- package/workspace/guide/initiatives-and-next-steps.md +1 -1
- package/workspace/guide/positioning.md +4 -2
- package/workspace/guide/settings-and-switches.md +1 -1
- package/workspace/lib/grill-runs.js +1 -1
- package/workspace/lib/job-graph.js +4 -0
- package/workspace/lib/orchestrator-keeprate.js +3 -2
- package/workspace/lib/report-readers.js +216 -0
- package/workspace/lib/settings-store.js +3 -0
- package/workspace/lib/strategy-card.js +6 -3
- package/workspace/lib/strategy-cli.js +7 -3
- package/workspace/lib/strategy-sources.js +46 -10
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-positioning.js +19 -7
- package/workspace/public/pm/bd-strategy.js +9 -2
- package/workspace/public/pm/grill-words.js +6 -2
- package/workspace/public/pm/readonly.js +2 -2
- package/workspace/server.js +3 -0
- package/workspace/skills/strategy-draft.skill +6 -3
- package/workspace/test-lists/report-reader-review.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.780.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,40 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.780.0",
|
|
38
|
+
"at": "2026-11-24T15:38:49.543Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1754,
|
|
43
|
+
"t": "The strategy draft speaks for the whole product; Positioning folds to one line",
|
|
44
|
+
"s": "The strategy draft speaks for the whole product; Positioning folds to one line",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"v": "0.779.0",
|
|
51
|
+
"at": "2026-11-24T15:18:38.678Z",
|
|
52
|
+
"f": 4,
|
|
53
|
+
"prs": [
|
|
54
|
+
{
|
|
55
|
+
"n": 1743,
|
|
56
|
+
"t": "PMOS reads each report draft as the CFO, engineer and sceptic, questions under the ✦",
|
|
57
|
+
"s": "PMOS reads each report draft as the CFO, engineer and sceptic, questions under the ✦",
|
|
58
|
+
"k": "new",
|
|
59
|
+
"h": "PMOS reads each report draft as the CFO, engineer and sceptic, questions under the ✦",
|
|
60
|
+
"try": {
|
|
61
|
+
"steps": [
|
|
62
|
+
"Open Library and draft a report (or ask the chat: draft the weekly report)",
|
|
63
|
+
"Wait about a minute, then open Work and the ✦ on an initiative the report covers"
|
|
64
|
+
],
|
|
65
|
+
"see": "The ✦ lists up to 6 questions such as 'CFO asks: What does a slip of the cutover cost?', each quoting the report, with the smallest fix as its next step"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
36
70
|
{
|
|
37
71
|
"v": "0.778.0",
|
|
38
72
|
"at": "2026-11-24T14:17:30.065Z",
|
|
@@ -405,41 +439,6 @@
|
|
|
405
439
|
}
|
|
406
440
|
}
|
|
407
441
|
]
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
"v": "0.760.0",
|
|
411
|
-
"at": "2026-11-24T02:57:16.535Z",
|
|
412
|
-
"f": 4,
|
|
413
|
-
"prs": [
|
|
414
|
-
{
|
|
415
|
-
"n": 1707,
|
|
416
|
-
"t": "The weekly digest (quiet rows slice C)",
|
|
417
|
-
"s": "The weekly digest (quiet rows slice C)",
|
|
418
|
-
"k": "new",
|
|
419
|
-
"try": {
|
|
420
|
-
"steps": [
|
|
421
|
-
"On a Monday, open Today",
|
|
422
|
-
"Press \"last week's digest\" in the Overview sentence",
|
|
423
|
-
"Switch it off in its header, then on again in Settings › General"
|
|
424
|
-
],
|
|
425
|
-
"see": "A read-only page in the Viewer: the line this week in one sentence, What moved, What PMOS did by itself (with what you undid and the Checker's samples), Not sent, and Next week. No button acts on…",
|
|
426
|
-
"open": "/today.html"
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
]
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
"v": "0.759.0",
|
|
433
|
-
"at": "2026-11-24T02:32:35.299Z",
|
|
434
|
-
"f": 4,
|
|
435
|
-
"prs": [
|
|
436
|
-
{
|
|
437
|
-
"n": 1710,
|
|
438
|
-
"t": "Workflows stage panel follows the picked workspace; a removed pick never opens on a 404",
|
|
439
|
-
"s": "Workflows stage panel follows the picked workspace; a removed pick never opens on a 404",
|
|
440
|
-
"k": "fix"
|
|
441
|
-
}
|
|
442
|
-
]
|
|
443
442
|
}
|
|
444
443
|
]
|
|
445
444
|
}
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T15:38:46Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T15:38:46Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T15:38:46Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.780.0",
|
|
4
|
+
"at": "2026-11-24T15:38:49.543Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1754,
|
|
9
|
+
"t": "The strategy draft speaks for the whole product; Positioning folds to one line",
|
|
10
|
+
"s": "The strategy draft speaks for the whole product; Positioning folds to one line",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.779.0",
|
|
17
|
+
"at": "2026-11-24T15:18:38.678Z",
|
|
18
|
+
"f": 4,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1743,
|
|
22
|
+
"t": "PMOS reads each report draft as the CFO, engineer and sceptic, questions under the ✦",
|
|
23
|
+
"s": "PMOS reads each report draft as the CFO, engineer and sceptic, questions under the ✦",
|
|
24
|
+
"k": "new",
|
|
25
|
+
"h": "PMOS reads each report draft as the CFO, engineer and sceptic, questions under the ✦",
|
|
26
|
+
"try": {
|
|
27
|
+
"steps": [
|
|
28
|
+
"Open Library and draft a report (or ask the chat: draft the weekly report)",
|
|
29
|
+
"Wait about a minute, then open Work and the ✦ on an initiative the report covers"
|
|
30
|
+
],
|
|
31
|
+
"see": "The ✦ lists up to 6 questions such as 'CFO asks: What does a slip of the cutover cost?', each quoting the report, with the smallest fix as its next step"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
2
36
|
{
|
|
3
37
|
"v": "0.778.0",
|
|
4
38
|
"at": "2026-11-24T14:17:30.065Z",
|
|
@@ -115,6 +115,7 @@ A loop never sends a message, moves a Jira ticket, merges into a product reposit
|
|
|
115
115
|
| [New dates, done and tidy names](claude-proposes.md) | Each morning, and when a date passes | The tasks of the initiative, and the evidence that work happened | The initiative's ✦ | `PMOS_PROPOSE=off` |
|
|
116
116
|
| [Grill](claude-proposes.md) | Before an initiative leaves a stage, when a forecast turns at risk, when scope or dates move a lot, and once a month on running work with late work. Also when you write "grill this" in the initiative's chat. | The initiative, your stored research, your meeting notes and the decisions that stand | "PMOS grilled it" under the initiative's ✦ | Settings › Checks: Off. `PMOS_GRILL=off` |
|
|
117
117
|
| [You decided this before](claude-proposes.md) | You add an initiative that repeats an earlier decision | `DECISIONS.md`, the decision records, the PM journal, `planning/out-of-scope/` and the initiative records | The initiative's ✦ | `pmos ai off past-repeat` |
|
|
118
|
+
| [Report readers](claude-proposes.md) | A report draft is written | The draft, read as the CFO, the engineering lead and the sceptic | The ✦ of each initiative the question quotes | `pmos ai off report-readers` |
|
|
118
119
|
| [Initiative descriptions](claude-proposes.md) | Once a day. At most 3 drafts a day for each product. | The PRD's first Problem or Why paragraph, or the record's own first paragraph | "Description" under the initiative's ✦ | `pmos ai off descriptions`. `PMOS_DESCRIPTIONS=off` |
|
|
119
120
|
| [Expected outcomes](claude-proposes.md) | Once a day. At most 3 drafts a day for each product. When a check date passes: the verdict, from the goal's reading or one short run. | The PRD's success criteria, or the anchored key result. For a verdict: the goal's reading, or the lines the run cites | "Expected outcome" under the initiative's ✦. A verdict is recorded with Undo. Your move when PMOS cannot tell. | `pmos ai off outcomes`. `PMOS_OUTCOMES=off` |
|
|
120
121
|
| [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` |
|
|
@@ -164,7 +165,7 @@ When you ask an agent session to do a piece of work, it can finish it, including
|
|
|
164
165
|
- `pmos ai log [<job>]`: the last audit lines. Each dropped proposal shows why.
|
|
165
166
|
- `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.
|
|
166
167
|
|
|
167
|
-
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`, `meeting-prewarm`, `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.
|
|
168
|
+
The AI jobs are `past-repeat`, `report-readers`, `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`, `meeting-prewarm`, `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.
|
|
168
169
|
|
|
169
170
|
## The team of role agents
|
|
170
171
|
|
|
@@ -240,7 +241,7 @@ What each part does:
|
|
|
240
241
|
- **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.
|
|
241
242
|
- **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.
|
|
242
243
|
- **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.
|
|
243
|
-
- **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.
|
|
244
|
+
- **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. PMOS also does this by itself for every report draft: once a draft is written, the same pass reads it as all three readers, and each question that quotes an initiative's part of the report shows under that initiative's ✦ as "CFO asks: …", with the smallest fix as its next step (✓ adds it as a task, ✕ drops it). The same text is read once. `pmos ai off report-readers` stops it.
|
|
244
245
|
- **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.
|
|
245
246
|
- **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.
|
|
246
247
|
- **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).
|
package/workspace/guide/cli.md
CHANGED
|
@@ -403,8 +403,8 @@ PMOS drafts 4 to 6 principles for a product from its past decisions. Each draft
|
|
|
403
403
|
The same five lines as the Strategy card on Work ([The strategy in five lines](initiatives-and-next-steps.md)). The keys are `for`, `problem`, `bet`, `win` and `wont`. Run the commands in the product's repository, or pass `--root <dir>`. The lines are in `strategy-card.jsonl` in the product's records folder, and the card shows what these commands write.
|
|
404
404
|
|
|
405
405
|
- `pmos strategy show` shows the five lines. A line PMOS drafted shows ✦ and the files it came from.
|
|
406
|
-
- `pmos strategy sources` lists the product's files a drafted line can cite
|
|
407
|
-
- `pmos strategy draft --line <key> --text "<line>" --source <file>` is PMOS's draft of one blank line. It needs 1 to 5 `--source` values: a file of the product, or a tracker key such as `ABC-123`. A line that is already written is not changed.
|
|
406
|
+
- `pmos strategy sources` lists the product's files a drafted line can cite. The whole-product files come first (README and docs, decisions, goals, briefs, out-of-scope, research), then the work as evidence (initiative records, PRDs, done tests).
|
|
407
|
+
- `pmos strategy draft --line <key> --text "<line>" --source <file>` is PMOS's draft of one blank line. It needs 1 to 5 `--source` values: a file of the product, or a tracker key such as `ABC-123`. At least one must be a whole-product file, or the sources must come from 2 or more initiatives: one initiative's files are refused, because they describe a feature, not the product. A line that is already written is not changed.
|
|
408
408
|
- `pmos strategy set --line <key> --text "<line>"` writes your own line. `--text ""` blanks it.
|
|
409
409
|
- `pmos strategy undo` takes back every line PMOS drafted. `--line <key>` takes back one.
|
|
410
410
|
|
|
@@ -877,6 +877,7 @@ The benchmark needs a signed-in agent CLI. It never pushes and never opens a pul
|
|
|
877
877
|
- `pmos jira criteria-ask <initiative> [KEY …]` says yes to them. Tickets assigned to you get the criteria in Jira; the others go to the draft for their owners.
|
|
878
878
|
- `pmos jira criteria-asks [--direct|--draft|--health]` lists the criteria asks that wait for Jira, prints the draft by owner, or prints the health number.
|
|
879
879
|
- `pmos jira criteria-done <ask id>` or `--refused "<why>"` records the answer for one criteria ask.
|
|
880
|
+
- `pmos jira criteria-reach [--count]`: how many open tickets get acceptance criteria, from the done test and from the initiative's files.
|
|
880
881
|
- `pmos jira criteria <initiative>`: the done-test checks each ticket carries as acceptance criteria, and the checks on no ticket
|
|
881
882
|
- `pmos jira digest [--since <YYYY-MM-DD or time>]`: what moved in the tracker since the last working day, who moved it, the moved tickets with no task in PMOS, and what is worth a question (blocked, reopened, nobody assigned, stuck, not in the last read). It reads only the stored Jira reads. The daily Jira read also asks Jira for every status change in the projects PMOS reads, so a ticket no initiative or task names is in the digest too, under "Not in PMOS yet".
|
|
882
883
|
|
|
@@ -115,7 +115,7 @@ A published copy of a board does not show customer signals.
|
|
|
115
115
|
|
|
116
116
|
A Work that shows one product has a **Strategy** card above its initiatives. It holds five lines: who the product is for, the problem, the bet, how you win, and what you won't do. Press the pencil to write or change them. Press the tick or Enter to save, or Esc to cancel. A save offers Undo.
|
|
117
117
|
|
|
118
|
-
You do not have to write the lines yourself. When a product has no strategy, PMOS drafts the five lines
|
|
118
|
+
You do not have to write the lines yourself. When a product has no strategy, PMOS drafts the five lines for the whole product, not for one initiative. It reads the product's own files first (its README and docs, goals, briefs, out-of-scope list, research and decisions) and uses the initiatives only as evidence. A line must come from a product file or from 2 or more initiatives. While it works, the card says "drafting from this product's files…". Each line it drafts shows ✦ and, under it, the files it came from. A line the files do not support stays blank. PMOS never writes over a line you wrote. Change a drafted line with the pencil and it becomes yours. ✦ in the card's head drafts PMOS's lines again; your own lines stay. The Undo icon takes back every drafted line, and then PMOS does not draft again by itself; press ✦ on the empty card to draft again. PMOS starts at most once a day for each product. Turn it off with `pmos ai off strategy-draft`.
|
|
119
119
|
|
|
120
120
|
When all five lines are written, PMOS checks the initiatives that are not built yet (Triage to Prioritize, not chore or incident). An initiative gets a short note when:
|
|
121
121
|
|
|
@@ -10,7 +10,9 @@ When all five lines of a product's strategy are written (see [the strategy in fi
|
|
|
10
10
|
|
|
11
11
|
## Draft
|
|
12
12
|
|
|
13
|
-
Press **✦** beside "Positioning · not drafted yet". PMOS drafts one positioning statement and two to five key messages from the five lines.
|
|
13
|
+
Press **✦** beside "Positioning · not drafted yet". PMOS drafts one positioning statement and two to five key messages from the five lines. Point at a line to see the strategy lines it comes from, with their words, for example "From The bet: One weekly plan per child".
|
|
14
|
+
|
|
15
|
+
The part is folded: it shows only the positioning statement. Press "4 key messages" (the number of messages) to open the rest, and press it again to fold them.
|
|
14
16
|
|
|
15
17
|
PMOS uses only the words of the strategy. It does not add customers, numbers, prices or competitors. A drafted line that names no strategy line is not shown. When PMOS cannot run a draft, it puts the lines together from the strategy word for word and says "without AI". Edit them before you keep them.
|
|
16
18
|
|
|
@@ -22,7 +24,7 @@ PMOS uses only the words of the strategy. It does not add customers, numbers, pr
|
|
|
22
24
|
|
|
23
25
|
## Kept lines
|
|
24
26
|
|
|
25
|
-
Kept lines stay under the strategy, the positioning statement first. When a strategy line that a kept line comes from changes, the kept line says "
|
|
27
|
+
Kept lines stay under the strategy, the positioning statement first. When a strategy line that a kept line comes from changes, the kept line says "The strategy changed since you kept this". Press **✕** on a kept line to drop it.
|
|
26
28
|
|
|
27
29
|
The lines are kept in `positioning.jsonl` in the product's records folder. Every keep and drop adds a line, so earlier versions are kept.
|
|
28
30
|
|
|
@@ -120,7 +120,7 @@ An "off" switch accepts `off`, `0`, `false` or `no` unless the row says a differ
|
|
|
120
120
|
|---|---|---|---|
|
|
121
121
|
| `PMOS_HEADLESS` | `off` sends every background job back to a terminal pane. | on | — |
|
|
122
122
|
| `PMOS_AI` | `off` turns every AI job off (the kill switch of [what agents may do](agent-capabilities.md)). | on | `pmos ai off` (the `ai.on` setting) |
|
|
123
|
-
| `PMOS_AI_<JOB>` | `off` turns one AI job off. The names are `PMOS_AI_PAST_REPEAT`, `PMOS_AI_DECISION_MEMORY`, `PMOS_AI_OUTCOMES`, `PMOS_AI_DESCRIPTIONS`, `PMOS_AI_DRIFT`, `PMOS_AI_REHEARSE`, `PMOS_AI_NEXT_PROMPT`, `PMOS_AI_SHARPEN_PROMPT` and `PMOS_AI_IDLE_LAB`. | on | `pmos ai off <job>` (the `ai.off` setting) |
|
|
123
|
+
| `PMOS_AI_<JOB>` | `off` turns one AI job off. The names are `PMOS_AI_PAST_REPEAT`, `PMOS_AI_REPORT_READERS`, `PMOS_AI_DECISION_MEMORY`, `PMOS_AI_OUTCOMES`, `PMOS_AI_DESCRIPTIONS`, `PMOS_AI_DRIFT`, `PMOS_AI_REHEARSE`, `PMOS_AI_NEXT_PROMPT`, `PMOS_AI_SHARPEN_PROMPT` and `PMOS_AI_IDLE_LAB`. | on | `pmos ai off <job>` (the `ai.off` setting) |
|
|
124
124
|
| `PMOS_CRITIC` | `off` stops the design critic and the sceptical reviewer: no critic reads a prototype version before it opens, and `pmos lab critic` and `pmos critic` refuse. The prototype rules still run. | on | — |
|
|
125
125
|
| `PMOS_AUTONOMY` | `off` stops every change PMOS applies by itself (D106) and every goal loop; proposals still wait for your ✓. | on | `pmos ai off` |
|
|
126
126
|
| `PMOS_BUILD_SANDBOX` | `docker` or `podman` runs `pmos build check` in a container with no network (the image is `check.image` in `pmos/factory.json`). Without it the check runs in the worktree, and only you can run it. | off | — |
|
|
@@ -106,7 +106,7 @@ function create(deps) {
|
|
|
106
106
|
const row = (deps.rowOf && deps.rowOf(w, ini)) || {};
|
|
107
107
|
const lines = PR.readLines(PR.ledgerFile(dir)), P = PR.fold(lines), kept = PR.keptIds(P);
|
|
108
108
|
// the learning edge (OS evaluation T1): the last 3 reasons the PM gave this job on this initiative, ✕ why and ✎ rewrites
|
|
109
|
-
const lessons = PR.lessonsOf(lines, { ini, match: (p) => p.group === 'grill' && p.type !== 'past' && p.type !== 'decision', n: 3, wide: true });
|
|
109
|
+
const lessons = PR.lessonsOf(lines, { ini, match: (p) => p.group === 'grill' && p.type !== 'past' && p.type !== 'decision' && p.type !== 'reader', n: 3, wide: true });
|
|
110
110
|
const mine = [...P.props.values()].filter((p) => p.ini === ini && p.group === 'grill');
|
|
111
111
|
const dropped = mine.filter((p) => P.drops.has(PR.sigOf(p))).slice(0, 20).map((p) => one(p.title, 120));
|
|
112
112
|
const open = mine.filter((p) => !P.drops.has(PR.sigOf(p)) && !kept.has(p.id)).slice(0, 20).map((p) => one(p.title, 120));
|
|
@@ -45,6 +45,9 @@ const LEDGERS = Object.freeze({
|
|
|
45
45
|
'<runtime>/grill-runs.jsonl': { concept: 'grill-spend', owner: 'lib/grill.js', readers: [
|
|
46
46
|
r('lib/bg-queue.js', 'grill-runs.jsonl', 'the spend limit that holds step 5'),
|
|
47
47
|
r('lib/routes-grill.js', null, "Settings › PMOS's checks: this month's spend")] },
|
|
48
|
+
'<runtime>/spec-critic.jsonl': { concept: 'critic-runs', owner: 'lib/spec-critic.js', readers: [
|
|
49
|
+
r('lib/critic-cli.js', 'SC.stats', '`pmos critic stats` and `pmos critic show`: each pass, its readers and the PM\'s real or noise labels'),
|
|
50
|
+
r('lib/report-readers.js', 'SC.latest', 'a report draft whose text was already read is not read again')] },
|
|
48
51
|
'<runtime>/goal-loops.jsonl': { concept: 'goal-loops', owner: 'lib/goal-loop.js', readers: [
|
|
49
52
|
r('lib/loop-cli.js', null, '`pmos loop status`: each goal, its round and its state')] },
|
|
50
53
|
'<state>/autonomy.jsonl': { concept: 'autonomy', owner: 'lib/autonomy.js', readers: [
|
|
@@ -167,6 +170,7 @@ const JOBS = Object.freeze([
|
|
|
167
170
|
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)'),
|
|
168
171
|
q('meeting-prewarm', 'lib/live-round-meeting.js', ['<runtime>/idle-lab/meeting-prewarm.jsonl'], [props, 'calendar', '<runtime>/meeting-material.jsonl'], 'round 1 itself is filed by lib/live-round.js (W1)'),
|
|
169
172
|
ai('past-repeat', 'lib/past-repeat.js', [props], ['repo:DECISIONS.md']),
|
|
173
|
+
ai('report-readers', 'lib/report-readers.js', [props, '<runtime>/spec-critic.jsonl'], ['report drafts']), // report-reader-review: each report draft read as the CFO, the engineer and the sceptic
|
|
170
174
|
ai('decision-memory', 'lib/decision-memory.js', [props], ['repo:DECISIONS.md']),
|
|
171
175
|
ai('outcomes', 'lib/outcome-props.js', [props, '<state>/outcome-runs.jsonl'], ['initiative records', 'repo:planning/runs/outcome_checks.jsonl', '<state>/metric-reads.jsonl']),
|
|
172
176
|
ai('descriptions', 'lib/description-props.js', [props], ['initiative records']),
|
|
@@ -75,6 +75,7 @@ const JOBS = Object.freeze([
|
|
|
75
75
|
{ job: 'grill', label: 'Grill' },
|
|
76
76
|
{ job: 'past-repeat', label: 'You decided this before' },
|
|
77
77
|
{ job: 'decision-memory', label: 'Decision memory' },
|
|
78
|
+
{ job: 'report-readers', label: 'Report readers' },
|
|
78
79
|
{ job: 'descriptions', label: 'Descriptions' },
|
|
79
80
|
{ job: 'outcomes', label: 'Expected outcomes' },
|
|
80
81
|
{ job: 'idle-lab', label: 'Idle lab' },
|
|
@@ -82,10 +83,10 @@ const JOBS = Object.freeze([
|
|
|
82
83
|
]);
|
|
83
84
|
const GROUP_JOB = { found: 'found-elsewhere', dates: 'dates', status: 'looks-done', names: 'names', description: 'descriptions', outcome: 'outcomes',
|
|
84
85
|
prototyped: 'idle-lab', improved: 'idle-lab', scanned: 'idle-lab' };
|
|
85
|
-
/** The ✦ job of a proposal { group, type }: a grill finding of type past or
|
|
86
|
+
/** The ✦ job of a proposal { group, type }: a grill finding of type past, decision or reader is its own job. null: not a ✦ job. */
|
|
86
87
|
function jobOf(p) {
|
|
87
88
|
if (!p) return null;
|
|
88
|
-
if (p.group === 'grill') return p.type === 'past' ? 'past-repeat' : p.type === 'decision' ? 'decision-memory' : 'grill';
|
|
89
|
+
if (p.group === 'grill') return p.type === 'past' ? 'past-repeat' : p.type === 'decision' ? 'decision-memory' : p.type === 'reader' ? 'report-readers' : 'grill';
|
|
89
90
|
// the live round (lib/live-round.js): its ✦ ask, and a round it made (data.live), are its own job, apart from the idle lab
|
|
90
91
|
if (p.group === 'live' || ((p.group === 'prototyped' || p.group === 'improved') && p.data && p.data.live)) return 'live-round';
|
|
91
92
|
return GROUP_JOB[p.group] || null;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* report-readers.js — PMOS reads each report draft as the CFO, the engineering lead and the sceptic, by itself, and files their questions
|
|
3
|
+
* under the blue ✦ of the initiatives the report covers (initiative report-reader-review; bet A110 on the A330 critic).
|
|
4
|
+
*
|
|
5
|
+
* WHY. `pmos critic <file> --as all` (lib/spec-critic.js, initiatives spec-critic and review-lenses-cfo-engineer-sceptic) asks a report the
|
|
6
|
+
* questions its readers will ask, but only when the chat is told the PM is about to share it, and only in a terminal. The A110 proof found an
|
|
7
|
+
* unanswered reader question in all 15 reader reviews of 5 real reports. PMOS acts by itself: no run button, the findings are ✦ proposals.
|
|
8
|
+
*
|
|
9
|
+
* WHEN IT RUNS. After every report draft this process writes (lib/report-draft.js onDraftWritten: Draft now, Redraft, a schedule). One
|
|
10
|
+
* read-only session through the spec critic's ask path (kind `ask`), with every reader. The same text is read once: a run on the same file and
|
|
11
|
+
* the same text (spec-critic.jsonl) starts none. Off: Settings `critic.reports` off, PMOS_CRITIC=off, or the AI kill switch for job
|
|
12
|
+
* `report-readers` (PMOS_AI_REPORT_READERS=off, `pmos ai off report-readers`). Wawan said yes to a run on every draft on 2026-11-24.
|
|
13
|
+
*
|
|
14
|
+
* WHAT IT FILES. Each question whose quote sits in one initiative's block of the report (`### Title (id)` under `## Initiatives`, or a Timeline
|
|
15
|
+
* row whose first cell is one block's title) becomes one proposal under that initiative's ✦: lib/proposals.js group `grill`, type `reader`, section `check` (its
|
|
16
|
+
* own ✓, never Keep all). Title "CFO asks: <question>", why the quoted line, next step the smallest fix (✓ adds it as a task). Every proposal
|
|
17
|
+
* passes lib/ai-guard.js first: its quote must be at its `<report>:<line>`. A question that quotes no block stays in the critic ledger only.
|
|
18
|
+
*
|
|
19
|
+
* blockOf(text) PURE → [id | null] per line (index 0 = line 1)
|
|
20
|
+
* lineOf(lines, quote) PURE → the 1-based line the quote starts near, or 0
|
|
21
|
+
* proposalsOf({ text, rel, cadence, questions }) PURE → the guard's proposals, each with data.ini
|
|
22
|
+
* grillProp(p) the lib/proposals.js `propose` fields for one guarded proposal
|
|
23
|
+
* cases() · replayRoot() the replay (a recorded critic answer, never the model)
|
|
24
|
+
* file({ root, rel, cadence, dir, runtime, ask, ws?, board?, env?, guard? }) → Promise<{ filed, dropped, skipped?, off?, held? }>
|
|
25
|
+
* attach(ctxFactory) hook onDraftWritten once; ctx: { workspaceList, stateDirFor, runtimeDir, spawnScheduled|spawnSession, boardOf? }
|
|
26
|
+
* filedCount(dir) reader proposals in a state folder (the health number; `node lib/report-readers.js filed`)
|
|
27
|
+
*/
|
|
28
|
+
const fs = require('fs');
|
|
29
|
+
const path = require('path');
|
|
30
|
+
const crypto = require('crypto');
|
|
31
|
+
const SC = require('./spec-critic.js');
|
|
32
|
+
const G = require('./grill.js');
|
|
33
|
+
const PR = require('./proposals.js');
|
|
34
|
+
|
|
35
|
+
const JOB = 'report-readers';
|
|
36
|
+
const VERSION = '1';
|
|
37
|
+
const MAX = 6;
|
|
38
|
+
const SETTING = 'critic.reports';
|
|
39
|
+
const one = (v, n) => String(v == null ? '' : v).replace(/\s+/g, ' ').trim().slice(0, n);
|
|
40
|
+
const norm = (s) => String(s == null ? '' : s).toLowerCase().replace(/\s+/g, ' ').trim();
|
|
41
|
+
const hash = (s) => crypto.createHash('sha1').update(String(s)).digest('hex').slice(0, 10);
|
|
42
|
+
const ASKS = { cfo: 'CFO asks', engineer: 'Engineer asks', sceptic: 'Sceptic asks' };
|
|
43
|
+
|
|
44
|
+
/** PURE. The initiative block each line sits in. Outside the blocks, a table row whose first cell is one block's title gets that block. */
|
|
45
|
+
function blockOf(text) {
|
|
46
|
+
const L = String(text || '').split('\n');
|
|
47
|
+
const out = new Array(L.length).fill(null);
|
|
48
|
+
const titles = new Map();
|
|
49
|
+
let inInis = false, cur = null;
|
|
50
|
+
L.forEach((l, i) => {
|
|
51
|
+
if (/^##\s/.test(l)) { inInis = /^##\s+Initiatives\s*$/i.test(l); cur = null; return; }
|
|
52
|
+
const m = inInis && /^###\s+(.+?)\s+\(([A-Za-z0-9._-]{1,80})\)\s*$/.exec(l);
|
|
53
|
+
if (m) { cur = m[2]; titles.set(m[2], m[1].trim()); }
|
|
54
|
+
if (inInis) out[i] = cur;
|
|
55
|
+
});
|
|
56
|
+
// outside the blocks, only a table row whose first cell is one block's title (the Timeline): prose that names a title, such as the
|
|
57
|
+
// headline, may be about something else, so it is never filed on that initiative
|
|
58
|
+
L.forEach((l, i) => {
|
|
59
|
+
if (out[i]) return;
|
|
60
|
+
const m = /^\|\s*([^|]+?)\s*\|/.exec(l);
|
|
61
|
+
if (!m) return;
|
|
62
|
+
const hit = [...titles].filter(([, t]) => norm(t) === norm(m[1]));
|
|
63
|
+
if (hit.length === 1) out[i] = hit[0][0];
|
|
64
|
+
});
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** PURE. The 1-based line a quote sits at (the quote may run over up to 3 lines), or 0. */
|
|
69
|
+
function lineOf(lines, quote) {
|
|
70
|
+
const q = norm(quote);
|
|
71
|
+
if (!q) return 0;
|
|
72
|
+
for (let i = 0; i < lines.length; i++) if (norm(lines[i]).includes(q)) return i + 1;
|
|
73
|
+
for (let i = 0; i < lines.length; i++) if (norm(lines.slice(i, i + 3).join(' ')).includes(q)) return i + 1;
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** PURE. Critic questions → the guard's proposals. rel: the report, repository-relative. */
|
|
78
|
+
function proposalsOf({ text, rel, cadence = '', questions } = {}) {
|
|
79
|
+
const lines = String(text || '').split('\n');
|
|
80
|
+
const blocks = blockOf(text);
|
|
81
|
+
const out = [];
|
|
82
|
+
for (const q of Array.isArray(questions) ? questions : []) {
|
|
83
|
+
if (out.length >= MAX) break;
|
|
84
|
+
if (!q || !q.quote || !q.question) continue;
|
|
85
|
+
const at = lineOf(lines, q.quote);
|
|
86
|
+
const ini = at ? blocks[at - 1] : null;
|
|
87
|
+
if (!ini) continue;
|
|
88
|
+
const reader = ASKS[q.reader] ? q.reader : 'sceptic';
|
|
89
|
+
const key = [cadence, reader, q.lens].join('|');
|
|
90
|
+
out.push({
|
|
91
|
+
id: 'rr-' + hash([ini, key].join('|')),
|
|
92
|
+
title: one(q.question, 140),
|
|
93
|
+
say: one(`"${one(q.quote, 160)}"${q.why ? ' ' + q.why : ''}`, 300),
|
|
94
|
+
confidence: 'medium',
|
|
95
|
+
claims: [{ text: one(q.question, 300), sources: [{ label: one(`${path.basename(String(rel || 'report'))} · ${q.lens}`, 80), ref: `${rel}:${at}`, quote: q.quote }] }],
|
|
96
|
+
data: { ini, reader, lens: one(q.lens, 40), key, next: one(q.fix || 'Answer it in the report before it is sent', 140) },
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The lib/proposals.js `propose` fields for one guarded proposal (group grill, type reader). */
|
|
103
|
+
function grillProp(p) {
|
|
104
|
+
const d = p.data || {};
|
|
105
|
+
const src = (p.claims[0] && p.claims[0].sources[0]) || {};
|
|
106
|
+
return {
|
|
107
|
+
id: G.idOf(d.ini, 'reader', d.key), group: 'grill', type: 'reader', section: 'check',
|
|
108
|
+
title: one((ASKS[d.reader] || 'Sceptic asks') + ': ' + p.title, 200),
|
|
109
|
+
why: one(p.say + ' Next: ' + d.next, 460),
|
|
110
|
+
sources: [{ label: one(src.label || 'the report', 80), ref: one(src.ref, 500) }],
|
|
111
|
+
items: [], data: { angle: 'reader', reader: d.reader, lens: d.lens, next: d.next, rank: d.reader === 'sceptic' ? 4 : 3 },
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* The replay: a recorded critic answer on a fixture report. A question in a block is filed; one that quotes the headline is not. */
|
|
116
|
+
const FIXTURE_REL = 'planning/reports/weekly/2026-11-20.md';
|
|
117
|
+
const FIXTURE = ['---', 'type: Reference', 'title: "Weekly report 2026-11-20"', '---', '', '## Headline', '', 'Sign-in work is on track for the March cutover.', '',
|
|
118
|
+
'## Initiatives', '', '### Move sign-in to the new provider (ciam-cutover)', '', 'Stage: Build · On track · 4 of 9', '',
|
|
119
|
+
'Cutover planned for 15 or 30 March 2026, load tests to follow.', ''].join('\n');
|
|
120
|
+
const RECORDED = [
|
|
121
|
+
{ reader: 'cfo', lens: 'cost-of-delay', question: 'What does a slip of the cutover cost?', quote: 'Cutover planned for 15 or 30 March 2026', why: 'No cost is named.', fix: 'Add the cost of a two-week slip next to the date' },
|
|
122
|
+
{ reader: 'sceptic', lens: 'evidence', question: 'What says it is on track?', quote: 'Sign-in work is on track for the March cutover', why: '', fix: 'Name the reading' },
|
|
123
|
+
];
|
|
124
|
+
let fixtureRoot = null;
|
|
125
|
+
function replayRoot() {
|
|
126
|
+
if (fixtureRoot && fs.existsSync(fixtureRoot)) return fixtureRoot;
|
|
127
|
+
fixtureRoot = fs.mkdtempSync(path.join(require('os').tmpdir(), 'pmos-report-readers-replay-'));
|
|
128
|
+
const p = path.join(fixtureRoot, FIXTURE_REL);
|
|
129
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
130
|
+
fs.writeFileSync(p, FIXTURE);
|
|
131
|
+
return fixtureRoot;
|
|
132
|
+
}
|
|
133
|
+
function cases() {
|
|
134
|
+
return [{ name: 'a reader question in an initiative block is filed; one outside every block is not', run: async () => proposalsOf({ text: FIXTURE, rel: FIXTURE_REL, cadence: 'weekly', questions: RECORDED }),
|
|
135
|
+
expect: { filed: 1, cites: [FIXTURE_REL] } }];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function guardOf() { try { return require('./ai-guard.js'); } catch { return null; } }
|
|
139
|
+
function settingOff(runtime) {
|
|
140
|
+
if (!runtime) return false;
|
|
141
|
+
try { return require('./settings-store.js').get(runtime, SETTING) === 'off'; } catch { return false; }
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** One reader review of one report draft. dir: the workspace's PMOS state folder (proposals.jsonl); runtime: the per-user folder. */
|
|
145
|
+
async function file({ root, rel, cadence = '', dir, runtime, ask, ws = '', board = '', env = process.env, guard = guardOf(), now = Date.now() } = {}) {
|
|
146
|
+
if (SC.off(env)) return { filed: [], dropped: [], off: 'the critic is off (PMOS_CRITIC=off)' };
|
|
147
|
+
if (settingOff(runtime)) return { filed: [], dropped: [], off: `Settings ${SETTING} is off` };
|
|
148
|
+
if (!guard) return { filed: [], dropped: [], off: 'the AI guardrail (lib/ai-guard.js) is not installed' };
|
|
149
|
+
if (!root || !rel || !dir) return { filed: [], dropped: [], off: 'no report or no PMOS state folder' };
|
|
150
|
+
const gdir = runtime || dir;
|
|
151
|
+
const stop = guard.off(JOB, { env, settingsDir: runtime || null });
|
|
152
|
+
if (stop) return { filed: [], dropped: [], off: stop };
|
|
153
|
+
const abs = path.resolve(root, rel);
|
|
154
|
+
let raw = '';
|
|
155
|
+
try { raw = fs.readFileSync(abs, 'utf8'); } catch { return { filed: [], dropped: [], off: 'the report could not be read' }; }
|
|
156
|
+
const text = SC.textOf(raw, abs);
|
|
157
|
+
const prev = runtime ? SC.latest(runtime, abs) : null;
|
|
158
|
+
if (prev && prev.ok && prev.sha === SC.sha(text)) return { filed: [], dropped: [], skipped: 'this text was read already' };
|
|
159
|
+
if (!guard.ready(gdir, JOB, VERSION)) {
|
|
160
|
+
const rp = await guard.replay(JOB, VERSION, cases(), { root: replayRoot(), stateDir: gdir, max: MAX });
|
|
161
|
+
if (!rp.ok) return { filed: [], dropped: [], held: true };
|
|
162
|
+
}
|
|
163
|
+
const K = SC.lensesFor(root, { as: 'all' });
|
|
164
|
+
const r = await SC.critique(ask, { lenses: K.lenses, text: raw, file: abs });
|
|
165
|
+
if (runtime) SC.record(runtime, { from: 'report', ws, file: abs, sha: SC.sha(text), chars: text.length, lenses: r.lenses || [], readers: K.readers,
|
|
166
|
+
ok: r.ok, why: r.why, questions: r.questions, dropped: r.dropped, ms: r.ms });
|
|
167
|
+
if (!r.ok) return { filed: [], dropped: [], off: r.why };
|
|
168
|
+
const props = proposalsOf({ text: raw, rel, cadence, questions: r.questions });
|
|
169
|
+
if (!props.length) return { filed: [], dropped: [], none: true };
|
|
170
|
+
const run = 'rr' + Number(now).toString(36);
|
|
171
|
+
const got = await guard.file({ job: JOB, version: VERSION, run, root, stateDir: gdir, settingsDir: runtime || null, env, max: MAX }, props, async (accepted) => {
|
|
172
|
+
const F = PR.read(dir), kept = PR.keptIds(F);
|
|
173
|
+
for (const p of accepted) {
|
|
174
|
+
const prop = grillProp(p);
|
|
175
|
+
if (F.drops.has(PR.sigOf(prop)) || kept.has(prop.id)) continue;
|
|
176
|
+
PR.append(dir, null, { kind: 'propose', ini: p.data.ini, board: board || '', run, ...prop, at: new Date(now).toISOString() });
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
console.log(`[report-readers] ${rel}: ${got.filed.length} filed, ${got.dropped.length} dropped`);
|
|
180
|
+
return got;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let attached = false;
|
|
184
|
+
/** server.js calls this once: every draft this process writes gets one reader review, in the background. */
|
|
185
|
+
function attach(ctxFactory) {
|
|
186
|
+
if (attached || typeof ctxFactory !== 'function') return;
|
|
187
|
+
attached = true;
|
|
188
|
+
require('./report-draft.js').onDraftWritten(({ root, cadence, path: rel }) => {
|
|
189
|
+
setImmediate(() => {
|
|
190
|
+
let ctx = null; try { ctx = ctxFactory(); } catch { ctx = null; }
|
|
191
|
+
if (!ctx) return;
|
|
192
|
+
const abs = path.resolve(String(root));
|
|
193
|
+
const list = typeof ctx.workspaceList === 'function' ? ctx.workspaceList() : [];
|
|
194
|
+
const w = list.find((x) => x && x.root && path.resolve(x.root) === abs) || { id: '', root: abs };
|
|
195
|
+
let dir = null; try { dir = ctx.stateDirFor ? ctx.stateDirFor(w) : null; } catch { dir = null; }
|
|
196
|
+
const spawn = ctx.spawnScheduled || ctx.spawnSession;
|
|
197
|
+
if (!dir || typeof spawn !== 'function') return;
|
|
198
|
+
let board = ''; try { board = (ctx.boardOf && ctx.boardOf(w)) || ''; } catch { board = ''; }
|
|
199
|
+
file({ root: abs, rel, cadence, dir, runtime: ctx.runtimeDir || null, ask: SC.askVia(spawn), ws: w.id || '', board })
|
|
200
|
+
.catch((e) => console.log(`[report-readers] ${rel}: not run (${one(e && e.message, 160)})`));
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** Reader proposals filed in one state folder: the health number. */
|
|
206
|
+
function filedCount(dir) {
|
|
207
|
+
try { const F = PR.read(dir); return [...F.props.values()].filter((p) => p.group === 'grill' && p.type === 'reader').length; } catch { return 0; }
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
module.exports = { JOB, VERSION, MAX, SETTING, ASKS, blockOf, lineOf, proposalsOf, grillProp, cases, replayRoot, file, attach, filedCount, FIXTURE, FIXTURE_REL, RECORDED };
|
|
211
|
+
|
|
212
|
+
if (require.main === module && process.argv[2] === 'filed') {
|
|
213
|
+
const cwd = process.cwd();
|
|
214
|
+
const dir = [['pmos', 'state'], ['state'], ['.pmos']].map((r) => path.join(cwd, ...r)).find((d) => { try { return fs.statSync(d).isDirectory(); } catch { return false; } });
|
|
215
|
+
console.log(dir ? filedCount(dir) : 0);
|
|
216
|
+
}
|
|
@@ -106,6 +106,9 @@ const DEFS = Object.freeze({
|
|
|
106
106
|
// and the monthly credit cap in US dollars. At the cap Claude pauses. `pmos grill mode|cap` reads and sets them.
|
|
107
107
|
'grill.mode': one('checks', 'computer', ['full', 'exits', 'off'], 'full'),
|
|
108
108
|
'grill.cap': { section: 'checks', scope: 'computer', type: 'dollars', min: 0, max: 500, def: 10 },
|
|
109
|
+
// report-reader-review: PMOS reads each report draft as the CFO, the engineer and the sceptic and files their questions under the ✦
|
|
110
|
+
// (lib/report-readers.js). On by default (Wawan, 2026-11-24: "Yes, on every report draft").
|
|
111
|
+
'critic.reports': one('checks', 'computer', ['on', 'off'], 'on'),
|
|
109
112
|
// Background use with no dollar limit (Wawan 2026-11-17: the runs use the subscription plan). On: the step-5 spend hold never holds
|
|
110
113
|
// (lib/bg-queue.js spendHold); the usage-limit hold a failed run leaves is the brake. `pmos grill cap unlimited` sets it.
|
|
111
114
|
'ai.unlimited': bool('checks', 'computer', false),
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* fit(card, row) → null (fits, or nothing to say) | { kind: 'wont' | 'none', why }
|
|
9
9
|
* notes(card, rows) → [{ id, title, stage, kind, why }] at most MAX_NOTES
|
|
10
10
|
* count(dirs) → how many of the folders hold a complete card
|
|
11
|
-
* draft(dir, fields, sources,
|
|
12
|
-
* each citing 1 to MAX_SOURCES refs that
|
|
11
|
+
* draft(dir, fields, sources, { check, wide }) → { ok, card, wrote } | { ok: false, error } PMOS's draft (initiative strategy-draft): only
|
|
12
|
+
* blank lines, each citing 1 to MAX_SOURCES refs that check() accepts and wide() finds broad enough for the whole
|
|
13
|
+
* product (lib/strategy-sources.js checkRef, breadth); appends { at, by: 'pmos', fields, sources }
|
|
13
14
|
* undo(dir, key?, now?) → { ok, card, blanked } | { ok: false, error } blanks the lines that still hold PMOS's draft (or one), { ev: 'undo' }
|
|
14
15
|
* drafted(dirs) → how many lines PMOS drafted still stand (the health number of strategy-draft)
|
|
15
16
|
*
|
|
@@ -111,7 +112,7 @@ function save(dir, fields, now = Date.now()) {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
/** PMOS's draft: only the lines that are blank now, each with the refs it came from. `check(ref)` → true when the ref is a source of the product. */
|
|
114
|
-
function draft(dir, fields, sources, { now = Date.now(), check = null } = {}) {
|
|
115
|
+
function draft(dir, fields, sources, { now = Date.now(), check = null, wide = null } = {}) {
|
|
115
116
|
if (!fileOf(dir)) return { ok: false, error: 'This product has no records folder.' };
|
|
116
117
|
const c = clean(fields);
|
|
117
118
|
if (!Object.keys(c).length) return { ok: false, error: 'Name a line to draft: ' + FIELDS.join(', ') + '.' };
|
|
@@ -124,6 +125,8 @@ function draft(dir, fields, sources, { now = Date.now(), check = null } = {}) {
|
|
|
124
125
|
if (refs.length > MAX_SOURCES) return { ok: false, error: `Cite at most ${MAX_SOURCES} sources for "${LABELS[k]}".` };
|
|
125
126
|
const bad = check ? refs.filter((r) => !check(r)) : [];
|
|
126
127
|
if (bad.length) return { ok: false, error: 'Not a source of this product: ' + bad.join(', ') + '. `pmos strategy sources` lists the files a line may cite; a tracker key (ABC-123) is accepted too.' };
|
|
128
|
+
const narrow = wide ? wide(refs) : null; // lib/strategy-sources.js breadth: the line must speak for the whole product
|
|
129
|
+
if (narrow) return { ok: false, code: 'narrow', error: `"${LABELS[k]}": ${narrow}.` };
|
|
127
130
|
out[k] = c[k]; src[k] = refs;
|
|
128
131
|
}
|
|
129
132
|
if (!Object.keys(out).length) return { ok: false, code: 'written', error: 'Those lines are written already (' + kept.map((k) => LABELS[k]).join(', ') + '); PMOS drafts only blank lines.' };
|
|
@@ -75,13 +75,17 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd() } =
|
|
|
75
75
|
if (sub === 'sources') {
|
|
76
76
|
const list = SS.sourcesOf(root);
|
|
77
77
|
if (flags.json) { say(JSON.stringify({ ok: true, sources: list })); return 0; }
|
|
78
|
-
if (!list.length) say('No
|
|
79
|
-
|
|
78
|
+
if (!list.length) say('No product doc, goal, initiative or PRD file found. A tracker key (ABC-123) can be cited too.');
|
|
79
|
+
let level = null;
|
|
80
|
+
for (const s of list) {
|
|
81
|
+
if (s.level !== level) { level = s.level; say(level === 'product' ? 'The whole product (start here):' : 'The work, as evidence (a line needs 2 or more initiatives, or a product file too):'); }
|
|
82
|
+
say(` ${s.kind.padEnd(12)} ${s.ref} — ${s.title}`);
|
|
83
|
+
}
|
|
80
84
|
return 0;
|
|
81
85
|
}
|
|
82
86
|
if (sub === 'draft') {
|
|
83
87
|
const bad = needLine(); if (bad != null) return bad;
|
|
84
|
-
const r = SC.draft(dir, { [flags.line]: flags.text }, { [flags.line]: flags.source || [] }, { check: (ref) => SS.checkRef(root, ref) });
|
|
88
|
+
const r = SC.draft(dir, { [flags.line]: flags.text }, { [flags.line]: flags.source || [] }, { check: (ref) => SS.checkRef(root, ref), wide: SS.breadth });
|
|
85
89
|
if (!r.ok) return fail(r.error);
|
|
86
90
|
say(flags.json ? JSON.stringify({ ok: true, wrote: r.wrote }) : `✦ drafted ${SC.LABELS[flags.line]}: ${r.card[flags.line]}`);
|
|
87
91
|
return 0;
|
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
/* strategy-sources.js — the product's own files a drafted strategy line may cite (initiative strategy-draft; done test
|
|
3
3
|
* planning/done-tests/strategy-draft.md C4). READ-ONLY.
|
|
4
4
|
*
|
|
5
|
-
* sourcesOf(root) → [{ ref, kind, title }] ref: the file's path relative to the product root ('/' separators)
|
|
6
|
-
* kind ∈
|
|
5
|
+
* sourcesOf(root) → [{ ref, kind, level, title }] ref: the file's path relative to the product root ('/' separators)
|
|
6
|
+
* kind ∈ doc · goal · brief · out-of-scope · research · decisions (level 'product', listed first) ·
|
|
7
|
+
* initiative · prd · done-test (level 'initiative': evidence, never the strategy on its own)
|
|
8
|
+
* levelOf(ref) → 'product' | 'initiative' a file under initiatives/, prd/, done-tests/ or core-docs/initiative-*, or a tracker key,
|
|
9
|
+
* is one piece of work; any other file of the product speaks for the whole product
|
|
10
|
+
* breadth(refs) → null when the refs can carry a PRODUCT strategy line: 1+ product-level file, or work from 2+ different initiatives;
|
|
11
|
+
* else the reason (Wawan 2026-11-24: a draft from one initiative's files read as that feature's scope)
|
|
7
12
|
* checkRef(root, ref) → true when `ref` is a file inside the product root (not under .git or node_modules), or a tracker key (ABC-123)
|
|
8
13
|
* titleOf(root, ref) → the file's title (frontmatter `title`, else its first heading, else its name), or the key itself
|
|
9
14
|
*
|
|
@@ -15,7 +20,9 @@ const path = require('path');
|
|
|
15
20
|
const PER_KIND = 40;
|
|
16
21
|
const KEY = /^[A-Z][A-Z0-9]{1,15}-\d{1,7}$/;
|
|
17
22
|
const SKIP = /(^|\/)(\.git|node_modules)(\/|$)/;
|
|
18
|
-
const
|
|
23
|
+
const PRODUCT_DIRS = [['okrs', 'goal'], ['briefs', 'brief'], ['out-of-scope', 'out-of-scope'], ['research', 'research']];
|
|
24
|
+
const WORK_DIRS = [['initiatives', 'initiative'], ['prd', 'prd'], ['done-tests', 'done-test']];
|
|
25
|
+
const WORK = /(^|\/)(initiatives|prd|done-tests)\/|(^|\/)core-docs\/initiative-/;
|
|
19
26
|
const BASES = ['planning', 'pmos/planning', 'pmos/state'];
|
|
20
27
|
const DOC_NAME = /(readme|vision|strategy|brief|product|overview|about)/i;
|
|
21
28
|
|
|
@@ -44,18 +51,47 @@ function sourcesOf(root) {
|
|
|
44
51
|
const ref = posix(path.relative(root, f));
|
|
45
52
|
if (seen.has(ref) || !inside(root, f)) return;
|
|
46
53
|
seen.add(ref);
|
|
47
|
-
out.push({ ref, kind, title: head(f) || path.basename(f, '.md') });
|
|
54
|
+
out.push({ ref, kind, level: levelOf(ref), title: head(f) || path.basename(f, '.md') });
|
|
48
55
|
};
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
const dirs = (list) => {
|
|
57
|
+
for (const [sub, kind] of list) {
|
|
58
|
+
const files = [];
|
|
59
|
+
for (const b of BASES) files.push(...mdIn(path.join(root, b, sub)));
|
|
60
|
+
for (const f of newest(files).slice(0, PER_KIND)) push(f, kind);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
// the whole product first: its docs, decisions, goals, briefs, out-of-scope list and research
|
|
54
64
|
const docs = [...mdIn(root), ...mdIn(path.join(root, 'docs'))].filter((f) => DOC_NAME.test(path.basename(f)));
|
|
55
65
|
for (const f of newest(docs).slice(0, PER_KIND)) push(f, 'doc');
|
|
66
|
+
for (const f of [path.join(root, 'DECISIONS.md'), path.join(root, 'pmos', 'DECISIONS.md')]) { try { if (fs.statSync(f).isFile()) push(f, 'decisions'); } catch { /* none */ } }
|
|
67
|
+
dirs(PRODUCT_DIRS);
|
|
68
|
+
// then the work, as evidence of what the product does
|
|
69
|
+
dirs(WORK_DIRS);
|
|
56
70
|
return out;
|
|
57
71
|
}
|
|
58
72
|
|
|
73
|
+
function levelOf(ref) {
|
|
74
|
+
const r = String(ref || '').trim();
|
|
75
|
+
return KEY.test(r) || WORK.test(r) ? 'initiative' : 'product';
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The piece of work a work-level ref belongs to: the initiative id (a PRD's '-prd' cut), or the tracker key. */
|
|
79
|
+
function workOf(ref) {
|
|
80
|
+
const r = String(ref || '').trim();
|
|
81
|
+
if (KEY.test(r)) return 'key:' + r;
|
|
82
|
+
const m = /core-docs\/initiative-([^/]+)\//.exec(r);
|
|
83
|
+
if (m) return m[1];
|
|
84
|
+
return path.basename(r).replace(/\.md$/, '').replace(/-prd$/, '');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function breadth(refs) {
|
|
88
|
+
const list = (refs || []).map((r) => String(r || '').trim()).filter(Boolean);
|
|
89
|
+
if (list.some((r) => levelOf(r) === 'product')) return null;
|
|
90
|
+
const work = new Set(list.map(workOf));
|
|
91
|
+
if (work.size >= 2) return null;
|
|
92
|
+
return 'every source is one piece of work (' + [...work].join(', ') + '). A strategy line speaks for the whole product: cite a product file (README, goals, brief, out-of-scope, research, decisions) or a pattern in 2 or more initiatives';
|
|
93
|
+
}
|
|
94
|
+
|
|
59
95
|
function checkRef(root, ref) {
|
|
60
96
|
const r = String(ref || '').trim();
|
|
61
97
|
if (KEY.test(r)) return true;
|
|
@@ -73,4 +109,4 @@ function titleOf(root, ref) {
|
|
|
73
109
|
return head(path.resolve(String(root || ''), r)) || path.basename(r).replace(/\.md$/, '');
|
|
74
110
|
}
|
|
75
111
|
|
|
76
|
-
module.exports = { PER_KIND, sourcesOf, checkRef, titleOf };
|
|
112
|
+
module.exports = { PER_KIND, sourcesOf, checkRef, titleOf, levelOf, breadth };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.780.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.780.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
* Built only from Komorebi parts: pm-btn (icon only), pm-input to edit a drafted line, pm-li for each line, pm-meta for its source.
|
|
7
7
|
* It reads and writes /api/positioning (lib/routes-strategy-card.js) and nothing else.
|
|
8
8
|
* · Nothing kept, no draft: one quiet line, "Positioning · not drafted yet", and the ✦ that drafts.
|
|
9
|
-
* ·
|
|
9
|
+
* · Collapsed by default (Wawan 2026-11-24, "taking too much space"): the positioning statement only, and "N key messages" that opens
|
|
10
|
+
* the rest (bdPosMore). Where each line comes from is in its tooltip.
|
|
11
|
+
* · Kept lines: a line whose strategy line changed since says so. ✕ drops it.
|
|
10
12
|
* · A draft: each line in an input the PM can edit, with where it comes from, ✓ to keep it and ✕ to leave it. Lines put together
|
|
11
13
|
* without AI say so once.
|
|
12
14
|
* The controls carry ids (bdPosDraft, bdPosKeep, bdPosDrop) so the local use log counts their use (the bet's kill line). */
|
|
@@ -15,7 +17,7 @@ import { pmPost } from './http.js';
|
|
|
15
17
|
const API = '/api/positioning';
|
|
16
18
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
17
19
|
const SV = (d) => `<svg class="pm-ic" width="16" height="16" viewBox="0 0 24 24" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
18
|
-
const I = { spark: 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z', ok: 'M5 12l5 5 9-10', x: 'M6 6l12 12M18 6L6 18', again: 'M4 12a8 8 0 0 1 14-5.3M20 4v5h-5M20 12a8 8 0 0 1-14 5.3M4 20v-5h5' };
|
|
20
|
+
const I = { spark: 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z', ok: 'M5 12l5 5 9-10', x: 'M6 6l12 12M18 6L6 18', again: 'M4 12a8 8 0 0 1 14-5.3M20 4v5h-5M20 12a8 8 0 0 1-14 5.3M4 20v-5h5', chev: 'M7 10l5 5 5-5' };
|
|
19
21
|
const LABELS = { for: 'Who it is for', problem: 'The problem', bet: 'The bet', win: 'How we win', wont: "What we won't do" };
|
|
20
22
|
const btn = (id, icon, label, kind, data = '') => `<button type="button" class="pm-btn${kind ? ' ' + kind : ''}" id="${id}"${data} aria-label="${esc(label)}" title="${esc(label)}">${SV(icon)}</button>`;
|
|
21
23
|
|
|
@@ -23,7 +25,9 @@ const btn = (id, icon, label, kind, data = '') => `<button type="button" class="
|
|
|
23
25
|
export const fromLine = (l) => 'From ' + (l.cites || []).map((c) => `${LABELS[c] || c}: ${(l.quotes && l.quotes[c]) || ''}`).join(' · ');
|
|
24
26
|
const kindWord = (l) => (l.kind === 'positioning' ? 'Positioning' : 'Message');
|
|
25
27
|
|
|
26
|
-
/** The part's markup. state = { kept, draft, busy }. Pure, so the test reads it.
|
|
28
|
+
/** The part's markup. state = { kept, draft, busy, left, open }. Pure, so the test reads it.
|
|
29
|
+
* Collapsed (the default): the positioning statement only, and a fold "N key messages" (bdPosMore) that opens the rest. Where a line comes
|
|
30
|
+
* from sits in its tooltip, not under it, so the part stays short; a line whose strategy changed still says so. */
|
|
27
31
|
export function partHtml(state) {
|
|
28
32
|
const kept = Array.isArray(state.kept) ? state.kept : [];
|
|
29
33
|
const d = state.draft && state.draft.state === 'ready' ? state.draft : null;
|
|
@@ -32,10 +36,17 @@ export function partHtml(state) {
|
|
|
32
36
|
const fresh = d ? d.lines.filter((l) => !keptIds.has(l.id) && !(state.left || []).includes(l.id)) : [];
|
|
33
37
|
const head = `<div class="head"><h4 class="pm-h-sm" style="flex:1">Positioning${kept.length || fresh.length || pending ? '' : ' <span class="pm-meta">· not drafted yet</span>'}${pending ? ' <span class="pm-meta">· drafting…</span>' : ''}</h4>`
|
|
34
38
|
+ (pending ? '' : btn('bdPosDraft', kept.length || d ? I.again : I.spark, kept.length || d ? 'Draft again from the strategy' : 'Draft positioning from the strategy')) + '</div>';
|
|
35
|
-
const
|
|
36
|
-
const
|
|
39
|
+
const tip = (l) => ` title="${esc(kindWord(l) + ' · ' + fromLine(l))}"`;
|
|
40
|
+
const keptRow = (l) => `<div class="pm-li" role="listitem" data-pos="${esc(l.id)}"${tip(l)}><span class="txt"><span class="t">${esc(l.text)}</span>${l.stale ? '<span class="w">The strategy changed since you kept this</span>' : ''}</span>${btn('bdPosDrop', I.x, 'Drop this line', 'outline', ` data-id="${esc(l.id)}"`)}</div>`;
|
|
41
|
+
const draftRow = (l) => `<div class="pm-li" role="listitem" data-draft="${esc(l.id)}"${tip(l)}><span class="txt"><input class="pm-input" data-text="${esc(l.id)}" maxlength="200" value="${esc(l.text)}" aria-label="${esc(kindWord(l))}" /></span>${btn('bdPosKeep', I.ok, 'Keep this line', 'primary', ` data-id="${esc(l.id)}"`)}${btn('bdPosLeave', I.x, 'Leave this line', 'outline', ` data-id="${esc(l.id)}"`)}</div>`;
|
|
42
|
+
const rows = [...kept.map((l) => ({ l, html: keptRow(l) })), ...fresh.map((l) => ({ l, html: draftRow(l) }))];
|
|
43
|
+
const first = rows.findIndex((r) => r.l.kind === 'positioning');
|
|
44
|
+
const lead = first >= 0 ? rows[first] : rows[0];
|
|
45
|
+
const rest = rows.filter((r) => r !== lead);
|
|
46
|
+
const shown = state.open ? [lead, ...rest].filter(Boolean) : (lead ? [lead] : []);
|
|
47
|
+
const fold = rest.length ? `<button type="button" class="pm-fold" id="bdPosMore" aria-expanded="${!!state.open}">${SV(I.chev)}${rest.length} key message${rest.length === 1 ? '' : 's'}</button>` : '';
|
|
37
48
|
const note = fresh.length && d.by === 'template' ? '<p class="pm-meta">Put together from the strategy word for word, without AI. Edit before you keep.</p>' : '';
|
|
38
|
-
return `<div aria-label="Positioning">${head}${
|
|
49
|
+
return `<div aria-label="Positioning">${head}${note}${shown.length ? `<div role="list">${shown.map((r) => r.html).join('')}</div>` : ''}${fold}</div>`;
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
/** Draw the part into `host` and wire its presses. */
|
|
@@ -46,7 +57,7 @@ export async function mount(host, opts = {}) {
|
|
|
46
57
|
const get = async () => { try { return await (await fetch(API + q, { credentials: 'same-origin' })).json(); } catch { return null; } };
|
|
47
58
|
const r = await get();
|
|
48
59
|
if (!r || !r.ok || !r.complete) { host.hidden = true; host.innerHTML = ''; return; } // an extra: no strategy, no part
|
|
49
|
-
const S = { kept: r.kept, draft: r.draft, busy: false, left: [] };
|
|
60
|
+
const S = { kept: r.kept, draft: r.draft, busy: false, left: [], open: host.dataset.open === '1' };
|
|
50
61
|
const draw = () => { host.hidden = false; host.innerHTML = partHtml(S); };
|
|
51
62
|
let tries = 0;
|
|
52
63
|
const poll = async () => {
|
|
@@ -75,6 +86,7 @@ export async function mount(host, opts = {}) {
|
|
|
75
86
|
const kid = res.line && res.line.id;
|
|
76
87
|
if (say) say('Line kept.', async () => { if (kid) await pmPost(API + '/drop', { ws, id: kid }).catch(() => null); S.left = S.left.filter((x) => x !== id); poll(); });
|
|
77
88
|
} else if (b.id === 'bdPosLeave') { S.left.push(id); draw(); }
|
|
89
|
+
else if (b.id === 'bdPosMore') { S.open = !S.open; host.dataset.open = S.open ? '1' : ''; draw(); }
|
|
78
90
|
else if (b.id === 'bdPosDrop') {
|
|
79
91
|
const was = S.kept.find((x) => x.id === id);
|
|
80
92
|
const res = await pmPost(API + '/drop', { ws, id }).catch(() => null);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* · Not written: one quiet line, "Strategy · not written yet", the ✦ that has PMOS draft it (bdStratDraft) and the pencil. While PMOS
|
|
8
8
|
* drafts (initiative strategy-draft: it starts by itself on a product with no strategy), "drafting from this product's files…".
|
|
9
9
|
* · A line PMOS drafted shows ✦ and, under it, the files it came from. One Undo in the head (bdStratUndo) takes every drafted line back;
|
|
10
|
-
* editing a line makes it the PM's. The inputs carry neutral hints, never an example product's strategy.
|
|
10
|
+
* editing a line makes it the PM's. ✦ beside it (bdStratRedraft) takes PMOS's lines back and drafts them again from the whole product. The inputs carry neutral hints, never an example product's strategy.
|
|
11
11
|
* · Written: the five lines. Once all five are written, new work that does not fit folds under one line, "2 don't fit", that opens
|
|
12
12
|
* them, each with why. A note informs only; nothing is moved or blocked. No note, no line (zero is silence).
|
|
13
13
|
* · The pencil turns the lines into inputs; the tick (or Enter) saves, Esc puts them back. A save offers Undo in the Board's toast.
|
|
@@ -45,7 +45,7 @@ export function cardHtml(state) {
|
|
|
45
45
|
const drafted = (card && card.drafted) || {}, src = state.sources || {};
|
|
46
46
|
const from = (k) => (src[k] && src[k].length ? `<span class="pm-meta" style="display:block">From ${src[k].map((x) => esc(x.title)).join(' · ')}</span>` : '');
|
|
47
47
|
const rows = FIELDS.map((k) => `<dt>${esc(LABELS[k])}</dt><dd${drafted[k] ? ' data-drafted="1"' : ''}>${String(card[k] || '').trim() ? (drafted[k] ? `<span aria-label="Drafted by PMOS" title="Drafted by PMOS">✦</span> ` : '') + esc(card[k]) + (drafted[k] ? from(k) : '') : '<span class="pm-meta">Not written</span>'}</dd>`).join('');
|
|
48
|
-
const undo = Object.keys(drafted).length ? btn('bdStratUndo', I.undo, "Undo PMOS's draft", 'outline') : '';
|
|
48
|
+
const undo = Object.keys(drafted).length ? btn('bdStratRedraft', I.spark, "Draft again from the whole product's files", 'outline') + btn('bdStratUndo', I.undo, "Undo PMOS's draft", 'outline') : '';
|
|
49
49
|
const n = Array.isArray(notes) ? notes.length : 0;
|
|
50
50
|
const fold = n ? `<button type="button" class="pm-fold" id="bdStratFits" aria-expanded="${!!open}">${SV(I.chev)}${esc(fitsLine(n))}</button>`
|
|
51
51
|
+ (open ? `<div role="list">${notes.map((x) => `<div class="pm-li" role="listitem" data-ini="${esc(x.id)}"><span class="txt"><span class="t">${esc(x.title)}</span><span class="w">Doesn't fit the strategy because it ${esc(x.why)}</span></span></div>`).join('')}</div>` : '')
|
|
@@ -102,6 +102,13 @@ export async function mount(host, opts = {}) {
|
|
|
102
102
|
host.dataset.polls = ''; mount(host, opts);
|
|
103
103
|
}).catch(() => { S.drafting = false; draw(); });
|
|
104
104
|
}
|
|
105
|
+
else if (b.id === 'bdStratRedraft') {
|
|
106
|
+
// take PMOS's lines back, then draft again; the PM's own lines stay
|
|
107
|
+
pmPost('/api/strategy-card', { ws, undo: true }).then((x) => {
|
|
108
|
+
if (!x || !x.ok) { if (say) say((x && x.error) || 'The strategy was not drafted again.'); return null; }
|
|
109
|
+
return pmPost('/api/strategy-card/draft', { ws });
|
|
110
|
+
}).then((x) => { if (x && !x.drafting && say) say('PMOS could not draft: ' + (x.error || x.why || 'no run started') + '.'); host.dataset.polls = ''; mount(host, opts); }).catch(() => null);
|
|
111
|
+
}
|
|
105
112
|
else if (b.id === 'bdStratUndo') {
|
|
106
113
|
pmPost('/api/strategy-card', { ws, undo: true }).then((x) => {
|
|
107
114
|
if (!x || !x.ok) { if (say) say((x && x.error) || 'The draft was not taken back.'); return; }
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* pm/grill-words.js — the words and marks every page uses for Claude's checks (Grill and Forecast screens; canvas GrillResult, GrillLenses,
|
|
2
2
|
* FcIntel, FcPhone). Pure: Node can import it.
|
|
3
3
|
*
|
|
4
|
-
* ANGLE { [angle]: { label, icon (a 24-unit path) } }: premortem · redteam · voices · reframe · scope · whatif · decision · past
|
|
4
|
+
* ANGLE { [angle]: { label, icon (a 24-unit path) } }: premortem · redteam · voices · reframe · scope · whatif · decision · past · reader
|
|
5
|
+
* (reader: a report reader's question, lib/report-readers.js; labelled by its reader, "CFO asks")
|
|
5
6
|
* findingOf(p) a grill proposal (lib/grill.js finding) → { angle, label, icon, title, why, next, simulated }
|
|
6
7
|
* the title and why without the angle prefix and the "Next:" tail lib/grill.js writes into them
|
|
7
8
|
* whenWord(iso, now) 'overnight' · 'today' · 'yesterday' · 'on Oct 30'
|
|
@@ -20,6 +21,7 @@ export const ANGLE = Object.freeze({
|
|
|
20
21
|
whatif: { label: 'What-if', icon: 'M4 18c4 0 4-12 8-12s4 12 8 12M4 12c4 0 4-6 8-6' },
|
|
21
22
|
decision: { label: 'Earlier decision', icon: 'M6 3h9l3 3v15H6zM9 9h6M9 13h6M9 17h3' },
|
|
22
23
|
past: { label: 'You decided this before', icon: 'M3 12a9 9 0 1 0 3-6.7M3 4v4h4M12 7v5l3 2' },
|
|
24
|
+
reader: { label: 'A reader asks', icon: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8M4 21c1-4 4-6 8-6s7 2 8 6' },
|
|
23
25
|
});
|
|
24
26
|
const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
25
27
|
|
|
@@ -31,7 +33,9 @@ export function findingOf(p) {
|
|
|
31
33
|
const next = String(d.next || '');
|
|
32
34
|
let why = String((p && p.why) || '');
|
|
33
35
|
if (next && why.endsWith(' Next: ' + next)) why = why.slice(0, -(' Next: ' + next).length);
|
|
34
|
-
|
|
36
|
+
const ASKS = { cfo: 'CFO asks', engineer: 'Engineer asks', sceptic: 'Sceptic asks' };
|
|
37
|
+
const label = angle === 'reader' && ASKS[d.reader] ? ASKS[d.reader] : A.label;
|
|
38
|
+
return { angle, label, icon: A.icon, title: title || label, why, next, simulated: d.simulated || '' };
|
|
35
39
|
}
|
|
36
40
|
const dayKey = (t) => { const d = new Date(t); return d.getFullYear() * 400 + d.getMonth() * 32 + d.getDate(); };
|
|
37
41
|
export function whenWord(iso, now = Date.now()) {
|
|
@@ -17,8 +17,8 @@ export const RO = !!PACK;
|
|
|
17
17
|
|
|
18
18
|
/** What a reader can do. Each is a selector; a press inside a match is let through. */
|
|
19
19
|
export const VIEW_CONTROLS = [
|
|
20
|
-
// the Timeline: the span, the legend behind (i), a column's sort, back to today, the Deliveries lane, the folds, an initiative's name (opens its viewer)
|
|
21
|
-
'#bdLgdBtn', '.tg-chd', '.tg-tback', '.dl-fb', '.dl-dn', '.dl-e[aria-label*="press to open"]', '.bd-fold', '.bd-prdb', 'label.tg-n', 'button.tg-n.ini2',
|
|
20
|
+
// the Timeline: the span, the legend behind (i), a column's sort, back to today, the edge tab that scrolls to a bar off the view, the Deliveries lane, the folds, an initiative's name (opens its viewer)
|
|
21
|
+
'#bdLgdBtn', '.tg-chd', '.tg-tback', '.tg-edge', '.dl-fb', '.dl-dn', '.dl-e[aria-label*="press to open"]', '.bd-fold', '.bd-prdb', 'label.tg-n', 'button.tg-n.ini2',
|
|
22
22
|
// the stage track: the switch between it and the Timeline (the two views a publisher shares), an initiative's name, the Monitor and Evaluate fold
|
|
23
23
|
// (UI grill U2: they live in the View chip with the span, and the menu draws only these two for a reader)
|
|
24
24
|
'#bdView', '#bdViewMenu [data-pv="track"]', '#bdViewMenu [data-pv="time"]', '#bdViewMenu [data-spick]', 'button.bt-nm', '#fold',
|
package/workspace/server.js
CHANGED
|
@@ -2939,6 +2939,9 @@ const reportDesignTick = () => {
|
|
|
2939
2939
|
try { m.sweep(reportDesignCtx()); } catch (e) { warnWriteFail('report design tick', e); }
|
|
2940
2940
|
};
|
|
2941
2941
|
try { require('./lib/routes-report-design.js').attach(reportDesignCtx); } catch { /* a checkout without the module still starts */ }
|
|
2942
|
+
// report-reader-review: every report draft this process writes is read once as the CFO, the engineer and the sceptic; their questions go under the
|
|
2943
|
+
// ✦ of the initiatives the report covers (lib/report-readers.js, through lib/ai-guard.js). The read runs through spawnScheduled (the capacity governor).
|
|
2944
|
+
try { require('./lib/report-readers.js').attach(() => ({ ...reportDesignCtx(), stateDirFor })); } catch { /* a checkout without the module still starts */ }
|
|
2942
2945
|
// report-structure: the structure jobs, the source checks (interactive sessions started like Work's approved steps, STEP_FLAGS) and the draft gate.
|
|
2943
2946
|
// The tick collects check answers and starts the drafts that waited for a failing source (4 hours, then without it).
|
|
2944
2947
|
// agent-orchestrator: the checks of a draft the schedule tick fired, and the tick's retries of them, use spawnScheduled (the capacity governor). A press uses spawnSession.
|
|
@@ -8,7 +8,7 @@ output:
|
|
|
8
8
|
- Strategy
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
/strategy-draft — draft the FIVE-LINE STRATEGY of THIS product from its own files. Each line is short, plain and true to what the product's files already say. The PM edits or undoes each line on the Strategy card. Work only from what you can read here.
|
|
11
|
+
/strategy-draft — draft the FIVE-LINE STRATEGY of THIS product from its own files. The strategy is about the WHOLE PRODUCT: who the product serves, the problem it exists to fix, its bet and its edge. It is not the scope of any one initiative, feature or release. Each line is short, plain and true to what the product's files already say. The PM edits or undoes each line on the Strategy card. Work only from what you can read here.
|
|
12
12
|
|
|
13
13
|
The five lines and their keys:
|
|
14
14
|
- `for` — Who it is for: the people the product serves, as its files name them.
|
|
@@ -17,15 +17,18 @@ The five lines and their keys:
|
|
|
17
17
|
- `win` — How we win: why this product wins over the other ways people solve the problem.
|
|
18
18
|
- `wont` — What we won't do: what the product leaves out on purpose, as its files show (out-of-scope lists, non-goals, parked or killed work).
|
|
19
19
|
|
|
20
|
+
Product, not feature. A line that names one feature, one release, one screen, one technical mechanism (a paywall rule, a flag, a URL) or a number from one initiative is feature scope: lift it to what it says about the product, or leave the line out. Test each line: would it still be true after this quarter's initiatives are done? If not, it is not strategy.
|
|
21
|
+
|
|
20
22
|
Rules that always hold:
|
|
21
23
|
1. ONE KIND OF WRITE. Your only write is `pmos strategy draft` (step 3), once per line. Write no file. Send, post or share nothing.
|
|
22
24
|
2. CITED. Every line cites 1 to 5 sources it came from: file paths that `pmos strategy sources` lists (or another file of this product), or a tracker key (ABC-123). Cite the files that say it, not the files near it.
|
|
23
25
|
3. NOTHING INVENTED. Never invent customers, numbers, dates, competitors or features the files do not name. If the files do not show a line, leave that line blank: four true lines are correct, five guessed ones are not.
|
|
24
26
|
4. SHORT. One line each, at most 160 characters, in the product's own words. No marketing tone.
|
|
25
|
-
5.
|
|
27
|
+
5. WIDE SOURCES. A line cites a product-level file (README or product doc, goals, brief, out-of-scope, research, decisions), or work from 2 or more different initiatives. `pmos strategy draft` refuses a line whose sources are all one initiative's files.
|
|
28
|
+
6. NEVER OVER THE PM. `pmos strategy draft` refuses a line that is already written. Leave it.
|
|
26
29
|
|
|
27
30
|
Procedure:
|
|
28
31
|
1. Run `pmos strategy show` for the lines already written, and `pmos strategy sources` for the product's files you may cite.
|
|
29
|
-
2. Read the files
|
|
32
|
+
2. Read the whole-product files first (`pmos strategy sources` lists them first): the README or product doc, the goals, briefs, the out-of-scope list, research and decisions. Then skim the initiatives as EVIDENCE: what do several of them have in common about who the product serves and what it bets on? One initiative's details are never a strategy line on their own.
|
|
30
33
|
3. For each blank line you can support, run once: `pmos strategy draft --line <key> --text "<the line>" --source <ref> [--source <ref>]`. A refused draft says why: fix it or leave the line out.
|
|
31
34
|
4. End with one line: which lines you drafted, and which you left blank and why.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "PMOS reads each report draft as the CFO, the engineer and the sceptic and files their questions under the initiative's ✦ (initiative report-reader-review, bet A110 on the A330 critic): lib/report-readers.js on report-draft.js onDraftWritten, through lib/ai-guard.js; Settings critic.reports. Backend only.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"report-readers.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"report-readers.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|