create-pmos 0.783.0 → 0.785.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 (77) hide show
  1. package/package.json +70 -78
  2. package/payload/AGENTS.md +160 -0
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/design-system/ui/components/Badge/README.md +2 -2
  5. package/payload/design-system/ui/components/Glyph/README.md +28 -0
  6. package/payload/design-system/ui/components/bundle.css +3 -0
  7. package/payload/planning/evals/eval-calibration.md +1 -1
  8. package/payload/planning/okrs/health-budgets.md +1 -1
  9. package/payload/state/discoveries.md +1 -1
  10. package/workspace/bin/card-catalog-gen.js +22 -0
  11. package/workspace/board-columns-test.js +2 -2
  12. package/workspace/briefing-premium-insights-test.js +5 -4
  13. package/workspace/calm-timeline-test.js +4 -3
  14. package/workspace/changelog.json +69 -10
  15. package/workspace/design-system/ui/components/Badge/README.md +2 -2
  16. package/workspace/design-system/ui/components/Glyph/README.md +28 -0
  17. package/workspace/design-system/ui/components/bundle.css +3 -0
  18. package/workspace/guide/claude-proposes.md +1 -0
  19. package/workspace/guide/cli.md +8 -0
  20. package/workspace/guide/home.md +4 -3
  21. package/workspace/guide/index.md +2 -2
  22. package/workspace/guide/layout.md +16 -2
  23. package/workspace/lib/briefing-premium-agent.js +3 -0
  24. package/workspace/lib/card-catalog-gen.js +123 -0
  25. package/workspace/lib/cos-chat.js +1 -0
  26. package/workspace/lib/declined-asks.js +177 -0
  27. package/workspace/lib/declined-cli.js +87 -0
  28. package/workspace/lib/goal-chat.js +1 -0
  29. package/workspace/lib/initiative-chat.js +1 -0
  30. package/workspace/lib/jira-status.js +11 -2
  31. package/workspace/lib/live-events.js +99 -0
  32. package/workspace/lib/pmos-verbs.js +3 -0
  33. package/workspace/lib/program-chat.js +1 -0
  34. package/workspace/lib/proposals.js +13 -2
  35. package/workspace/lib/report-chat.js +1 -0
  36. package/workspace/lib/route-modules.js +1 -0
  37. package/workspace/lib/routes-live-rows.js +30 -0
  38. package/workspace/lib/routes-proposals.js +31 -3
  39. package/workspace/lib/routes-slash.js +142 -2
  40. package/workspace/lib/routes-task-links.js +1 -1
  41. package/workspace/lib/scope-cuts.js +138 -0
  42. package/workspace/lib/task-cli.js +5 -3
  43. package/workspace/lib/workflow-chat.js +1 -0
  44. package/workspace/okr-goals-ui-test.js +3 -2
  45. package/workspace/package-lock.json +2 -2
  46. package/workspace/package.json +1 -1
  47. package/workspace/public/pm/bd-cols.js +3 -1
  48. package/workspace/public/pm/bd-span.js +13 -7
  49. package/workspace/public/pm/bd-views.js +6 -3
  50. package/workspace/public/pm/bd-work-ds.css +1 -0
  51. package/workspace/public/pm/bd-work.js +15 -2
  52. package/workspace/public/pm/cozy-board.css +3 -0
  53. package/workspace/public/pm/cozy-insights.css +3 -4
  54. package/workspace/public/pm/ds-bridge.css +12 -0
  55. package/workspace/public/pm/goal-forecast.js +7 -4
  56. package/workspace/public/pm/home-app.js +5 -3
  57. package/workspace/public/pm/ini-props.js +4 -3
  58. package/workspace/public/pm/komorebi.css +1 -0
  59. package/workspace/public/pm/live-edit.js +34 -3
  60. package/workspace/public/pm/live-feed.js +42 -0
  61. package/workspace/public/pm/okr-list.js +5 -2
  62. package/workspace/public/pm/premium-board.js +2 -0
  63. package/workspace/public/pm/premium-insights.js +10 -4
  64. package/workspace/public/pm/premium-vw-doc.css +5 -0
  65. package/workspace/public/pm/premium-vw-doc.js +11 -31
  66. package/workspace/public/pm/premium-vw-file.js +13 -8
  67. package/workspace/public/pm/premium-vw-guide.css +9 -0
  68. package/workspace/public/pm/premium-vw-guide.js +20 -17
  69. package/workspace/public/pm/reading-view.js +44 -0
  70. package/workspace/public/pm/state-glyph.js +135 -0
  71. package/workspace/skills/jira-sync.skill +4 -3
  72. package/workspace/task-milestones-test.js +2 -2
  73. package/workspace/test-lists/a2ui-chat-rules.json +9 -0
  74. package/workspace/test-lists/a2ui-live-rows.json +9 -0
  75. package/workspace/test-lists/declined-asks.json +9 -0
  76. package/workspace/test-lists/scope-cuts-save-date.json +5 -0
  77. package/workspace/test-lists/state-glyph.json +5 -0
@@ -13,7 +13,137 @@ const fs = require('fs');
13
13
  const os = require('os');
14
14
  const path = require('path');
15
15
 
16
- const PMOS = [{ cmd: '/goal', name: 'Give PMOS a goal', say: 'It asks a few questions to make the goal SMART, then works on it after you press Start.' }];
16
+ // /goal, then one entry per command a card button runs (the card catalog, A455)
17
+ const PMOS = [{ cmd: '/goal', name: 'Give PMOS a goal', say: 'It asks a few questions to make the goal SMART, then works on it after you press Start.' },
18
+ /* card-catalog:begin, generated by bin/card-catalog-gen.js: edit lib/card-catalog.json, not this block */
19
+ {"cmd":"/pmos:task-set","run":"pmos task set","name":"Move the date and 7 more","say":"pmos task set <id> --due <date> [--start <date>] [--owner <who>] [--notes <text>] [--milestone] [--pin] [--no-milestone]"},
20
+ {"cmd":"/pmos:task-state","run":"pmos task state","name":"Change status and 1 more","say":"pmos task state <id> --to <state> --why <text>"},
21
+ {"cmd":"/pmos:task-comment","run":"pmos task comment","name":"Comment","say":"pmos task comment <id> <text>"},
22
+ {"cmd":"/pmos:task-describe","run":"pmos task describe","name":"Write the description","say":"pmos task describe <id>"},
23
+ {"cmd":"/pmos:task-remove","run":"pmos task remove","name":"Remove","say":"pmos task remove <id> --why <text>"},
24
+ {"cmd":"/pmos:task-add","run":"pmos task add","name":"Add a subtask and 1 more","say":"pmos task add <initiative> \"<title>\" --parent <task> [--due <date>] [--owner <who>]"},
25
+ {"cmd":"/pmos:rehearse-move","run":"pmos rehearse move","name":"What slips if it moves and 1 more","say":"pmos rehearse move <id> --due <date> [--by <days>]"},
26
+ {"cmd":"/pmos:task-link","run":"pmos task link","name":"Link two tasks","say":"pmos task link <from> <to> --type fs|ss|ff|sf --lag <days>"},
27
+ {"cmd":"/pmos:task-unlink","run":"pmos task unlink","name":"Unlink","say":"pmos task unlink <from> <to>"},
28
+ {"cmd":"/pmos:item-move","run":"pmos item move","name":"Move on the board","say":"pmos item move <item> <todo|doing|review|done> --evidence <ref>"},
29
+ {"cmd":"/pmos:item-set","run":"pmos item set","name":"Change date or owner","say":"pmos item set <item> --due <date> --owner <who>"},
30
+ {"cmd":"/pmos:item-withdraw","run":"pmos item withdraw","name":"Withdraw","say":"pmos item withdraw <item>"},
31
+ {"cmd":"/pmos:my-work-show","run":"pmos my-work show","name":"Open the context card","say":"pmos my-work show <item>"},
32
+ {"cmd":"/pmos:initiative-up","run":"pmos initiative up","name":"Move up / down","say":"pmos initiative up <id>"},
33
+ {"cmd":"/pmos:initiative-down","run":"pmos initiative down","name":"Move up / down","say":"pmos initiative down <id>"},
34
+ {"cmd":"/pmos:initiative-top","run":"pmos initiative top","name":"Move to top / bottom","say":"pmos initiative top <id>"},
35
+ {"cmd":"/pmos:initiative-bottom","run":"pmos initiative bottom","name":"Move to top / bottom","say":"pmos initiative bottom <id>"},
36
+ {"cmd":"/pmos:initiative-after","run":"pmos initiative after","name":"Rank after another","say":"pmos initiative after <id> <other>"},
37
+ {"cmd":"/pmos:initiative-check-by","run":"pmos initiative check-by","name":"Set check date","say":"pmos initiative check-by <id> <date>"},
38
+ {"cmd":"/pmos:initiative-kind","run":"pmos initiative kind","name":"Change kind","say":"pmos initiative kind <id> product|project|sdlc"},
39
+ {"cmd":"/pmos:workflow-switch","run":"pmos workflow switch","name":"Change workflow and 1 more","say":"pmos workflow switch <id> --to <workflow> --stage <stage> --why <text>"},
40
+ {"cmd":"/pmos:workflow-move","run":"pmos workflow move","name":"Move to stage","say":"pmos workflow move <id> --stage <stage> --why <text>"},
41
+ {"cmd":"/pmos:initiative-describe","run":"pmos initiative describe","name":"Write the description","say":"pmos initiative describe <id>"},
42
+ {"cmd":"/pmos:parked-hold","run":"pmos parked hold","name":"Park it and 1 more","say":"pmos parked hold <id> --why <text>"},
43
+ {"cmd":"/pmos:initiative-export","run":"pmos initiative export","name":"Export the breakdown","say":"pmos initiative export <id>"},
44
+ {"cmd":"/pmos:initiative-adopt","run":"pmos initiative adopt","name":"Keep","say":"pmos initiative adopt <proposal>"},
45
+ {"cmd":"/pmos:initiative-drop","run":"pmos initiative drop","name":"Drop","say":"pmos initiative drop <proposal>"},
46
+ {"cmd":"/pmos:parked-back","run":"pmos parked back","name":"Bring back","say":"pmos parked back <id>"},
47
+ {"cmd":"/pmos:program-check","run":"pmos program check","name":"Check a milestone","say":"pmos program check <id> <milestone>"},
48
+ {"cmd":"/pmos:program-milestone","run":"pmos program milestone","name":"Move a milestone and 3 more","say":"pmos program milestone <id> move <m> --date <date>"},
49
+ {"cmd":"/pmos:program-join","run":"pmos program join","name":"Add an initiative","say":"pmos program join <id> <initiative>"},
50
+ {"cmd":"/pmos:program-leave","run":"pmos program leave","name":"Take one out","say":"pmos program leave <id> <initiative>"},
51
+ {"cmd":"/pmos:program-charter","run":"pmos program charter","name":"Set goal and why","say":"pmos program charter <id> --goal <text> --why <text>"},
52
+ {"cmd":"/pmos:program-capacity","run":"pmos program capacity","name":"Set team capacity","say":"pmos program capacity <team> <n>"},
53
+ {"cmd":"/pmos:program-decide","run":"pmos program decide","name":"Decide what goes first","say":"pmos program decide --team <team> --first <initiative>"},
54
+ {"cmd":"/pmos:program-order","run":"pmos program order","name":"Order its initiatives","say":"pmos program order <id> <id,id,…>"},
55
+ {"cmd":"/pmos:program-archive","run":"pmos program archive","name":"Archive","say":"pmos program archive <id>"},
56
+ {"cmd":"/pmos:program-task","run":"pmos program task","name":"Add","say":"pmos program task <id> \"<title>\" --key <key>"},
57
+ {"cmd":"/pmos:program-task-done","run":"pmos program task-done","name":"Done","say":"pmos program task-done <id> <key>"},
58
+ {"cmd":"/pmos:units-show","run":"pmos units show","name":"Open","say":"pmos units show <unit>"},
59
+ {"cmd":"/pmos:launch-check","run":"pmos launch check","name":"Check what is not ready","say":"pmos launch check <initiative> --date <date>"},
60
+ {"cmd":"/pmos:launch-tier","run":"pmos launch tier","name":"Set the launch tier","say":"pmos launch tier <initiative>"},
61
+ {"cmd":"/pmos:ready-check","run":"pmos ready check","name":"Run the check","say":"pmos ready check <initiative>"},
62
+ {"cmd":"/pmos:strategy-set","run":"pmos strategy set","name":"Write it","say":"pmos strategy set --line <key> --text <text>"},
63
+ {"cmd":"/pmos:strategy-draft","run":"pmos strategy draft","name":"Let PMOS draft","say":"pmos strategy draft"},
64
+ {"cmd":"/pmos:strategy-undo","run":"pmos strategy undo","name":"Undo PMOS’s draft","say":"pmos strategy undo --line <key>"},
65
+ {"cmd":"/pmos:positioning-keep","run":"pmos positioning keep","name":"Keep","say":"pmos positioning keep --text <text> --cites <source>"},
66
+ {"cmd":"/pmos:positioning-drop","run":"pmos positioning drop","name":"Drop","say":"pmos positioning drop <id>"},
67
+ {"cmd":"/pmos:principles-keep","run":"pmos principles keep","name":"Keep","say":"pmos principles keep <id>"},
68
+ {"cmd":"/pmos:principles-drop","run":"pmos principles drop","name":"Drop","say":"pmos principles drop <id>"},
69
+ {"cmd":"/pmos:principles-undo","run":"pmos principles undo","name":"Undo","say":"pmos principles undo <id>"},
70
+ {"cmd":"/pmos:principles-add","run":"pmos principles add","name":"Add one","say":"pmos principles add --text <text>"},
71
+ {"cmd":"/pmos:artefacts-set","run":"pmos artefacts set","name":"Write it","say":"pmos artefacts set <scope> <artefact> --text <text>"},
72
+ {"cmd":"/pmos:artefacts-undo","run":"pmos artefacts undo","name":"Undo","say":"pmos artefacts undo <a-id>"},
73
+ {"cmd":"/pmos:proactive-goals","run":"pmos proactive goals","name":"Add and 3 more","say":"pmos proactive goals add <text> --initiative <id>"},
74
+ {"cmd":"/pmos:measure-add","run":"pmos measure add","name":"Add a reading","say":"pmos measure add <anchor> <value> --source <source>"},
75
+ {"cmd":"/pmos:outcomes-declare","run":"pmos outcomes declare","name":"Declare the metric","say":"pmos outcomes declare <id> --metric <text>"},
76
+ {"cmd":"/pmos:outcomes-test","run":"pmos outcomes test","name":"Set the smallest test","say":"pmos outcomes test <id> --test <text>"},
77
+ {"cmd":"/pmos:outcomes-record","run":"pmos outcomes record","name":"Record the result","say":"pmos outcomes record <id> worked|didnt-work|cant-tell --evidence <text>"},
78
+ {"cmd":"/pmos:decisions-add","run":"pmos decisions add","name":"Record a decision","say":"pmos decisions add"},
79
+ {"cmd":"/pmos:decisions-check","run":"pmos decisions check","name":"Check it","say":"pmos decisions check <id> worked|didnt-work|cant-tell --evidence <text>"},
80
+ {"cmd":"/pmos:decisions-undo","run":"pmos decisions undo","name":"Take it out","say":"pmos decisions undo <id>"},
81
+ {"cmd":"/pmos:glossary-set","run":"pmos glossary set","name":"Set meaning","say":"pmos glossary set <term> <meaning>"},
82
+ {"cmd":"/pmos:glossary-remove","run":"pmos glossary remove","name":"Remove","say":"pmos glossary remove <term>"},
83
+ {"cmd":"/pmos:signal-add","run":"pmos signal add","name":"Add","say":"pmos signal add <initiative> --who <who>"},
84
+ {"cmd":"/pmos:signal-remove","run":"pmos signal remove","name":"Remove","say":"pmos signal remove <sid>"},
85
+ {"cmd":"/pmos:forecast-baseline","run":"pmos forecast baseline","name":"Set baseline","say":"pmos forecast baseline"},
86
+ {"cmd":"/pmos:forecast-baseline-off","run":"pmos forecast baseline-off","name":"Clear baseline","say":"pmos forecast baseline-off"},
87
+ {"cmd":"/pmos:people-record","run":"pmos people record","name":"Record who a session met","say":"pmos people record --file <sightings.json>"},
88
+ {"cmd":"/pmos:mention-draft","run":"pmos mention draft","name":"Draft a reply","say":"pmos mention draft <id> --text <text>"},
89
+ {"cmd":"/pmos:mention-answered","run":"pmos mention answered","name":"Mark answered","say":"pmos mention answered <id> --who <who>"},
90
+ {"cmd":"/pmos:mention-watch","run":"pmos mention watch","name":"Watch for","say":"pmos mention watch <id> --what <text>"},
91
+ {"cmd":"/pmos:mention-stands","run":"pmos mention stands","name":"Settled","say":"pmos mention stands <id> --settled"},
92
+ {"cmd":"/pmos:signoff-ask","run":"pmos signoff ask","name":"Ask","say":"pmos signoff ask <initiative> --who <who>"},
93
+ {"cmd":"/pmos:signoff-answer","run":"pmos signoff answer","name":"Record the answer","say":"pmos signoff answer <id> --answer <text>"},
94
+ {"cmd":"/pmos:signoff-drop","run":"pmos signoff drop","name":"Drop","say":"pmos signoff drop <id> --why <text>"},
95
+ {"cmd":"/pmos:jira-answer","run":"pmos jira answer","name":"Answer a ticket question","say":"pmos jira answer <initiative> <ticket> <n> --text <text>"},
96
+ {"cmd":"/pmos:driver-keep","run":"pmos driver keep","name":"Keep","say":"pmos driver keep <proposal>"},
97
+ {"cmd":"/pmos:driver-return","run":"pmos driver return","name":"Send back with a note","say":"pmos driver return <proposal> --note <text>"},
98
+ {"cmd":"/pmos:driver-drop","run":"pmos driver drop","name":"Drop","say":"pmos driver drop <proposal> --note <text>"},
99
+ {"cmd":"/pmos:driver-undo","run":"pmos driver undo","name":"Undo","say":"pmos driver undo <proposal>"},
100
+ {"cmd":"/pmos:driver-pause","run":"pmos driver pause","name":"Pause PMOS on this","say":"pmos driver pause initiative <id>"},
101
+ {"cmd":"/pmos:proactive-feedback","run":"pmos proactive feedback","name":"Useful and 3 more","say":"pmos proactive feedback <id> useful"},
102
+ {"cmd":"/pmos:rules-edit","run":"pmos rules edit","name":"Edit","say":"pmos rules edit <n> --text <text>"},
103
+ {"cmd":"/pmos:rules-retire","run":"pmos rules retire","name":"Retire","say":"pmos rules retire <n>"},
104
+ {"cmd":"/pmos:rules-restore","run":"pmos rules restore","name":"Bring back","say":"pmos rules restore <n>"},
105
+ {"cmd":"/pmos:autonomy-restore","run":"pmos autonomy restore","name":"Undo the job","say":"pmos autonomy restore <job>"},
106
+ {"cmd":"/pmos:autonomy-check","run":"pmos autonomy check","name":"Check it","say":"pmos autonomy check <ref> --verdict PASS|FAIL --why <text>"},
107
+ {"cmd":"/pmos:ai-off","run":"pmos ai off","name":"Turn off","say":"pmos ai off <job>"},
108
+ {"cmd":"/pmos:ai-on","run":"pmos ai on","name":"Turn on","say":"pmos ai on <job>"},
109
+ {"cmd":"/pmos:team-pause","run":"pmos team pause","name":"Pause / resume","say":"pmos team pause <role>"},
110
+ {"cmd":"/pmos:team-resume","run":"pmos team resume","name":"Pause / resume","say":"pmos team resume <role>"},
111
+ {"cmd":"/pmos:team-dispatch","run":"pmos team dispatch","name":"Dispatch on an initiative","say":"pmos team dispatch <initiative> --roles <roles>"},
112
+ {"cmd":"/pmos:scan-match","run":"pmos scan match","name":"Match to an initiative","say":"pmos scan match <finding> <initiative> --scan <id>"},
113
+ {"cmd":"/pmos:critic-label","run":"pmos critic label","name":"Real and 1 more","say":"pmos critic label <run> <n> real"},
114
+ {"cmd":"/pmos:jira-pin","run":"pmos jira pin","name":"Keep live","say":"pmos jira pin <initiative>"},
115
+ {"cmd":"/pmos:jira-approve","run":"pmos jira approve","name":"Approve to push","say":"pmos jira approve <initiative> <ID>"},
116
+ {"cmd":"/pmos:jira-criteria-propose","run":"pmos jira criteria-propose","name":"Draft done-criteria","say":"pmos jira criteria-propose <initiative>"},
117
+ {"cmd":"/pmos:jira-epic","run":"pmos jira epic","name":"Use an epic","say":"pmos jira epic <initiative> new|<KEY>"},
118
+ {"cmd":"/pmos:docs-link","run":"pmos docs link","name":"Link a copy","say":"pmos docs link <file> <link>"},
119
+ {"cmd":"/pmos:docs-unlink","run":"pmos docs unlink","name":"Unlink","say":"pmos docs unlink <file> <kind>"},
120
+ {"cmd":"/pmos:docs-sync-start","run":"pmos docs sync-start","name":"Sync","say":"pmos docs sync-start <file> <kind> --use pmos|copy"},
121
+ {"cmd":"/pmos:refresh-since","run":"pmos refresh since","name":"Read now if changed","say":"pmos refresh since <source>"},
122
+ {"cmd":"/pmos:calendar-import","run":"pmos calendar import","name":"Import calendar","say":"pmos calendar import"},
123
+ {"cmd":"/pmos:report-draft","run":"pmos report draft","name":"Draft","say":"pmos report draft <cadence> <slot>"},
124
+ {"cmd":"/pmos:report-check","run":"pmos report check","name":"Check","say":"pmos report check <id>"},
125
+ {"cmd":"/pmos:report-rule","run":"pmos report rule","name":"Add a rule","say":"pmos report rule <id> add voice|wording|off|keep"},
126
+ {"cmd":"/pmos:report-issue","run":"pmos report issue","name":"Send","say":"pmos report issue <cadence> <slot>"},
127
+ {"cmd":"/pmos:schedule-run","run":"pmos schedule run","name":"Run now","say":"pmos schedule run <id>"},
128
+ {"cmd":"/pmos:schedule-disable","run":"pmos schedule disable","name":"Pause / resume","say":"pmos schedule disable <id>"},
129
+ {"cmd":"/pmos:schedule-enable","run":"pmos schedule enable","name":"Pause / resume","say":"pmos schedule enable <id>"},
130
+ {"cmd":"/pmos:schedule-edit","run":"pmos schedule edit","name":"Edit","say":"pmos schedule edit <id>"},
131
+ {"cmd":"/pmos:schedule-rm","run":"pmos schedule rm","name":"Remove","say":"pmos schedule rm <id>"},
132
+ {"cmd":"/pmos:rehearse-end","run":"pmos rehearse end","name":"Move the end","say":"pmos rehearse end <initiative> --to <date>"},
133
+ {"cmd":"/pmos:rehearse-cut","run":"pmos rehearse cut","name":"Cut it","say":"pmos rehearse cut <task|initiative>"},
134
+ {"cmd":"/pmos:press-release","run":"pmos press-release","name":"Draft again","say":"pmos press-release <initiative> --again"},
135
+ {"cmd":"/pmos:skill-copy","run":"pmos skill copy","name":"Copy to edit","say":"pmos skill copy <name>"},
136
+ {"cmd":"/pmos:skill-edit","run":"pmos skill edit","name":"Edit","say":"pmos skill edit <name> --file <f>"},
137
+ {"cmd":"/pmos:build-rollout","run":"pmos build rollout","name":"Roll out","say":"pmos build rollout <item> --to <percent>"},
138
+ {"cmd":"/pmos:build-rollback","run":"pmos build rollback","name":"Roll back","say":"pmos build rollback <item>"},
139
+ {"cmd":"/pmos:build-review","run":"pmos build review","name":"Review","say":"pmos build review <item>"},
140
+ {"cmd":"/pmos:loop-stop","run":"pmos loop stop","name":"Stop","say":"pmos loop stop <id> --note <text>"},
141
+ {"cmd":"/pmos:loop-resume","run":"pmos loop resume","name":"Resume","say":"pmos loop resume <id>"},
142
+ {"cmd":"/pmos:lab-delete","run":"pmos lab delete","name":"Delete version","say":"pmos lab delete <ini> --version <n>"},
143
+ {"cmd":"/pmos:lab-undo","run":"pmos lab undo","name":"Undo","say":"pmos lab undo <batch>"},
144
+ {"cmd":"/pmos:grill-mode","run":"pmos grill mode","name":"Change mode","say":"pmos grill mode full|exits|off"},
145
+ {"cmd":"/pmos:grill-cap","run":"pmos grill cap","name":"Set the cap","say":"pmos grill cap <dollars>"},
146
+ /* card-catalog:end */];
17
147
  const CLAUDE = [
18
148
  ['/compact', 'Compact the conversation', 'Claude Code summarises the conversation so far to free room.'],
19
149
  ['/clear', 'Clear the conversation', 'Claude Code starts again with an empty context in the same session.'],
@@ -80,12 +210,22 @@ function list(deps = {}) {
80
210
  return { status: 200, body: { ok: true, commands: out } };
81
211
  }
82
212
 
213
+ /** A pick from the PMOS group of the / menu: "/pmos:task-set LEN-1 --due 2026-12-01". Claude Code takes no /pmos command, so the
214
+ * chat turns it into words naming the pmos command before it reaches the session; anything else answers null. */
215
+ function pmosAsk(q) {
216
+ const m = /^(\/pmos:[a-z0-9-]+)(?:\s+([\s\S]*))?$/i.exec(String(q == null ? '' : q).trim());
217
+ const e = m && PMOS.find((x) => x.cmd === m[1] && x.run);
218
+ if (!e) return null;
219
+ const run = e.run + (m[2] ? ' ' + m[2].trim() : '');
220
+ return 'The PM picked `' + run + '` from the / menu (its form: `' + e.say + '`). Run it with the ids and values the PM gave; when one is missing, ask for it in one question. Then tell the PM the Undo line it prints.';
221
+ }
222
+
83
223
  // The commands a card's buttons run live beside the chat's commands (star-buttons-act-directly): GET /api/card-catalog
84
224
  // (lib/card-catalog-route.js) and the ✦ drafts' background job, POST/GET /api/star-drafts (lib/star-drafts-route.js). They ride on this
85
225
  // module's entry, so route-modules.js keeps its list.
86
226
  const BESIDE = [require('./card-catalog-route.js'), require('./star-drafts-route.js')];
87
227
 
88
- module.exports = {
228
+ module.exports = { pmosAsk,
89
229
  prefixes: ['/api/slash-commands', '/api/card-catalog', '/api/star-drafts'],
90
230
  list, sayOf, CLAUDE,
91
231
  handle: async (req, res, url, ctx) => {
@@ -311,7 +311,7 @@ const WRITES = {
311
311
 
312
312
  module.exports = {
313
313
  prefixes: ['/api/task-links'],
314
- sweepFor, sourcesOf, frame, acceptFor, LOOP,
314
+ sweepFor, sourcesOf, prdText, frame, acceptFor, LOOP,
315
315
  handle: async (req, res, url, ctx) => {
316
316
  const p0 = url.pathname;
317
317
  if (req.method === 'GET') {
@@ -0,0 +1,138 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* scope-cuts.js — the scope cuts that save a date (initiative scope-cuts-save-date; idea A43, factory job #1761).
4
+ *
5
+ * The dates ✦ (lib/proposals.js datesOf) answers a late task by giving its date up. A PM has a second answer: keep the date and move scope
6
+ * out of it. This file finds that answer for one initiative. PURE: it reads the tasks it is given and writes nothing; lib/proposals.js
7
+ * viewOf draws the result under the initiative's one ✦ and lib/routes-proposals.js applies it on the PM's ✓ (with Undo).
8
+ *
9
+ * THE RULE.
10
+ * · The date is the initiative's committed end (the row's `end`). No end, or an end already past: nothing (a past date cannot be saved by
11
+ * a cut; the dates ✦ proposes new dates for it).
12
+ * · Each open task's finish is forecast: its due date, or, for a late task, the time it had counted from today, the way the dates ✦
13
+ * counts it (so the two ✦ never disagree on a finish).
14
+ * · A task that finishes after the date is cut. A task that waits on a cut task (an approved task link: `to` waits on `from`) is cut too.
15
+ * · A ◇ milestone is a promise: it is never cut. When one finishes after the date, cuts alone cannot save it, and the proposal says so.
16
+ * · Closed tasks and Epic rows are never items.
17
+ * · Each item says what the cut costs: the PRD names it (listed last: the dearest cut), or a Jira ticket (a drafted comment, never a write).
18
+ * · A cut task moves to after the date: it starts the next working day after it and keeps its length.
19
+ *
20
+ * cutsOf(ini, T, o) PURE → [proposal] (zero or one): { id, sig, ini, group: 'scope', type: 'cut', section: 'check', title, why,
21
+ * sources, items: [{ id, task, title, from, to, finish, cost?, waits?, jira?, owner? }], data: { date, finish, keep, late,
22
+ * promise? } }
23
+ * o: { today (iso), limit (iso or day number: the committed end), links: [{ from, to }], named(title) → true when the PRD names it }
24
+ * noteOf(p) the note line a kept cut adds to its task
25
+ * countOf(lines) PURE → { kept, undone, still } scope cuts in a proposals ledger
26
+ * main(argv) `node lib/scope-cuts.js count [<root>]`: the health number (last line: cuts kept and not undone)
27
+ */
28
+ const path = require('path');
29
+
30
+ const TAG = '[scope-cut]';
31
+ const GROUP = 'scope';
32
+ const PR = () => require('./proposals.js'); // lazy: proposals.js requires this file
33
+ const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
34
+ const WBS_RE = /^\d+(\.\d+)*\s+/;
35
+
36
+ /** Working days from day a (exclusive) to day b (inclusive); 0 when b is not after a. */
37
+ function workdaysBetween(a, b) {
38
+ let n = 0;
39
+ for (let d = a + 1; d <= b; d++) { const w = new Date(d * 864e5).getUTCDay(); if (w !== 0 && w !== 6) n++; }
40
+ return n;
41
+ }
42
+
43
+ /** A task's forecast finish (day number), or null when it has no date. Late tasks get the time they had, from today (as datesOf). */
44
+ function finishOf(t, today) {
45
+ const P = PR();
46
+ if (t.e == null) return null;
47
+ if (t.e >= today) return t.e;
48
+ const len = t.s != null && t.e != null ? Math.max(1, t.e - t.s) : 5;
49
+ if (t.hasStart) return P.workday(P.workday(today + 1) + len);
50
+ return P.workday(today + Math.max(P.RISK_DAYS, len));
51
+ }
52
+
53
+ function cutsOf(ini, T, o = {}) {
54
+ const P = PR();
55
+ const today = P.dn(o.today), L = typeof o.limit === 'number' ? o.limit : P.dn(o.limit);
56
+ if (today == null || L == null || L < today) return [];
57
+ const open = [...(T || new Map()).values()].filter((t) => t && t.ini === ini && !t.closed && t.kind !== 'Epic');
58
+ if (!open.length) return [];
59
+ const fin = new Map();
60
+ for (const t of open) { const f = finishOf(t, today); if (f != null) fin.set(t.uid, f); }
61
+ const promises = open.filter((t) => t.ms && fin.has(t.uid) && fin.get(t.uid) > L);
62
+ const cut = new Map(); // uid → waits (the cut task's title it waits on, or '')
63
+ for (const t of open) if (!t.ms && fin.has(t.uid) && fin.get(t.uid) > L) cut.set(t.uid, '');
64
+ if (!cut.size) return [];
65
+ // a task that waits on a cut task cannot land without it: it goes too (a milestone never does; it is a promise)
66
+ const links = (o.links || []).filter((l) => l && l.from && l.to);
67
+ for (let grew = true; grew;) {
68
+ grew = false;
69
+ for (const l of links) {
70
+ if (!cut.has(l.from) || cut.has(l.to)) continue;
71
+ const b = T.get(l.to); if (!b || b.closed || b.ini !== ini || b.ms) continue;
72
+ cut.set(l.to, (T.get(l.from).title || l.from).replace(WBS_RE, '')); grew = true;
73
+ }
74
+ }
75
+ const named = typeof o.named === 'function' ? o.named : () => false;
76
+ const items = [];
77
+ for (const [uid, waits] of cut) {
78
+ const t = T.get(uid), f = fin.get(uid);
79
+ const len = t.s != null && t.e != null ? Math.max(0, t.e - t.s) : 0;
80
+ const s1 = P.workday(L + 1), e1 = P.workday(s1 + len);
81
+ const cost = t.jira ? 'jira' : named(t.title) ? 'prd' : '';
82
+ items.push({ id: uid, task: uid, title: t.title, from: { start: t.hasStart ? P.isoN(t.s) : '', due: P.isoN(t.e) }, to: { start: t.hasStart ? P.isoN(s1) : '', due: P.isoN(e1) },
83
+ finish: f != null ? P.isoN(f) : '', ...(cost ? { cost } : {}), ...(waits ? { waits } : {}), ...(t.jira ? { jira: true } : {}), ...(t.owner ? { owner: t.owner } : {}) });
84
+ }
85
+ // the cheapest cuts first: a task nobody's PRD names, then a Jira ticket (a comment, not a write), then what the PRD names
86
+ const rank = (x) => (x.cost === 'prd' ? 2 : x.cost === 'jira' ? 1 : 0);
87
+ items.sort((a, b) => rank(a) - rank(b) || String(b.finish).localeCompare(String(a.finish)) || String(a.title).localeCompare(String(b.title)));
88
+ const lastF = Math.max(...[...fin.values()]);
89
+ const kept = open.filter((t) => !cut.has(t.uid) && fin.has(t.uid)).map((t) => fin.get(t.uid));
90
+ const keep = kept.length ? Math.max(...kept) : null;
91
+ const late = workdaysBetween(L, lastF);
92
+ const date = P.md(L);
93
+ const named1 = items.filter((x) => x.cost === 'prd').length;
94
+ const why = 'At today\'s pace the last task ends ' + P.md(lastF) + ', ' + plural(late, 'working day', 'working days') + ' after ' + date + '. '
95
+ + (promises.length ? 'The ◇ ' + promises[0].title.replace(WBS_RE, '') + ' also ends after it and is a promise, so cuts alone cannot save ' + date + '.'
96
+ : (items.length === 1 ? 'Moving it' : 'Moving these') + ' to after ' + date + ' keeps the date' + (keep != null ? ': the rest ends by ' + P.md(keep) + '.' : '.'))
97
+ + (named1 ? ' The PRD names ' + (named1 === 1 ? (items.length === 1 ? 'it' : 'one of them') : named1 + ' of them') + ': cut ' + (named1 === 1 ? 'it' : 'those') + ' last.' : '');
98
+ const id = P.idOf(ini, GROUP, 'cut', '');
99
+ const p = { id, ini, group: GROUP, type: 'cut', section: 'check',
100
+ title: 'Cut ' + plural(items.length, 'task', 'tasks') + ' to keep ' + date,
101
+ why, sources: [{ label: 'the plan', ref: plural(items.length, 'task', 'tasks') + ' due after ' + P.isoN(L) }], items,
102
+ data: { date: P.isoN(L), finish: P.isoN(lastF), keep: keep != null ? P.isoN(keep) : '', late, ...(promises.length ? { promise: promises[0].title } : {}) } };
103
+ // a new date or a moved task is a new signature: a ✕ holds while the tasks and the date it rests on hold
104
+ p.sig = 'd:' + P.hash([id, P.isoN(L), ...items.map((x) => x.task + '@' + x.finish)].join('|'));
105
+ return [p];
106
+ }
107
+
108
+ /** The note line a kept cut adds to its task. */
109
+ function noteOf(p) { return 'Cut to keep ' + PR().md(PR().dn(p.data && p.data.date)) + ' (PMOS ✦): ' + String(p.why || '').slice(0, 300); }
110
+
111
+ /** PURE. Scope cuts in a proposals ledger (oldest first): kept, undone, and kept and not undone. */
112
+ function countOf(lines) {
113
+ const undone = new Set();
114
+ for (const l of lines || []) if (l && l.kind === 'undo' && l.batch) undone.add(l.batch);
115
+ let kept = 0, back = 0;
116
+ for (const l of lines || []) {
117
+ if (!l || l.kind !== 'keep' || !Array.isArray(l.wrote) || !l.wrote.some((w) => w && w.scope === true)) continue;
118
+ kept++; if (undone.has(l.batch)) back++;
119
+ }
120
+ return { kept, undone: back, still: kept - back };
121
+ }
122
+
123
+ function main(argv, { say = (s) => console.log(s), cwd = process.cwd() } = {}) {
124
+ const pos = argv.filter((a) => !a.startsWith('--'));
125
+ const [sub = 'count', rootArg] = pos;
126
+ if (sub !== 'count') { say('usage: node lib/scope-cuts.js count [<root>] — scope cuts kept, undone and still kept (the last line)'); return 2; }
127
+ const root = path.resolve(cwd, rootArg || '.');
128
+ let dir;
129
+ try { dir = require('./driver.js').stateDirOf(root); } catch (e) { say(`${TAG} could not find the state folder of ${root}: ${(e && e.message) || e}`); return 1; }
130
+ const c = countOf(PR().readLines(PR().ledgerFile(dir)));
131
+ say(`${TAG} ${plural(c.kept, 'scope cut', 'scope cuts')} kept, ${c.undone} undone`);
132
+ say(String(c.still));
133
+ return 0;
134
+ }
135
+
136
+ module.exports = { GROUP, TAG, cutsOf, finishOf, noteOf, countOf, workdaysBetween, main };
137
+
138
+ if (require.main === module) process.exitCode = main(process.argv.slice(2));
@@ -28,6 +28,7 @@ const path = require('path');
28
28
  const { execFileSync } = require('child_process');
29
29
  const actorLib = require('./actor.js');
30
30
  const driver = require('./driver.js');
31
+ const LIVE = require('./live-events.js'); // bet A458: each change shows on the open pages at once (GET /api/live-rows)
31
32
  const { repoScript } = require('./repo-script.js');
32
33
  const B = require(repoScript('boards.js'));
33
34
  const TI = require('./task-items.js');
@@ -187,6 +188,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
187
188
  if (!e.body || e.body.ok !== true) return fail(`added ${t.uid}, but it was not placed under ${sec}: ${(e.body && e.body.error) || 'the write was refused'}`);
188
189
  }
189
190
  if (body.parent) console.error('[task-parent]', 'add', 1);
191
+ LIVE.emit(stateDir, { id: t.uid, field: 'added', value: { initiative: id, title: t.title, status: t.status, owner: t.owner || '', start: t.start || '', end: t.end || '', ...(sec ? { section: sec } : {}), ...(body.parent ? { parent: body.parent } : {}) } });
190
192
  if (json) say(JSON.stringify({ ok: true, task: { id: t.uid, board: t.board, title: t.title, state: t.status, owner: t.owner, start: t.start, due: t.end, ...(sec ? { stage: sec } : {}), ...(body.parent ? { parent: body.parent } : {}) } }));
191
193
  else say(`✓ added ${t.uid} · ${t.status} · ${t.title}${body.parent ? ' · a subtask of ' + body.parent : ''}${sec ? ' · under ' + sec : ''}${t.end ? ' · due ' + t.end : ''}. The initiative's Tasks section shows it. Nothing was sent.`);
192
194
  return 0;
@@ -249,7 +251,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
249
251
  if (PIN_FLAGS.some((k) => flags[k])) body.pinned = flags.pin ? true : flags['no-pin'] ? false : null;
250
252
  const e = boards.taskEdit(ctx, body, g);
251
253
  if (!e.body || e.body.ok !== true) refused.push({ task: id, error: (e.body && e.body.error) || 'the write was refused' });
252
- else done.push({ task: id, title: t.title, set: Object.fromEntries(keys.map((k) => [k, k === 'stage' ? body.section : body[k]])), ...(body.parent !== undefined ? { was: (e.body.from && e.body.from.parent) || '' } : {}) });
254
+ else { LIVE.emit(stateDir, LIVE.fieldEvents(id, body)); done.push({ task: id, title: t.title, set: Object.fromEntries(keys.map((k) => [k, k === 'stage' ? body.section : body[k]])), ...(body.parent !== undefined ? { was: (e.body.from && e.body.from.parent) || '' } : {}) }); }
253
255
  }
254
256
  const what = (x) => Object.entries(x).map(([k, v]) => (k === 'stage' ? (v ? 'under ' + v : 'under no stage') : k === 'parent' ? (v ? 'under ' + v : 'at the top level') : k === 'milestone' ? (v ? 'a milestone' : 'not a milestone') : k === 'pinned' ? (v === true ? 'pinned to the timeline' : v === false ? 'off the timeline' : 'pinned by the rule') : v === '' ? 'no ' + k : k + ' ' + v)).join(', ');
255
257
  // a date changed outside a drag: inside the approved links, what waits on it moves quietly (batch 11 item 15, the grey ✦ on the page)
@@ -329,7 +331,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
329
331
  if (!t) { refused.push({ task: id, error: `no task ${id}; pmos task list <initiative> --all names them` }); continue; }
330
332
  const r = boards.taskDelete(ctx, { ws: w.id, board: t.board, task: id, ...(flags.why ? { why: flags.why } : {}) }, g);
331
333
  if (!r.body || r.body.ok !== true) refused.push({ task: id, error: (r.body && r.body.error) || 'the write was refused' });
332
- else done.push({ task: id, title: t.title });
334
+ else { LIVE.emit(stateDir, { id, field: 'removed', value: true }); done.push({ task: id, title: t.title }); }
333
335
  }
334
336
  if (json) say(JSON.stringify({ ok: !refused.length, done, refused }));
335
337
  else {
@@ -388,7 +390,7 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
388
390
  if (t.state === to) { done.push({ task: id, title: t.title, state: to, same: true }); continue; }
389
391
  const r = boards.taskState(ctx, { ws: w.id, board: t.board, task: id, state: to, ...(flags.why ? { why: flags.why } : {}) }, g);
390
392
  if (!r.body || r.body.ok !== true) refused.push({ task: id, error: (r.body && r.body.error) || 'the write was refused' });
391
- else done.push({ task: id, title: t.title, state: to });
393
+ else { LIVE.emit(stateDir, { id, field: 'state', value: to }); done.push({ task: id, title: t.title, state: to }); }
392
394
  }
393
395
  if (json) say(JSON.stringify({ ok: !refused.length, done, refused }));
394
396
  else {
@@ -19,6 +19,7 @@ const RULE = [
19
19
  'Write conditions in the PM\'s plain words ("Only when they touch customer data"), never as a rule or code.',
20
20
  'In the chat, say in one line per choice why you drafted it so (quote the PM or the file they added), then ask at most one question when something is unclear.',
21
21
  'You never save, copy or archive a workflow: the PM presses Create workflow. Never write a .jsonl file by hand.',
22
+ /* card-catalog:begin, generated by bin/card-catalog-gen.js: edit lib/card-catalog.json, not this block */"The card buttons run these pmos commands (the card catalog; who acts: you = one press with Undo, agent = PMOS starts a run, waits = only after the PM says yes). Run the one that fits the PM's ask, and tell the PM the Undo line it prints: pmos workflow switch <id> --to <workflow> --stage <stage> --why <text> (Use for an initiative; you); pmos build rollout <item> --to <percent> (Roll out; waits); pmos build rollback <item> (Roll back; waits); pmos build review <item> (Review; agent); pmos lab delete <ini> --version <n> (Delete version; you); pmos lab undo <batch> (Undo; you); pmos grill mode full|exits|off (Change mode; you); pmos grill cap <dollars> (Set the cap; you)."/* card-catalog:end */,
22
23
  ].join('\n');
23
24
 
24
25
  /** The message as PMOS types it into the session: the rule, then the PM's words. */
@@ -156,8 +156,9 @@ const ROWS = [
156
156
 
157
157
  /* R · a broken limit */
158
158
  const C = await open({ m: model({ crit: true }), rows: [] });
159
- const cr = await C.page.evaluate(() => ({ crit: document.querySelector('#insHero').classList.contains('crit'), t: document.querySelector('#brief').textContent, pulse: !!document.querySelector('#nsRow .ins-nsc .cz-dot.m-crit') }));
160
- ok('R1 a broken limit is the one time the ✦ line turns red, and its dot pulses', cr.crit && /fell under its floor/.test(cr.t) && cr.pulse, JSON.stringify(cr));
159
+ const cr = await C.page.evaluate(() => ({ crit: document.querySelector('#insHero').classList.contains('crit'), t: document.querySelector('#brief').textContent, pulse: !!document.querySelector('#nsRow .ins-nsc .pm-glyph[data-state="late"]') }));
160
+ // state-glyphs: the broken limit is the Late glyph; only Needs you moves now (brief agreed 2026-11-23), so it no longer pulses
161
+ ok('R1 a broken limit is the one time the ✦ line turns red, and its glyph says Late', cr.crit && /fell under its floor/.test(cr.t) && cr.pulse, JSON.stringify(cr));
161
162
  await shot(C.page, 'okr-crit', '#stage');
162
163
  await C.ctx.close();
163
164
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.783.0",
3
+ "version": "0.785.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.783.0",
9
+ "version": "0.785.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.783.0",
3
+ "version": "0.785.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -14,6 +14,7 @@ import { endStage } from './bd-pins.js';
14
14
  import { stageOfRow, wfOf, wfIcon, catOfRow, catLabel, CAT_ORDER } from './bd-wf.js';
15
15
  import { offTone, md, dy } from './bd-span.js';
16
16
  import { stageName as oneStageName } from './stage-chip.js';
17
+ import { stateGlyph } from './state-glyph.js';
17
18
 
18
19
  /** Every column in its place, left to right: key, title, width in px. Initiative takes what the others leave of its 250 px. */
19
20
  export const COLS = [
@@ -84,7 +85,8 @@ const stageName = (r) => oneStageName(r) || ((s) => (s && s.name) || '')(stageOf
84
85
  function cell(r, k, o) {
85
86
  const now = o.now;
86
87
  if (k === 'stage') return `<span class="tg-c">${esc(stageName(r))}</span>`;
87
- if (k === 'status') { const t = stTone(r, now); return t ? `<span class="tg-c tg-cst ${t === 'none' ? 'q' : t}"><i class="cz-dot ${t === 'none' ? 'q' : t}" aria-hidden="true"></i>${STATUS[t]}</span>` : '<span class="tg-c"></span>'; }
88
+ // a state is a shape, not a word (state-glyphs): the glyph carries the word as its label and tooltip; the facts stay in their own cells
89
+ if (k === 'status') { const t = stTone(r, now); if (!t) return '<span class="tg-c"></span>'; const m = nextMs(r, now); return `<span class="tg-c tg-cst">${stateGlyph(t, { why: m && m.late ? `${m.name}, ${m.over} ${m.over === 1 ? 'day' : 'days'} late` : '' })}</span>`; }
88
90
  if (k === 'start') { const d = day(r.start); return `<span class="tg-c">${d ? esc(dy(d, now)) : ''}</span>`; }
89
91
  if (k === 'ms') {
90
92
  const m = nextMs(r, now);
@@ -48,7 +48,8 @@ import { mergeClose } from './program-model.js';
48
48
  import { stagesOfRow } from './bd-wf.js';
49
49
  import { shownMs, endStage } from './bd-pins.js';
50
50
  import { stageName } from './stage-chip.js'; // W1: the one stage
51
- import { provenStatus } from './status-proof.js'; // T3: a status renders only with its source and read time
51
+ import { provenStatus } from './status-proof.js';
52
+ import { stateGlyph } from './state-glyph.js'; // a state is a shape, not a word (state-glyphs) // T3: a status renders only with its source and read time
52
53
 
53
54
  const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
54
55
  const day = (v) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(v || '')); return m ? new Date(+m[1], +m[2] - 1, +m[3]) : null; };
@@ -123,7 +124,8 @@ export function fcRange(r) {
123
124
  const toneOf = (r, now) => { const ps = provenStatus(r); return r.late || anyMsLate(r, now) ? 'late' : ps === 'at risk' ? 'risk' : r.track && r.track.you ? 'you' : ps === 'on track' ? 'ok' : 'q'; }; // T3: a proven status only
124
125
  /** A row's dot (batch 13 item 4): only off track. 'late' | 'risk' | 'q' (on hold) | null. */
125
126
  export const offTone = (r, now) => { const t = toneOf(r, now); return t === 'late' || t === 'risk' ? t : r.status === 'on hold' ? 'q' : null; };
126
- const dotHtml = (r, now) => { const t = offTone(r, now); return t ? `<i class="cz-dot ${t}${t === 'q' ? '' : ' m-warn'}" aria-hidden="true"></i>` : ''; };
127
+ /** A row's state glyph (state-glyphs): only off track, as before; on hold is Waiting on others. '' when on track (zero is silence). */
128
+ const dotHtml = (r, now, cls = '') => { const t = offTone(r, now); return t ? stateGlyph(t === 'q' ? 'wait' : t, { size: 12, cls }) : ''; };
127
129
  const dated = (r) => day(r.start) || day(r.end) || (r.track && day(r.track.forecast)) || (r.draft && day(r.draft.start));
128
130
  /** Done work leaves no edge tab (TsCGrill 5): the initiative is closed (its workflow's terminal stage, batch 26 item 5), past Deliver, or every
129
131
  * part it counts is done. */
@@ -221,7 +223,7 @@ const slipWords = (r, e) => { const p = r.plan, b = p && day(p.end), n = p && p.
221
223
  * (pm/cozy-pop-work.js), so the bar has one design everywhere (Wawan, 2026-11-19). X: a date → its percent of the box; the markup sits in a
222
224
  * position:relative box of the row's height. o: { pxPct: px per 1 % of the box, reach: days in which ◇s merge, mode: 'all' | 'pinned',
223
225
  * label: false drops the end label, phone } → html */
224
- export const rowBar = (r, X, now, o = {}) => qBar(r, X, now, !!o.phone, md, o.pxPct || 0, { reach: o.reach || 7, mode: o.mode || 'all', noLabel: o.label === false, endIn: !!o.endIn });
226
+ export const rowBar = (r, X, now, o = {}) => qBar(r, X, now, !!o.phone, md, o.pxPct || 0, { reach: o.reach || 7, mode: o.mode || 'all', noLabel: o.label === false, endIn: !!o.endIn, noState: true }); // Work and the popup show the state before the title (state-glyphs)
225
227
  function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
226
228
  const s = day(r.start), e = day(r.end), fr = fcRange(r), fc = r.forecast ? null : r.track && day(r.track.forecast), tone = toneOf(r);
227
229
  const tm = taskMarks(r, X, now, phone, pxPct, ms), et = tm.end, note = markWords(r, now);
@@ -248,10 +250,13 @@ function qBar(r, X, now, phone, fmt, pxPct, ms = {}) {
248
250
  const ed = et ? day(et.date) : e; if (+ed !== +e) hover.push('Initiative ends ' + dy(e, now));
249
251
  const name = landsOf(r, et), eTitle = name + ' · ' + md(ed) + (et && et.stage ? ' · ◆ ' + et.stage : '') + (et && et.done ? ' · done' : isLate ? ' · late' : '');
250
252
  // nothing lands (batch 25 item 13): a workflow with no ◆ stage and no dated milestone draws no ◇ and no label; the bar's own end says it
251
- if (!name) return out + planMarks(r, X, phone, fmt);
253
+ // the state glyph sits at the end of the bar (state-glyphs): after the end label, or at the bar's end when there is no label
254
+ const sg = phone || ms.noState ? '' : dotHtml(r, now, 'tg-sg'), atEnd = Math.max(X(e), over ? X(now) : 0, late ? X(fc) : 0, fr ? X(fr.high) : 0);
255
+ if (!name) return out + (sg ? `<span class="tg-sgw" style="left:${P(atEnd)}">${sg}</span>` : '') + planMarks(r, X, phone, fmt);
252
256
  if (!tm.endMerged) out += `<button type="button" class="tg-end${et && et.done ? ' dn' : ''}${isLate ? ' late' : ''}" data-ms-pick="${esc(r.key)}" data-ms-id="${esc(et ? et.id : '')}" style="left:${P(X(ed))}" aria-haspopup="dialog" aria-label="${esc(eTitle + '. Milestones of ' + r.title)}" title="${esc(eTitle + (clash ? '. ' + clash : ''))}"></button>`;
253
257
  // with the Next milestone column on, the column names it and the bar's end has no label (StsA8Board); the ◇ keeps the words as its hover
254
- if (!ms.noLabel) out += endLabel(Math.max(X(e), X(ed), over ? X(now) : 0, late ? X(fc) : 0, fr ? X(fr.high) : 0), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r));
258
+ if (!ms.noLabel) out += endLabel(Math.max(atEnd, X(ed)), name, ed, isLate ? 'late' : risk, now, pxPct, hover, slipHtml(r) + sg);
259
+ else if (sg) out += `<span class="tg-sgw" style="left:${P(Math.max(atEnd, X(ed)))}">${sg}</span>`;
255
260
  } else if (fc) {
256
261
  out += `<span class="tg-fc solo" style="left:${P(X(fc))};width:12px;margin-left:-12px" title="Jira forecast ${esc(md(fc))}"></span>` + endLabel(X(fc), 'Jira forecast', fc, '', now, pxPct, [], '');
257
262
  } else if (r.draft && day(r.draft.start)) {
@@ -537,7 +542,7 @@ function scaled(rows, M, o) {
537
542
  const ratio = days / viewDays, tpx = Math.max(200, o.trackPx || (o.phone ? 340 : 1100)), pxDay = tpx / viewDays;
538
543
  // the columns beside the names (batch 19 item 5, StsA8Board): a desktop only; o.cols from pm/bd-cols.js colsFor, or null
539
544
  const C = !o.phone && o.cols ? o.cols : null;
540
- const msO = { sp, reach: Math.max(1, Math.round(40 / pxDay)), mode: o.msMode || 'pinned', noLabel: !!(C && C.msOn) }; // a row's milestone ◇s closer than ~40 px merge (batch 11 item 3); the Filter's milestones (batch 13 item 4)
545
+ const msO = { sp, reach: Math.max(1, Math.round(40 / pxDay)), mode: o.msMode || 'pinned', noLabel: !!(C && C.msOn), noState: !!(C && C.statusOn) }; // a row's milestone ◇s closer than ~40 px merge (batch 11 item 3); the Filter's milestones (batch 13 item 4)
541
546
  const ov = overlay(W, X, now, sprint, rel), pxPct = (tpx * (W.fixed ? 1 : ratio)) / 100;
542
547
  const ra = rel && day(rel.iso), sa = sprint && day(sprint.start), sb = sprint && day(sprint.end);
543
548
  // an undated initiative's track says so beside today, where the view opens
@@ -584,7 +589,8 @@ function scaled(rows, M, o) {
584
589
  // one line per initiative (PgTimeline): its status dot and its name; the owner and the step stay in the row's title for a pointer and a reader
585
590
  const one = (r, cls) => { const s = o.status(r), sub = [r.owner, stageName(r), s.text].filter(Boolean).join(' · ');
586
591
  // the dot keeps its place while it is silent, so every name starts at the same line (XcalmA1Desk)
587
- const dot = dotHtml(r, now) || '<i class="tg-nodot" aria-hidden="true"></i>', nm = `<b>${r.inProgram && o.memberIcon ? o.memberIcon(r.inProgram) : ''}${esc(r.title)}</b>`;
592
+ // the state glyph sits at the end of the bar now (state-glyphs); the blank keeps every name on the same line
593
+ const dot = '<i class="tg-nodot" aria-hidden="true"></i>', nm = `<b>${r.inProgram && o.memberIcon ? o.memberIcon(r.inProgram) : ''}${esc(r.title)}</b>`;
588
594
  // with columns, the Status cell carries the dot and the name has none (say it once)
589
595
  const inner = C ? `<span class="tg-c0">${C.statusOn ? '' : dot}${nm}</span>${C.cells(r)}` : dot + nm, lab = C ? [r.title, C.label(r)].filter(Boolean).join(', ') : r.title + ', ' + sub;
590
596
  return `<div class="tg-r${cls || ''}${o.sel === r.key ? ' sel' : ''}" data-row="${esc(r.key)}"><button type="button" class="tg-n ini2" data-key="${esc(r.key)}" title="${esc(sub)}" aria-label="${esc(lab)}">${inner}</button><div class="tg-p"${ext(r)}>${ov}${dated(r) ? qBar(r, X, now, false, fmt, pxPct, msO) + edgeTabs(r, X, now, false) : ND}</div></div>`; };
@@ -16,6 +16,7 @@ import { nextHtml } from './bd-next.js';
16
16
  import { markFor } from './changed-mark.js'; // bet A456: the ✦ and Undo on a row PMOS changed in the last 24 h
17
17
  import { stageName, stageChip } from './stage-chip.js'; // W1: the one stage
18
18
  import { provenStatus, NO_SIGNAL } from './status-proof.js';
19
+ import { stateGlyph, fromStatus, isStateWord } from './state-glyph.js'; // a state is a shape, not a word (state-glyphs)
19
20
  import * as PL from './bd-phone-line.js'; // the phone row's own small line, no Gantt on a phone (board PhIniB) // T3: a status renders only with its source and read time
20
21
 
21
22
  let A = null; // the page: { M(), statusOf(r), usual(t), trail(r), sel(), groups(L), folded(key), laneHead(g), subTile(name), memberIcon(id), programOf(r), programs(),
@@ -302,11 +303,13 @@ export function stagesHtml(L, o = {}) {
302
303
  }
303
304
 
304
305
  /* ── the phone list (BdPhone) ─────────────────────────────────────────────────────────────────────────────────── */
305
- /** A phone row: the status dot, the title, the stage and what it waits on; the workflow's icon at the end when the board has more than one. */
306
+ /** A phone row: the state glyph, the title, the stage and what it waits on; the workflow's icon at the end when the board has more than one. */
306
307
  function phoneRow(r) {
307
308
  const s = statusLine(r), t = r.track || {}, w = WF.stageOfRow(r);
308
309
  // the phone design (Ph2_work): "Discover · 15 days over · wawan", the late or at risk words in their own tone, no kind icon before the name
309
- const say = t.you ? t.you.replace(/^Your /, 'your ') : s.tone !== 'ok' && s.tone !== 'q' ? s.text.toLowerCase() : '';
310
+ // the state word is the glyph before the title (state-glyphs); a fact ("15 days over") stays in the meta line
311
+ const say = t.you ? t.you.replace(/^Your /, 'your ') : s.tone !== 'ok' && s.tone !== 'q' && !isStateWord(s.text) ? s.text.replace(/^At risk · /, '').toLowerCase() : '';
312
+ const gs = fromStatus(s);
310
313
  const st = stageName(r) || (w && w.name) || '';
311
314
  // a Project (Ph2 checks across kinds): the end date leads the late words, "ends 4 Dec"
312
315
  const em = WK.kindOf(r.kind) === 'project' && /^\d{4}-\d{2}-\d{2}/.test(String(r.end || '')) ? String(r.end).slice(0, 10).split('-') : null;
@@ -323,7 +326,7 @@ function phoneRow(r) {
323
326
  const line = PL.lineHtml(r, { today, next: ahead, alert: s.tone === 'red' || s.tone === 'late' || s.tone === 'risk' });
324
327
  const sg = r.signals && r.signals.n ? esc(sigWords(r.signals.n)) : ''; // A157: the count in words; the tap opens the panel, which lists them (sigListHtml)
325
328
  const sub = [st ? stIc + esc(st) : '', line ? '' : ends, nx, lt, sg, say ? `<em class="${t.you ? 'you' : esc(s.tone)}">${esc(say)}</em>` : '', r.owner ? esc(r.owner) : ''].filter(Boolean).join(' · ');
326
- return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog"><i class="cz-dot ${s.tone} ${s.mo || ''}"></i><span class="tx"><span class="t">${nameHtml(r)}</span><span class="s q">${sub}</span>${line}</span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
329
+ return `<button type="button" class="bd-lrow ini2${A.sel && A.sel() === r.key ? ' sel' : ''}" data-key="${esc(r.key)}" aria-haspopup="dialog">${stateGlyph(gs.state, { why: gs.why, size: 16, progress: outOf(r) ? outOf(r).pct / 100 : 0 })}<span class="tx"><span class="t">${nameHtml(r)}</span><span class="s q">${sub}</span>${line}</span>${t.you && t.days != null ? `<span class="r">${t.days}d</span>` : ''}${many() ? WF.wfIcon(WF.wfOf(r), 18) : ''}</button>`;
327
330
  }
328
331
  export function phoneListHtml(L) {
329
332
  const you = L.filter((r) => r.track && r.track.you), bad = L.filter((r) => !you.includes(r) && needOf(r) <= 3), left = L.filter((r) => !you.includes(r) && !bad.includes(r));
@@ -42,6 +42,7 @@ table.pm-table.wk:not(.has-x) col.c-title { width: auto; }
42
42
  @media (max-width: 1280px) { table.pm-table.wk col.c-title { width: 200px; } table.pm-table.wk col.c-ms { width: 130px; } table.pm-table.wk col.c-date { width: 150px; } table.pm-table.wk col.c-stage { width: 96px; } }
43
43
  table.pm-table.wk th, table.pm-table.wk td { height: 40px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
44
44
  table.pm-table.wk td.n { font-weight: var(--fw-strong); color: var(--ink); }
45
+ table.pm-table.wk td.n .wk-sg { margin-right: 8px; } /* the state glyph before the title (state-glyphs) */
45
46
  table.pm-table.wk tr.wk-i { cursor: pointer; }
46
47
  table.pm-table.wk tr.wk-i:focus-visible { outline: none; box-shadow: inset var(--glow); }
47
48
  table.pm-table.wk tr.wk-i.sel td { background: var(--blue-tint); }