create-pmos 0.825.0 → 0.826.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 (35) hide show
  1. package/package.json +88 -30
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/changelog.json +87 -16
  7. package/workspace/guide/agent-capabilities.md +1 -0
  8. package/workspace/guide/cli.md +23 -0
  9. package/workspace/guide/home.md +1 -0
  10. package/workspace/guide/layout.md +1 -1
  11. package/workspace/guide/settings-and-switches.md +2 -0
  12. package/workspace/lib/code-map-cli.js +100 -0
  13. package/workspace/lib/code-map.js +247 -0
  14. package/workspace/lib/features.json +58 -1
  15. package/workspace/lib/pmos-verbs.js +3 -0
  16. package/workspace/lib/route-modules.js +1 -0
  17. package/workspace/lib/routes-code-map.js +66 -0
  18. package/workspace/lib/routes-today.js +2 -1
  19. package/workspace/lib/today-cli.js +4 -2
  20. package/workspace/lib/today-order.js +120 -0
  21. package/workspace/package-lock.json +2 -2
  22. package/workspace/package.json +1 -1
  23. package/workspace/public/pm/code-map.js +60 -0
  24. package/workspace/public/pm/cozy-board.css +8 -0
  25. package/workspace/public/pm/cozy-settings.js +0 -1
  26. package/workspace/public/pm/cozy-today-app.js +41 -2
  27. package/workspace/public/pm/cozy-today-page.css +3 -0
  28. package/workspace/public/pm/cozy-today-view.js +20 -5
  29. package/workspace/public/pm/pop-cap.js +5 -2
  30. package/workspace/public/pm/premium-board.js +2 -0
  31. package/workspace/public/pm/today-order.js +88 -0
  32. package/workspace/public/premium-board.html +2 -0
  33. package/workspace/test-lists/code-map.json +9 -0
  34. package/workspace/test-lists/directory-all-verbs.json +9 -0
  35. package/workspace/test-lists/today-order.json +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.825.0",
3
+ "version": "0.826.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,31 +34,103 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.825.0",
38
- "at": "2026-11-25T10:33:55.582Z",
37
+ "v": "0.826.0",
38
+ "at": "2026-11-25T11:36:40.845Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
42
- "n": 1939,
43
- "t": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
44
- "s": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
42
+ "n": 1973,
43
+ "t": "What PMOS can do lists every pmos verb (A540)",
44
+ "s": "What PMOS can do lists every pmos verb (A540)",
45
45
  "k": "new",
46
- "i": "does-alone",
46
+ "i": "directory-all-verbs",
47
47
  "try": {
48
48
  "steps": [
49
- "Open Today, then Settings (the gear) › How PMOS decides › What PMOS does alone.",
50
- "Read the rows: each kind of change says what PMOS does and since when.",
51
- "Press the arrow on Task names, then open Work and check a task name PMOS changed still has Undo."
49
+ "On Today, open the menu and press What PMOS can do.",
50
+ "Type pick in Find a feature, then press /pick to put it in the chat box.",
51
+ "On Work, type / in the chat and find /line in the list."
52
52
  ],
53
- "see": "One table: each kind of change says Does it, Undo or Asks you and since when, the always-ask rows have no button, and D106 opens the guide.",
53
+ "see": "Every pmos command PMOS has is listed with one plain line; /pick and /line put the command in the chat box.",
54
54
  "open": "/today.html"
55
55
  }
56
56
  },
57
+ {
58
+ "n": 1944,
59
+ "t": "A map of the product's code on Work, one box per main part (job #1900, A176)",
60
+ "s": "A map of the product's code on Work, one box per main part (job #1900, A176)",
61
+ "k": "new",
62
+ "h": "A map of the product's code on Work, one box per main part (job #1900, A176)",
63
+ "try": {
64
+ "steps": [
65
+ "Open Work and pick one product",
66
+ "Under the strategy, read the Code map: one box per main part",
67
+ "Ask the chat: say the api part is the public REST API"
68
+ ],
69
+ "see": "One box per main folder of the product's repository, each with what it is, how it is tested and who changed it last. A part with no tests or many recent fixes is tinted and says why. After the chat…",
70
+ "open": "/premium-board.html"
71
+ },
72
+ "i": "code-map"
73
+ },
74
+ {
75
+ "n": 1969,
76
+ "t": "Today rearranges to the day, with a quiet line and a pin (job #1914, A310)",
77
+ "s": "Today rearranges to the day, with a quiet line and a pin (job #1914, A310)",
78
+ "k": "new",
79
+ "h": "Today rearranges to the day, with a quiet line and a pin (job #1914, A310)",
80
+ "try": {
81
+ "steps": [
82
+ "Open Today on a Monday, a Friday, a day with 3 or more meetings, or the day one of your initiatives ships",
83
+ "Read the quiet line under the page head and press the lock icon beside it",
84
+ "Open Today again tomorrow and press the lock icon to unpin"
85
+ ],
86
+ "see": "The same blocks show in a different order, and one line says why (for example 'Ordered for Monday · from your calendar'). After the pin the line says the order is pinned and the order stays the same…",
87
+ "open": "/today.html"
88
+ },
89
+ "i": "today-order"
90
+ },
91
+ {
92
+ "n": 1972,
93
+ "t": "Popup four learn from a full 30-day use log (A498)",
94
+ "s": "Popup four learn from a full 30-day use log (A498)",
95
+ "k": "fix",
96
+ "i": "popup-cap"
97
+ },
98
+ {
99
+ "n": 1975,
100
+ "t": "Settings opens again; features rows for code and connectors",
101
+ "s": "Settings opens again; features rows for code and connectors",
102
+ "k": "fix",
103
+ "h": "Settings opens again; features rows for code and connectors",
104
+ "try": {
105
+ "steps": [
106
+ "Open Today",
107
+ "Open Settings from the rail",
108
+ "Open What PMOS can do and find Code map"
109
+ ],
110
+ "see": "Settings opens, and Connectors and What PMOS does alone both show; Code map and What connectors read and write are listed"
111
+ },
112
+ "i": "connector-data"
113
+ }
114
+ ]
115
+ },
116
+ {
117
+ "v": "0.825.0",
118
+ "at": "2026-11-25T10:33:55.582Z",
119
+ "f": 4,
120
+ "prs": [
121
+ {
122
+ "n": 1939,
123
+ "t": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
124
+ "s": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
125
+ "k": "new",
126
+ "i": "does-alone"
127
+ },
57
128
  {
58
129
  "n": 1949,
59
130
  "t": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
60
131
  "s": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
61
132
  "k": "new",
133
+ "i": "name-links",
62
134
  "h": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
63
135
  "try": {
64
136
  "steps": [
@@ -68,14 +140,14 @@
68
140
  ],
69
141
  "see": "The names that match one record are underlined. A small card shows the record (a meeting's date, people and notes) with one press: Open the notes, Open the document, or Ask PMOS about the person. A…",
70
142
  "open": "/today.html"
71
- },
72
- "i": "name-links"
143
+ }
73
144
  },
74
145
  {
75
146
  "n": 1953,
76
147
  "t": "What each connector reads and writes (job #1920, A150)",
77
148
  "s": "What each connector reads and writes (job #1920, A150)",
78
149
  "k": "new",
150
+ "i": "connector-data",
79
151
  "h": "What each connector reads and writes (job #1920, A150)",
80
152
  "try": {
81
153
  "steps": [
@@ -85,14 +157,14 @@
85
157
  ],
86
158
  "see": "Each connected row says in one line what PMOS reads and writes. The page shows What PMOS reads, What PMOS writes and What leaves this computer, with a switch only where PMOS can really stop the read.",
87
159
  "open": "/today.html"
88
- },
89
- "i": "connector-data"
160
+ }
90
161
  },
91
162
  {
92
163
  "n": 1941,
93
164
  "t": "Hold the phone chat mic to talk (job #1891, A13)",
94
165
  "s": "Hold the phone chat mic to talk (job #1891, A13)",
95
166
  "k": "new",
167
+ "i": "hold-to-talk",
96
168
  "h": "Hold the phone chat mic to talk (job #1891, A13)",
97
169
  "try": {
98
170
  "steps": [
@@ -102,8 +174,7 @@
102
174
  ],
103
175
  "see": "Your words show above the mic while you hold it; letting go sends them like typing, so the change is done with Undo (a question gets an answer); sliding left cancels and nothing is sent.",
104
176
  "open": "/today.html"
105
- },
106
- "i": "hold-to-talk"
177
+ }
107
178
  }
108
179
  ]
109
180
  },
@@ -536,19 +607,6 @@
536
607
  "k": "new"
537
608
  }
538
609
  ]
539
- },
540
- {
541
- "v": "0.796.0",
542
- "at": "2026-11-24T21:11:47.859Z",
543
- "f": 4,
544
- "prs": [
545
- {
546
- "n": 1820,
547
- "t": "Milestone and initiative rows in Ask PMOS answers carry their buttons (job #1818)",
548
- "s": "Milestone and initiative rows in Ask PMOS answers carry their buttons (job #1818)",
549
- "k": "fix"
550
- }
551
- ]
552
610
  }
553
611
  ]
554
612
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@b21929886
1
+ kernel-source: pmos@a8ace0d29
2
2
  assembled: 2026-11-25
3
3
  mode: vendor
@@ -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-25T10:33:51Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T11:36:37Z"}
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-25T10:33:51Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T11:36:37Z"}
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-25T10:33:51Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T11:36:37Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,30 +1,102 @@
1
1
  [
2
2
  {
3
- "v": "0.825.0",
4
- "at": "2026-11-25T10:33:55.582Z",
3
+ "v": "0.826.0",
4
+ "at": "2026-11-25T11:36:40.845Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
8
- "n": 1939,
9
- "t": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
10
- "s": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
8
+ "n": 1973,
9
+ "t": "What PMOS can do lists every pmos verb (A540)",
10
+ "s": "What PMOS can do lists every pmos verb (A540)",
11
11
  "k": "new",
12
- "i": "does-alone",
12
+ "i": "directory-all-verbs",
13
13
  "try": {
14
14
  "steps": [
15
- "Open Today, then Settings (the gear) › How PMOS decides › What PMOS does alone.",
16
- "Read the rows: each kind of change says what PMOS does and since when.",
17
- "Press the arrow on Task names, then open Work and check a task name PMOS changed still has Undo."
15
+ "On Today, open the menu and press What PMOS can do.",
16
+ "Type pick in Find a feature, then press /pick to put it in the chat box.",
17
+ "On Work, type / in the chat and find /line in the list."
18
18
  ],
19
- "see": "One table: each kind of change says Does it, Undo or Asks you and since when, the always-ask rows have no button, and D106 opens the guide.",
19
+ "see": "Every pmos command PMOS has is listed with one plain line; /pick and /line put the command in the chat box.",
20
20
  "open": "/today.html"
21
21
  }
22
22
  },
23
+ {
24
+ "n": 1944,
25
+ "t": "A map of the product's code on Work, one box per main part (job #1900, A176)",
26
+ "s": "A map of the product's code on Work, one box per main part (job #1900, A176)",
27
+ "k": "new",
28
+ "h": "A map of the product's code on Work, one box per main part (job #1900, A176)",
29
+ "try": {
30
+ "steps": [
31
+ "Open Work and pick one product",
32
+ "Under the strategy, read the Code map: one box per main part",
33
+ "Ask the chat: say the api part is the public REST API"
34
+ ],
35
+ "see": "One box per main folder of the product's repository, each with what it is, how it is tested and who changed it last. A part with no tests or many recent fixes is tinted and says why. After the chat…",
36
+ "open": "/premium-board.html"
37
+ },
38
+ "i": "code-map"
39
+ },
40
+ {
41
+ "n": 1969,
42
+ "t": "Today rearranges to the day, with a quiet line and a pin (job #1914, A310)",
43
+ "s": "Today rearranges to the day, with a quiet line and a pin (job #1914, A310)",
44
+ "k": "new",
45
+ "h": "Today rearranges to the day, with a quiet line and a pin (job #1914, A310)",
46
+ "try": {
47
+ "steps": [
48
+ "Open Today on a Monday, a Friday, a day with 3 or more meetings, or the day one of your initiatives ships",
49
+ "Read the quiet line under the page head and press the lock icon beside it",
50
+ "Open Today again tomorrow and press the lock icon to unpin"
51
+ ],
52
+ "see": "The same blocks show in a different order, and one line says why (for example 'Ordered for Monday · from your calendar'). After the pin the line says the order is pinned and the order stays the same…",
53
+ "open": "/today.html"
54
+ },
55
+ "i": "today-order"
56
+ },
57
+ {
58
+ "n": 1972,
59
+ "t": "Popup four learn from a full 30-day use log (A498)",
60
+ "s": "Popup four learn from a full 30-day use log (A498)",
61
+ "k": "fix",
62
+ "i": "popup-cap"
63
+ },
64
+ {
65
+ "n": 1975,
66
+ "t": "Settings opens again; features rows for code and connectors",
67
+ "s": "Settings opens again; features rows for code and connectors",
68
+ "k": "fix",
69
+ "h": "Settings opens again; features rows for code and connectors",
70
+ "try": {
71
+ "steps": [
72
+ "Open Today",
73
+ "Open Settings from the rail",
74
+ "Open What PMOS can do and find Code map"
75
+ ],
76
+ "see": "Settings opens, and Connectors and What PMOS does alone both show; Code map and What connectors read and write are listed"
77
+ },
78
+ "i": "connector-data"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "v": "0.825.0",
84
+ "at": "2026-11-25T10:33:55.582Z",
85
+ "f": 4,
86
+ "prs": [
87
+ {
88
+ "n": 1939,
89
+ "t": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
90
+ "s": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
91
+ "k": "new",
92
+ "i": "does-alone"
93
+ },
23
94
  {
24
95
  "n": 1949,
25
96
  "t": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
26
97
  "s": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
27
98
  "k": "new",
99
+ "i": "name-links",
28
100
  "h": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
29
101
  "try": {
30
102
  "steps": [
@@ -34,14 +106,14 @@
34
106
  ],
35
107
  "see": "The names that match one record are underlined. A small card shows the record (a meeting's date, people and notes) with one press: Open the notes, Open the document, or Ask PMOS about the person. A…",
36
108
  "open": "/today.html"
37
- },
38
- "i": "name-links"
109
+ }
39
110
  },
40
111
  {
41
112
  "n": 1953,
42
113
  "t": "What each connector reads and writes (job #1920, A150)",
43
114
  "s": "What each connector reads and writes (job #1920, A150)",
44
115
  "k": "new",
116
+ "i": "connector-data",
45
117
  "h": "What each connector reads and writes (job #1920, A150)",
46
118
  "try": {
47
119
  "steps": [
@@ -51,14 +123,14 @@
51
123
  ],
52
124
  "see": "Each connected row says in one line what PMOS reads and writes. The page shows What PMOS reads, What PMOS writes and What leaves this computer, with a switch only where PMOS can really stop the read.",
53
125
  "open": "/today.html"
54
- },
55
- "i": "connector-data"
126
+ }
56
127
  },
57
128
  {
58
129
  "n": 1941,
59
130
  "t": "Hold the phone chat mic to talk (job #1891, A13)",
60
131
  "s": "Hold the phone chat mic to talk (job #1891, A13)",
61
132
  "k": "new",
133
+ "i": "hold-to-talk",
62
134
  "h": "Hold the phone chat mic to talk (job #1891, A13)",
63
135
  "try": {
64
136
  "steps": [
@@ -68,8 +140,7 @@
68
140
  ],
69
141
  "see": "Your words show above the mic while you hold it; letting go sends them like typing, so the change is done with Undo (a question gets an answer); sliding left cancels and nothing is sent.",
70
142
  "open": "/today.html"
71
- },
72
- "i": "hold-to-talk"
143
+ }
73
144
  }
74
145
  ]
75
146
  },
@@ -167,6 +167,7 @@ When you ask an agent session to do a piece of work, it can finish it, including
167
167
  - `pmos ai status`: whether each AI job is on, whether its replay passed, and what its last run filed. It also shows the keep rate of each job that files under ✦ for the last 14 days: how many you kept of the ones you decided, and how many wait. It shows each product too. A job with 3 or more decided and none kept is listed to pause. You decide: `pmos ai off <job>`.
168
168
  - `pmos ai status` also shows the background runs of the last 7 days: for each kind of run, how many ran, the tokens each run read, and the cost. Lean and full starts show side by side.
169
169
  - `pmos ai log [<job>]`: the last audit lines. Each dropped proposal shows why.
170
+ - `pmos code show`: the product's code map, one line per main part: what it is, how it is tested, who changed it last, and why a part is risky. `pmos code describe --part <name> --text "<what it is>"` puts the PM's words on a part.
170
171
  - `pmos ai worth`: each kind of background run this month, its cost next to how much of its ✦ work you kept. A kind that costs most and is kept least is flagged for you to decide. It pauses nothing.
171
172
  - `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.
172
173
 
@@ -81,6 +81,20 @@ The command prints "Nothing needs you" when the list is empty. It exits with 0 w
81
81
 
82
82
  The command reads `GET /api/today`, `GET /api/board-premium`, `GET /api/programs` and `GET /api/your-move`. None of them changes anything.
83
83
 
84
+ #### pmos today order
85
+
86
+ `pmos today order` reads and pins the order of Today's blocks. Today keeps the same blocks (`overview`, `move` for Your move, `log` for Today's log, and `agenda`) and changes only their order to fit the day. On the day one of your initiatives ships, Your move leads. On a day with 3 or more meetings, the agenda leads. On a Monday the Overview leads, and on a Friday Today's log leads. On any other day Today keeps its usual order. A quiet line under the page head says why the order changed, with a lock button that pins the order.
87
+
88
+ ```
89
+ pmos today order # the pinned order, or the order for each kind of day
90
+ pmos today order --pin monday # pin the order of one kind of day: launch, meetings, monday, friday
91
+ pmos today order --pin move,overview # pin your own order; blocks you leave out go at the end
92
+ pmos today order --unpin # Today orders itself to the day again
93
+ pmos today order --json # the pin and the orders as JSON
94
+ ```
95
+
96
+ A pinned order stays on every day until you unpin it. The page and the command read and write the same pin, a small file in the PMOS runtime folder (`GET` and `POST /api/today-order`). A block is never removed: an unknown block name is refused, and a block you leave out goes at the end. The command exits with 0 when it read or wrote the pin, 1 when it could not, and 2 when you gave it an option it does not have.
97
+
84
98
  ### pmos mention: Today's Mentions
85
99
 
86
100
  These commands post nothing:
@@ -461,6 +475,15 @@ The same five lines as the Strategy card on Work ([The strategy in five lines](i
461
475
  - `pmos strategy set --line <key> --text "<line>"` writes your own line. `--text ""` blanks it.
462
476
  - `pmos strategy undo` takes back every line PMOS drafted. `--line <key>` takes back one.
463
477
 
478
+ ### pmos code: the product's code map
479
+
480
+ The same map as the Code panel on Work: one line per main part of the product's code, with what it is, how it is tested and who changed it last. PMOS draws it from the default branch (origin/HEAD, then main, master, HEAD) when you first open the product on Work, and again after the branch moves. It reads git only and never writes to the repository. A part is risky when it has no test files, or when 5 or more of its commits in the last 30 days are fixes and they are at least half of its commits. Run the commands in the product's repository, or pass `--root <dir>`. The map is in `code-map.json` in the product's records folder, and your own words are in `code-map-notes.jsonl`.
481
+
482
+ - `pmos code show` shows the map. `!` marks a risky part and says why. `--json` prints the map.
483
+ - `pmos code map` draws the map again now.
484
+ - `pmos code describe --part <name> --text "<what it is>"` says what a part is in your words. The panel shows your words in place of PMOS's. `--text ""` puts PMOS's words back. A part the map does not have is refused.
485
+ - `pmos code count` prints the number of parts in the map.
486
+
464
487
  ### pmos declined: asks you said no to, with a kind reply
465
488
 
466
489
  PMOS lists the asks in the product's Jira readings that were closed without being done: Won't Do, Declined, Duplicate, Not a bug and the like. Each one gets a short reply draft to the person who asked: thanks for the ask, the decision and its reason, and what would bring it back. PMOS never sends the reply. Copy it and send it yourself. Run the commands in the product's repository, or pass `--root <dir>`.
@@ -47,6 +47,7 @@ Today, Work, Insights and the Viewer use one typeface, Plus Jakarta Sans, with t
47
47
  ## Your move
48
48
 
49
49
  - **At most 5 show.** The rest are under **Can wait**, in the same order. Nothing is dropped.
50
+ - **Today's order fits the day.** Today keeps the same blocks and changes only their order. On the day one of your initiatives ships, Your move leads. On a day with 3 or more meetings, the agenda leads. On a Monday the Overview leads, and on a Friday Today's log leads. One quiet line under the greeting says why, for example "Ordered for Monday · from your calendar". Press the lock beside it to keep that order on every day; press it again to unpin. A block is never removed, and an ordinary day has no line. From a terminal: `pmos today order`.
50
51
  - **At most 3 rows a day for each product.** A row from a product's own records counts toward the 3: an open question, a check, a grill finding, a date change from a meeting, a key result, or a change PMOS proposes on an initiative. A reply someone waits for, your own task and a draft never count. The rows are fixed the first time Today shows them that day. When you finish a row, nothing takes its place until tomorrow. A new row that holds up a ship date takes the place of that product's lowest row and never makes a fourth. Rows over the 3 wait under **Later** with "Waits for tomorrow". A product with nothing for you has no row.
51
52
  - **Today's batch.** Everything other people will see (a review request, Jira tickets, a follow-up, a closed ask) is one row: "Today's batch: 5 to send". Press it to open the batch full size. **Back** returns to Today. The drafts are in groups by kind, and each one says who will see it. ✎ **Change it first** opens the draft, ✕ **Skip** drops it (with Undo), and ✓ **Approve** sends it. When more than one draft waits, PMOS suggests **Approve and send all**. Nothing is sent until you press. If no channel is connected yet, the draft stays in the batch and says so. A draft you leave for 7 days lapses and is not sent. On a phone the batch shows one draft at a time, full text first: swipe right to approve, left to skip.
52
53
  - **The dashed line.** Your move ends with one dashed line, for example "9 more move in the line by themselves · none stuck" (or "· 1 stuck"). It counts the live initiatives of your products that do not wait on you. Press it to open the Line on Work. With nothing on the line there is no dashed line.
@@ -220,7 +220,7 @@ The **Product** and **Program** facts go one level up. A program or a product op
220
220
 
221
221
  ## The popup's actions
222
222
 
223
- The initiative popup shows five actions at most: **Ask PMOS** in the header and four buttons at the right of **Work breakdown**. Back and Close are not actions. The four are **Add a task or milestone**, **Who**, **Set the date** and **Stage** until PMOS has 30 days of your use. After that, they are the four you use most, and PMOS works them out again once a week, so they do not move while you work. The four follow you to your phone and other browsers.
223
+ The initiative popup shows five actions at most: **Ask PMOS** in the header and four buttons at the right of **Work breakdown**. Back and Close are not actions. The four are **Add a task or milestone**, **Who**, **Set the date** and **Stage** until PMOS has 30 days of your use, which means your use log reaches back to its 30-day limit. After that, they are the four you use most, and PMOS works them out again once a week, so they do not move while you work. The four follow you to your phone and other browsers.
224
224
 
225
225
  - **Add** goes to the List and puts the cursor in the add box.
226
226
  - **Who**, **Set the date** and **Stage** change the selected tasks. If no task is selected, the line "Pick the tasks to change · Esc to stop" shows. Click the tasks, then press the line's button, for example **Who for 2 tasks**. Press Esc to stop.
@@ -368,6 +368,8 @@ A source that PMOS reads on a schedule says how often and when it reads next on
368
368
 
369
369
  Press › on a row to open its page. A change you make there shows on the Connectors row as soon as you go back.
370
370
 
371
+ Each connected row also says in one line what PMOS reads and writes through it. Its page has **What PMOS reads**, **What PMOS writes** and **What leaves this computer**, with a switch only where PMOS can really stop the read. The chat reads the same list with `pmos connectors data`.
372
+
371
373
  | Row | What it does |
372
374
  |---|---|
373
375
  | Active | On or off. Off: PMOS does not read it on its own. |
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+ /* code-map-cli.js — `pmos code`: the product's code map, the same map the Code panel on Work shows (idea A176, initiative code-map).
3
+ * The store is lib/code-map.js (code-map.json and code-map-notes.jsonl in the product's records folder).
4
+ *
5
+ * pmos code show [--json] one line per main part: what it is, how tested, who changed it last; ! marks a risky part
6
+ * pmos code map [--json] draw the map again now from the default branch (read-only git)
7
+ * pmos code describe --part <name> --text "<…>" say what a part is in your own words (the chat writes it for the PM); "" puts PMOS's back
8
+ * pmos code count the number of parts in the map, on the last line
9
+ * every command: [--root <dir>] (default: this repository)
10
+ *
11
+ * Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent, and nothing in the repository is written. */
12
+ const path = require('path');
13
+ const fs = require('fs');
14
+ const CM = require('./code-map.js');
15
+
16
+ const COMMANDS = { code: ['show', 'map', 'describe', 'count'] };
17
+ const USAGE = [
18
+ 'usage: pmos code show|map|describe|count — the product\'s code map: one line per main part',
19
+ ' pmos code show [--json] what each part is, how it is tested, who changed it last; ! marks a risky part',
20
+ ' pmos code map [--json] draw the map again now from the default branch',
21
+ ' pmos code describe --part api --text "<what it is>" say what a part is; --text "" puts PMOS\'s words back',
22
+ ' pmos code count the number of parts in the map',
23
+ 'Run it in the product\'s repository, or pass --root <dir>.',
24
+ ];
25
+ const ALLOWED = { show: ['json', 'root'], map: ['json', 'root'], describe: ['json', 'root', 'part', 'text'], count: ['json', 'root'] };
26
+ const BOOL = new Set(['json']);
27
+
28
+ function parse(args) {
29
+ const pos = [], flags = {};
30
+ for (let i = 0; i < args.length; i++) {
31
+ const a = args[i];
32
+ if (!a.startsWith('--')) { pos.push(a); continue; }
33
+ const k = a.slice(2);
34
+ if (BOOL.has(k)) { flags[k] = true; continue; }
35
+ flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
36
+ }
37
+ return { pos, flags };
38
+ }
39
+ /** The nearest folder at or above `cwd` that holds a .git entry, read from the disk with no git run; `cwd` when there is none. */
40
+ function repoRoot(cwd) {
41
+ let dir = path.resolve(cwd);
42
+ for (let i = 0; i < 64; i++) {
43
+ if (fs.existsSync(path.join(dir, '.git'))) return dir;
44
+ const up = path.dirname(dir); if (up === dir) break; dir = up;
45
+ }
46
+ return cwd;
47
+ }
48
+ function recordsDirOf(root) {
49
+ try { const { repoScript } = require('./repo-script.js'); return require(repoScript('signals/layout-paths.js')).pathsFor(root).recordsDir; } catch { return path.join(root, 'planning', 'records'); }
50
+ }
51
+ const dayOf = (iso) => { const d = new Date(iso); return isNaN(d) ? '' : d.toLocaleDateString('en-GB', { day: 'numeric', month: 'short', timeZone: 'UTC' }); };
52
+ /** One part as one line. */
53
+ function lineOf(p) {
54
+ const what = p.note || [p.kind, p.code + (p.code === 1 ? ' file' : ' files')].filter(Boolean).join(' · ');
55
+ const who = p.last && p.last.by ? ` · ${p.last.by} last, ${dayOf(p.last.at)}` : '';
56
+ return `${p.risky ? '!' : ' '} ${p.name}: ${what} · ${p.tested}${p.risky && p.why !== 'no tests' ? ' · ' + p.why.replace(/^no tests, /, '') : ''}${who}`;
57
+ }
58
+
59
+ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now = Date.now() } = {}) {
60
+ const args = argv[0] === 'code' ? argv.slice(1) : argv.slice();
61
+ const sub = args[0];
62
+ if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
63
+ if (!COMMANDS.code.includes(sub)) { say(`unknown code command "${sub}". Use one of: ${COMMANDS.code.join(', ')}`); return 2; }
64
+ const { pos, flags } = parse(args.slice(1));
65
+ for (const k of Object.keys(flags)) if (!ALLOWED[sub].includes(k)) { say(`✗ --${k} is not an option of pmos code ${sub}`); return 2; }
66
+ if (pos.length) { say(`✗ pmos code ${sub} takes options, not an argument (pmos code help)`); return 2; }
67
+ const root = path.resolve(flags.root || repoRoot(cwd));
68
+ const dir = recordsDirOf(root);
69
+ const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
70
+
71
+ if (sub === 'map') {
72
+ const map = await CM.build(root, { now });
73
+ if (!map) return fail('no code map: this folder is not a git repository, or it holds no code');
74
+ CM.save(dir, map);
75
+ if (flags.json) { say(JSON.stringify({ ok: true, map: CM.view(dir) })); return 0; }
76
+ say(`Drew ${map.parts.length} parts from ${map.ref} ${map.head.slice(0, 7)}.`);
77
+ for (const p of CM.view(dir).parts) say(lineOf(p));
78
+ return 0;
79
+ }
80
+ const map = CM.view(dir);
81
+ if (sub === 'count') { say(flags.json ? JSON.stringify({ ok: true, parts: map ? map.parts.length : 0 }) : String(map ? map.parts.length : 0)); return 0; }
82
+ if (sub === 'show') {
83
+ if (flags.json) { say(JSON.stringify({ ok: true, map })); return 0; }
84
+ if (!map) { say('No code map yet. Run pmos code map, or open Work on this product.'); return 0; }
85
+ say(`Code map, read from ${map.ref} ${map.head.slice(0, 7)} on ${dayOf(map.at)}:`);
86
+ for (const p of map.parts) say(lineOf(p));
87
+ if (map.more) say(` and ${map.more} smaller part${map.more === 1 ? '' : 's'}`);
88
+ return 0;
89
+ }
90
+ // describe
91
+ if (!flags.part) return fail('--part <name> is needed (pmos code show lists the parts)', 2);
92
+ if (flags.text === undefined) return fail('--text "<what it is>" is needed ("" puts PMOS\'s words back)', 2);
93
+ const r = CM.describe(dir, flags.part, flags.text, now);
94
+ if (!r.ok) return fail(r.error);
95
+ const p = CM.findPart(r.map, flags.part);
96
+ say(flags.json ? JSON.stringify({ ok: true, part: p }) : `${p.name}: ${p.note || "PMOS's words again"}`);
97
+ return 0;
98
+ }
99
+
100
+ module.exports = { run, COMMANDS, USAGE, lineOf };