create-pmos 0.739.0 → 0.741.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 (34) hide show
  1. package/package.json +33 -39
  2. package/payload/AGENTS.md +1 -0
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/planning/evals/eval-calibration.md +1 -1
  5. package/payload/planning/okrs/health-budgets.md +1 -1
  6. package/payload/state/discoveries.md +1 -1
  7. package/workspace/changelog.json +32 -0
  8. package/workspace/guide/breakdown.md +8 -0
  9. package/workspace/guide/cli.md +10 -0
  10. package/workspace/guide/layout.md +2 -4
  11. package/workspace/lib/glossary-cli.js +94 -0
  12. package/workspace/lib/glossary.js +112 -0
  13. package/workspace/lib/pmos-verbs.js +3 -0
  14. package/workspace/lib/route-modules.js +1 -0
  15. package/workspace/lib/routes-glossary.js +29 -0
  16. package/workspace/package-lock.json +2 -2
  17. package/workspace/package.json +1 -1
  18. package/workspace/public/pm/bd-ini-panel.js +1 -1
  19. package/workspace/public/pm/bd-pop-ds.css +3 -5
  20. package/workspace/public/pm/bd-pop-ds.js +26 -4
  21. package/workspace/public/pm/cozy-ev.css +6 -0
  22. package/workspace/public/pm/cozy-nav.js +2 -0
  23. package/workspace/public/pm/cozy-pop-work.css +1 -0
  24. package/workspace/public/pm/cozy-pop-work.js +51 -14
  25. package/workspace/public/pm/cozy-viewer.js +6 -1
  26. package/workspace/public/pm/cozy-vw-shell.css +6 -0
  27. package/workspace/public/pm/glossary.js +250 -0
  28. package/workspace/public/pm/home-ini.js +1 -1
  29. package/workspace/public/pm/live-edit.js +9 -1
  30. package/workspace/public/pm/pop-work-model.js +2 -0
  31. package/workspace/public/pm/work-tree.js +19 -1
  32. package/workspace/test-lists/artefacts-menu.json +9 -0
  33. package/workspace/test-lists/jira-row-edit.json +9 -0
  34. package/workspace/test-lists/product-glossary.json +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.739.0",
3
+ "version": "0.741.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,38 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.741.0",
38
+ "at": "2026-11-23T09:00:39.651Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1657,
43
+ "t": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
44
+ "s": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
45
+ "k": "new"
46
+ },
47
+ {
48
+ "n": 1658,
49
+ "t": "Every Jira task in a work breakdown can be changed the same way",
50
+ "s": "Every Jira task in a work breakdown can be changed the same way",
51
+ "k": "fix"
52
+ }
53
+ ]
54
+ },
55
+ {
56
+ "v": "0.740.0",
57
+ "at": "2026-11-23T08:20:40.488Z",
58
+ "f": 4,
59
+ "prs": [
60
+ {
61
+ "n": 1654,
62
+ "t": "A product's own words show their meaning on hover, on every page (A386)",
63
+ "s": "A product's own words show their meaning on hover, on every page (A386)",
64
+ "k": "new"
65
+ }
66
+ ]
67
+ },
36
68
  {
37
69
  "v": "0.739.0",
38
70
  "at": "2026-11-23T07:58:34.158Z",
@@ -404,44 +436,6 @@
404
436
  "k": "new"
405
437
  }
406
438
  ]
407
- },
408
- {
409
- "v": "0.716.0",
410
- "at": "2026-11-22T20:55:20.302Z",
411
- "f": 4,
412
- "prs": [
413
- {
414
- "n": 1586,
415
- "t": "One-minute ease check per page from the local use log (job #1585)",
416
- "s": "One-minute ease check per page from the local use log (job #1585)",
417
- "k": "new"
418
- }
419
- ]
420
- },
421
- {
422
- "v": "0.715.0",
423
- "at": "2026-11-22T20:02:36.257Z",
424
- "f": 4,
425
- "prs": [
426
- {
427
- "n": 1581,
428
- "t": "The ? list is sized by tokens and uses Komorebi parts only (Checker K5, action-keys)",
429
- "s": "The ?",
430
- "k": "fix"
431
- },
432
- {
433
- "n": 1582,
434
- "t": "Key hints step back once a key is learned (A480)",
435
- "s": "Key hints step back once a key is learned (A480)",
436
- "k": "new"
437
- },
438
- {
439
- "n": 1584,
440
- "t": "Set a task's sprint and priority in place, with one Undo (job #1563)",
441
- "s": "Set a task's sprint and priority in place, with one Undo (job #1563)",
442
- "k": "new"
443
- }
444
- ]
445
439
  }
446
440
  ]
447
441
  }
package/payload/AGENTS.md CHANGED
@@ -113,6 +113,7 @@ The PM talks to you from an initiative's popup in the workspace. PMOS acts by it
113
113
  - **The merge ✦ ("7 references and 2 retros can each be one artefact. Merge them?").** The popup derives it from the files: it shows while several different files of one kind belong to the initiative. When you merge files, put `superseded_by: <path of the merged file>` in the frontmatter of each old file. The Artefacts list then shows the merged file, folds each old file under it as an earlier version, and the ✦ goes away by itself. Delete nothing.
114
114
  - **The case card (Problem, Goal, Done when).** It reads the Experiment and Done test artefacts first, then the record's Problem, Goal and Done test sections. When the PM says yes to a case line, save it where the card reads it: `pmos artefacts set experiment:<id> experiment why --text "<problem>"`, `pmos artefacts set experiment:<id> experiment hypothesis --text "<goal>"`, and `pmos artefacts set experiment:<id> done-test check --text "<one check>"` once for each check. `pmos why` and `pmos ready check` read the same lines.
115
115
  - **The Positioning part of the Strategy card.** When the PM agrees a positioning statement or key message, keep it with `pmos positioning keep --text "<line>" --cites <keys> [--kind positioning]`, citing the strategy lines it comes from (`pmos positioning strategy` lists the keys). Drop one with `pmos positioning drop <id>`. The Board shows what these write.
116
+ - **The product glossary (a word's meaning on hover).** When the PM asks to explain, add or change one of the product's own words ("add MAGW to the glossary"), run `pmos glossary set <term> "<meaning>"` in the product's repository; `pmos glossary remove <term>` takes one out and `pmos glossary` lists them. Every page reads the same file and shows the meaning on hover, or on a long press on a phone.
116
117
  - **A program's card (For, Goal).** After the PM's yes, run `pmos program charter <program id> --why "<what it is for>"` or `--goal "<goal>"` in the repository where the program was made. Its Done when comes from the last milestone and the target date.
117
118
  - **The ✦ that drafts missing documents.** Save a PRD as a file the record names in `prd_path:`, a rubric in `rubric_path:`, and the done test with `pmos artefacts set experiment:<id> done-test check`. A file that nothing names does not show in the Artefacts list.
118
119
  - **A stage's dates on the timeline.** A stage's bar runs from the earliest start to the latest end of its tasks (a task with no start counts from its due date). To change a stage's dates, change the dates of its tasks, with the PM's yes. Do not edit the workflow history to move a bar.
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@869d46c3
1
+ kernel-source: pmos@8efbf548
2
2
  assembled: 2026-11-23
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-23T07:58:30Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T09:00:36Z"}
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-23T07:58:30Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T09:00:36Z"}
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-23T07:58:30Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-23T09:00:36Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,36 @@
1
1
  [
2
+ {
3
+ "v": "0.741.0",
4
+ "at": "2026-11-23T09:00:39.651Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1657,
9
+ "t": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
10
+ "s": "Initiative artefacts move into ⋯; Stages and Work breakdown take the full width",
11
+ "k": "new"
12
+ },
13
+ {
14
+ "n": 1658,
15
+ "t": "Every Jira task in a work breakdown can be changed the same way",
16
+ "s": "Every Jira task in a work breakdown can be changed the same way",
17
+ "k": "fix"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "v": "0.740.0",
23
+ "at": "2026-11-23T08:20:40.488Z",
24
+ "f": 4,
25
+ "prs": [
26
+ {
27
+ "n": 1654,
28
+ "t": "A product's own words show their meaning on hover, on every page (A386)",
29
+ "s": "A product's own words show their meaning on hover, on every page (A386)",
30
+ "k": "new"
31
+ }
32
+ ]
33
+ },
2
34
  {
3
35
  "v": "0.739.0",
4
36
  "at": "2026-11-23T07:58:34.158Z",
@@ -59,6 +59,14 @@ PMOS does not change the stage, owner or status of a Jira ticket. It skips these
59
59
 
60
60
  A task that is linked to a Jira ticket shows the ticket key. Select the key to open the ticket in Jira. A task that is only in PMOS shows no key. The Jira sub-tasks of a ticket show under the ticket.
61
61
 
62
+ Every Jira ticket in the breakdown has the same controls:
63
+
64
+ - **Status** moves the ticket in Jira. Select the status, then select **To do**, **In progress** or **Done**. The new status shows at once, with **Moving in Jira** until Jira answers. The message then says that Jira moved the ticket, with **Undo**. If Jira refuses, the ticket goes back and the message gives Jira's reason.
65
+ - **Dates** and the **name** change in PMOS only. Jira does not change.
66
+ - A Jira sub-task shows under its ticket. Only its status can change.
67
+
68
+ A ticket that PMOS has not read from Jira yet still opens in Jira when you select its key.
69
+
62
70
  A red dot on a ticket shows that it has no epic, or that its epic is not one of the initiative's epics. Hold the pointer on the dot to see why. Above the list, PMOS suggests a fix: put the tickets under the initiative's epic. When you select ✓:
63
71
 
64
72
  - PMOS sets the epic directly only on the tickets that are assigned to you. It uses your own Atlassian connection.
@@ -278,6 +278,16 @@ The idle lab run uses only the first three commands:
278
278
  - `pmos lab critic checks [--root <dir>]`: the checks the critic uses for the product in that folder. No server is needed.
279
279
  - `pmos lab critic label <run> <n> real|noise`: your word on finding `n` of a critic run. `pmos lab critic stats` counts the runs, the findings, and how many you called real or noise.
280
280
 
281
+ ### pmos glossary: the product's own words, explained on every page
282
+
283
+ Run it in the product's repository, or pass `--root <dir>`. It writes the product's records folder on disk, needs no running workspace and sends nothing.
284
+
285
+ - `pmos glossary` (or `pmos glossary list`) lists the words and what they mean. `--json` prints them for a script.
286
+ - `pmos glossary set <term> <meaning…>` adds a word or changes its meaning, for example `pmos glossary set OTP "One-time password"`. A word is at most 40 characters and a meaning at most 200, each on one line. A word written with a capital letter (OTP) is found in that case only; an all-lowercase word (paywall) is found in any case.
287
+ - `pmos glossary remove <term>` takes a word out.
288
+ - On every workspace page, the words of the products you show get a faint dotted underline. Hover over one, or press and hold it on a phone, to see what it means. When you show more than one product, the card names whose word it is.
289
+ - `pmos glossary uses [--days 7]` prints how many meanings were shown on this computer in the last days, from the local use log. Its last line is the number.
290
+
281
291
  ### pmos questions: every open question in one list
282
292
 
283
293
  Run it in the product's repository, or pass `--root <dir>`. It changes nothing, takes no default and sends nothing.
@@ -176,16 +176,14 @@ On a computer the popup is built from the parts of the PMOS design system. The t
176
176
  - **The case.** **Problem**, **Goal** and **Done when** from the initiative's records. Press a line to change it. A line not written offers a PMOS draft (✦) or ✕. When no line is written yet, one suggestion offers to draft them all from what is linked: ✓ sends the request to the chat, ✕ says not this, and the pencil lets you write it yourself. When the chat saves a line, the case shows it as soon as the chat's turn ends, with no reload and no commit. It also reads its lines again when you come back to the page.
177
177
  - **Details.** The facts: dates, the next milestone, product, program, workflow and what is open.
178
178
 
179
- Under it, the left column has two blocks:
179
+ Under it, two blocks use the full width of the popup:
180
180
 
181
181
  - **Stages.** Each stage of the workflow, with its dates under its name or "no dates yet", on a month scale with a red line for today. A stage's bar runs from the earliest start to the latest end of its tasks; a task with no start counts from its due date. Only a stage with no dated task uses the days the workflow moved through it. To change a stage's dates, change its tasks' dates. A stage has a bar only when it has real dates. A milestone is a diamond on its stage's row.
182
182
  - **Work breakdown.** **List** or **Gantt**; PMOS keeps your choice on this computer. **List** has one box on top: type a task and press Enter. Say its stage ("… in Plan"), or it goes to the stage in progress; start with ◇ to add a milestone. Each stage with tasks is one group that says how much is done, for example "1 of 3 done". Press the group to fold it, and press it again to open it. A stage whose tasks are all done is folded until you open it. In a stage, the tasks are in date order, a late task first. A done task stays in its place, in grey with a check. Stages with no tasks fold into one line at the end. Press the box before a task to mark it done, with **Undo**. Press its name to rename it: Enter saves and Escape cancels. When you point at the row, four icons show: **Who** (You, the people on this initiative, or **PMOS does it**, which gives the task to PMOS), **Due date**, **Stage** (moves the task to another stage) and ⋯ (**Status**, **Make it a milestone** and **Open the task**). Each change has **Undo**. A Jira ticket keeps its owner and stage from Jira. **Gantt** is the table described below, with its bars.
183
183
 
184
184
  Press the rest of a row, or a milestone, to open it as a full popup in place of the work side. Its top line has ←, the path (**Work › product › initiative**), the chat button, ⋯ and ×. ← or the initiative's name goes back to the initiative, where you left it. The chat button shows **Ask PMOS** beside it. × closes the popup. A task shows its status, dates, owner, notes and what changed. A milestone also shows its date and how many days are left, the done test, **Kill if**, and the suggestion from PMOS about it when there is one.
185
185
 
186
- The right column has one block:
187
-
188
- - **Artefacts.** The brief, the prototype and the documents, each with its kind and date. A document the gate needs that nobody wrote is grey and says which gate. + adds a file, a link or a new document. After a merge, the merged file stands and says how many earlier files it holds, for example "7 earlier". An old file folds under it when its frontmatter has `superseded_by:` with the merged file's path, or when it opens with the merge's "superseded by" note. The merge suggestion then goes away by itself.
186
+ **Artefacts** are at the top of the initiative's ⋯ menu: the brief, the prototype and the documents, each with its kind and date. Press one to open it full screen, with ← back to the initiative. A document the gate needs that nobody wrote is grey and says which gate. **Add an artefact** adds a file, a link or a new document; it is in the menu the next time you open ⋯. When PMOS suggests a merge, the suggestion is the first row of the section. After a merge, the merged file stands and says how many earlier files it holds, for example "7 earlier". An old file folds under it when its frontmatter has `superseded_by:` with the merged file's path, or when it opens with the merge's "superseded by" note. The merge suggestion then goes away by itself.
189
187
 
190
188
  On a phone, in a shared read-only copy and in a breakdown given the whole popup, the work side keeps the three parts below. They use the full width of the popup: in a wide popup the timeline gets the extra width. A done task shows in grey text, never struck through.
191
189
 
@@ -0,0 +1,94 @@
1
+ 'use strict';
2
+ /* glossary-cli.js — `pmos glossary …`: a product's own words and what they mean (bet A386, initiative glossary-hover; lib/glossary.js).
3
+ *
4
+ * pmos glossary [list] [--json] [--root <dir>] the words, sorted
5
+ * pmos glossary set <term> <meaning…> [--root <dir>] add a word or change its meaning; every page shows it on hover
6
+ * pmos glossary remove <term> [--root <dir>] take a word out
7
+ * pmos glossary uses [--days 7] meanings shown on this computer in the last days; the last line is the number
8
+ *
9
+ * It writes the product's records folder on disk (the same file the workspace reads), so it needs no running server, and the page shows
10
+ * the change the next time it loads. Exit codes: 0 done, 1 refused (the reason is printed), 2 usage. */
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+ const { execFileSync } = require('child_process');
14
+ const G = require('./glossary.js');
15
+
16
+ const COMMANDS = { glossary: ['list', 'set', 'remove', 'uses'] };
17
+ const USAGE = [
18
+ 'usage: pmos glossary [list|set|remove|uses] — the product\'s own words; every page shows a word\'s meaning on hover (a long press on a phone)',
19
+ ' pmos glossary the words and what they mean',
20
+ ' pmos glossary set <term> <meaning…> add a word or change its meaning, for example: pmos glossary set OTP "One-time password"',
21
+ ' pmos glossary remove <term> take a word out',
22
+ ' pmos glossary uses [--days 7] how many meanings were shown on this computer; the last line is the number',
23
+ ' every command: [--root <dir>] [--json]',
24
+ ];
25
+
26
+ function repoRoot(cwd) {
27
+ try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; }
28
+ catch { return cwd; }
29
+ }
30
+
31
+ function parse(argv) {
32
+ const pos = []; const flags = {};
33
+ for (let i = 0; i < argv.length; i++) {
34
+ const a = argv[i];
35
+ if (a === '--root' || a === '--days') flags[a.slice(2)] = argv[++i];
36
+ else if (a.startsWith('--root=')) flags.root = a.slice(7);
37
+ else if (a.startsWith('--days=')) flags.days = a.slice(7);
38
+ else if (a.startsWith('--')) flags[a.slice(2)] = true;
39
+ else if (a === '-h') flags.help = true;
40
+ else pos.push(a);
41
+ }
42
+ return { pos, flags };
43
+ }
44
+
45
+ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now = Date.now(), runtimeDir = null } = {}) {
46
+ const { pos, flags } = parse(argv[0] === 'glossary' ? argv.slice(1) : argv.slice());
47
+ if (flags.help || pos[0] === 'help') { for (const l of USAGE) say(l); return 0; }
48
+ const cmd = pos[0] || 'list';
49
+ if (!COMMANDS.glossary.includes(cmd)) { say(`✗ ${cmd} is not a command of pmos glossary`); for (const l of USAGE) say(l); return 2; }
50
+ const json = !!flags.json;
51
+
52
+ if (cmd === 'uses') {
53
+ const days = flags.days === undefined ? 7 : Number(flags.days);
54
+ if (!Number.isInteger(days) || days < 1 || days > 30) { say('✗ --days is a whole number from 1 to 30'); return 2; }
55
+ let lines = [];
56
+ try { const dir = runtimeDir || require('./state-root.js').defaultRoot({ env: process.env }); lines = require('./use-log.js').readLines(dir); } catch { lines = []; }
57
+ const n = G.uses(lines, days, now);
58
+ if (json) { say(JSON.stringify({ ok: true, days, uses: n })); return 0; }
59
+ say(`${G.TAG} ${n} meaning${n === 1 ? '' : 's'} shown in the last ${days} day${days === 1 ? '' : 's'} on this computer.`);
60
+ say(String(n));
61
+ return 0;
62
+ }
63
+
64
+ if (flags.root === true || flags.root === '') { say('✗ --root needs a value'); return 2; }
65
+ const root = path.resolve(flags.root || repoRoot(cwd));
66
+ let isDir = false; try { isDir = fs.statSync(root).isDirectory(); } catch { isDir = false; }
67
+ if (!isDir) { say(`✗ ${root} is not a directory`); return 1; }
68
+ const dir = G.dirOf(root);
69
+
70
+ if (cmd === 'list') {
71
+ const terms = G.read(dir);
72
+ if (json) { say(JSON.stringify({ ok: true, terms })); return 0; }
73
+ if (!terms.length) say('The glossary is empty. Add a word: pmos glossary set <term> <meaning>');
74
+ for (const t of terms) say(`${t.term}: ${t.meaning}`);
75
+ return 0;
76
+ }
77
+ if (cmd === 'set') {
78
+ if (pos.length < 3) { say('✗ give the word and its meaning: pmos glossary set <term> <meaning…>'); return 2; }
79
+ const r = G.set(dir, pos[1], pos.slice(2).join(' '), now);
80
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
81
+ if (json) { say(JSON.stringify(r)); return 0; }
82
+ say(`✓ ${r.term} is in the glossary. Every page shows its meaning on hover.`);
83
+ return 0;
84
+ }
85
+ // remove
86
+ if (pos.length !== 2) { say('✗ give one word: pmos glossary remove <term> (quote a word with spaces)'); return 2; }
87
+ const r = G.remove(dir, pos[1], now);
88
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
89
+ if (json) { say(JSON.stringify(r)); return 0; }
90
+ say(`✓ ${r.term} is out of the glossary.`);
91
+ return 0;
92
+ }
93
+
94
+ module.exports = { run, COMMANDS, USAGE };
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+ /* glossary.js — a product's glossary of its own words (bet A386, initiative glossary-hover). THE ONE WRITER and THE ONE FOLD of
3
+ * glossary.jsonl. `pmos glossary` (lib/glossary-cli.js) writes it, GET /api/glossary (lib/routes-glossary.js) reads it for the page,
4
+ * and pm/glossary.js shows a word's meaning on hover (a long press on a phone) on every page.
5
+ *
6
+ * read(dir) → [{ term, meaning, at }] the current words, sorted by term (any case)
7
+ * set(dir, term, meaning, now) → { ok, term, terms } | { ok: false, error } adds a word or changes its meaning
8
+ * remove(dir, term, now) → { ok, term, terms } | { ok: false, error } takes a word out (an empty meaning line)
9
+ * checkTerm(term) · checkMeaning(meaning) → '' when good, else the reason
10
+ * dirOf(root) → the records folder of the product checkout at `root`
11
+ * uses(lines, days, now) → how many meanings were shown (use-log `glossary-show`) in the last `days` days PURE
12
+ *
13
+ * WHERE. `dir` is the product's records folder (lib/records-dir.js): planning/records in the PMOS repo, pmos/state/records in a kit
14
+ * product. The file is append-only: one line { at, term, meaning } per change; an empty meaning takes the word out. The last line for a
15
+ * word wins, and a word is matched with any case, so "otp" changes "OTP" (and the new spelling is kept).
16
+ * Log lines say [glossary]. Nothing is sent anywhere. */
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+
20
+ const FILE = 'glossary.jsonl';
21
+ const MAX_TERM = 40;
22
+ const MAX_MEANING = 200;
23
+ const MAX_TERMS = 300;
24
+ const SHOW = 'glossary-show'; // the use-log control a meaning shown is noted under (pm/glossary.js)
25
+ const TAG = '[glossary]';
26
+ const say = (s) => { try { console.log(TAG + ' ' + s); } catch { /* no console */ } };
27
+ const one = (v) => String(v == null ? '' : v).replace(/\s+/g, ' ').trim();
28
+ const keyOf = (t) => one(t).toLowerCase();
29
+
30
+ function checkTerm(term) {
31
+ const t = one(term);
32
+ if (!t) return 'Name the word.';
33
+ if (t.length > MAX_TERM) return `A word is at most ${MAX_TERM} characters.`;
34
+ if (!/[\p{L}\p{N}]/u.test(t)) return 'A word needs a letter or a digit.';
35
+ return '';
36
+ }
37
+
38
+ function checkMeaning(meaning) {
39
+ const m = one(meaning);
40
+ if (!m) return 'Say what the word means.';
41
+ if (m.length > MAX_MEANING) return `A meaning is at most ${MAX_MEANING} characters.`;
42
+ return '';
43
+ }
44
+
45
+ const fileOf = (dir) => (dir ? path.join(dir, FILE) : null);
46
+
47
+ function readLines(dir) {
48
+ const f = fileOf(dir);
49
+ if (!f) return [];
50
+ let text = '';
51
+ try { text = fs.readFileSync(f, 'utf8'); } catch { return []; }
52
+ const out = [];
53
+ for (const l of text.split('\n')) {
54
+ if (!l.trim()) continue;
55
+ try { const o = JSON.parse(l); if (o && typeof o === 'object' && typeof o.term === 'string') out.push(o); } catch { /* a torn line is skipped */ }
56
+ }
57
+ return out;
58
+ }
59
+
60
+ function read(dir) {
61
+ const by = new Map();
62
+ for (const l of readLines(dir)) {
63
+ const k = keyOf(l.term);
64
+ if (!k) continue;
65
+ const m = one(l.meaning);
66
+ if (m) by.set(k, { term: one(l.term), meaning: m, at: l.at || null });
67
+ else by.delete(k);
68
+ }
69
+ return [...by.values()].sort((a, b) => a.term.localeCompare(b.term, 'en', { sensitivity: 'base' }));
70
+ }
71
+
72
+ function append(dir, line) {
73
+ fs.mkdirSync(dir, { recursive: true });
74
+ fs.appendFileSync(fileOf(dir), JSON.stringify(line) + '\n');
75
+ }
76
+
77
+ function set(dir, term, meaning, now = Date.now()) {
78
+ if (!dir) return { ok: false, error: 'This product has no records folder.' };
79
+ const bad = checkTerm(term) || checkMeaning(meaning);
80
+ if (bad) return { ok: false, error: bad };
81
+ const t = one(term), had = read(dir);
82
+ if (!had.some((x) => keyOf(x.term) === keyOf(t)) && had.length >= MAX_TERMS) return { ok: false, error: `A glossary holds at most ${MAX_TERMS} words. Remove one first.` };
83
+ try { append(dir, { at: new Date(now).toISOString(), term: t, meaning: one(meaning) }); } catch (e) { return { ok: false, error: 'could not save the word: ' + ((e && e.message) || e) }; }
84
+ const terms = read(dir);
85
+ say(`set ${t} (${terms.length} words)`);
86
+ return { ok: true, term: t, terms };
87
+ }
88
+
89
+ function remove(dir, term, now = Date.now()) {
90
+ if (!dir) return { ok: false, error: 'This product has no records folder.' };
91
+ const bad = checkTerm(term);
92
+ if (bad) return { ok: false, error: bad };
93
+ const hit = read(dir).find((x) => keyOf(x.term) === keyOf(term));
94
+ if (!hit) return { ok: false, error: `${one(term)} is not in the glossary.` };
95
+ try { append(dir, { at: new Date(now).toISOString(), term: hit.term, meaning: '' }); } catch (e) { return { ok: false, error: 'could not remove the word: ' + ((e && e.message) || e) }; }
96
+ const terms = read(dir);
97
+ say(`removed ${hit.term} (${terms.length} words)`);
98
+ return { ok: true, term: hit.term, terms };
99
+ }
100
+
101
+ /** The records folder of the product checkout at `root` (scripts/signals/layout-paths.js, as lib/records-dir.js does). */
102
+ function dirOf(root) {
103
+ try { const { repoScript } = require('./repo-script.js'); return require(repoScript('signals/layout-paths.js')).pathsFor(root).recordsDir; }
104
+ catch { return path.join(root, 'planning', 'records'); }
105
+ }
106
+
107
+ function uses(lines, days = 7, now = Date.now()) {
108
+ const cut = now - days * 864e5;
109
+ return (lines || []).filter((l) => l && l.kind === 'use' && l.control === SHOW && Date.parse(l.at) >= cut && Date.parse(l.at) <= now + 864e5).length;
110
+ }
111
+
112
+ module.exports = { FILE, MAX_TERM, MAX_MEANING, MAX_TERMS, SHOW, TAG, checkTerm, checkMeaning, readLines, read, set, remove, dirOf, uses };
@@ -130,6 +130,9 @@ const VERBS = Object.freeze({
130
130
  // Not a pm-os-absorb verb (run: null): initiative design-drift-guard added it through the same table.
131
131
  design: Object.freeze({ module: 'design-cli.js', run: null, guide: 'cli.md',
132
132
  help: 'pmos design drift — which pages are built from your design system and which drift from it, read from git (pmos design help)' }),
133
+ // Not a pm-os-absorb verb (run: null): initiative glossary-hover (bet A386) added it through the same table.
134
+ glossary: Object.freeze({ module: 'glossary-cli.js', run: null, guide: 'cli.md',
135
+ help: 'pmos glossary [list|set|remove|uses] — the product\'s own words; every page shows a word\'s meaning on hover (pmos glossary help)' }),
133
136
  // Not a pm-os-absorb verb (run: null): initiative page-fix-count-first (bet A462) added it through the same table.
134
137
  pages: Object.freeze({ module: 'pages-cli.js', run: null, guide: 'cli.md',
135
138
  help: 'pmos pages [show|check] — each page\'s fixes, reverts and restores in the last 14 days, and a feature change that adds to a page that keeps breaking (pmos pages help)' }),
@@ -51,6 +51,7 @@ const MODULES = Object.freeze([
51
51
  'routes-doc-health', // console3 B2: the six document health checks, recomputed from text
52
52
  'routes-outbox', // console3 B3: the outbox queue, hash-bound confirm (no channel connected)
53
53
  'routes-waiting', // home-your-move-waiting: Waiting on others, derived from records, with its exit rule
54
+ 'routes-glossary', // glossary-hover (A386): the glossary of the products a page shows (read only; pmos glossary writes it)
54
55
  'routes-open-questions', // open-questions-register (A420): one register of every unanswered question, with owner, age and default
55
56
  'routes-calendar-views', // console3 C2: Day/Week/Month/Quarter/Year cells, Gantt and the strategy lens (read-only)
56
57
  'routes-events-place', // events-place (nav slice 6): every date PMOS holds, grouped Late / Today / Coming up, and the PM's fixed marks and noes (events/marks.jsonl; page-press POST)
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+ /* routes-glossary.js — the glossary of the products a page shows (bet A386, initiative glossary-hover; lib/glossary.js, pm/glossary.js).
3
+ *
4
+ * GET /api/glossary?ws=<id>[,<id>…] → { ok, terms: [{ term, meaning, ws }] } no ws: the home product
5
+ *
6
+ * Read only: `pmos glossary set|remove` writes the same file (glossary.jsonl in each product's records folder), so a word the chat adds
7
+ * shows on the next page load. An unknown product is left out. Nothing is sent anywhere. */
8
+ const G = require('./glossary.js');
9
+ const { recordsDirFor } = require('./records-dir.js');
10
+
11
+ module.exports = {
12
+ prefixes: ['/api/glossary'],
13
+ handle: async (req, res, url, ctx) => {
14
+ if (url.pathname !== '/api/glossary') return false;
15
+ if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
16
+ const asked = String(url.searchParams.get('ws') || '').split(',').map((s) => s.trim()).filter(Boolean).slice(0, 20);
17
+ const ids = [];
18
+ for (const id of asked.length ? asked : [null]) {
19
+ let w = null;
20
+ try { w = ctx.getWs ? ctx.getWs(id) : null; } catch { w = null; }
21
+ if (!w || !w.id || (id && w.id !== id)) continue; // getWs gives the home product for an unknown id: leave it out
22
+ if (!ids.includes(w.id)) ids.push(w.id);
23
+ }
24
+ const terms = [];
25
+ for (const ws of ids) for (const t of G.read(recordsDirFor(ctx, ws))) terms.push({ term: t.term, meaning: t.meaning, ws });
26
+ ctx.json(res, { ok: true, terms });
27
+ return true;
28
+ },
29
+ };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.739.0",
3
+ "version": "0.741.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.739.0",
9
+ "version": "0.741.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.739.0",
3
+ "version": "0.741.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",
@@ -338,7 +338,7 @@ export function openIni(r, from, o = {}) {
338
338
  // on a desk it opens in the one popup with Ask PMOS about it beside it (slice 2 of the six-place navigation); a phone keeps its sheet
339
339
  const B = (O.M() || {}).board || {};
340
340
  VW.open({ kind: 'Initiative', title: r.title, icon: 'goal', wrap: true, id: vidOf(r), from: 'Work', kindChip: 'Initiative', sub: metaOf(r), pop: { id: r.id || '', kind: 'initiative', title: r.title, ws: r.ws || B.ws || undefined, ...roPop() },
341
- discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => { const x = O.rowOf(r.key) || r, b = VW.bodyOf(vidOf(x)); return (PW.on(b) ? PW.moreItems(null, popExtra(x)) : []).concat(iniMore(x)); }, rename: O.rename ? O.rename(r) : null,
341
+ discuss: r.id ? true : () => location.assign(O.askHref(r, '')), more: () => { const x = O.rowOf(r.key) || r, b = VW.bodyOf(vidOf(x)); return (PW.on(b) ? PW.moreItems(null, popExtra(x), b) : []).concat(iniMore(x)); }, rename: O.rename ? O.rename(r) : null,
342
342
  // the kind of work (batch 29 item 11, KdV1-3): its glyph stands before Discuss; a tap opens the three kinds. A published copy
343
343
  // (pm/readonly.js) cannot change it, so it has no press: the Board's icon still names the kind
344
344
  presses: (window.PMOS_READONLY ? [] : [WK.pressOf(r.kind)]).concat(dashFor(r) ? dashFor(r).presses() : []), onPress: (a, b) => {
@@ -2,14 +2,12 @@
2
2
  * boards WorkPopupDS, WorkGanttDS, WorkCaseEmptyDS). It only places the parts pm/bd-pop-ds.js draws (pm-block, pm-sug x, pm-tabs, pm-gt,
3
3
  * pm-dia, pm-now, pm-group, pm-li, pm-fold, pm-input); the look is the system's. */
4
4
 
5
- /* ── two columns: the work on the left, the case and its artefacts on the right ── */
6
- .pw.pwd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: var(--space-16); align-items: start; padding-bottom: var(--space-24); }
7
- .pwd-main, .pwd-side { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
5
+ /* ── one column: the Overview, then the Stages and the breakdown at the full width; the artefacts are in ⋯ (artefacts-in-more-menu) ── */
6
+ .pw.pwd { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-16); align-items: start; padding-bottom: var(--space-24); }
7
+ .pwd-main { display: flex; flex-direction: column; gap: var(--space-16); min-width: 0; }
8
8
  .pwd-blk { gap: var(--space-12); }
9
9
  .pwd-bh { justify-content: space-between; gap: var(--space-8); }
10
10
  .pwd-bh .pm-h-sm { margin: 0; }
11
- @container (max-width: 860px) { .pw.pwd { grid-template-columns: minmax(0, 1fr); } }
12
- @media (max-width: 1100px) { .pw.pwd { grid-template-columns: minmax(0, 1fr); } }
13
11
 
14
12
  /* ── Where it stands ── */
15
13
  .pwd-say { margin: 0; font-size: var(--fs-body); line-height: 24px; }
@@ -11,6 +11,7 @@
11
11
  * caseHtml(W, o) → The case: its lines (each editable), the facts; no line written: one Suggestion to draft them all
12
12
  * overviewHtml(W, r, o) → Overview: Where it stands, The case and its facts in one block that folds; folded, the one-line summary
13
13
  * artsHtml(arts) → Artefacts: a List with Add in the head
14
+ * artMenu(arts, o) → the ⋯ menu's Artefacts section (the desk popup has no side card)
14
15
  * stageKeyOf(text, st) → { key, name, title } the stage a captured line names ("… in Plan"), else the stage in progress
15
16
  *
16
17
  * The UI says PMOS, never Claude. Buttons are icons with aria-label. */
@@ -181,15 +182,18 @@ export function listHtml(rows, W, o = {}) {
181
182
  // a priority set in the row (inline-sprint-priority) says itself first; none, nothing
182
183
  const sub = x.jsub ? [x.who && x.who !== 'You' ? x.who : '', x.date].filter(Boolean).join(' · ') : [x.priority || '', x.date, x.who && x.who !== 'You' ? x.who : ''].filter(Boolean).join(' · ');
183
184
  // the tick (WorkStatesDS 3): marks it done, with Undo; a done task and a Jira ticket show their state only
184
- const box = x.done ? `<span class="pwd-ck dn" aria-label="Done" role="img">${SV(I.ok, 14)}</span>`
185
+ // a Jira ticket's box moves it in Jira, done or not (jira-row-edit): To do, In progress or Done, asked of Jira (pm/jira-move.js)
186
+ const E = WT.editOf(x, !!o.ro);
187
+ const box = E.status === 'jira' ? `<button type="button" class="pwd-ck${x.done ? ' dn' : ''}" data-pw-jstat="${esc(x.uid)}" aria-haspopup="menu" aria-label="${esc('Status in Jira: ' + (x.jst || x.status) + '. Move it in Jira')}" title="${esc('Jira · ' + (x.jmv ? 'moving to ' + x.status : x.jst || x.status))}">${SV(x.done ? I.ok : x.ms ? I.dia : I.box, 14)}</button>`
188
+ : x.done ? `<span class="pwd-ck dn" aria-label="Done" role="img">${SV(I.ok, 14)}</span>`
185
189
  : o.ro || x.jira ? `<span class="pwd-ck" aria-hidden="true">${SV(x.ms ? I.dia : I.box, 14)}</span>`
186
190
  : `<button type="button" class="pwd-ck" data-pw-tick="${esc(x.uid)}" aria-label="${esc('Mark ' + x.title + ' done')}" title="Mark it done">${SV(x.ms ? I.dia : I.box, 14)}</button>`;
187
- const title = x.jira || o.ro || x.done ? `<span class="t">${esc(x.title)}</span>` : `<button type="button" class="t pwd-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
191
+ const title = !E.name || x.done ? `<span class="t">${esc(x.title)}</span>` : `<button type="button" class="t pwd-tt" data-pw-name="${esc(x.uid)}" aria-label="${esc('Rename ' + x.title)}">${esc(x.title)}</button>`;
188
192
  // on hover (WorkStatesDS 1): Who, Due date, Stage and More, each a small picker; a Jira ticket keeps Jira's owner and stage
189
193
  const ab = (attr, label, d) => `<button type="button" class="pm-btn" ${attr} aria-label="${esc(label)}" title="${esc(label)}">${SV(d)}</button>`;
190
194
  const acts = o.ro ? '' : '<span class="acts">'
191
195
  + (x.jira || x.done ? '' : ab(`data-pw-who="${esc(x.uid)}" aria-haspopup="menu"`, 'Who: ' + (x.who || 'no one'), I.who))
192
- + (x.done ? '' : ab(`data-pw-date="${esc(x.uid)}" aria-haspopup="dialog"`, x.date ? (x.ms ? 'Date: ' : 'Due: ') + x.date : 'Set a date', I.cal))
196
+ + (x.done || !E.dates ? '' : ab(`data-pw-date="${esc(x.uid)}" aria-haspopup="dialog"`, x.date ? (x.ms ? 'Date: ' : 'Due: ') + x.date : 'Set a date', I.cal))
193
197
  + (x.jira ? '' : ab(`data-pw-stage="${esc(x.uid)}" aria-haspopup="menu"`, 'Stage', I.stage))
194
198
  // Sprint and Priority (inline-sprint-priority): an open PMOS task only; Jira keeps its tickets' own
195
199
  + (x.jira || x.done ? '' : ab(`data-pw-sprint="${esc(x.uid)}" aria-haspopup="menu"`, 'Sprint', I.sprint) + ab(`data-pw-prio="${esc(x.uid)}" aria-haspopup="menu"`, 'Priority: ' + (x.priority || 'none'), I.flag))
@@ -197,7 +201,7 @@ export function listHtml(rows, W, o = {}) {
197
201
  // a parent (WorkSubtasksDS): the fold chevron, "n of m done" with its bar; children indent one step per level, up to three
198
202
  const chev = x.kids ? `<button type="button" class="pwd-chev" data-pw-sub="${esc(x.uid)}" aria-expanded="${!!x.open}" aria-label="${esc((x.open ? 'Fold ' : 'Open ') + x.title)}">${SV(x.open ? I.down : I.right, 14)}</button>` : (x.depth || (o.nested && !x.depth) ? '<span class="pwd-chev sp" aria-hidden="true"></span>' : '');
199
203
  const prog = x.kids ? `<span class="pwd-prog" aria-hidden="true"><i style="width:${x.nLeaf ? Math.round((x.nDone / x.nLeaf) * 100) : 0}%"></i></span><span class="pm-meta pwd-cnt">${esc(x.count)}</span>` : '';
200
- const jira = keyChip(x) + (x.jsub ? ' <span class="pm-meta">Jira sub-task</span>' : '');
204
+ const jira = keyChip({ ...x, jurl: WT.chipUrl(x, rows) }) + (x.jmv ? ' <span class="pm-meta">Moving in Jira</span>' : '') + (x.jsub ? ' <span class="pm-meta">Jira sub-task</span>' : '');
201
205
  const dot = epicDot(x, o.epics);
202
206
  // drag (work-subtasks-followups): onto a task nests it, left takes it out; a Jira sub-task stays under its ticket
203
207
  const drag = o.drag && !o.ro && !x.jsub ? ' draggable="true"' : '';
@@ -310,6 +314,24 @@ export function artsHtml(arts, o = {}) {
310
314
  return `<section class="pm-block pwd-blk pwd-arts" aria-label="Artefacts"><div class="pm-row pwd-bh"><h2 class="pm-h-sm">Artefacts</h2>${add}</div>${o.merge || ''}${rows || '<p class="pm-meta">Nothing yet.</p>'}</section>`;
311
315
  }
312
316
 
317
+ /** The ⋯ menu's Artefacts section (artefacts-in-more-menu, Wawan 2026-11-23: the side card took the width the Stages need). arts: the model's
318
+ * artefacts (each row's `art` is its index, as openArt reads it). o: { ro, merge: { say } (the ✦ line) }.
319
+ * → [{ head }, { label, icon, merge }?, { label, sub, icon, art } | { label, sub, icon, missing, disabled }, …, { label, icon, add }?, { sep }]
320
+ * Read only with nothing to open: []. */
321
+ export function artMenu(arts, o = {}) {
322
+ const R = (arts || []).map((a, i) => ({ a, i })).filter((x) => x.a && !(o.ro && x.a.missing));
323
+ if (o.ro && !R.length) return [];
324
+ const out = [{ head: 'Artefacts' }];
325
+ if (o.merge && o.merge.say && !o.ro) out.push({ label: o.merge.say, icon: I.star, merge: true });
326
+ for (const { a, i } of R) {
327
+ const sub = a.missing ? String(a.missing) : [a.kindName || a.kind, a.when, a.olds && a.olds.length ? a.olds.length + ' earlier' : ''].filter(Boolean).join(' · ');
328
+ out.push(a.missing ? { label: a.title || '', sub, icon: iconOf(a), missing: true, disabled: true } : { label: a.title || '', sub, icon: iconOf(a), art: i });
329
+ }
330
+ if (!o.ro) out.push({ label: 'Add an artefact', icon: I.plus, add: true });
331
+ out.push({ sep: true });
332
+ return out;
333
+ }
334
+
313
335
  /** Who can have a task (WorkStatesDS 1): You first, then the people who own tasks of this initiative, then PMOS. → [{ k, label, pmos? }] */
314
336
  export function whoOf(rows, cur = '') {
315
337
  const S = new Set();
@@ -556,3 +556,9 @@ body.pm-focus.cz-railon { --cz-railx: var(--space-16); }
556
556
  body.pm-focus .cz-pop-card { inset: 0; border-radius: 0; }
557
557
  .pm-focus-bar { position: fixed; top: var(--space-8); right: var(--space-8); z-index: 1000; }
558
558
  .pm-focus-bar .pm-focus-leave { background: var(--card); color: var(--ink); box-shadow: var(--lift); }
559
+
560
+ /* ── the product glossary (pm/glossary.js, bet A386): its words carry a faint dotted underline (a CSS highlight, the page's markup is
561
+ * untouched), and a hover or a long press shows a small Komorebi card with the word and its meaning. Tokens only. ── */
562
+ ::highlight(pm-term) { text-decoration: underline dotted; text-underline-offset: var(--space-4); } /* the text's own colour: --muted means another thing inside .c3 */
563
+ .gl-tip.pm-ds { position: fixed; z-index: 90; max-width: min(calc(var(--space-64) * 5), calc(100vw - var(--space-16))); background: var(--card); color: var(--ink); border-radius: var(--radius-md); box-shadow: var(--lift); padding: var(--space-8) var(--space-12); font-size: var(--fs-meta); line-height: var(--lh-meta); left: var(--fr-gl-x, 0); top: var(--fr-gl-y, 0); pointer-events: auto; }
564
+ .gl-tip.pm-ds .gl-m { margin: var(--space-4) 0 0; }