create-pmos 0.730.0 → 0.732.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +45 -45
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/brand/icons.json +59 -0
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +44 -0
- package/workspace/design-system/brand/icons.json +59 -0
- package/workspace/guide/agent-capabilities.md +1 -0
- package/workspace/guide/cli.md +10 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/initiatives-and-next-steps.md +23 -1
- package/workspace/guide/layout.md +3 -1
- package/workspace/guide/positioning.md +33 -0
- package/workspace/lib/board-premium.js +10 -0
- package/workspace/lib/customer-signals.js +207 -0
- package/workspace/lib/headless.js +1 -0
- package/workspace/lib/icon-check.js +280 -0
- package/workspace/lib/job-graph.js +1 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/positioning-draft.js +225 -0
- package/workspace/lib/principles-cli.js +109 -0
- package/workspace/lib/principles.js +165 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-boards.js +5 -1
- package/workspace/lib/routes-principles.js +109 -0
- package/workspace/lib/routes-strategy-card.js +33 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/agenda-live.js +1 -1
- package/workspace/public/pm/bd-positioning.js +91 -0
- package/workspace/public/pm/bd-principles.js +64 -0
- package/workspace/public/pm/bd-span.js +1 -1
- package/workspace/public/pm/bd-sprint-ds.js +1 -1
- package/workspace/public/pm/bd-sprint.js +1 -1
- package/workspace/public/pm/bd-strategy.js +10 -3
- package/workspace/public/pm/bd-views.js +36 -3
- package/workspace/public/pm/bd-work.js +1 -1
- package/workspace/public/pm/cozy-board.css +14 -0
- package/workspace/public/pm/cozy-day-pick.js +1 -1
- package/workspace/public/pm/cozy-events-view.js +1 -1
- package/workspace/public/pm/cozy-popup.js +8 -22
- package/workspace/public/pm/cozy-rec-present.js +1 -1
- package/workspace/public/pm/cozy-viewer.js +4 -3
- package/workspace/public/pm/goal-chat.js +1 -1
- package/workspace/public/pm/home-chat.js +1 -1
- package/workspace/public/pm/home-rec-row.js +1 -1
- package/workspace/public/pm/home-today.js +3 -3
- package/workspace/public/pm/ini-agent.js +1 -1
- package/workspace/public/pm/ini-edit.js +2 -2
- package/workspace/public/pm/ini-groups.js +1 -1
- package/workspace/public/pm/ini-versions.js +1 -1
- package/workspace/public/pm/ini-view.js +2 -2
- package/workspace/public/pm/intent.js +2 -2
- package/workspace/public/pm/okr-list.js +2 -2
- package/workspace/public/pm/pinned-views.js +1 -1
- package/workspace/public/pm/premium-board.js +2 -0
- package/workspace/public/pm/premium-insights.js +3 -3
- package/workspace/public/pm/premium-mtg-present.js +2 -2
- package/workspace/public/pm/premium-mtg-replay.js +1 -1
- package/workspace/public/pm/premium-shell.js +1 -1
- package/workspace/public/pm/premium-vw-mtg.js +1 -1
- package/workspace/public/pm/premium-vw-slides.js +3 -3
- package/workspace/public/pm/task-card.js +1 -1
- package/workspace/public/pm/wf-page.js +1 -1
- package/workspace/public/premium-board.html +2 -0
- package/workspace/public/premium-events.html +2 -2
- package/workspace/skills/principles-draft.skill +23 -0
- package/workspace/test-lists/icon-check.json +9 -0
- package/workspace/test-lists/positioning-draft.json +9 -0
- package/workspace/test-lists/principles.json +9 -0
- package/workspace/test-lists/roadmap-signal-count.json +9 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* customer-signals.js — the customer signals behind each roadmap item (initiative roadmap-signal-count, bet A157;
|
|
4
|
+
* done test planning/done-tests/roadmap-signal-count.md).
|
|
5
|
+
*
|
|
6
|
+
* A customer signal is one customer asking for, or hurting from, what an initiative does: who, where it was heard, a link
|
|
7
|
+
* and a one-line note. The Board shows how many back each item and a tap lists them (public/pm/bd-views.js).
|
|
8
|
+
*
|
|
9
|
+
* THE LEDGER: customer-signals.jsonl in the repository's runs directory (planning/runs/ for PMOS itself, pmos/state/ in a
|
|
10
|
+
* kit repository; lib/plan-ledgers.js runsDir). Append-only JSON lines:
|
|
11
|
+
* { v: 1, ev: 'added', sid, at, initiative, who, where, link, note, via }
|
|
12
|
+
* { v: 1, ev: 'removed', sid, at, via }
|
|
13
|
+
* sid 'cs_' + 10 hex of sha1(initiative, who in lower case, link or note): the same ask added twice is one signal
|
|
14
|
+
* where ticket | call | email | chat | survey | review | other
|
|
15
|
+
* note at most 140 characters. The customer's own text stays where it was written; the ledger keeps a pointer and a line.
|
|
16
|
+
*
|
|
17
|
+
* The record's `raised_by: "customer: <name>"` (lib/initiative-origin.js) counts as one signal too (where `record`), unless
|
|
18
|
+
* that customer already has one in the ledger.
|
|
19
|
+
*
|
|
20
|
+
* parseAdd(o) → { ok, line } | { ok: false, error } PURE
|
|
21
|
+
* fold(lines) → Map(initiative → [signal], newest first) PURE
|
|
22
|
+
* rowSignals(list, origin) → { n, items } | null PURE (null: zero is silence)
|
|
23
|
+
* ledgerFile(root) · readLines(root) · sigOf(root) · byInitiative(root) · add(root, o) · remove(root, sid) · count(root)
|
|
24
|
+
*
|
|
25
|
+
* CLI (what chat and agents run; nothing else writes the ledger):
|
|
26
|
+
* node workspace/lib/customer-signals.js add <initiative> --who "<customer>" [--where ticket] [--link <url>] [--note "<one line>"] [--root <checkout>]
|
|
27
|
+
* node workspace/lib/customer-signals.js remove <sid> [--root <checkout>]
|
|
28
|
+
* node workspace/lib/customer-signals.js list [<initiative>] [--root <checkout>] [--json]
|
|
29
|
+
* node workspace/lib/customer-signals.js count [<checkout>] last line: the number of initiatives with a signal
|
|
30
|
+
* Every log line carries [signals]. Exit codes: 0 done, 1 refused, 2 usage.
|
|
31
|
+
*/
|
|
32
|
+
const fs = require('fs');
|
|
33
|
+
const path = require('path');
|
|
34
|
+
const crypto = require('crypto');
|
|
35
|
+
|
|
36
|
+
const TAG = '[signals]';
|
|
37
|
+
const FILE = 'customer-signals.jsonl';
|
|
38
|
+
const WHERE = Object.freeze(['ticket', 'call', 'email', 'chat', 'survey', 'review', 'other']);
|
|
39
|
+
const MAX_WHO = 60;
|
|
40
|
+
const MAX_NOTE = 140;
|
|
41
|
+
const MAX_LINK = 500;
|
|
42
|
+
const MAX_ITEMS = 10;
|
|
43
|
+
const ID_RE = /^[a-z0-9][a-z0-9._-]{0,120}$/;
|
|
44
|
+
const SID_RE = /^cs_[0-9a-f]{10}$/;
|
|
45
|
+
const LINE_BREAK = /[\r\n\x00-\x08\x0b-\x1f]/;
|
|
46
|
+
|
|
47
|
+
const str = (v) => (v == null ? '' : String(v)).trim();
|
|
48
|
+
const sidOf = (initiative, who, key) => 'cs_' + crypto.createHash('sha1').update([initiative, who.toLowerCase(), key].join('\0')).digest('hex').slice(0, 10);
|
|
49
|
+
|
|
50
|
+
/** One `added` line from what a caller gives, or the reason it is refused. PURE. */
|
|
51
|
+
function parseAdd(o = {}, now = new Date()) {
|
|
52
|
+
const initiative = str(o.initiative), who = str(o.who), where = str(o.where || 'other').toLowerCase(), link = str(o.link), note = str(o.note);
|
|
53
|
+
if (!ID_RE.test(initiative)) return { ok: false, error: 'name the initiative by its id (lowercase, as on its record)' };
|
|
54
|
+
if (!who) return { ok: false, error: 'say who the customer is: --who "<person or company>"' };
|
|
55
|
+
if (who.length > MAX_WHO || LINE_BREAK.test(who)) return { ok: false, error: `the customer is one line of at most ${MAX_WHO} characters` };
|
|
56
|
+
if (!WHERE.includes(where)) return { ok: false, error: `where is one of: ${WHERE.join(', ')}` };
|
|
57
|
+
if (link.length > MAX_LINK || LINE_BREAK.test(link)) return { ok: false, error: `the link is one line of at most ${MAX_LINK} characters` };
|
|
58
|
+
if (note.length > MAX_NOTE || LINE_BREAK.test(note)) return { ok: false, error: `the note is one line of at most ${MAX_NOTE} characters; the customer's own words stay where they were written` };
|
|
59
|
+
const at = new Date(now).toISOString();
|
|
60
|
+
return { ok: true, line: { v: 1, ev: 'added', sid: sidOf(initiative, who, link || note), at, initiative, who, where, link: link || null, note: note || null, via: o.via || 'cli' } };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Lines (objects) → Map(initiative → [signal], newest first). A line it cannot read is skipped. PURE. */
|
|
64
|
+
function fold(lines) {
|
|
65
|
+
const live = new Map();
|
|
66
|
+
for (const l of lines || []) {
|
|
67
|
+
if (!l || typeof l !== 'object' || !SID_RE.test(String(l.sid || ''))) continue;
|
|
68
|
+
if (l.ev === 'added') {
|
|
69
|
+
if (!ID_RE.test(String(l.initiative || '')) || !str(l.who)) continue;
|
|
70
|
+
if (live.has(l.sid)) continue; // added twice: the first line stands
|
|
71
|
+
live.set(l.sid, { sid: l.sid, initiative: l.initiative, who: str(l.who).slice(0, MAX_WHO), where: WHERE.includes(l.where) ? l.where : 'other',
|
|
72
|
+
link: l.link ? str(l.link).slice(0, MAX_LINK) : null, note: l.note ? str(l.note).slice(0, MAX_NOTE) : null, at: l.at || null });
|
|
73
|
+
} else if (l.ev === 'removed') live.delete(l.sid);
|
|
74
|
+
}
|
|
75
|
+
const out = new Map();
|
|
76
|
+
for (const s of live.values()) {
|
|
77
|
+
if (!out.has(s.initiative)) out.set(s.initiative, []);
|
|
78
|
+
out.get(s.initiative).push(s);
|
|
79
|
+
}
|
|
80
|
+
for (const list of out.values()) list.sort((a, b) => String(b.at || '').localeCompare(String(a.at || '')));
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** One row's signals: the ledger's, plus the record's raised_by customer when no ledger signal names them. null when none. PURE. */
|
|
85
|
+
function rowSignals(list, origin) {
|
|
86
|
+
const items = (list || []).map(({ sid, who, where, link, note, at }) => ({ sid, who, where, link, note, at }));
|
|
87
|
+
if (origin && origin.kind === 'customer' && origin.name && !items.some((s) => s.who.toLowerCase() === String(origin.name).toLowerCase())) {
|
|
88
|
+
items.push({ sid: null, who: String(origin.name), where: 'record', link: null, note: 'raised it', at: null });
|
|
89
|
+
}
|
|
90
|
+
return items.length ? { n: items.length, items: items.slice(0, MAX_ITEMS) } : null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ── the ledger on disk ──────────────────────────────────────────────────────────────────────────────
|
|
94
|
+
function ledgerFile(root) { return path.join(require('./plan-ledgers.js').runsDir(root), FILE); }
|
|
95
|
+
function readLines(root) {
|
|
96
|
+
let text = '';
|
|
97
|
+
try { text = fs.readFileSync(ledgerFile(root), 'utf8'); } catch { return []; }
|
|
98
|
+
const out = [];
|
|
99
|
+
for (const raw of text.split('\n')) { if (!raw.trim()) continue; try { out.push(JSON.parse(raw)); } catch { /* a torn line is skipped */ } }
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
/** What a cache keys on: the ledger's size and time, or 'none'. */
|
|
103
|
+
function sigOf(root) {
|
|
104
|
+
try { const st = fs.statSync(ledgerFile(root)); return st.size + ':' + st.mtimeMs; } catch { return 'none'; }
|
|
105
|
+
}
|
|
106
|
+
function byInitiative(root) { return fold(readLines(root)); }
|
|
107
|
+
function append(root, line) {
|
|
108
|
+
const file = ledgerFile(root);
|
|
109
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
110
|
+
fs.appendFileSync(file, JSON.stringify(line) + '\n');
|
|
111
|
+
return file;
|
|
112
|
+
}
|
|
113
|
+
function recordOf(root, id) { try { return require('./plan-tree.js').recordPath(path.resolve(root), id); } catch { return null; } }
|
|
114
|
+
|
|
115
|
+
/** Add one signal. Refused for an initiative with no record. → { ok, sid, dup } | { ok: false, error } */
|
|
116
|
+
function add(root, o, now = new Date()) {
|
|
117
|
+
const p = parseAdd(o, now);
|
|
118
|
+
if (!p.ok) return p;
|
|
119
|
+
if (!recordOf(root, p.line.initiative)) return { ok: false, error: `no initiative "${p.line.initiative}" here: pmos initiative list shows the ids` };
|
|
120
|
+
const cur = byInitiative(root).get(p.line.initiative) || [];
|
|
121
|
+
if (cur.some((s) => s.sid === p.line.sid)) return { ok: true, sid: p.line.sid, dup: true };
|
|
122
|
+
append(root, p.line);
|
|
123
|
+
return { ok: true, sid: p.line.sid, dup: false };
|
|
124
|
+
}
|
|
125
|
+
/** Take one signal out (an append, never an edit). → { ok } | { ok: false, error } */
|
|
126
|
+
function remove(root, sid, now = new Date()) {
|
|
127
|
+
if (!SID_RE.test(str(sid))) return { ok: false, error: 'name the signal by its id (cs_ and 10 characters; list shows them)' };
|
|
128
|
+
const live = [...byInitiative(root).values()].some((l) => l.some((s) => s.sid === sid));
|
|
129
|
+
if (!live) return { ok: false, error: `no signal ${sid} is on the list` };
|
|
130
|
+
append(root, { v: 1, ev: 'removed', sid, at: new Date(now).toISOString(), via: 'cli' });
|
|
131
|
+
return { ok: true };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** The records of a checkout, either layout, with their raised_by line. */
|
|
135
|
+
function records(root) {
|
|
136
|
+
const ORIGIN = require('./initiative-origin.js');
|
|
137
|
+
const out = [];
|
|
138
|
+
for (const rel of ['planning/initiatives', 'pmos/state/initiatives']) {
|
|
139
|
+
let names = [];
|
|
140
|
+
try { names = fs.readdirSync(path.join(root, rel)); } catch { continue; }
|
|
141
|
+
for (const n of names) {
|
|
142
|
+
if (!n.endsWith('.md') || /^(readme|index|log)\.md$/i.test(n)) continue;
|
|
143
|
+
let rb = '';
|
|
144
|
+
try { rb = ORIGIN.raisedByOfText(fs.readFileSync(path.join(root, rel, n), 'utf8')); } catch { rb = ''; }
|
|
145
|
+
out.push({ id: n.slice(0, -3), origin: ORIGIN.originOf({ raised_by: rb }) });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return out;
|
|
149
|
+
}
|
|
150
|
+
/** Every initiative with a record → its signals, and how many have at least one. */
|
|
151
|
+
function count(root) {
|
|
152
|
+
const by = byInitiative(root);
|
|
153
|
+
const rows = {};
|
|
154
|
+
for (const r of records(root)) { const s = rowSignals(by.get(r.id), r.origin); if (s) rows[r.id] = s; }
|
|
155
|
+
return { initiatives: records(root).length, backed: Object.keys(rows).length, rows };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ── CLI ─────────────────────────────────────────────────────────────────────────────────────────────
|
|
159
|
+
function flag(argv, name) { const i = argv.indexOf('--' + name); return i >= 0 && i + 1 < argv.length ? argv[i + 1] : null; }
|
|
160
|
+
function positional(argv) {
|
|
161
|
+
const out = [];
|
|
162
|
+
for (let i = 0; i < argv.length; i++) { if (argv[i].startsWith('--')) { if (argv[i] !== '--json') i++; continue; } out.push(argv[i]); }
|
|
163
|
+
return out;
|
|
164
|
+
}
|
|
165
|
+
const line = (s) => (s.who + ' · ' + s.where + (s.link ? ' · ' + s.link : '') + (s.note ? ' · ' + s.note : '') + (s.at ? ' · ' + s.at.slice(0, 10) : '') + (s.sid ? ' ' + s.sid : ''));
|
|
166
|
+
|
|
167
|
+
function main(argv, say = console.log) {
|
|
168
|
+
const [cmd, ...rest] = argv;
|
|
169
|
+
const pos = positional(rest);
|
|
170
|
+
const json = rest.includes('--json');
|
|
171
|
+
if (cmd === 'add') {
|
|
172
|
+
const root = path.resolve(flag(rest, 'root') || '.');
|
|
173
|
+
const r = add(root, { initiative: pos[0], who: flag(rest, 'who'), where: flag(rest, 'where'), link: flag(rest, 'link'), note: flag(rest, 'note') });
|
|
174
|
+
if (!r.ok) { say(`${TAG} refused: ${r.error}`); return 1; }
|
|
175
|
+
say(`${TAG} ${r.dup ? 'already on the list' : 'added'}: ${r.sid} on ${pos[0]}`);
|
|
176
|
+
return 0;
|
|
177
|
+
}
|
|
178
|
+
if (cmd === 'remove') {
|
|
179
|
+
const root = path.resolve(flag(rest, 'root') || '.');
|
|
180
|
+
const r = remove(root, pos[0]);
|
|
181
|
+
if (!r.ok) { say(`${TAG} refused: ${r.error}`); return 1; }
|
|
182
|
+
say(`${TAG} removed: ${pos[0]}`);
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
if (cmd === 'list') {
|
|
186
|
+
const root = path.resolve(flag(rest, 'root') || '.');
|
|
187
|
+
const c = count(root);
|
|
188
|
+
const rows = pos[0] ? (c.rows[pos[0]] ? { [pos[0]]: c.rows[pos[0]] } : {}) : c.rows;
|
|
189
|
+
if (json) { say(JSON.stringify({ rows }, null, 1)); return 0; }
|
|
190
|
+
if (!Object.keys(rows).length) { say(`${TAG} no customer signals${pos[0] ? ' on ' + pos[0] : ''}`); return 0; }
|
|
191
|
+
for (const [id, s] of Object.entries(rows)) { say(`${id} · ${s.n}`); for (const x of s.items) say(' ' + line(x)); }
|
|
192
|
+
return 0;
|
|
193
|
+
}
|
|
194
|
+
if (cmd === 'count') {
|
|
195
|
+
const root = path.resolve(pos[0] || flag(rest, 'root') || '.');
|
|
196
|
+
const c = count(root);
|
|
197
|
+
say(`${TAG} ${c.backed} of ${c.initiatives} initiatives have a customer signal`);
|
|
198
|
+
say(String(c.backed));
|
|
199
|
+
return 0;
|
|
200
|
+
}
|
|
201
|
+
say('usage: customer-signals.js add <initiative> --who "<customer>" [--where ' + WHERE.join('|') + '] [--link <url>] [--note "<one line>"] | remove <sid> | list [<initiative>] [--json] | count [<checkout>]');
|
|
202
|
+
return 2;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (require.main === module) process.exit(main(process.argv.slice(2)));
|
|
206
|
+
|
|
207
|
+
module.exports = { TAG, FILE, WHERE, MAX_NOTE, MAX_ITEMS, parseAdd, fold, rowSignals, ledgerFile, readLines, sigOf, byInitiative, add, remove, count, main };
|
|
@@ -87,6 +87,7 @@ const HEADLESS_SKILLS = Object.freeze([
|
|
|
87
87
|
'day-check', 'calendar-sync', 'jira-sync', 'my-work-read', 'report-biweekly', 'report-template',
|
|
88
88
|
'tracker-refresh', 'measure', 'memory-groom', 'backlog-triage',
|
|
89
89
|
'story-first', // batch 29 item 5: the first story so far, once, when a product has none (lib/story-seed.js)
|
|
90
|
+
'principles-draft', // bet A352: the product's principles from its decisions, once, when it has none (lib/routes-principles.js)
|
|
90
91
|
]);
|
|
91
92
|
// The note passes that run headless, by the origin prefix lib/routes-notes.js gives them.
|
|
92
93
|
const HEADLESS_ORIGINS = Object.freeze(['notes-bullets:', 'notes-summary:']);
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* icon-check.js — one icon per action (initiative icon-consistency-check, bet A414).
|
|
3
|
+
*
|
|
4
|
+
* The design system names one icon for each action (brand/icons.json: the action, the words of its labels, and the icon's
|
|
5
|
+
* shapes). This module reads the pages of a product, finds every control whose label names an action and that draws an
|
|
6
|
+
* icon, and reports:
|
|
7
|
+
* off a control that draws its action with another icon than the one icons.json names (the count the check keeps at 0)
|
|
8
|
+
* mixed an action drawn with more than one icon, listed or not (the hint for the next entry of icons.json)
|
|
9
|
+
* shared one icon that stands for two listed actions (an icon means one thing)
|
|
10
|
+
*
|
|
11
|
+
* It reads source text only: a button, link or span with an aria-label or title, and the first icon inside it. The icon is
|
|
12
|
+
* an inline <svg>, or a ${…} call whose argument is path data, or a name in an icon table of the same file or of a file it
|
|
13
|
+
* imports. An icon it cannot resolve is counted as `unread`, never guessed. Two drawings of the same lines in another order
|
|
14
|
+
* or direction are the same icon.
|
|
15
|
+
*
|
|
16
|
+
* loadRegistry(read) · actionOf(label, reg) · canon(markup) · scanText(text, file, tableOf) · check(repo, ref, opts) · count(…)
|
|
17
|
+
* node lib/icon-check.js check [--root <dir>] [--json] [--gate] the report; --gate exits 1 when an icon is off
|
|
18
|
+
* node lib/icon-check.js count [--days 7] [--root <dir>] the runs of the check in the last days (the health number)
|
|
19
|
+
*
|
|
20
|
+
* A product sets its own icons in pmos/design-system/brand/icons.json; PMOS's own copy is the default. `scan` in that file
|
|
21
|
+
* names the folders to read. Every run writes `[icon-check] run` to stderr and one line to pmos/state/icon-check.jsonl.
|
|
22
|
+
*/
|
|
23
|
+
const fs = require('fs');
|
|
24
|
+
const path = require('path');
|
|
25
|
+
const D = require('./design-drift.js');
|
|
26
|
+
|
|
27
|
+
const OWN = path.join(__dirname, '..', 'design-system', 'brand', 'icons.json');
|
|
28
|
+
const REG_PLACES = ['pmos/design-system/brand/icons.json', 'workspace/design-system/brand/icons.json'];
|
|
29
|
+
const LOG = 'pmos/state/icon-check.jsonl';
|
|
30
|
+
const SKIP_DIR = /(^|\/)(node_modules|vendor|third-party|dist|build|\.git)\//;
|
|
31
|
+
|
|
32
|
+
// ── the registry ──────────────────────────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
/** The product's icons.json, else PMOS's own. read(p) → text|null for a repo path. */
|
|
35
|
+
function loadRegistry(read) {
|
|
36
|
+
let text = null;
|
|
37
|
+
for (const p of REG_PLACES) { text = read ? read(p) : null; if (text != null) break; }
|
|
38
|
+
if (text == null) text = fs.readFileSync(OWN, 'utf8');
|
|
39
|
+
const raw = JSON.parse(text);
|
|
40
|
+
const actions = {};
|
|
41
|
+
for (const [name, a] of Object.entries(raw.actions || {})) {
|
|
42
|
+
actions[name] = { name, words: (a.words || [name]).map(norm), except: (a.except || []).map(norm), svg: a.svg, icon: canon(a.svg), lucide: a.lucide || null };
|
|
43
|
+
}
|
|
44
|
+
return { actions, scan: raw.scan || ['workspace/public', 'src', 'app', 'public', 'web'] };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The action a label names: its first words match one of an action's words. 'Close the viewer' → 'close'. */
|
|
48
|
+
const norm = (s) => String(s || '').toLowerCase().replace(/[^a-z0-9 ]+/g, ' ').replace(/\s+/g, ' ').trim();
|
|
49
|
+
function actionOf(label, reg) {
|
|
50
|
+
const l = ' ' + norm(label) + ' ';
|
|
51
|
+
let best = null, len = 0;
|
|
52
|
+
for (const a of Object.values(reg.actions)) {
|
|
53
|
+
if ((a.except || []).some((x) => l.startsWith(' ' + x + ' '))) continue;
|
|
54
|
+
for (const w of a.words) if (l.startsWith(' ' + w + ' ') && w.length > len) { best = a.name; len = w.length; }
|
|
55
|
+
}
|
|
56
|
+
return best;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// ── the shape of an icon ──────────────────────────────────────────────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
const r2 = (n) => String(Math.round(Number(n) * 100) / 100);
|
|
62
|
+
const attr = (tag, k) => { const m = tag.match(new RegExp(`\\s${k}="([^"]*)"`)); return m ? m[1] : null; };
|
|
63
|
+
|
|
64
|
+
/** Path data → canonical pieces: each straight segment as a sorted point pair, each curve or arc as its absolute command. */
|
|
65
|
+
function pathPieces(d) {
|
|
66
|
+
const toks = String(d).match(/[a-zA-Z]|-?(?:\d*\.\d+|\d+)(?:e-?\d+)?/g) || [];
|
|
67
|
+
const out = [];
|
|
68
|
+
let i = 0, cmd = null, x = 0, y = 0, sx = 0, sy = 0;
|
|
69
|
+
const num = () => Number(toks[i++]);
|
|
70
|
+
const isNum = () => i < toks.length && !/^[a-zA-Z]$/.test(toks[i]);
|
|
71
|
+
const seg = (x1, y1, x2, y2) => { if (x1 === x2 && y1 === y2) return; const a = `${r2(x1)},${r2(y1)}`, b = `${r2(x2)},${r2(y2)}`; out.push('L' + (a < b ? a + ' ' + b : b + ' ' + a)); };
|
|
72
|
+
while (i < toks.length) {
|
|
73
|
+
if (/^[a-zA-Z]$/.test(toks[i])) cmd = toks[i++];
|
|
74
|
+
if (!cmd) { i++; continue; }
|
|
75
|
+
const rel = cmd === cmd.toLowerCase();
|
|
76
|
+
const C = cmd.toUpperCase();
|
|
77
|
+
if (C === 'Z') { seg(x, y, sx, sy); x = sx; y = sy; if (!isNum()) continue; }
|
|
78
|
+
if (!isNum()) { if (C !== 'Z') i++; continue; }
|
|
79
|
+
if (C === 'M') { let nx = num(), ny = num(); if (rel) { nx += x; ny += y; } x = sx = nx; y = sy = ny; cmd = rel ? 'l' : 'L'; }
|
|
80
|
+
else if (C === 'L') { let nx = num(), ny = num(); if (rel) { nx += x; ny += y; } seg(x, y, nx, ny); x = nx; y = ny; }
|
|
81
|
+
else if (C === 'H') { let nx = num(); if (rel) nx += x; seg(x, y, nx, y); x = nx; }
|
|
82
|
+
else if (C === 'V') { let ny = num(); if (rel) ny += y; seg(x, y, x, ny); y = ny; }
|
|
83
|
+
else {
|
|
84
|
+
const n = { C: 6, S: 4, Q: 4, T: 2, A: 7 }[C];
|
|
85
|
+
if (!n) { i++; continue; }
|
|
86
|
+
const v = []; for (let k = 0; k < n; k++) v.push(num());
|
|
87
|
+
const abs = v.slice();
|
|
88
|
+
if (rel) { if (C === 'A') { abs[5] += x; abs[6] += y; } else for (let k = 0; k < n; k += 2) { abs[k] += x; abs[k + 1] += y; } }
|
|
89
|
+
out.push(C + r2(x) + ',' + r2(y) + ' ' + abs.map(r2).join(','));
|
|
90
|
+
x = abs[n - 2]; y = abs[n - 1];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** A rect as path data, so `<rect>` and the same square drawn as a path are one icon. */
|
|
97
|
+
function rectPath(x, y, w, h, rx) {
|
|
98
|
+
const r = Math.min(rx, w / 2, h / 2);
|
|
99
|
+
if (!r) return `M${x} ${y}H${x + w}V${y + h}H${x}Z`;
|
|
100
|
+
return `M${x + r} ${y}H${x + w - r}A${r} ${r} 0 0 1 ${x + w} ${y + r}V${y + h - r}A${r} ${r} 0 0 1 ${x + w - r} ${y + h}`
|
|
101
|
+
+ `H${x + r}A${r} ${r} 0 0 1 ${x} ${y + h - r}V${y + r}A${r} ${r} 0 0 1 ${x + r} ${y}Z`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** The canonical key of an icon's markup (its shapes only: size, stroke and class do not count). '' when it has no shape. */
|
|
105
|
+
function canon(markup) {
|
|
106
|
+
const pieces = [];
|
|
107
|
+
for (const m of String(markup || '').matchAll(/<(path|rect|circle|line|polyline|polygon|ellipse)\b([^>]*)>/g)) {
|
|
108
|
+
const [tag, kind] = [m[0], m[1]];
|
|
109
|
+
if (kind === 'path') pieces.push(...pathPieces(attr(tag, 'd') || ''));
|
|
110
|
+
else if (kind === 'line') pieces.push(...pathPieces(`M${attr(tag, 'x1')} ${attr(tag, 'y1')}L${attr(tag, 'x2')} ${attr(tag, 'y2')}`));
|
|
111
|
+
else if (kind === 'polyline' || kind === 'polygon') pieces.push(...pathPieces('M' + (attr(tag, 'points') || '') + (kind === 'polygon' ? 'Z' : '')));
|
|
112
|
+
else if (kind === 'circle') pieces.push(`O${r2(attr(tag, 'cx') || 0)},${r2(attr(tag, 'cy') || 0)},${r2(attr(tag, 'r') || 0)}`);
|
|
113
|
+
else if (kind === 'ellipse') pieces.push(`E${r2(attr(tag, 'cx') || 0)},${r2(attr(tag, 'cy') || 0)},${r2(attr(tag, 'rx') || 0)},${r2(attr(tag, 'ry') || 0)}`);
|
|
114
|
+
else pieces.push(...pathPieces(rectPath(...['x', 'y', 'width', 'height'].map((k) => Number(attr(tag, k) || 0)), Number(attr(tag, 'rx') || attr(tag, 'ry') || 0))));
|
|
115
|
+
}
|
|
116
|
+
return [...new Set(pieces)].sort().join(' ');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ── reading a page ────────────────────────────────────────────────────────────────────────────────────────────────
|
|
120
|
+
|
|
121
|
+
const GEOM = /^\s*[Mm]\s*-?[\d.]/;
|
|
122
|
+
const asMarkup = (s) => (GEOM.test(s) ? `<path d="${s}"/>` : /<(path|rect|circle|line|polyline|polygon|ellipse)\b/.test(s) ? s : null);
|
|
123
|
+
|
|
124
|
+
/** The icon tables of one file: every `name: '<path data or shapes>'` (or `const NAME = '…'`). → Map name → markup */
|
|
125
|
+
function tablesOf(text) {
|
|
126
|
+
const t = new Map();
|
|
127
|
+
for (const m of text.matchAll(/(?:^|[\s,{])['"]?([A-Za-z_$][\w$-]*)['"]?\s*:\s*(['"`])((?:(?!\2)[^\\]|\\.)*)\2/g)) {
|
|
128
|
+
const mk = asMarkup(m[3]); if (mk && !t.has(m[1])) t.set(m[1], mk);
|
|
129
|
+
}
|
|
130
|
+
for (const m of text.matchAll(/(?:\b(?:const|let|var)\s+|,\s*)([A-Za-z_$][\w$]*)\s*=\s*(['"`])((?:(?!\2)[^\\]|\\.)*)\2/g)) {
|
|
131
|
+
const mk = asMarkup(m[3]); if (mk && !t.has(m[1])) t.set(m[1], mk);
|
|
132
|
+
}
|
|
133
|
+
return t;
|
|
134
|
+
}
|
|
135
|
+
const importsOf = (text) => [...text.matchAll(/\bfrom\s+['"](\.{1,2}\/[^'"]+)['"]/g)].map((m) => m[1]);
|
|
136
|
+
|
|
137
|
+
/** One `${…}` expression → { markup } | { unread } | null (not an icon call). */
|
|
138
|
+
function iconOfExpr(e, lookup) {
|
|
139
|
+
if (!/^\s*[A-Za-z_$][\w$.]*\s*\(|^\s*[A-Za-z_$][\w$]*\s*(\.|\[)/.test(e)) return null;
|
|
140
|
+
for (const s of e.matchAll(/(['"`])((?:(?!\1)[^\\$]|\\.)*)\1/g)) { const mk = asMarkup(s[2]); if (mk) return { markup: mk }; }
|
|
141
|
+
const names = [...e.matchAll(/\.([A-Za-z_$][\w$]*)|\[\s*['"]([\w$-]+)['"]\s*\]|\(\s*['"]([\w$-]+)['"]/g)].map((m) => m[1] || m[2] || m[3]);
|
|
142
|
+
const bare = e.match(/^\s*[A-Za-z_$][\w$]*\s*\(\s*([A-Za-z_$][\w$]*)\s*[,)]/);
|
|
143
|
+
if (bare) names.push(bare[1]);
|
|
144
|
+
for (const n of names) { const mk = lookup(n); if (mk) return { markup: mk }; }
|
|
145
|
+
return { unread: e.trim().slice(0, 60) };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** The icons a control's inner text draws, in order: inline <svg> or `${…}` icon calls. → [{ markup } | { unread }] */
|
|
149
|
+
function iconsIn(inner, lookup) {
|
|
150
|
+
const out = [];
|
|
151
|
+
const re = /<svg\b[\s\S]*?<\/svg>|\$\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g;
|
|
152
|
+
let m;
|
|
153
|
+
while ((m = re.exec(inner)) && out.length < 4) {
|
|
154
|
+
if (m[0].startsWith('<svg')) { if (canon(m[0])) out.push({ markup: m[0] }); else { const ex = m[0].match(/\$\{([^{}]*)\}/); const r = ex ? iconOfExpr(ex[1], lookup) : null; if (r) out.push(r); } }
|
|
155
|
+
else { const r = iconOfExpr(m[1], lookup); if (r) out.push(r); }
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** Every labelled control that draws an icon in one file. → [{ file, line, label, icons: [{ markup } | { unread }] }] */
|
|
161
|
+
function scanText(text, file, lookup = () => null) {
|
|
162
|
+
const out = [];
|
|
163
|
+
const re = /<(button|a|span)\b((?:[^>"'`]|"[^"]*"|'[^']*')*?)\s(?:aria-label|title)="([^"]{1,80})"((?:[^>"'`]|"[^"]*"|'[^']*')*)>([\s\S]{0,600}?)<\/\1>/g;
|
|
164
|
+
let m;
|
|
165
|
+
while ((m = re.exec(text))) {
|
|
166
|
+
const label = m[3];
|
|
167
|
+
if (/^\$\{[^}]*\}$/.test(label.trim())) continue;
|
|
168
|
+
const head = m[5].search(/<(button|a)\b/);
|
|
169
|
+
const icons = iconsIn(head >= 0 ? m[5].slice(0, head) : m[5], lookup);
|
|
170
|
+
if (head >= 0) re.lastIndex = m.index + 1; // a control nested inside: read it as itself on the next match
|
|
171
|
+
if (!icons.length) continue;
|
|
172
|
+
const line = text.slice(0, m.index).split('\n').length;
|
|
173
|
+
out.push({ file, line, label: label.replace(/\$\{[^}]*\}/g, '…'), icons });
|
|
174
|
+
}
|
|
175
|
+
return out;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ── the check ─────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
179
|
+
|
|
180
|
+
const isPage = (p, scan) => /\.(m?js|html|jsx|tsx|vue|svelte)$/.test(p) && !SKIP_DIR.test(p) && !/\.test\.|(^|\/)test[-.]/.test(p)
|
|
181
|
+
&& scan.some((d) => p === d || p.startsWith(d.replace(/\/$/, '') + '/'));
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Check one commit (or the files on disk). opts.files: { path: text } instead of git (tests).
|
|
185
|
+
* → { ref, uses, off: [use], mixed: [{ action, listed, icons: [{ icon, uses }] }], shared: [{ icon, actions }], unread, total }
|
|
186
|
+
*/
|
|
187
|
+
function check(repo, ref = 'WORKTREE', { files: given, registry } = {}) {
|
|
188
|
+
let all, read;
|
|
189
|
+
if (given) { all = Object.keys(given); read = (p) => (p in given ? given[p] : null); }
|
|
190
|
+
else { const R = D.readerOf(repo, ref); all = R.list(); read = R.read; }
|
|
191
|
+
const reg = registry || loadRegistry(read);
|
|
192
|
+
const pages = all.filter((p) => isPage(p, reg.scan)).sort();
|
|
193
|
+
const texts = given ? new Map(pages.map((p) => [p, given[p]])) : D.readMany(repo, ref === 'WORKTREE' ? null : ref, pages);
|
|
194
|
+
const tables = new Map();
|
|
195
|
+
const tableOf = (p) => { if (!tables.has(p)) tables.set(p, texts.has(p) ? tablesOf(texts.get(p)) : new Map()); return tables.get(p); };
|
|
196
|
+
const uses = [];
|
|
197
|
+
for (const p of pages) {
|
|
198
|
+
const text = texts.get(p); if (text == null) continue;
|
|
199
|
+
const near = [p, ...importsOf(text).map((i) => path.posix.normalize(path.posix.join(path.posix.dirname(p), i)))];
|
|
200
|
+
const lookup = (n) => { for (const q of near) { const mk = tableOf(q).get(n); if (mk) return mk; } return null; };
|
|
201
|
+
for (const u of scanText(text, p, lookup)) {
|
|
202
|
+
u.action = actionOf(u.label, reg);
|
|
203
|
+
const keys = u.icons.filter((i) => i.markup).map((i) => canon(i.markup)).filter(Boolean);
|
|
204
|
+
const want = u.action && reg.actions[u.action].icon;
|
|
205
|
+
// A control may draw two icons (a chip: its kind, then the X that drops it). It draws its action when one of them is the action's.
|
|
206
|
+
if (keys.length) u.icon = want && keys.includes(want) ? want : keys[0];
|
|
207
|
+
else u.unread = (u.icons.find((i) => i.unread) || {}).unread || 'no shape';
|
|
208
|
+
delete u.icons;
|
|
209
|
+
uses.push(u);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const read1 = uses.filter((u) => u.icon);
|
|
213
|
+
const off = read1.filter((u) => u.action && reg.actions[u.action].icon !== u.icon);
|
|
214
|
+
const byAction = new Map();
|
|
215
|
+
for (const u of read1) {
|
|
216
|
+
const key = u.action || 'unlisted:' + u.label.toLowerCase().replace(/[^a-z ]+/g, ' ').trim().split(/\s+/)[0];
|
|
217
|
+
if (!byAction.has(key)) byAction.set(key, new Map());
|
|
218
|
+
const g = byAction.get(key); if (!g.has(u.icon)) g.set(u.icon, []); g.get(u.icon).push(u);
|
|
219
|
+
}
|
|
220
|
+
const mixed = [...byAction].filter(([, g]) => g.size > 1).map(([k, g]) => ({
|
|
221
|
+
action: k.replace(/^unlisted:/, ''), listed: !k.startsWith('unlisted:'),
|
|
222
|
+
icons: [...g].map(([icon, us]) => ({ icon, uses: us.map((u) => ({ file: u.file, line: u.line, label: u.label })) })).sort((a, b) => b.uses.length - a.uses.length),
|
|
223
|
+
})).sort((a, b) => (b.listed - a.listed) || b.icons.length - a.icons.length);
|
|
224
|
+
const byIcon = new Map();
|
|
225
|
+
for (const a of Object.values(reg.actions)) { if (!byIcon.has(a.icon)) byIcon.set(a.icon, new Set()); byIcon.get(a.icon).add(a.name); }
|
|
226
|
+
const shared = [...byIcon].filter(([, s]) => s.size > 1).map(([icon, s]) => ({ icon, actions: [...s].sort() }));
|
|
227
|
+
return { ref, actions: Object.keys(reg.actions).length, uses: uses.length, read: read1.length, unread: uses.length - read1.length,
|
|
228
|
+
listedUses: read1.filter((u) => u.action).length, off, mixed, shared };
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Append one run to the product's local log and say so on stderr (the health log). */
|
|
232
|
+
function logRun(root, result, now = Date.now()) {
|
|
233
|
+
process.stderr.write(`[icon-check] run off=${result.off.length}\n`);
|
|
234
|
+
try {
|
|
235
|
+
const p = path.join(root, LOG);
|
|
236
|
+
fs.mkdirSync(path.dirname(p), { recursive: true });
|
|
237
|
+
fs.appendFileSync(p, JSON.stringify({ at: new Date(now).toISOString(), off: result.off.length, mixed: result.mixed.length }) + '\n');
|
|
238
|
+
} catch { /* a read-only checkout still prints */ }
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** The runs in the last `days` days. */
|
|
242
|
+
function count(root, days = 7, now = Date.now()) {
|
|
243
|
+
let text = '';
|
|
244
|
+
try { text = fs.readFileSync(path.join(root, LOG), 'utf8'); } catch { return 0; }
|
|
245
|
+
const since = now - days * 864e5;
|
|
246
|
+
return text.split('\n').filter(Boolean).filter((l) => { try { return Date.parse(JSON.parse(l).at) >= since; } catch { return false; } }).length;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
module.exports = { loadRegistry, actionOf, canon, pathPieces, rectPath, tablesOf, scanText, check, logRun, count, LOG, OWN };
|
|
250
|
+
|
|
251
|
+
const USAGE = [
|
|
252
|
+
'usage: node lib/icon-check.js check [--root <dir>] [--ref <ref>|WORKTREE] [--json] [--gate]',
|
|
253
|
+
' each control that draws its action with another icon than the design system names (brand/icons.json)',
|
|
254
|
+
' node lib/icon-check.js count [--days 7] [--root <dir>] the runs of the check in the last days',
|
|
255
|
+
];
|
|
256
|
+
|
|
257
|
+
/** The CLI. → exit code (0 done, 1 an icon is off with --gate or the folder is not a git repository, 2 usage). */
|
|
258
|
+
function main(args, { say = (l) => console.log(l), cwd = process.cwd(), now = Date.now() } = {}) {
|
|
259
|
+
const flag = (k, d) => { const i = args.indexOf('--' + k); return i >= 0 && args[i + 1] !== undefined && !args[i + 1].startsWith('--') ? args[i + 1] : d; };
|
|
260
|
+
const has = (k) => args.includes('--' + k);
|
|
261
|
+
const root = path.resolve(cwd, flag('root', '.'));
|
|
262
|
+
if (args[0] === 'count') { say(String(count(root, Number(flag('days', 7)), now))); return 0; }
|
|
263
|
+
if (args[0] !== 'check') { for (const l of USAGE) say(l); return 2; }
|
|
264
|
+
const top = D.gitOut(root, ['rev-parse', '--show-toplevel']);
|
|
265
|
+
if (!top) { say('✗ this is not a git repository. Run the check in your product\'s repository, or give --root.'); return 1; }
|
|
266
|
+
const r = check(top.trim(), flag('ref', 'WORKTREE'));
|
|
267
|
+
logRun(root, r, now);
|
|
268
|
+
if (has('json')) { say(JSON.stringify(r, null, 2)); return has('gate') && r.off.length ? 1 : 0; }
|
|
269
|
+
say(`${r.actions} actions have one icon each. ${r.listedUses} controls name one of them; ${r.off.length} draw it another way.`);
|
|
270
|
+
for (const u of r.off) say(` ${u.action} · ${u.file}:${u.line} · "${u.label}" draws another icon than the one the design system names`);
|
|
271
|
+
for (const s of r.shared) say(` ${s.actions.join(' and ')} share one icon: give one of them another`);
|
|
272
|
+
const hints = r.mixed.filter((m) => !m.listed).slice(0, 5);
|
|
273
|
+
if (hints.length) say(`Not listed yet, drawn more than one way: ${hints.map((m) => `${m.action} (${m.icons.length} icons)`).join(', ')}.`);
|
|
274
|
+
if (r.unread) say(`${r.unread} of ${r.uses} labelled icons could not be read from the source, and were not checked.`);
|
|
275
|
+
return has('gate') && (r.off.length || r.shared.length) ? 1 : 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
module.exports.main = main;
|
|
279
|
+
|
|
280
|
+
if (require.main === module) process.exitCode = main(process.argv.slice(2));
|
|
@@ -174,6 +174,7 @@ const JOBS = Object.freeze([
|
|
|
174
174
|
ai('rehearse', 'lib/rehearse-guard.js', [], ['task links']),
|
|
175
175
|
ai('next-prompt', 'lib/next-prompt.js', []),
|
|
176
176
|
ai('sharpen-prompt', 'lib/next-prompt.js', []),
|
|
177
|
+
ai('principles-draft', 'lib/routes-principles.js', [], ['repo:DECISIONS.md']), // bet A352: the drafts land in principles.jsonl through `pmos principles draft`
|
|
177
178
|
{ id: 'improve-self', kind: 'script', module: 'repo:scripts/improve.js', reads: ['repo:planning/improve/signals.jsonl'], writes: ['repo:planning/improve/loop.jsonl'] },
|
|
178
179
|
{ id: 'log-run', kind: 'script', module: 'repo:scripts/log-run.js', reads: [], writes: ['repo:planning/runs/agent-runs.jsonl', 'repo:planning/runs/verify-queue.jsonl'] },
|
|
179
180
|
]);
|
|
@@ -145,6 +145,9 @@ const VERBS = Object.freeze({
|
|
|
145
145
|
// Not a pm-os-absorb verb (run: null): initiative decision-journal-outcome-checks added it through the same table.
|
|
146
146
|
decisions: Object.freeze({ module: 'decisions-cli.js', run: null, guide: 'cli.md',
|
|
147
147
|
help: 'pmos decisions add|list|show|check|record — a decision journal: what you decided, what you expect, a date to check, and how your calls turned out (pmos decisions help)' }),
|
|
148
|
+
// Not a pm-os-absorb verb (run: null): initiative product-principles-draft (bet A352) added it through the same table.
|
|
149
|
+
principles: Object.freeze({ module: 'principles-cli.js', run: null, guide: 'cli.md',
|
|
150
|
+
help: 'pmos principles list|sources|draft|keep|drop|undo|add — the product\'s principles, drafted from its decisions, each citing them; keep or drop each (pmos principles help)' }),
|
|
148
151
|
// Not a pm-os-absorb verb (run: null): initiative parked-reason-way-back (bet A446) added it through the same table.
|
|
149
152
|
parked: Object.freeze({ module: 'parked-cli.js', run: null, guide: 'cli.md',
|
|
150
153
|
help: 'pmos parked list|hold|back|coverage — parked initiatives: why each is parked, what brings it back, and bringing it back (pmos parked help)' }),
|