create-pmos 0.730.0 → 0.731.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 +20 -32
- 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 +19 -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/initiatives-and-next-steps.md +6 -0
- package/workspace/guide/layout.md +2 -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/principles-cli.js +109 -0
- package/workspace/lib/principles.js +165 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-principles.js +109 -0
- 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-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-work.js +1 -1
- 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 +1 -1
- package/workspace/public/pm/cozy-rec-present.js +1 -1
- 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/principles.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.731.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -33,6 +33,25 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.731.0",
|
|
38
|
+
"at": "2026-11-23T05:49:52.192Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1631,
|
|
43
|
+
"t": "One icon per action, and a check for icons that drift (A414)",
|
|
44
|
+
"s": "One icon per action, and a check for icons that drift (A414)",
|
|
45
|
+
"k": "new"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1629,
|
|
49
|
+
"t": "PMOS drafts a product's principles from its past decisions, each citing them (job #1613)",
|
|
50
|
+
"s": "PMOS drafts a product's principles from its past decisions, each citing them (job #1613)",
|
|
51
|
+
"k": "new"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
36
55
|
{
|
|
37
56
|
"v": "0.730.0",
|
|
38
57
|
"at": "2026-11-23T05:37:33.548Z",
|
|
@@ -423,37 +442,6 @@
|
|
|
423
442
|
"k": "fix"
|
|
424
443
|
}
|
|
425
444
|
]
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
"v": "0.707.0",
|
|
429
|
-
"at": "2026-11-22T11:12:27.208Z",
|
|
430
|
-
"f": 4,
|
|
431
|
-
"prs": [
|
|
432
|
-
{
|
|
433
|
-
"n": 1534,
|
|
434
|
-
"t": "A weekly what-moved list in Your move (A441)",
|
|
435
|
-
"s": "A weekly what-moved list in Your move (A441)",
|
|
436
|
-
"k": "new"
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"n": 1532,
|
|
440
|
-
"t": "A blocked outcome check shows as blocked, with the step to fix it (A451)",
|
|
441
|
-
"s": "A blocked outcome check shows as blocked, with the step to fix it (A451)",
|
|
442
|
-
"k": "new"
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"n": 1535,
|
|
446
|
-
"t": "Corrections become standing rules (A464)",
|
|
447
|
-
"s": "Corrections become standing rules (A464)",
|
|
448
|
-
"k": "new"
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
"n": 1533,
|
|
452
|
-
"t": "Date moves only the tracker says wait for the owner, default to the tracker's date (A449)",
|
|
453
|
-
"s": "Date moves only the tracker says wait for the owner, default to the tracker's date (A449)",
|
|
454
|
-
"k": "new"
|
|
455
|
-
}
|
|
456
|
-
]
|
|
457
445
|
}
|
|
458
446
|
]
|
|
459
447
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "One icon per action (bet A414). Each action names the words its labels start with and the one icon it draws: stroke shapes on the 24 px grid, as in brand/README.md Iconography. `node workspace/lib/icon-check.js check` reads every labelled control of the pages in `scan` and lists each one that draws its action another way. `except` holds label starts that look like the action but are not it. A product copies this file to pmos/design-system/brand/icons.json to change it. Two actions never share one icon.",
|
|
3
|
+
"scan": ["workspace/public", "src", "app", "public", "web"],
|
|
4
|
+
"actions": {
|
|
5
|
+
"dismiss": {
|
|
6
|
+
"words": ["close", "dismiss", "cancel", "no", "not now", "not this", "clear", "drop"],
|
|
7
|
+
"except": ["no plan dates", "no owner", "clear it", "not this one"],
|
|
8
|
+
"svg": "<path d=\"M6 6l12 12M18 6L6 18\"/>"
|
|
9
|
+
},
|
|
10
|
+
"approve": {
|
|
11
|
+
"words": ["yes", "save", "done", "confirm"],
|
|
12
|
+
"except": ["yes, pmos"],
|
|
13
|
+
"svg": "<path d=\"M5 12.5l4.5 4.5L19 7.5\"/>"
|
|
14
|
+
},
|
|
15
|
+
"add": {
|
|
16
|
+
"words": ["add", "new"],
|
|
17
|
+
"except": ["add dates"],
|
|
18
|
+
"svg": "<path d=\"M12 5v14M5 12h14\"/>"
|
|
19
|
+
},
|
|
20
|
+
"undo": {
|
|
21
|
+
"words": ["undo"],
|
|
22
|
+
"svg": "<path d=\"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3\"/>"
|
|
23
|
+
},
|
|
24
|
+
"back": {
|
|
25
|
+
"words": ["back"],
|
|
26
|
+
"except": ["back to what i wrote"],
|
|
27
|
+
"svg": "<path d=\"M19 12H5M11 6l-6 6 6 6\"/>"
|
|
28
|
+
},
|
|
29
|
+
"previous": {
|
|
30
|
+
"words": ["previous"],
|
|
31
|
+
"svg": "<path d=\"M15 6l-6 6 6 6\"/>"
|
|
32
|
+
},
|
|
33
|
+
"next": {
|
|
34
|
+
"words": ["next"],
|
|
35
|
+
"svg": "<path d=\"M9 6l6 6-6 6\"/>"
|
|
36
|
+
},
|
|
37
|
+
"edit": {
|
|
38
|
+
"words": ["edit"],
|
|
39
|
+
"svg": "<path d=\"M4 20h4L19 9l-4-4L4 16v4zM13.5 6.5l4 4\"/>"
|
|
40
|
+
},
|
|
41
|
+
"delete": {
|
|
42
|
+
"words": ["delete"],
|
|
43
|
+
"svg": "<path d=\"M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13\"/>"
|
|
44
|
+
},
|
|
45
|
+
"search": {
|
|
46
|
+
"words": ["search"],
|
|
47
|
+
"svg": "<path d=\"M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14M20 20l-4-4\"/>"
|
|
48
|
+
},
|
|
49
|
+
"stop": {
|
|
50
|
+
"words": ["stop"],
|
|
51
|
+
"except": ["stop and send"],
|
|
52
|
+
"svg": "<rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\"/>"
|
|
53
|
+
},
|
|
54
|
+
"upload": {
|
|
55
|
+
"words": ["upload"],
|
|
56
|
+
"svg": "<path d=\"M12 16V4M7 9l5-5 5 5M5 20h14\"/>"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-23T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T05:49:48Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-23T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T05:49:48Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-23T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T05:49:48Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.731.0",
|
|
4
|
+
"at": "2026-11-23T05:49:52.192Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1631,
|
|
9
|
+
"t": "One icon per action, and a check for icons that drift (A414)",
|
|
10
|
+
"s": "One icon per action, and a check for icons that drift (A414)",
|
|
11
|
+
"k": "new"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1629,
|
|
15
|
+
"t": "PMOS drafts a product's principles from its past decisions, each citing them (job #1613)",
|
|
16
|
+
"s": "PMOS drafts a product's principles from its past decisions, each citing them (job #1613)",
|
|
17
|
+
"k": "new"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
2
21
|
{
|
|
3
22
|
"v": "0.730.0",
|
|
4
23
|
"at": "2026-11-23T05:37:33.548Z",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "One icon per action (bet A414). Each action names the words its labels start with and the one icon it draws: stroke shapes on the 24 px grid, as in brand/README.md Iconography. `node workspace/lib/icon-check.js check` reads every labelled control of the pages in `scan` and lists each one that draws its action another way. `except` holds label starts that look like the action but are not it. A product copies this file to pmos/design-system/brand/icons.json to change it. Two actions never share one icon.",
|
|
3
|
+
"scan": ["workspace/public", "src", "app", "public", "web"],
|
|
4
|
+
"actions": {
|
|
5
|
+
"dismiss": {
|
|
6
|
+
"words": ["close", "dismiss", "cancel", "no", "not now", "not this", "clear", "drop"],
|
|
7
|
+
"except": ["no plan dates", "no owner", "clear it", "not this one"],
|
|
8
|
+
"svg": "<path d=\"M6 6l12 12M18 6L6 18\"/>"
|
|
9
|
+
},
|
|
10
|
+
"approve": {
|
|
11
|
+
"words": ["yes", "save", "done", "confirm"],
|
|
12
|
+
"except": ["yes, pmos"],
|
|
13
|
+
"svg": "<path d=\"M5 12.5l4.5 4.5L19 7.5\"/>"
|
|
14
|
+
},
|
|
15
|
+
"add": {
|
|
16
|
+
"words": ["add", "new"],
|
|
17
|
+
"except": ["add dates"],
|
|
18
|
+
"svg": "<path d=\"M12 5v14M5 12h14\"/>"
|
|
19
|
+
},
|
|
20
|
+
"undo": {
|
|
21
|
+
"words": ["undo"],
|
|
22
|
+
"svg": "<path d=\"M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3\"/>"
|
|
23
|
+
},
|
|
24
|
+
"back": {
|
|
25
|
+
"words": ["back"],
|
|
26
|
+
"except": ["back to what i wrote"],
|
|
27
|
+
"svg": "<path d=\"M19 12H5M11 6l-6 6 6 6\"/>"
|
|
28
|
+
},
|
|
29
|
+
"previous": {
|
|
30
|
+
"words": ["previous"],
|
|
31
|
+
"svg": "<path d=\"M15 6l-6 6 6 6\"/>"
|
|
32
|
+
},
|
|
33
|
+
"next": {
|
|
34
|
+
"words": ["next"],
|
|
35
|
+
"svg": "<path d=\"M9 6l6 6-6 6\"/>"
|
|
36
|
+
},
|
|
37
|
+
"edit": {
|
|
38
|
+
"words": ["edit"],
|
|
39
|
+
"svg": "<path d=\"M4 20h4L19 9l-4-4L4 16v4zM13.5 6.5l4 4\"/>"
|
|
40
|
+
},
|
|
41
|
+
"delete": {
|
|
42
|
+
"words": ["delete"],
|
|
43
|
+
"svg": "<path d=\"M5 7h14M10 7V4h4v3M7 7l1 13h8l1-13\"/>"
|
|
44
|
+
},
|
|
45
|
+
"search": {
|
|
46
|
+
"words": ["search"],
|
|
47
|
+
"svg": "<path d=\"M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14M20 20l-4-4\"/>"
|
|
48
|
+
},
|
|
49
|
+
"stop": {
|
|
50
|
+
"words": ["stop"],
|
|
51
|
+
"except": ["stop and send"],
|
|
52
|
+
"svg": "<rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" rx=\"2\"/>"
|
|
53
|
+
},
|
|
54
|
+
"upload": {
|
|
55
|
+
"words": ["upload"],
|
|
56
|
+
"svg": "<path d=\"M12 16V4M7 9l5-5 5 5M5 20h14\"/>"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -124,6 +124,7 @@ A loop never sends a message, moves a Jira ticket, merges into a product reposit
|
|
|
124
124
|
| [Prototypes before a meeting](notes.md) | A meeting starts in the next 60 minutes, and its title, agenda or material names an initiative in Triage or Discover with no prototype. One round at a time. An initiative is tried once a week at most, and never while a round waits for you. | The initiative, as a live round reads it | Round 1 under the initiative's ✦ at minute 0. In the meeting, ✓ on **✦ Show it?** starts the next round. | `pmos ai off meeting-prewarm` |
|
|
125
125
|
| [What you might have missed](claude-proposes.md) | Each Monday, for the week before. It uses no model. | Records only: tasks, dates, initiatives and Jira status | One ✦ in Home's chat, at most 3 items | `pmos ai off drift`. `PMOS_DRIFT=off` |
|
|
126
126
|
| [The story so far](home.md) | Once, when you open a product that has no story yet. At most once a day for each product. | The initiatives, their stages and dates, and the Intent and Goal | "The story so far" on the product page. After that, the weekly report keeps it current. | `pmos ai off story-seed`. `PMOS_STORY_SEED=off` |
|
|
127
|
+
| [Principles](initiatives-and-next-steps.md) | Once, when you open the Board of a product that has 3 or more decisions and no principles. At most once a day for each product. | The decisions in `DECISIONS.md` and its ADRs, and `pmos decisions` | Drafts with ✦ in the Board's Principles block, each citing its decisions. Nothing is a principle until you keep it. | `pmos ai off principles-draft` |
|
|
127
128
|
| Change check | When no merged pull request waits for the verifier. At most 4 a day. | One change that PMOS made by itself, the record it changed, and its sources | Nothing when it passes. A FAIL removes the change from "did" and counts like an Undo. | `pmos ai off verify`. `PMOS_VERIFY_CHANGES=off` |
|
|
128
129
|
| [Your impact](claude-proposes.md) | PMOS reads once a day. Home shows the week after it ends. | Slack, mail, Jira, your meeting notes, your documents and your key results | Adler's sprout on Home, and your impact log | Settings › General › Your impact. `PMOS_IMPACT=off` |
|
|
129
130
|
| [Morning brief and day check](proactive-engine.md) | The morning brief at 06:45, once you schedule it. The day check every 60 minutes by default (30, 60 or off). | Calendar, Wispr Flow, Slack, Jira and Confluence are on by default. Mail, GitHub, Drive, Figma and websites are off by default. Mail: subjects and senders only. | Today | Each source is a setting. `pmos proactive settings` |
|
package/workspace/guide/cli.md
CHANGED
|
@@ -319,6 +319,16 @@ Write one line for each product decision, also one that is smaller than an initi
|
|
|
319
319
|
- `pmos decisions record` shows how your decisions turned out: for each quarter, the decisions that worked, did not work and could not be told, and the hit rate (worked divided by worked plus did not work). It also shows the reversals and their reasons.
|
|
320
320
|
- On the check date, the decision shows on Today as a gate that waits for you, with the command to record the verdict. PMOS never records a verdict for you.
|
|
321
321
|
|
|
322
|
+
### pmos principles: the product's principles, from its decisions
|
|
323
|
+
|
|
324
|
+
PMOS drafts 4 to 6 principles for a product from its past decisions. Each draft cites the decisions it came from. You keep or drop each one, on the product's Board or here. Run the commands in the product's repository, or pass `--root <dir>`. The principles are kept in `principles.jsonl` in the product's records folder.
|
|
325
|
+
|
|
326
|
+
- `pmos principles list` shows the kept principles, then the drafts that wait for you. `--all` also shows the dropped ones.
|
|
327
|
+
- `pmos principles sources` shows the decisions a principle can cite: the decisions that still stand in `DECISIONS.md` and its ADRs, and the decisions in `pmos decisions` that were not reversed.
|
|
328
|
+
- `pmos principles draft --text "<principle>" --why "<the pattern>" --source <id>` files one draft. It needs 1 to 5 `--source` ids from `pmos principles sources`; any other id is refused. A principle you dropped is not filed again.
|
|
329
|
+
- `pmos principles keep <id>` and `pmos principles drop <id>` answer a draft. `pmos principles undo <id>` puts it back to a draft.
|
|
330
|
+
- `pmos principles add --text "<principle>"` adds your own principle, kept at once. `--why` and `--source` are optional.
|
|
331
|
+
|
|
322
332
|
### pmos parked: parked work, why and the way back
|
|
323
333
|
|
|
324
334
|
An initiative on hold keeps why it is parked and what brings it back: a return day, or another initiative that must finish first. A reason that says "waiting on <id>" names the way back too. When the way back is met, Today shows "Bring back …?".
|
|
@@ -108,6 +108,12 @@ The notes fold under one line, for example "2 don't fit". Open it to see each in
|
|
|
108
108
|
|
|
109
109
|
The lines are kept in `strategy-card.jsonl` in the product's records folder. Every save adds a line, so earlier versions are kept. A Board that shows several products at once shows no strategy card.
|
|
110
110
|
|
|
111
|
+
### Principles from your decisions
|
|
112
|
+
|
|
113
|
+
Below the strategy, a Board that shows one product has a **Principles** block. When the product has 3 or more decisions (in `DECISIONS.md` and its ADRs, or in `pmos decisions`) and no principles yet, PMOS drafts 4 to 6 principles by itself, once. Each draft shows ✦, the principle in one line, why, and the decisions it came from, for example "from D12, D31". Press ✓ to keep it or ✕ to drop it. Each press offers Undo. Kept principles show first. A dropped principle is not drafted again.
|
|
114
|
+
|
|
115
|
+
You can also ask the chat to keep, drop or add a principle (`pmos principles`). The Board shows the change. When there are no principles and no drafts, the block is not shown.
|
|
116
|
+
|
|
111
117
|
### Now, Next and Later are retired (D105)
|
|
112
118
|
|
|
113
119
|
Earlier versions put each initiative in one of three horizons: Now, Next and Later. They are retired. Nothing you placed is lost:
|
|
@@ -21,6 +21,8 @@ PMOS has one family of design systems, agreed on 2026-11-20. Its files are in th
|
|
|
21
21
|
|
|
22
22
|
Read `design-system/README.md` first. Each kit gets a copy in `pmos/design-system/`, so another project or session can use it. A product may change `brand/` only. The other parts follow it.
|
|
23
23
|
|
|
24
|
+
**One icon per action.** `brand/icons.json` names one icon for each common action: dismiss (Close, No, Not now, Clear, Drop) is ✕, approve (Yes, Save, Done) is ✓, Add is +, and Undo, Back, Previous, Next, Edit, Delete, Search, Stop and Upload have one icon each. No two actions share an icon. To see each button that draws its action another way, run `node workspace/lib/icon-check.js check` in your product's repository. It names the file, the line and the label. `--gate` exits 1 when one is off. To change an icon, copy the file to `pmos/design-system/brand/icons.json` and edit it there.
|
|
25
|
+
|
|
24
26
|
The workspace has one stylesheet for each part: `pm/brand.css`, `pm/charts.css`, `pm/komorebi.css`, `pm/documents.css` and `pm/slides.css`. They are made from those files. A page moves to the UI system when it loads brand, charts and komorebi, in that order, and puts `pm-ds` on its root. Pages move one at a time, and a page that has not moved looks as it did.
|
|
25
27
|
|
|
26
28
|
These pages are on the UI system: the meeting buddy, the recording tab, the audience tab, the extension's capture popup and the Welcome page. On a moved page, `pm/ds-bridge.css` points the old colour names at the system's colours, so the parts that other modules draw there follow the system too. While a screen is shared, the recording tab's stage uses the Dark theme.
|
|
@@ -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)' }),
|