create-pmos 0.788.0 → 0.790.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.
Files changed (40) hide show
  1. package/package.json +44 -46
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/design-system/ui/components/bundle.css +1 -1
  4. package/payload/planning/evals/eval-calibration.md +1 -1
  5. package/payload/planning/okrs/health-budgets.md +1 -1
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/changelog.json +43 -10
  8. package/workspace/design-system/ui/components/bundle.css +1 -1
  9. package/workspace/guide/cli.md +4 -0
  10. package/workspace/guide/layout.md +11 -3
  11. package/workspace/lib/board-premium.js +1 -0
  12. package/workspace/lib/initiative-cli.js +41 -4
  13. package/workspace/lib/initiative-writer.js +31 -1
  14. package/workspace/lib/route-modules.js +1 -0
  15. package/workspace/lib/routes-boards.js +2 -0
  16. package/workspace/lib/routes-proposals.js +1 -1
  17. package/workspace/lib/routes-status-line.js +51 -0
  18. package/workspace/lib/status-line.js +165 -0
  19. package/workspace/package-lock.json +2 -2
  20. package/workspace/package.json +1 -1
  21. package/workspace/premium-viewer-download-test.js +1 -1
  22. package/workspace/premium-vw-copy-test.js +2 -0
  23. package/workspace/public/pm/bd-views.js +7 -2
  24. package/workspace/public/pm/cozy-board.css +7 -0
  25. package/workspace/public/pm/cozy-pop-work.css +8 -0
  26. package/workspace/public/pm/cozy-pop-work.js +53 -2
  27. package/workspace/public/pm/home-data.js +2 -1
  28. package/workspace/public/pm/komorebi.css +1 -1
  29. package/workspace/public/pm/pop-work-model.js +2 -1
  30. package/workspace/public/pm/premium-vw-copies.js +17 -10
  31. package/workspace/public/pm/premium-vw-copy.css +7 -0
  32. package/workspace/public/pm/premium-vw-doc.css +13 -1
  33. package/workspace/public/pm/premium-vw-doc.js +1 -1
  34. package/workspace/public/pm/premium-vw-file.js +21 -9
  35. package/workspace/public/pm/premium-vw-guide.css +2 -1
  36. package/workspace/public/pm/premium-vw-guide.js +1 -1
  37. package/workspace/public/pm/premium-vw-notepad.css +1 -1
  38. package/workspace/public/premium-board.html +1 -1
  39. package/workspace/public/premium-library.html +1 -1
  40. package/workspace/test-lists/status-line.json +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.788.0",
3
+ "version": "0.790.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": {
@@ -34,24 +34,57 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.788.0",
38
- "at": "2026-11-24T18:07:52.786Z",
37
+ "v": "0.790.0",
38
+ "at": "2026-11-24T18:34:00.454Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
42
- "n": 1783,
43
- "t": "Stuck work gets one prepared next step under the ✦",
44
- "s": "Stuck work gets one prepared next step under the ✦",
45
- "k": "new",
42
+ "n": 1797,
43
+ "t": "Copies, shared links and the notepad read in the Reading layout; Work and Library on pm-layout-open (A334)",
44
+ "s": "Copies, shared links and the notepad read in the Reading layout; Work and Library on pm-layout-open (A334)",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.789.0",
51
+ "at": "2026-11-24T18:21:37.096Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1801,
56
+ "t": "Scope cuts S2, S6, S7 checks",
57
+ "s": "Scope cuts S2, S6, S7 checks",
58
+ "k": "x",
59
+ "h": "Scope cuts S2, S6, S7 checks",
46
60
  "try": {
47
61
  "steps": [
48
- "On Work, open an initiative that has a task In progress with no change for two weeks",
49
- "Press its ✦ and find Stuck",
50
- "Press ✓ on the prepared step, then Undo on the toast"
62
+ "Open Work and open an initiative whose end date is still ahead but whose tasks run past it",
63
+ "Press its ✦ and find Cut to keep the date",
64
+ "Keep it, then press Undo"
51
65
  ],
52
- "see": "Stuck lists the task with one step: a drafted note to its owner, or park it. ✓ parks the task (or puts the note in the Outbox, unsent); Undo puts it back",
66
+ "see": "The ✦ lists the tasks that finish after the date, each with its forecast and the new dates after the date; Keep moves them and adds a note, and Undo puts them back",
53
67
  "open": "/premium-board.html"
54
68
  }
69
+ },
70
+ {
71
+ "n": 1791,
72
+ "t": "Status in one line, 12 words at most, the full text kept in the log (status-line, job #1775)",
73
+ "s": "Status in one line, 12 words at most, the full text kept in the log (status-line, job #1775)",
74
+ "k": "new"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "v": "0.788.0",
80
+ "at": "2026-11-24T18:07:52.786Z",
81
+ "f": 4,
82
+ "prs": [
83
+ {
84
+ "n": 1783,
85
+ "t": "Stuck work gets one prepared next step under the ✦",
86
+ "s": "Stuck work gets one prepared next step under the ✦",
87
+ "k": "new"
55
88
  }
56
89
  ]
57
90
  },
@@ -430,41 +463,6 @@
430
463
  "k": "fix"
431
464
  }
432
465
  ]
433
- },
434
- {
435
- "v": "0.770.0",
436
- "at": "2026-11-24T09:01:51.310Z",
437
- "f": 4,
438
- "prs": [
439
- {
440
- "n": 1733,
441
- "t": "Keep try steps when a PR Story has no Title line",
442
- "s": "Keep try steps when a PR Story has no Title line",
443
- "k": "fix"
444
- }
445
- ]
446
- },
447
- {
448
- "v": "0.769.0",
449
- "at": "2026-11-24T08:04:34.713Z",
450
- "f": 4,
451
- "prs": [
452
- {
453
- "n": 1729,
454
- "t": "The task detail is one column, with its fields as chips",
455
- "s": "The task detail is one column, with its fields as chips",
456
- "k": "new",
457
- "try": {
458
- "steps": [
459
- "Open any initiative and press one of its tasks",
460
- "Under the title, press the Status chip and pick In progress, then pick a day",
461
- "Write a comment at the bottom of Activity and press Send"
462
- ],
463
- "see": "One column: the title, one row of chips (only the fields that have a value, and +), then Where it stands, Description, Subtasks, Linked and Activity. The status changes with Undo; the comment shows…",
464
- "open": "/pm/"
465
- }
466
- }
467
- ]
468
466
  }
469
467
  ]
470
468
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@b4c98bfbb
1
+ kernel-source: pmos@d9cda7cbb
2
2
  assembled: 2026-11-24
3
3
  mode: vendor
@@ -138,7 +138,7 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
138
138
  .pm-layout-side,.pm-layout-open,.pm-layout-reading{display:grid;gap:var(--space-16);align-items:start}
139
139
  .pm-layout-side{grid-template-columns:minmax(0,1fr) var(--width-side)}
140
140
  .pm-layout-side>.pm-side,.pm-layout-reading>.pm-contents{position:sticky;top:0}
141
- .pm-layout-open{grid-template-columns:minmax(0,1fr)}
141
+ .pm-layout-open{grid-template-columns:minmax(0,1fr);align-content:start}
142
142
  .pm-layout-open:has(>.pm-item){grid-template-columns:minmax(0,1fr) var(--width-item)}
143
143
  .pm-layout-open>.pm-item,.pm-layout-popup{background:var(--card);border-radius:var(--radius-panel);box-shadow:var(--raise);padding:var(--space-24)}
144
144
  .pm-layout-popup{box-shadow:var(--lift);padding:var(--space-24) var(--space-32)}
@@ -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-24T18:07:48Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T18:33:55Z"}
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-24T18:07:48Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T18:33:55Z"}
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-24T18:07:48Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T18:33:55Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,23 +1,56 @@
1
1
  [
2
2
  {
3
- "v": "0.788.0",
4
- "at": "2026-11-24T18:07:52.786Z",
3
+ "v": "0.790.0",
4
+ "at": "2026-11-24T18:34:00.454Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
8
- "n": 1783,
9
- "t": "Stuck work gets one prepared next step under the ✦",
10
- "s": "Stuck work gets one prepared next step under the ✦",
11
- "k": "new",
8
+ "n": 1797,
9
+ "t": "Copies, shared links and the notepad read in the Reading layout; Work and Library on pm-layout-open (A334)",
10
+ "s": "Copies, shared links and the notepad read in the Reading layout; Work and Library on pm-layout-open (A334)",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.789.0",
17
+ "at": "2026-11-24T18:21:37.096Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1801,
22
+ "t": "Scope cuts S2, S6, S7 checks",
23
+ "s": "Scope cuts S2, S6, S7 checks",
24
+ "k": "x",
25
+ "h": "Scope cuts S2, S6, S7 checks",
12
26
  "try": {
13
27
  "steps": [
14
- "On Work, open an initiative that has a task In progress with no change for two weeks",
15
- "Press its ✦ and find Stuck",
16
- "Press ✓ on the prepared step, then Undo on the toast"
28
+ "Open Work and open an initiative whose end date is still ahead but whose tasks run past it",
29
+ "Press its ✦ and find Cut to keep the date",
30
+ "Keep it, then press Undo"
17
31
  ],
18
- "see": "Stuck lists the task with one step: a drafted note to its owner, or park it. ✓ parks the task (or puts the note in the Outbox, unsent); Undo puts it back",
32
+ "see": "The ✦ lists the tasks that finish after the date, each with its forecast and the new dates after the date; Keep moves them and adds a note, and Undo puts them back",
19
33
  "open": "/premium-board.html"
20
34
  }
35
+ },
36
+ {
37
+ "n": 1791,
38
+ "t": "Status in one line, 12 words at most, the full text kept in the log (status-line, job #1775)",
39
+ "s": "Status in one line, 12 words at most, the full text kept in the log (status-line, job #1775)",
40
+ "k": "new"
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "v": "0.788.0",
46
+ "at": "2026-11-24T18:07:52.786Z",
47
+ "f": 4,
48
+ "prs": [
49
+ {
50
+ "n": 1783,
51
+ "t": "Stuck work gets one prepared next step under the ✦",
52
+ "s": "Stuck work gets one prepared next step under the ✦",
53
+ "k": "new"
21
54
  }
22
55
  ]
23
56
  },
@@ -138,7 +138,7 @@ body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--font-s
138
138
  .pm-layout-side,.pm-layout-open,.pm-layout-reading{display:grid;gap:var(--space-16);align-items:start}
139
139
  .pm-layout-side{grid-template-columns:minmax(0,1fr) var(--width-side)}
140
140
  .pm-layout-side>.pm-side,.pm-layout-reading>.pm-contents{position:sticky;top:0}
141
- .pm-layout-open{grid-template-columns:minmax(0,1fr)}
141
+ .pm-layout-open{grid-template-columns:minmax(0,1fr);align-content:start}
142
142
  .pm-layout-open:has(>.pm-item){grid-template-columns:minmax(0,1fr) var(--width-item)}
143
143
  .pm-layout-open>.pm-item,.pm-layout-popup{background:var(--card);border-radius:var(--radius-panel);box-shadow:var(--raise);padding:var(--space-24)}
144
144
  .pm-layout-popup{box-shadow:var(--lift);padding:var(--space-24) var(--space-32)}
@@ -554,6 +554,10 @@ A page that keeps breaking should get fixed before it gets a new feature. This c
554
554
  | `pmos initiative export <id>` | Writes the breakdown as markdown to the terminal. |
555
555
  | `pmos initiative describe <id>` | Shows the description, and the lines PMOS can draft it from. |
556
556
  | `pmos initiative describe <id> "<text>"` | Saves the description. PMOS runs this only after your yes. |
557
+ | `pmos initiative status <id>` | Shows the status line (at most 12 words) and the log of full statuses. |
558
+ | `pmos initiative status <id> "<text>" [--line "<line>"]` | Saves a status. The full text goes to the log. The line is yours, or else the first 12 words. |
559
+ | `pmos initiative status-migrate [--apply]` | Counts the statuses longer than 12 words. With `--apply`, gives each one a line and moves the full text to the log. |
560
+ | `pmos initiative status-undo <batch>` | Undoes a `status-migrate`. A line edited since keeps its edit. |
557
561
  | `pmos initiative raised-by <id>` | Shows who raised it: you, a teammate, a customer, PMOS or the tracker. |
558
562
  | `pmos initiative raised-by <id> "<who>"` | Saves who raised it: `you`, `pmos`, `tracker`, `"teammate: <name>"` or `"customer: <name>"`. `none` removes it. |
559
563
  | `pmos initiative kind <id>` | Shows the kind of work, and for each lifecycle stage whether PMOS works it with you, watches it in Jira or hides it. |
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "Layout and first run: the places, the navigation, the Viewer, the launcher and Adler"
4
4
  description: "The places, the navigation at the left, the Viewer, the keys and the phone; the first run; when features appear; the PMOS app; and Adler."
5
- timestamp: 2026-11-25
5
+ timestamp: 2026-11-24
6
6
  ---
7
7
 
8
8
  # Layout and first run
@@ -139,10 +139,10 @@ A document opened in the Viewer (a doc, spec, brief, report, weekly update, meet
139
139
  - The title, then one line that says who drafted it (✦ when PMOS did), who checked it, for whom, the version and how long it takes to read. **Properties** opens the document's other fields.
140
140
  - **In short**: the answer and the ask, from the document's In short, Summary or TL;DR section.
141
141
  - One section for each heading. Press a heading to fold it. Each document keeps the sections you folded, the next time you open it.
142
- - **Contents** at the left lists the sections and marks the one you are reading as you scroll. Press one to go to it. Below 1100 px wide, and on a phone, there is no Contents.
142
+ - **Contents** at the left lists the sections and marks the one you are reading as you scroll. Press one to go to it. There is no Contents when the window is narrower than 1100 px, when the Viewer is narrower than 900 px, or on a phone.
143
143
  - Edit, Markdown, Health, Links, Copies, the report's Present, Print and Download, the Edit log and Proposals are where they were. An agent's edit still opens with **Keep** and **Undo all**.
144
144
 
145
- This guide's pages and a Markdown file opened from a chat read the same way; a file keeps **Download** and **Share** at the top. Other kinds move to this view one at a time. Slides, PDFs and prototypes keep the stage, and a task, ticket or event keeps the task detail.
145
+ This guide's pages and a Markdown file opened from a chat read the same way; a file keeps **Download** and **Share** at the top. A Google Doc or Confluence copy reads the same way too, with its status and **Check again**, **Use its version** or **Read again** above the title. A shared link to a Markdown file, and a printed one, read the same way: Contents at the left on a wide screen and sections that fold, with no comments and no chat. Other kinds move to this view one at a time. Slides, PDFs and prototypes keep the stage, and a task, ticket or event keeps the task detail.
146
146
 
147
147
  ### What you type is kept
148
148
 
@@ -468,6 +468,14 @@ PMOS shows the state of a piece of work as a small shape, not as a word. Each st
468
468
 
469
469
  The shape is before the title on Work, Goals and the phone rows, in the Status column of the Timeline, and at the end of a bar on the Timeline. The facts stay as words beside it, for example "29 days late" or "Commerce has it". Hold the pointer on a shape to see its word and why. A screen reader reads the same words. On a phone, press and hold a shape to open a small sheet with its word and one line of why.
470
470
 
471
+ ### Status in one line
472
+
473
+ Where a status shows (a card on Work, the top of an initiative, a row on Home and a row on the phone), you see the state shape, the stage, and one line of at most 12 words. PMOS sets the stage from the work itself, so the line says only what is new.
474
+
475
+ To write a status, press the status line at the top of an initiative. A count shows how many words you have used, for example "9 of 12 words". Past 12 words, the count turns red and PMOS suggests a short line from your text. Select **Use it** to keep that line, or edit it. When you save, the whole text goes to the initiative's log with its date and author, and the short line becomes the status. Nothing is lost.
476
+
477
+ From a terminal or the chat, `pmos initiative status <id>` shows the line and the log, and `pmos initiative status <id> "<text>"` saves a status.
478
+
471
479
  ### The dot on the menu
472
480
 
473
481
  The first time a place opens, its row in the menu gets one soft blue dot, and so does the menu button. The dot goes away when you open that place. The reports dot is on the Intelligence row, because reports are in Intelligence under **⋯**.
@@ -307,6 +307,7 @@ function rowOf(r0, wf, today) {
307
307
  const over = r.end && today && days(r.end, today) > 0 && r.status !== 'done' && !r.closed;
308
308
  return {
309
309
  key: 'board:' + r.id, id: r.id, title: clip(r.title, 140), sub: [r.owner || 'No owner', r.lane].filter(Boolean).join(' · '),
310
+ line: typeof r.line === 'string' && r.line ? clip(r.line, 120) : null, // status-line (A505): one line of at most 12 words, from lib/status-line.js
310
311
  status: r.status || null, statusLabel: r.status && r.status !== 'on track' ? (STATUS_LABEL[r.status] || r.status) : null, signal: r.signal || null, bad, late: r.status === 'late', closed: !!r.closed,
311
312
  stage: r.stage || null, cat: r.cat || null, stageNote: r.stageSource === 'derived' ? 'derived' : null,
312
313
  seg: names.map((n, j) => (j < cur ? 'p' : j === cur ? 'n' : '')), progress: pctOf(r.progress),
@@ -79,11 +79,11 @@ function docNote(docs) {
79
79
  return `Not on the Roadmap · ${docs.length} on a document lane: ${names}. A document lane does not show on Today or Work. If it is work, set lane: in its record to ${WORK_LANES}.`;
80
80
  }
81
81
 
82
- const COMMANDS = { initiative: ['new', 'top', 'up', 'down', 'bottom', 'after', 'check-by', 'adopt', 'drop', 'list', 'export', 'describe', 'raised-by', 'kind', 'role'] };
82
+ const COMMANDS = { initiative: ['new', 'top', 'up', 'down', 'bottom', 'after', 'check-by', 'adopt', 'drop', 'list', 'export', 'describe', 'raised-by', 'kind', 'role', 'status', 'status-migrate', 'status-undo'] };
83
83
  /** The horizon verbs D105 retired: they answer with what to use instead. */
84
84
  const RETIRED = Object.freeze(['now', 'next', 'later']);
85
85
  const USAGE = [
86
- 'usage: pmos initiative new|top|up|down|bottom|after|check-by|adopt|drop|list|export|describe|raised-by|kind|role — initiatives on the Roadmap',
86
+ 'usage: pmos initiative new|top|up|down|bottom|after|check-by|adopt|drop|list|export|describe|raised-by|kind|role|status|status-migrate|status-undo — initiatives on the Roadmap',
87
87
  ' pmos initiative new "<title>" --lane <lane> --anchor <KR|health:id> [--intent "<text>"] [--id <id>] [--kind product|sdlc|project] [--raised-by "<who>"]',
88
88
  ' pmos initiative new --from capture-YYYY-MM-DD-<n> [--anchor <anchor>] [--lane <lane>] [--title "<title>"]',
89
89
  ' pmos initiative top|up|down|bottom <id> reorder it on the Roadmap',
@@ -97,14 +97,17 @@ const USAGE = [
97
97
  ' pmos initiative raised-by <id> ["<who>"|none] who raised it; with a value, save it: you, pmos, tracker, "teammate: <name>", "customer: <name>"',
98
98
  ' pmos initiative kind <id> [product|project|sdlc] its kind and what each stage shows; with a kind, change it',
99
99
  ' pmos initiative role [product|project|sdlc] the kind new work starts as; with a kind, change it',
100
+ ' pmos initiative status <id> ["<text>"] [--line "<12 words>"] its status line and log; with text, save it: the whole text to the log, the line (yours, else its first 12 words) to the record',
101
+ ' pmos initiative status-migrate [--apply] every status over 12 words: count them (dry run), or with --apply give each its line and move the whole text to the log',
102
+ ' pmos initiative status-undo <batch> undo a status-migrate: each line not edited since gets its whole text back',
100
103
  ' --lane is a work lane of this repository: new-feature, improvement, bug-fix, discovery or chore in a product repository',
101
104
  ' (scripts/lane-defs.js; the PMOS repository itself uses feature, discovery, chore, incident, content and prototype)',
102
105
  ' every command: [--json] [--root <dir>]',
103
106
  'An agent session\'s move applies at once and names the agent. A new initiative lands at the end of the Roadmap.',
104
107
  'Now, Next and Later are retired (D105): the rank says what comes first, the lifecycle stage says where it is.',
105
108
  ];
106
- const BOOL = new Set(['json', 'top', 'help']); // --top is kept so an old script gets the retired answer, not a usage error
107
- const VALUE = new Set(['lane', 'anchor', 'intent', 'id', 'from', 'title', 'root', 'kind', 'raised-by']);
109
+ const BOOL = new Set(['json', 'top', 'help', 'apply']); // --top is kept so an old script gets the retired answer, not a usage error
110
+ const VALUE = new Set(['lane', 'anchor', 'intent', 'id', 'from', 'title', 'root', 'kind', 'raised-by', 'line']);
108
111
  const DATE_RE = /^\d{4}-\d{2}-\d{2}$/;
109
112
 
110
113
  function parse(argv) {
@@ -300,6 +303,40 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
300
303
  return done({ role: pos[0] }, `✓ New work starts as ${WK.LABEL[pos[0]]}. Settings shows it now. Each initiative can still change its own kind.`);
301
304
  }
302
305
 
306
+ if (verb === 'status' || verb === 'status-migrate' || verb === 'status-undo') {
307
+ // status-line (A505): the record's status in one line of at most 12 words; the whole text stays in the item's log
308
+ const SL = require('./status-line.js');
309
+ if (verb === 'status-migrate') {
310
+ if (pos.length) { say('usage: pmos initiative status-migrate [--apply]'); return 2; }
311
+ const r = SL.migrate(root, { apply: !!flags.apply, actor: actorLib.fromCli(who), now: now == null ? Date.now() : now });
312
+ if (json) { say(JSON.stringify(r)); return 0; }
313
+ if (!flags.apply) { say(`${r.long} of ${r.total} statuses are longer than ${SL.MAX_WORDS} words.`); for (const it of r.items.slice(0, 20)) say(` ${it.id} (${it.words} words) → ${it.line}`); if (r.items.length > 20) say(` … and ${r.items.length - 20} more`); if (r.long) say('Run it again with --apply to give each its line and move the whole text to the log.'); return 0; }
314
+ say(`✓ ${r.moved} of ${r.long} long statuses now have a line of at most ${SL.MAX_WORDS} words; the whole text of each is in its log. Undo: pmos initiative status-undo ${r.batch}`);
315
+ return 0;
316
+ }
317
+ if (verb === 'status-undo') {
318
+ if (pos.length !== 1) { say('usage: pmos initiative status-undo <batch>'); return 2; }
319
+ const r = SL.undo(root, pos[0], { actor: actorLib.fromCli(who), now: now == null ? Date.now() : now });
320
+ if (!r.ok) return fail(r.error, r.status === 400 ? 2 : 1);
321
+ return done(r, r.already ? `${pos[0]} was undone already.` : `✓ ${r.restored} statuses have their whole text back${r.kept ? `; ${r.kept} edited since keep their edit` : ''}.`);
322
+ }
323
+ const sid = pos[0];
324
+ if (!sid || pos.length > 2) { say('usage: pmos initiative status <id> ["<text>"] [--line "<12 words>"]'); return 2; }
325
+ if (pos.length === 2) {
326
+ const r = SL.set(root, sid, pos[1], { actor: actorLib.fromCli(who), line: flags.line, now: now == null ? Date.now() : now });
327
+ if (!r.ok) return fail(r.error, r.status === 400 ? 2 : 1);
328
+ return done({ id: sid, line: r.line, from: r.from }, `✓ ${sid}: the status says "${r.line}". The whole text is in its log. Work and Home show it now.`);
329
+ }
330
+ const cur = writer.readStatusLine(root, sid);
331
+ if (!cur.ok) return fail(cur.error);
332
+ const log = SL.logOf(root, sid);
333
+ if (json) { say(JSON.stringify({ ok: true, id: sid, line: SL.lineOf(cur.text), status: cur.text, log })); return 0; }
334
+ say(cur.text ? `${sid}: ${SL.lineOf(cur.text) || cur.text}` : `${sid} has no status yet.`);
335
+ if (cur.text && SL.isLong(cur.text)) say(` (the record holds ${SL.wordCount(cur.text)} words; pmos initiative status-migrate moves them to the log)`);
336
+ for (const e of log.slice(0, 10)) say(` ${String(e.at).slice(0, 10)} ${e.by}: ${e.text}`);
337
+ return 0;
338
+ }
339
+
303
340
  if (verb === 'describe') {
304
341
  // initiative-description-field: the record's own description. Read with no text; write with text, only after the PM said yes.
305
342
  const did = pos[0];
@@ -350,6 +350,36 @@ function restoreDescription(root, id, from, to, { actor } = {}) {
350
350
  return { ok: true, id };
351
351
  }
352
352
 
353
+ /** The record's status line (status-line, A505): the `status:` line of the front matter, one line of at most 12 words that the board card,
354
+ * the item header, the Home row and the phone row show. lib/status-line.js is the one caller: it keeps the whole text in the item's log
355
+ * (planning/runs/status-log.jsonl) before it calls this, so nothing is lost. `to` '' removes the line. `expect`: write only while the line
356
+ * still says this (an Undo keeps a newer edit). → { ok: true, id, from, to, same?, kept? } | refusal */
357
+ const statusLineAt = (lines) => { const at = lines.findIndex((l) => /^status:/.test(l)); return { at, val: at >= 0 ? unquote(lines[at].slice(7)) : '' }; };
358
+ function readStatusLine(root, id) {
359
+ const f = recordFile(root, id);
360
+ if (!f.ok) return f;
361
+ const fm = frontOfText(fs.readFileSync(f.file, 'utf8'));
362
+ if (!fm) return refuse(409, `the record of ${id} has no front matter`, 'id');
363
+ return { ok: true, id, text: statusLineAt(fm[1].split(/\r?\n/)).val };
364
+ }
365
+ function setStatusLine(root, id, to0, { actor, expect } = {}) {
366
+ if (!actorLib.valid(actor)) return refuse(500, 'initiative-writer: the caller must pass the actor from pm-guard.js or actor.js');
367
+ const to = typeof to0 === 'string' ? to0.replace(/\s+/g, ' ').trim() : '';
368
+ const f = recordFile(root, id);
369
+ if (!f.ok) return f;
370
+ const text = fs.readFileSync(f.file, 'utf8');
371
+ const fm = frontOfText(text);
372
+ if (!fm) return refuse(409, `the record of ${id} has no front matter — nothing was saved`, 'id');
373
+ const lines = fm[1].split(/\r?\n/);
374
+ const { at, val: from } = statusLineAt(lines);
375
+ if (at >= 0 && /^[>|]/.test(from)) return refuse(409, `the status of ${id} is a block of lines — edit the record by hand`, 'id');
376
+ if (expect !== undefined && from !== String(expect)) return { ok: true, id, from, to: from, kept: true };
377
+ if (from === to) return { ok: true, id, from, to, same: true };
378
+ if (!to) { if (at >= 0) lines.splice(at, 1); } else if (at >= 0) lines[at] = 'status: ' + q(to); else lines.push('status: ' + q(to));
379
+ try { fs.writeFileSync(f.file, '---\n' + lines.join('\n') + '\n---' + fm[2] + text.slice(fm[0].length), { flag: 'w' }); } catch { return refuse(500, 'the record could not be written — nothing was saved'); }
380
+ return { ok: true, id, from, to };
381
+ }
382
+
353
383
  /** Who raised it (who-raised-each-idea, bet A445): only the `raised_by:` line changes, added at the end of the front matter when there is
354
384
  * none; `none` (or '') removes it, and the row then reads its origin from the Roadmap's created line again (lib/initiative-origin.js).
355
385
  * → { ok: true, id, from, to } where from and to are the line's values ('' for no line), or a refusal (400 for a value parse refuses). */
@@ -417,4 +447,4 @@ function withdrawSplit(root, id, want, { actor } = {}) {
417
447
  return { ok: true, removed: true };
418
448
  }
419
449
 
420
- module.exports = { setKind, readKind, setRaisedBy, setDescription, restoreDescription, DESC_MAX, setOutcome, restoreOutcome, createInitiative, renameInitiative, setAnchor, restoreAnchor, withdrawSplit, recordSha, slugOf, ID_RE, INPUT_KEYS };
450
+ module.exports = { setStatusLine, readStatusLine, setKind, readKind, setRaisedBy, setDescription, restoreDescription, DESC_MAX, setOutcome, restoreOutcome, createInitiative, renameInitiative, setAnchor, restoreAnchor, withdrawSplit, recordSha, slugOf, ID_RE, INPUT_KEYS };
@@ -121,6 +121,7 @@ const MODULES = Object.freeze([
121
121
  'routes-artefacts', // R18 (D107): the seven artefacts, read-only, and the lossless carry of the older records (artefacts.jsonl)
122
122
  'routes-core-docs', // core-documents: the core documents of each level, Draft it (a core-doc run), Issue it and Drop (core-docs.jsonl)
123
123
  'routes-backlog', // work-backlog: every open task of a product in one list (No home, Jira epic), and PMOS taking tasks itself through the day run (gives.jsonl; page-press POST)
124
+ 'routes-status-line', // status-line (A505): an initiative's status in one line of at most 12 words, its log, and PMOS's short line (status-log.jsonl; page-press POST)
124
125
  'routes-pop-work', // popup-work-contents (slice 3): the summary of an initiative changed or confirmed in place (initiative-writer setDescription; page-press POST)
125
126
  'routes-custom-docs', // briefing-premium-adddoc: the documents the PM adds beyond the core set, Add a document (custom-docs.jsonl)
126
127
  'routes-library', // library-place (slice 7 of the six-place navigation): GET /api/library-items, what was made, every product (read only)
@@ -100,6 +100,7 @@ const writer = require('./initiative-writer.js');
100
100
  const itemSpans = require('./item-spans.js');
101
101
  const jiraStatus = require('./jira-status.js');
102
102
  const SS = require('./status-signal.js');
103
+ const SLINE = require('./status-line.js'); // status-line (A505)
103
104
  const jiraOf = (root, id) => { try { return jiraStatus.readSnapshot(root, id); } catch { return null; } };
104
105
  const routesInit = require('./routes-initiatives.js');
105
106
  const jiraTickets = require('./jira-tickets.js');
@@ -480,6 +481,7 @@ function baseRowsRead(w) {
480
481
  status: statusOf(rec, r.health, end, day, jiraOf(w.root, id), verdicts.get(id)),
481
482
  statusIn: statusIn(rec, r.health, end, day, jiraOf(w.root, id), verdicts.get(id)),
482
483
  outcome: verdicts.get(id) || null,
484
+ line: SLINE.lineOf(fm.status) || null, // status-line (A505): the record's status in one line of at most 12 words; the whole text is in its log
483
485
  health: r.health ? r.health.level : null,
484
486
  start: span ? span.start || null : null, end,
485
487
  progress: r.progress && r.progress.total ? Math.round((r.progress.done / r.progress.total) * 100) / 100 : null, // a fraction 0..1, as the PRD row reads
@@ -683,7 +683,7 @@ const WRITES = {
683
683
 
684
684
  module.exports = {
685
685
  prefixes: ['/api/proposals'],
686
- viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf, keepDefault, keepText, logSharedHold,
686
+ viewFor, saidOf, prdRename, limitOf, applyOne, keepCore, undoCore, autoKeep, heldOf, keepDefault, keepText, logSharedHold,
687
687
  handle: async (req, res, url, ctx) => {
688
688
  const p0 = url.pathname;
689
689
  if (req.method === 'GET') {
@@ -0,0 +1,51 @@
1
+ 'use strict';
2
+ /* routes-status-line.js — an initiative's status in one line, read and written from the item's popup (status-line, idea A505; board
3
+ * StatusLineDS: "When you write a status").
4
+ *
5
+ * GET /api/initiative/status?ws&id → { ok, id, line, words, long, log: [{ at, by, text, line }] }
6
+ * POST /api/initiative/status { ws, id, text, line? } → { ok, id, line, from } the whole text to the log, the line to the record
7
+ * POST /api/initiative/status-suggest { ws, id, text } → { ok, line, made } PMOS's short line for a text past 12 words
8
+ *
9
+ * The store is lib/status-line.js, the same as `pmos initiative status`, so a chat write and a page write land in one place. The POSTs pass
10
+ * pm-guard requirePagePress: the launch nonce and the page's origin, so an agent session cannot write here (it uses `pmos`). */
11
+ const guard = require('./pm-guard.js');
12
+ const W = require('./initiative-writer.js');
13
+ const SL = require('./status-line.js');
14
+
15
+ const text = (v) => (typeof v === 'string' ? v : '');
16
+ const bad = (status, error) => ({ status, body: { ok: false, error } });
17
+
18
+ async function handle(req, res, url, ctx) {
19
+ const send = (r) => { ctx.json(res, r.body, r.status); return true; };
20
+ const sub = url.pathname.replace(/^\/api\/initiative\/?/, '');
21
+ if (sub !== 'status' && sub !== 'status-suggest') return send(bad(404, 'no such route'));
22
+ if (sub === 'status' && req.method === 'GET') {
23
+ const id = url.searchParams.get('id') || '';
24
+ if (!W.ID_RE.test(id)) return send(bad(400, 'id must name an initiative'));
25
+ const w = ctx.getWs(url.searchParams.get('ws') || null);
26
+ if (!w) return send(bad(404, 'no such workspace'));
27
+ const cur = W.readStatusLine(w.root, id);
28
+ if (!cur.ok) return send(bad(cur.status || 404, cur.error));
29
+ return send({ status: 200, body: { ok: true, id, line: SL.lineOf(cur.text), words: SL.wordCount(cur.text), long: SL.isLong(cur.text), log: SL.logOf(w.root, id).slice(0, 20) } });
30
+ }
31
+ if (req.method !== 'POST') return send(bad(405, 'POST only'));
32
+ const read = await ctx.readJson(req);
33
+ if (!read.ok || !read.body || typeof read.body !== 'object') return send(bad(400, 'the body must be a JSON object'));
34
+ const body = read.body;
35
+ const g = guard.requirePagePress(req, body);
36
+ if (!g.ok) return send(bad(g.status, g.error));
37
+ const id = text(body.id);
38
+ if (!id || !W.ID_RE.test(id)) return send(bad(400, 'id must name an initiative'));
39
+ const w = ctx.getWs(text(body.ws) || null);
40
+ if (!w || (body.ws && w.id !== body.ws)) return send(bad(404, 'no such workspace'));
41
+ if (sub === 'status-suggest') {
42
+ const s = await SL.suggest(ctx, text(body.text));
43
+ return send({ status: 200, body: { ok: true, line: s.line, made: s.made } });
44
+ }
45
+ const r = SL.set(w.root, id, text(body.text), { actor: g.actor, line: text(body.line) || undefined });
46
+ if (!r.ok) return send(bad(r.status || 400, r.error || 'nothing was saved'));
47
+ try { if (ctx.invalidateNeedsAgg) ctx.invalidateNeedsAgg(w.id); } catch { /* the next read catches up */ }
48
+ return send({ status: 200, body: { ok: true, id, line: r.line, from: r.from || '' } });
49
+ }
50
+
51
+ module.exports = { prefixes: ['/api/initiative/status-suggest', '/api/initiative/status'], handle };