create-pmos 0.742.0 → 0.744.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 +26 -26
- package/payload/KIT-VERSION +1 -1
- 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/briefing-premium-board-test.js +3 -2
- package/workspace/changelog.json +25 -0
- package/workspace/guide/cli.md +1 -0
- package/workspace/guide/layout.md +3 -3
- package/workspace/lib/briefing-premium-agent.js +8 -2
- package/workspace/lib/decision-journal.js +107 -6
- package/workspace/lib/decisions-cli.js +24 -8
- package/workspace/lib/driver-decide.js +18 -1
- package/workspace/lib/parked-reasons.js +4 -1
- package/workspace/lib/routes-proposals.js +23 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-board.css +2 -0
- package/workspace/public/pm/library-keys.js +41 -0
- package/workspace/public/pm/page-chat.js +21 -1
- package/workspace/public/pm/premium-board.js +23 -1
- package/workspace/public/pm/premium-library.js +5 -12
- package/workspace/public/premium-board.html +2 -0
- package/workspace/server.js +2 -0
- package/workspace/test-lists/decisions-from-approvals.json +5 -0
- package/workspace/test-lists/work-ask-chat.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.744.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,31 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.744.0",
|
|
38
|
+
"at": "2026-11-23T10:01:07.752Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1664,
|
|
43
|
+
"t": "Approvals, card picks, drops and parks write the decision journal, with Undo (A475)",
|
|
44
|
+
"s": "Approvals, card picks, drops and parks write the decision journal, with Undo (A475)",
|
|
45
|
+
"k": "new"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"n": 1665,
|
|
49
|
+
"t": "Every merged job keeps a PR and a cost; the verifier reaches every run; Library keys tested by pressing them (A484, A9, A437)",
|
|
50
|
+
"s": "Every merged job keeps a PR and a cost; the verifier reaches every run; Library keys tested by pressing them (A484, A9, A437)",
|
|
51
|
+
"k": "fix"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"n": 1659,
|
|
55
|
+
"t": "Start a chat about a product from Work, and a program's chat answers its first message",
|
|
56
|
+
"s": "Start a chat about a product from Work, and a program's chat answers its first message",
|
|
57
|
+
"k": "fix"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
36
61
|
{
|
|
37
62
|
"v": "0.742.0",
|
|
38
63
|
"at": "2026-11-23T09:41:15.063Z",
|
|
@@ -611,31 +636,6 @@
|
|
|
611
636
|
"k": "new"
|
|
612
637
|
}
|
|
613
638
|
]
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
"v": "0.718.0",
|
|
617
|
-
"at": "2026-11-22T23:44:48.503Z",
|
|
618
|
-
"f": 4,
|
|
619
|
-
"prs": [
|
|
620
|
-
{
|
|
621
|
-
"n": 1589,
|
|
622
|
-
"t": "Search answers first, with its source",
|
|
623
|
-
"s": "Search answers first, with its source",
|
|
624
|
-
"k": "new"
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
"n": 1592,
|
|
628
|
-
"t": "Pmos why, the three-line why of any initiative or task",
|
|
629
|
-
"s": "Pmos why, the three-line why of any initiative or task",
|
|
630
|
-
"k": "new"
|
|
631
|
-
},
|
|
632
|
-
{
|
|
633
|
-
"n": 1590,
|
|
634
|
-
"t": "One health score per product, shown only when it drops",
|
|
635
|
-
"s": "One health score per product, shown only when it drops",
|
|
636
|
-
"k": "new"
|
|
637
|
-
}
|
|
638
|
-
]
|
|
639
639
|
}
|
|
640
640
|
]
|
|
641
641
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T10:01:04Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T10:01:04Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-23T10:01:04Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -148,9 +148,10 @@ const IVREAD = () => {
|
|
|
148
148
|
ok('B1 the page is served at /premium-board and /premium-board.html', (await fetch(BASE + '/premium-board')).status === 200 && (await fetch(BASE + '/premium-board.html')).status === 200);
|
|
149
149
|
|
|
150
150
|
/* the Agreed toolbar: the view toggle, Find, Filter, New initiative and ⋯; nothing of the older Board is attached (premium-agreed-design, audit section 2) */
|
|
151
|
-
const tools = await p.evaluate(() => ({ views: [...document.querySelectorAll('#bdViewMenu [data-pv]')].map((b) => b.dataset.pv).join(), order: [...document.querySelectorAll('.bd-hd #bdView, .bd-hd #bdFind, .bd-hd #bdFilter, .bd-hd #newIni, .bd-hd #moreBtn')].map((e) => e.id).join(),
|
|
151
|
+
const tools = await p.evaluate(() => ({ views: [...document.querySelectorAll('#bdViewMenu [data-pv]')].map((b) => b.dataset.pv).join(), order: [...document.querySelectorAll('.bd-hd #bdView, .bd-hd #bdAsk, .bd-hd #bdFind, .bd-hd #bdFilter, .bd-hd #newIni, .bd-hd #moreBtn')].map((e) => e.id).join(),
|
|
152
152
|
n: [...document.querySelectorAll('.bd-hd button, .bd-hd .crumb')].filter((b) => b.offsetParent !== null && !b.closest('[hidden], .bd-grpm, #bdChipset') && !b.matches('.crumb *')).length, old: ['#modeSeg', '#iniCap', '#iniBar', '#iniNote', '#popAsks', '#popSpr', '#popMet', '#popFilter', '#stHelp', '#more', '.bam2', '.bd-foot', '#dmQ', '#docBody .dmr'].filter((q) => !!document.querySelector(q)), console: document.querySelectorAll('a[href*="console"]').length }));
|
|
153
|
-
|
|
153
|
+
// work-ask-chat (bug 2026-11-23): Ask PMOS about the product sits before Find on a computer
|
|
154
|
+
ok('B1 the toolbar is one row of eight (UI grill U2, plus Ask PMOS): the picker, the View chip (List, By stage, Track and Timeline), the pill, Ask PMOS, Find, the tune button, New and ⋯, in that order', tools.views === 'list,stages,track,time' && tools.order === 'bdView,bdAsk,bdFind,bdFilter,newIni,moreBtn' && tools.n === 7, JSON.stringify(tools));
|
|
154
155
|
ok('B1 none of the older Board is on the page: no Page/Popup switch, header bar, note, asks, sprint, metrics or filter popover, Show more, row menu, footer or documents manager, and no console link', tools.old.length === 0 && tools.console === 0, JSON.stringify(tools));
|
|
155
156
|
|
|
156
157
|
/* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage.
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.744.0",
|
|
4
|
+
"at": "2026-11-23T10:01:07.752Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1664,
|
|
9
|
+
"t": "Approvals, card picks, drops and parks write the decision journal, with Undo (A475)",
|
|
10
|
+
"s": "Approvals, card picks, drops and parks write the decision journal, with Undo (A475)",
|
|
11
|
+
"k": "new"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1665,
|
|
15
|
+
"t": "Every merged job keeps a PR and a cost; the verifier reaches every run; Library keys tested by pressing them (A484, A9, A437)",
|
|
16
|
+
"s": "Every merged job keeps a PR and a cost; the verifier reaches every run; Library keys tested by pressing them (A484, A9, A437)",
|
|
17
|
+
"k": "fix"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"n": 1659,
|
|
21
|
+
"t": "Start a chat about a product from Work, and a program's chat answers its first message",
|
|
22
|
+
"s": "Start a chat about a product from Work, and a program's chat answers its first message",
|
|
23
|
+
"k": "fix"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
2
27
|
{
|
|
3
28
|
"v": "0.742.0",
|
|
4
29
|
"at": "2026-11-23T09:41:15.063Z",
|
package/workspace/guide/cli.md
CHANGED
|
@@ -346,6 +346,7 @@ Write one line for each product decision, also one that is smaller than an initi
|
|
|
346
346
|
- `pmos decisions show <id>` shows one decision, its checks and its reversal.
|
|
347
347
|
- `pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>"` records your verdict. With `cant-tell`, `--again <date>` sets a new date to look again.
|
|
348
348
|
- `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.
|
|
349
|
+
- `pmos decisions undo <id>` takes a decision out of the journal. PMOS also writes a line by itself when you press ✓ on a ✦ proposal, pick an answer on a card, drop a proposal with a reason, keep an agent's proposal, or park an initiative with a reason. `pmos decisions list` shows those lines under "Logged from your presses". The Undo of the press takes its line out too.
|
|
349
350
|
- 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.
|
|
350
351
|
|
|
351
352
|
### pmos principles: the product's principles, from its decisions
|
|
@@ -96,7 +96,7 @@ On a phone, PMOS opens on Today. It is one page with no boxes: **Where it stands
|
|
|
96
96
|
|
|
97
97
|
## Work
|
|
98
98
|
|
|
99
|
-
On a computer, Work is built from the parts of the PMOS design system. The top line shows the path (**Work ›** and the product; press the product to switch it), the tabs **Initiatives**, **Backlog** and **This sprint**, then Search, New initiative and More.
|
|
99
|
+
On a computer, Work is built from the parts of the PMOS design system. The top line shows the path (**Work ›** and the product; press the product to switch it), the tabs **Initiatives**, **Backlog** and **This sprint**, then Ask PMOS, Search, New initiative and More. Ask PMOS (the chat bubble, on a computer) opens a chat about the product shown, in the one popup; with several products it opens Ask PMOS about the page. A program's own chat is the chat bubble in its popup.
|
|
100
100
|
|
|
101
101
|
**Initiatives** has three blocks:
|
|
102
102
|
|
|
@@ -241,10 +241,10 @@ A Jira date and the planned finish of an initiative get no ✓: PMOS cannot writ
|
|
|
241
241
|
|
|
242
242
|
1. To narrow the list, use the chips at the top: **Kind** (a family, such as Briefs, or one kind inside it), the product, program and project chip, and **State**. Each shows how many rows it has. When a chip hides rows, a grey line says how many; press **Show all** to clear the chips.
|
|
243
243
|
2. To group the list, press the **Group** chip and pick **New** (this week, earlier this month, older), **Work** (each program and initiative is a shelf, with one row per kind in the order of the work), **Kind** or **Product**. Press a shelf to fold it.
|
|
244
|
-
3. To find a thing, type in **Find in Library**, or press
|
|
244
|
+
3. To find a thing, type in **Find in Library**, or press `/` (when the cursor is not in a text box and no popup is open). Titles that match show at once. Under them, **Also about this** lists the documents and notes that are about your words by meaning, each with the passage that matched and the idea in bold. PMOS reads them for meaning in a normal PMOS session; until it answers, or when it cannot, they are ranked by shared words and the line says so.
|
|
245
245
|
4. A meeting note with no title shows the name PMOS gave it, with ✦. Press ✦ to keep the name or type another. A note with no work shows ✦ and the initiative it talks about: press it to link the note to that work.
|
|
246
246
|
5. To add a file, a link or a new document, press **+**. Ask PMOS opens with "Add to Library" in the box. Say what to add; PMOS fills its kind, product and work and shows you the record.
|
|
247
|
-
6. To open a thing, press its row. It opens in the popup with the chat about it. On a screen 1200 px or wider, the first press shows the record at the right: every field, the first lines, the files that link to it and its editions. Press again, press Enter or press the open button to open it. A link opens in a new browser tab.
|
|
247
|
+
6. To open a thing, press its row. It opens in the popup with the chat about it. On a screen 1200 px or wider, the first press shows the record at the right: every field, the first lines, the files that link to it and its editions. Press again, press Enter or press the open button to open it. On any screen, Enter on a row's name opens it at once. A link opens in a new browser tab.
|
|
248
248
|
|
|
249
249
|
The Library is built from the PMOS design system's blocks. The top line is the path, the product chip, then **+** and **More** (Show all, Read the Library again). The search box is always shown. The list is one card of rows, the row you picked is lit, and the record at the right is a card with its fields. On a phone a row shows the kind, the name and the day only. While the list loads, three soft lines stand in for it. When the list cannot be read, one line says why, with **Retry**.
|
|
250
250
|
|
|
@@ -105,6 +105,12 @@ function popRow(c) {
|
|
|
105
105
|
/** The opening's row of an initiative's chat when the page model holds no row for it (bug 2026-10-24: Home's New session on an
|
|
106
106
|
* initiative other than the one the initiative model last read). The chat is the PM's own Claude Code session, so it starts with
|
|
107
107
|
* the initiative's id and what the page sent instead of refusing. A row of another kind that is not on the page is still refused. */
|
|
108
|
+
/** A chat that may start from what the page says it is about, when the server's model has no row for it: an initiative (init:), and a
|
|
109
|
+
* program or a whole product (board:, bug 2026-11-23: the Board model holds initiatives only, so a program's or a product's chat answered
|
|
110
|
+
* 404 and the first message went nowhere). A board: chat needs the page's words; with none it still needs a row. */
|
|
111
|
+
function scopedByContext(key, context) {
|
|
112
|
+
return /^init:/.test(String(key)) || (/^board:/.test(String(key)) && typeof context === 'string' && !!context.trim());
|
|
113
|
+
}
|
|
108
114
|
function contextRow(key, context) {
|
|
109
115
|
const say = typeof context === 'string' ? clip(context, 600) : '';
|
|
110
116
|
const id = String(key).replace(/^[a-z]+:/, '').replace(/:\d+$/, '');
|
|
@@ -149,7 +155,7 @@ function ask({ runtimeDir, key, text, model, context, spawnSession, wsId, now =
|
|
|
149
155
|
const q = String(text == null ? '' : text).trim();
|
|
150
156
|
if (!q) return fail(400, 'Write a question for the agent.');
|
|
151
157
|
if (q.length > MAX_Q) return fail(400, 'The question is too long (' + MAX_Q + ' characters at most).');
|
|
152
|
-
const row = rowFor(model, key, context);
|
|
158
|
+
const row = rowFor(model, key, context) || (scopedByContext(key, context) ? contextRow(key, context) : null);
|
|
153
159
|
if (!row) return fail(404, /^pop:/.test(key) ? 'the popup did not say what it shows' : model ? 'that row is not on the page' : 'the page has not read the repository yet');
|
|
154
160
|
if (typeof spawnSession !== 'function') return fail(409, 'this workspace cannot start sessions');
|
|
155
161
|
const origin = 'briefing-ask:' + key;
|
|
@@ -219,7 +225,7 @@ function chat({ runtimeDir, key, text, model, context, sessions, wsId, iniInfo,
|
|
|
219
225
|
// slice 4 (PRD L2): an ended chat resumes its own Claude Code conversation when the file for it is still there
|
|
220
226
|
const prev = alive ? null : chatRecordOf(runtimeDir, key);
|
|
221
227
|
const resume = !!(prev && prev.claude && typeof sessions.hasConversation === 'function' && sessions.hasConversation(prev.claude));
|
|
222
|
-
const row = alive ? null : rowFor(model, key, context) || (
|
|
228
|
+
const row = alive ? null : rowFor(model, key, context) || (scopedByContext(key, context) ? contextRow(key, context) : null);
|
|
223
229
|
if (!alive && !row && !resume) return fail(404, /^pop:/.test(key) ? 'the popup did not say what it shows' : model ? 'that row is not on the page' : 'the page has not read the repository yet');
|
|
224
230
|
// slice 2 (PRD G2): `/goal <text>` becomes the PMOS grilling prompt, on record before it reaches the session
|
|
225
231
|
let msg = q, goal = null;
|
|
@@ -23,6 +23,18 @@
|
|
|
23
23
|
* onTime, due, open, reversals: [{ id, decided, replacedBy, why }] }
|
|
24
24
|
* checkDate(text, today) → 'YYYY-MM-DD' | null a date, or +N d / w / m from today
|
|
25
25
|
*
|
|
26
|
+
* LOGGED FROM A PRESS (initiative decisions-from-approvals, bet A475). The PM's ✓ on a ✦ proposal, a picked card, a ✕ or a Drop with a
|
|
27
|
+
* reason, the Keep of an agent proposal and a hold with a reason each write one decision line by themselves, with `from` (approval, card,
|
|
28
|
+
* drop, park) and `ref` (the press it came from). Such a line has no check date unless it names an expected outcome, so it never makes a
|
|
29
|
+
* Today card by itself; it folds with state `logged`. The Undo of the press undoes the line; so does `pmos decisions undo <id>`.
|
|
30
|
+
* logFrom(root, { from, decided, ref, initiative?, why?, expected? }, { now, by, via }) → { ok, id, line?, existed? } | { ok: false, error }
|
|
31
|
+
* the same ref (not undone) is written once. Never throws
|
|
32
|
+
* undo(root, { id } | { ref }, { now, by, via }) → { ok, id, line } | { ok: false, error } one `undo` line; the fold leaves it out
|
|
33
|
+
* onLifecycle(root, rec, { now }) → result | null a lifecycle line the PM wrote: on-hold with a reason logs a park; active with reason
|
|
34
|
+
* `undo` (the hold's Undo) undoes the latest park line of that initiative
|
|
35
|
+
* loggedCount(rows, { days, now }) → number lines from presses in the last `days` days, not undone (the health number)
|
|
36
|
+
* CLI: node lib/decision-journal.js logged <root> [--days 7] prints `[decision-log] …` and the count alone on the last line
|
|
37
|
+
*
|
|
26
38
|
* A verdict is the PM's: PMOS never records one from a metric alone, and every verdict carries evidence. Nothing here sends anything.
|
|
27
39
|
*/
|
|
28
40
|
const fs = require('fs');
|
|
@@ -82,11 +94,12 @@ function checkDate(text, today) {
|
|
|
82
94
|
|
|
83
95
|
function fold(rows, { today = todayOf() } = {}) {
|
|
84
96
|
const by = new Map();
|
|
97
|
+
const undone = undoneOf(rows);
|
|
85
98
|
for (const r of rows || []) {
|
|
86
|
-
if (!r || r.type !== 'decision' || typeof r.id !== 'string' || by.has(r.id)) continue;
|
|
99
|
+
if (!r || r.type !== 'decision' || typeof r.id !== 'string' || by.has(r.id) || undone.has(r.id)) continue;
|
|
87
100
|
by.set(r.id, { id: r.id, date: r.date || String(r.at || '').slice(0, 10), decided: r.decided || '', expected: r.expected || '', check: r.check || '',
|
|
88
101
|
why: r.why || '', against: r.against || '', initiative: r.initiative || '', replaces: r.replaces || '', changed_mind: r.changed_mind || '',
|
|
89
|
-
replacedBy: '', replacedWhy: '', replacedAt: '', checks: [], verdict: null, dueAt: '', at: r.at || '', by: r.by || '' });
|
|
102
|
+
replacedBy: '', replacedWhy: '', replacedAt: '', checks: [], verdict: null, dueAt: '', at: r.at || '', by: r.by || '', from: r.from || '', ref: r.ref || '' });
|
|
90
103
|
}
|
|
91
104
|
for (const r of rows || []) {
|
|
92
105
|
if (!r || r.type !== 'check') continue;
|
|
@@ -103,17 +116,17 @@ function fold(rows, { today = todayOf() } = {}) {
|
|
|
103
116
|
}
|
|
104
117
|
const out = [...by.values()];
|
|
105
118
|
for (const e of out) {
|
|
106
|
-
e.state = e.verdict ? 'checked' : e.replacedBy ? 'replaced' : isDate(e.check)
|
|
119
|
+
e.state = e.verdict ? 'checked' : e.replacedBy ? 'replaced' : !isDate(e.check) ? 'logged' : e.check <= today ? 'due' : 'open';
|
|
107
120
|
e.days = isDate(e.check) && isDate(today) ? daysBetween(e.check, today) : 0; // > 0: days past the check date
|
|
108
121
|
}
|
|
109
122
|
return out;
|
|
110
123
|
}
|
|
111
124
|
|
|
112
|
-
const ORDER = { due: 0, open: 1,
|
|
125
|
+
const ORDER = { due: 0, open: 1, logged: 2, checked: 3, replaced: 4 };
|
|
113
126
|
/** Due checks first (oldest first), then open ones by check date, then the closed ones, newest first. */
|
|
114
127
|
function sorted(entries) {
|
|
115
128
|
return entries.slice().sort((a, b) => ORDER[a.state] - ORDER[b.state]
|
|
116
|
-
|| (a.state === 'due' || a.state === 'open' ? a.check.localeCompare(b.check) : String(b.verdict ? b.verdict.date : b.replacedAt).localeCompare(String(a.verdict ? a.verdict.date : a.replacedAt)))
|
|
129
|
+
|| (a.state === 'due' || a.state === 'open' ? a.check.localeCompare(b.check) : a.state === 'logged' ? String(b.at).localeCompare(String(a.at)) : String(b.verdict ? b.verdict.date : b.replacedAt).localeCompare(String(a.verdict ? a.verdict.date : a.replacedAt)))
|
|
117
130
|
|| a.id.localeCompare(b.id));
|
|
118
131
|
}
|
|
119
132
|
|
|
@@ -185,6 +198,83 @@ function check(root, { id, verdict, evidence, again } = {}, { now = Date.now(),
|
|
|
185
198
|
return { ok: true, line, file: rel(root, J.file) };
|
|
186
199
|
}
|
|
187
200
|
|
|
201
|
+
/* ── logged from a press (decisions-from-approvals) ── */
|
|
202
|
+
const FROM = Object.freeze(['approval', 'card', 'drop', 'park']);
|
|
203
|
+
const TAG = '[decision-log]';
|
|
204
|
+
|
|
205
|
+
/** The ids an `undo` line took out. */
|
|
206
|
+
function undoneOf(rows) {
|
|
207
|
+
const out = new Set();
|
|
208
|
+
for (const r of rows || []) if (r && r.type === 'undo' && typeof r.id === 'string') out.add(r.id);
|
|
209
|
+
return out;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function logFrom(root, f = {}, { now = Date.now(), by, via } = {}) {
|
|
213
|
+
try {
|
|
214
|
+
root = path.resolve(root);
|
|
215
|
+
const from = String(f.from || '');
|
|
216
|
+
if (!FROM.includes(from)) return { ok: false, error: `from is one of ${FROM.join(', ')}` };
|
|
217
|
+
const decided = one(f.decided).slice(0, MAX.decided), ref = one(f.ref).slice(0, 160);
|
|
218
|
+
if (decided.length < 3) return { ok: false, error: 'say what was decided' };
|
|
219
|
+
if (!ref) return { ok: false, error: 'ref names the press the decision came from' };
|
|
220
|
+
const initiative = one(f.initiative), why = one(f.why).slice(0, MAX.why), expected = one(f.expected).slice(0, MAX.expected);
|
|
221
|
+
const today = todayOf(now);
|
|
222
|
+
const J = read(root);
|
|
223
|
+
const undone = undoneOf(J.rows);
|
|
224
|
+
const had = J.rows.find((r) => r && r.type === 'decision' && r.ref === ref && !undone.has(r.id));
|
|
225
|
+
if (had) return { ok: true, id: had.id, existed: true };
|
|
226
|
+
const base = today.replace(/-/g, '') + '-' + slugOf(decided);
|
|
227
|
+
const have = new Set(J.rows.filter((r) => r && r.type === 'decision').map((r) => r.id));
|
|
228
|
+
let id = base, n = 2;
|
|
229
|
+
while (have.has(id)) id = base + '-' + n++;
|
|
230
|
+
const line = { type: 'decision', id, date: today, decided, expected, check: expected.length >= 8 ? addDays(today, DEFAULT_DAYS) : '', from, ref,
|
|
231
|
+
...(initiative && ID_RE.test(initiative) ? { initiative } : {}), ...(why ? { why } : {}), at: new Date(now).toISOString(), by: by || 'agent:unknown', via: via || 'ui' };
|
|
232
|
+
append(J.file, line);
|
|
233
|
+
console.log(`${TAG} logged ${id} from=${from} ref=${ref}`);
|
|
234
|
+
return { ok: true, id, line, file: rel(root, J.file) };
|
|
235
|
+
} catch (e) { return { ok: false, error: 'the decision journal could not be written: ' + String((e && e.message) || e).slice(0, 160) }; }
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function undo(root, { id, ref } = {}, { now = Date.now(), by, via } = {}) {
|
|
239
|
+
try {
|
|
240
|
+
root = path.resolve(root);
|
|
241
|
+
const J = read(root);
|
|
242
|
+
const undone = undoneOf(J.rows);
|
|
243
|
+
const all = J.rows.filter((r) => r && r.type === 'decision' && (id ? r.id === id : ref && r.ref === ref));
|
|
244
|
+
if (!all.length) return { ok: false, error: id ? `no decision ${id} in this journal (pmos decisions list shows the ids)` : 'no decision came from that press' };
|
|
245
|
+
const live = all.filter((r) => !undone.has(r.id)).pop();
|
|
246
|
+
if (!live) return { ok: false, error: `${all[all.length - 1].id} was already undone` };
|
|
247
|
+
const line = { type: 'undo', id: live.id, at: new Date(now).toISOString(), by: by || 'agent:unknown', via: via || 'ui' };
|
|
248
|
+
append(J.file, line);
|
|
249
|
+
console.log(`${TAG} undone ${live.id}`);
|
|
250
|
+
return { ok: true, id: live.id, line, file: rel(root, J.file) };
|
|
251
|
+
} catch (e) { return { ok: false, error: 'the decision journal could not be written: ' + String((e && e.message) || e).slice(0, 160) }; }
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** A lifecycle line the PM wrote (server.js /api/lifecycle). Never throws. */
|
|
255
|
+
function onLifecycle(root, rec, { now = Date.now() } = {}) {
|
|
256
|
+
if (!rec || typeof rec.initiative_id !== 'string') return null;
|
|
257
|
+
const who = { now, by: rec.by, via: rec.via };
|
|
258
|
+
const reason = one(rec.reason);
|
|
259
|
+
if (rec.state === 'on-hold' && reason) {
|
|
260
|
+
return logFrom(root, { from: 'park', decided: `Park ${rec.initiative_id}: ${reason}`, ref: `park:${rec.initiative_id}:${rec.at || new Date(now).toISOString()}`,
|
|
261
|
+
initiative: rec.initiative_id, why: reason + (rec.back ? ` (back on ${rec.back})` : '') }, who);
|
|
262
|
+
}
|
|
263
|
+
if (rec.state === 'active' && reason.toLowerCase() === 'undo') {
|
|
264
|
+
let J; try { J = read(root); } catch { return null; }
|
|
265
|
+
const undone = undoneOf(J.rows);
|
|
266
|
+
const last = J.rows.filter((r) => r && r.type === 'decision' && r.from === 'park' && r.initiative === rec.initiative_id && !undone.has(r.id)).pop();
|
|
267
|
+
return last ? undo(root, { id: last.id }, who) : null;
|
|
268
|
+
}
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** Lines written from presses in the last `days` days and not undone. */
|
|
273
|
+
function loggedCount(rows, { days = 7, now = Date.now() } = {}) {
|
|
274
|
+
const undone = undoneOf(rows), since = now - days * DAY;
|
|
275
|
+
return (rows || []).filter((r) => r && r.type === 'decision' && FROM.includes(r.from) && !undone.has(r.id) && Date.parse(r.at) >= since && Date.parse(r.at) <= now).length;
|
|
276
|
+
}
|
|
277
|
+
|
|
188
278
|
const rate = (w, d) => (w + d ? Math.round((100 * w) / (w + d)) : null);
|
|
189
279
|
|
|
190
280
|
/** The track record: how the user's calls turned out, per quarter of the date each check answered. */
|
|
@@ -235,4 +325,15 @@ function stamp(root) {
|
|
|
235
325
|
return out.join('|');
|
|
236
326
|
}
|
|
237
327
|
|
|
238
|
-
module.exports = { FILE, VERDICTS, VERDICT_WORDS, DEFAULT_DAYS, ON_TIME_DAYS, read, fold: foldWithFirst, sorted, add, check, record, entriesOf, checkDate, quarterOf, todayOf, stamp, filesOf
|
|
328
|
+
module.exports = { FILE, VERDICTS, VERDICT_WORDS, DEFAULT_DAYS, ON_TIME_DAYS, FROM, TAG, read, fold: foldWithFirst, sorted, add, check, record, entriesOf, checkDate, quarterOf, todayOf, stamp, filesOf,
|
|
329
|
+
logFrom, undo, onLifecycle, loggedCount };
|
|
330
|
+
|
|
331
|
+
if (require.main === module) {
|
|
332
|
+
const a = process.argv.slice(2);
|
|
333
|
+
if (a[0] !== 'logged') { console.error('usage: node lib/decision-journal.js logged <root> [--days 7]'); process.exit(2); }
|
|
334
|
+
const root = path.resolve(a[1] && !a[1].startsWith('--') ? a[1] : '.');
|
|
335
|
+
const i = a.indexOf('--days'), days = i > 0 ? Math.max(1, +a[i + 1] || 7) : 7;
|
|
336
|
+
const n = loggedCount(read(root).rows, { days });
|
|
337
|
+
console.log(`${TAG} ${n} decision ${n === 1 ? 'line was' : 'lines were'} logged from presses in the last ${days} days and not undone`);
|
|
338
|
+
console.log(String(n));
|
|
339
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>" [--again <date>]
|
|
10
10
|
* the verdict on a decision; cant-tell --again sets a new date to look again
|
|
11
11
|
* pmos decisions record [--json] the track record: per quarter, worked, didn't work, can't tell and the hit rate
|
|
12
|
+
* pmos decisions undo <id> [--json] takes a decision out of the journal (one `undo` line), e.g. one logged from a press
|
|
12
13
|
* every command: [--root <dir>] (default: this repository)
|
|
13
14
|
*
|
|
14
15
|
* The agent runs add and check only after the PM said yes in the chat; the line names who wrote it (lib/actor.js). A verdict is the PM's:
|
|
@@ -18,7 +19,7 @@ const path = require('path');
|
|
|
18
19
|
const { execFileSync } = require('child_process');
|
|
19
20
|
const J = require('./decision-journal.js');
|
|
20
21
|
|
|
21
|
-
const COMMANDS = { decisions: ['add', 'list', 'show', 'check', 'record'] };
|
|
22
|
+
const COMMANDS = { decisions: ['add', 'list', 'show', 'check', 'record', 'undo'] };
|
|
22
23
|
const USAGE = [
|
|
23
24
|
'usage: pmos decisions add|list|show|check|record — a decision journal: each decision has an expected outcome and a date to check it',
|
|
24
25
|
' pmos decisions add "<what was decided>" --expect "<what should happen>" [--check <YYYY-MM-DD|+30d>] [--why "<text>"] [--against "<who disagreed, and why>"] [--initiative <id>]',
|
|
@@ -27,10 +28,11 @@ const USAGE = [
|
|
|
27
28
|
' pmos decisions show <id> [--json] one decision and its checks',
|
|
28
29
|
' pmos decisions check <id> <worked|didnt-work|cant-tell> --evidence "<text>" [--again <date>] your verdict on a decision',
|
|
29
30
|
' pmos decisions record [--json] how your decisions turned out, per quarter',
|
|
31
|
+
' pmos decisions undo <id> [--json] take a decision out of the journal, for example one logged from a press',
|
|
30
32
|
'Run it in the product\'s repository, or pass --root <dir>. The check date is 30 days after the decision unless --check says otherwise.',
|
|
31
33
|
];
|
|
32
34
|
const VERDICT = { worked: 'worked', validated: 'worked', 'didnt-work': 'didnt-work', "didn't-work": 'didnt-work', refuted: 'didnt-work', 'cant-tell': 'cant-tell', "can't-tell": 'cant-tell', inconclusive: 'cant-tell' };
|
|
33
|
-
const ALLOWED = { add: ['json', 'root', 'expect', 'check', 'why', 'against', 'initiative', 'replaces', 'changed-mind'], list: ['json', 'root', 'all'], show: ['json', 'root'], check: ['json', 'root', 'evidence', 'again'], record: ['json', 'root'] };
|
|
35
|
+
const ALLOWED = { add: ['json', 'root', 'expect', 'check', 'why', 'against', 'initiative', 'replaces', 'changed-mind'], list: ['json', 'root', 'all'], show: ['json', 'root'], check: ['json', 'root', 'evidence', 'again'], record: ['json', 'root'], undo: ['json', 'root'] };
|
|
34
36
|
const BOOL = new Set(['json', 'all']);
|
|
35
37
|
|
|
36
38
|
function parse(args) {
|
|
@@ -56,10 +58,12 @@ function line(e) {
|
|
|
56
58
|
const when = e.state === 'due' ? `check due ${e.days > 0 ? 'since ' + short(e.check) : 'today'}`
|
|
57
59
|
: e.state === 'open' ? `check on ${short(e.check)}`
|
|
58
60
|
: e.state === 'checked' ? `${J.VERDICT_WORDS[e.verdict.verdict]} (${short(e.verdict.date)})`
|
|
61
|
+
: e.state === 'logged' ? `${FROM_WORDS[e.from] || 'logged'} on ${short(e.date)}`
|
|
59
62
|
: `reversed by ${e.replacedBy}`;
|
|
60
|
-
return ` ${e.id} — ${e.decided}\n expected:
|
|
63
|
+
return ` ${e.id} — ${e.decided}\n ${e.expected ? 'expected: ' + e.expected + ' · ' : ''}${when}`;
|
|
61
64
|
}
|
|
62
|
-
const
|
|
65
|
+
const FROM_WORDS = { approval: 'approved', card: 'picked on a card', drop: 'dropped with a reason', park: 'parked with a reason' };
|
|
66
|
+
const pub = (e) => ({ id: e.id, state: e.state, from: e.from || null, ref: e.ref || null, date: e.date, decided: e.decided, expected: e.expected, check: e.check, why: e.why || null, against: e.against || null,
|
|
63
67
|
initiative: e.initiative || null, replaces: e.replaces || null, changed_mind: e.changed_mind || null, replaced_by: e.replacedBy || null, replaced_why: e.replacedWhy || null,
|
|
64
68
|
verdict: e.verdict ? { verdict: e.verdict.verdict, evidence: e.verdict.evidence, date: e.verdict.date } : null,
|
|
65
69
|
checks: e.checks.map((c) => ({ verdict: c.verdict, evidence: c.evidence, date: c.date, ...(c.again ? { again: c.again } : {}) })), days_past: e.state === 'due' ? e.days : 0 });
|
|
@@ -88,17 +92,29 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
|
|
|
88
92
|
return 0;
|
|
89
93
|
}
|
|
90
94
|
|
|
95
|
+
if (sub === 'undo') {
|
|
96
|
+
if (pos.length !== 1) return fail('usage: pmos decisions undo <id>', 2);
|
|
97
|
+
const a = actor();
|
|
98
|
+
const r = J.undo(root, { id: pos[0] }, { now, by: a.by, via: a.via });
|
|
99
|
+
if (!r.ok) return fail(r.error);
|
|
100
|
+
if (flags.json) { say(JSON.stringify({ ok: true, id: r.id, file: r.file })); return 0; }
|
|
101
|
+
say(`✓ ${r.id} is out of the journal (${r.file}). Commit it to keep it.`);
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
91
105
|
const { entries, file } = J.entriesOf(root, { today });
|
|
92
106
|
|
|
93
107
|
if (sub === 'list') {
|
|
94
108
|
if (pos.length) return fail('pmos decisions list takes no argument', 2);
|
|
95
|
-
const shown = flags.all ? entries : entries.filter((e) => e.state === 'due' || e.state === 'open');
|
|
109
|
+
const shown = flags.all ? entries : entries.filter((e) => e.state === 'due' || e.state === 'open' || e.state === 'logged');
|
|
96
110
|
if (flags.json) { say(JSON.stringify({ ok: true, file, total: entries.length, decisions: shown.map(pub) })); return 0; }
|
|
97
111
|
if (!entries.length) { say('No decisions in this journal yet. Add one: pmos decisions add "<what was decided>" --expect "<what should happen>"'); return 0; }
|
|
98
|
-
const due = shown.filter((e) => e.state === 'due'), open = shown.filter((e) => e.state === 'open'), rest = shown.filter((e) => e.state === 'checked' || e.state === 'replaced');
|
|
99
|
-
|
|
112
|
+
const due = shown.filter((e) => e.state === 'due'), open = shown.filter((e) => e.state === 'open'), logged = shown.filter((e) => e.state === 'logged'), rest = shown.filter((e) => e.state === 'checked' || e.state === 'replaced');
|
|
113
|
+
const nLogged = entries.filter((e) => e.state === 'logged').length;
|
|
114
|
+
say(`${plural(entries.length, 'decision', 'decisions')} · ${due.length} due · ${open.length} open${nLogged ? ` · ${nLogged} logged` : ''} · ${entries.length - due.length - open.length - nLogged} closed`);
|
|
100
115
|
if (due.length) say(`\n${plural(due.length, 'check', 'checks')} due:\n` + due.map(line).join('\n'));
|
|
101
116
|
if (open.length) say('\nOpen:\n' + open.map(line).join('\n'));
|
|
117
|
+
if (logged.length) say('\nLogged from your presses:\n' + logged.map(line).join('\n') + '\n Undo one: pmos decisions undo <id>');
|
|
102
118
|
if (rest.length) say('\nClosed:\n' + rest.map(line).join('\n'));
|
|
103
119
|
if (due.length) say('\nRecord a verdict: pmos decisions check <id> worked|didnt-work|cant-tell --evidence "<what shows it>"');
|
|
104
120
|
return 0;
|
|
@@ -109,7 +125,7 @@ async function run(argv, { say = (s) => console.log(s), env = process.env, cwd =
|
|
|
109
125
|
const e = entries.find((x) => x.id === pos[0]);
|
|
110
126
|
if (!e) return fail(`no decision ${pos[0]} in this journal (pmos decisions list shows the ids)`);
|
|
111
127
|
if (flags.json) { say(JSON.stringify({ ok: true, decision: pub(e) })); return 0; }
|
|
112
|
-
say(`${e.id} (${short(e.date)})\n decided: ${e.decided}
|
|
128
|
+
say(`${e.id} (${short(e.date)})\n decided: ${e.decided}` + (e.expected ? `\n expected: ${e.expected}` : '') + (e.check ? `\n check: ${short(e.check)} · ${e.state}` : `\n ${FROM_WORDS[e.from] || e.state}`));
|
|
113
129
|
if (e.why) say(' why: ' + e.why);
|
|
114
130
|
if (e.against) say(' disagreed: ' + e.against);
|
|
115
131
|
if (e.initiative) say(' initiative: ' + e.initiative);
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
* Every other kind (evidence, sizing, assumption, stakeholders, follow-up, note) is kept as a decision only: the PM's choice to
|
|
26
26
|
* rely on it. A follow-up is never sent: the PM sends it from their own session. The driver never moves a stage by itself (D3).
|
|
27
27
|
* RETURN needs a note and DROP may carry one; each logs one correction (the north star counts it) and a return wakes a run.
|
|
28
|
+
* THE DECISION JOURNAL (decisions-from-approvals): the PM's Keep, and a Drop with a note, also write one line to the product's decision journal
|
|
29
|
+
* (lib/decision-journal.js logFrom, ref `driver:<proposal>`) when ctx.root names the product; Undo takes the line out.
|
|
28
30
|
*/
|
|
29
31
|
const fs = require('fs');
|
|
30
32
|
const path = require('path');
|
|
@@ -127,7 +129,21 @@ async function decide(verb, { file, proposal, note, actor, ctx = {}, now, auto =
|
|
|
127
129
|
} catch { /* the driver ledger already holds the correction */ }
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
|
-
|
|
132
|
+
const decision = journalOf(verb, p, text, actor, ctx, t, auto);
|
|
133
|
+
return { ok: true, proposal: D.fold(D.readLines(file)).proposals.get(p.id), wrote, warnings, ...(decision ? { decision } : {}) };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* decisions-from-approvals (bet A475): the PM's Keep, and a Drop with a note, write one line to the product's decision journal
|
|
137
|
+
* (lib/decision-journal.js logFrom). An automatic keep and a Return write none. Never fails the decision. → the journal id or null */
|
|
138
|
+
function journalOf(verb, p, note, actor, ctx, now, auto) {
|
|
139
|
+
if (auto || !ctx.root || !actorLib.isPm(actor) || !(verb === 'keep' || (verb === 'drop' && note))) return null;
|
|
140
|
+
const DJ = require('./decision-journal.js');
|
|
141
|
+
const what = String(p.what || 'proposal').replace(/-/g, ' '), why = String(p.why || '').trim();
|
|
142
|
+
const ini = p.target && p.target.kind === 'initiative' ? p.target.id : '';
|
|
143
|
+
const r = DJ.logFrom(ctx.root, verb === 'keep'
|
|
144
|
+
? { from: 'approval', decided: `Kept the ${what} proposal${ini ? ' on ' + ini : ''}${why ? ': ' + why : ''}`, ref: `driver:${p.id}`, initiative: ini, why }
|
|
145
|
+
: { from: 'drop', decided: `Dropped the ${what} proposal${ini ? ' on ' + ini : ''}`, ref: `driver:${p.id}`, initiative: ini, why: note }, { now, by: actor.by, via: actor.via });
|
|
146
|
+
return r.ok ? r.id : null;
|
|
131
147
|
}
|
|
132
148
|
|
|
133
149
|
const jobOf = (p) => `driver:${p.what}`;
|
|
@@ -202,6 +218,7 @@ async function undo({ file, proposal, actor, ctx = {}, now, stateDir, product =
|
|
|
202
218
|
record: { kind: 'correction', run: p.run, reason: 'driver:undo', by: actorLib.isPm(actor) ? 'pm' : actor.by } }) + '\n');
|
|
203
219
|
} catch { /* the driver ledger already holds the correction */ }
|
|
204
220
|
}
|
|
221
|
+
if (ctx.root) require('./decision-journal.js').undo(ctx.root, { ref: `driver:${p.id}` }, { now: t, by: actor.by, via: actor.via }); // its journal line goes too (none for an automatic keep)
|
|
205
222
|
const s = p.auto && stateDir ? require('./autonomy.js').recordSetback(stateDir, { job: jobOf(p), product, ref: p.id, kind: 'undo' }, { now: t }) : { demoted: null };
|
|
206
223
|
return { ok: true, back, demoted: s.demoted || null };
|
|
207
224
|
}
|
|
@@ -170,8 +170,11 @@ function hold(root, { id, why, back, after } = {}, { now = Date.now(), by, via }
|
|
|
170
170
|
if (after === id) return { ok: false, error: 'an initiative cannot wait on itself' };
|
|
171
171
|
if (!ids.has(after)) return { ok: false, error: `no initiative ${after} here to wait on` };
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
const r = append(root, L, { initiative_id: id, state: 'on-hold', reason, ...(back ? { back: String(back) } : {}), ...(after ? { after } : {}),
|
|
174
174
|
pm: pmSlug(), by: by || 'agent:unknown', via: via || 'cli', at: new Date(now).toISOString() });
|
|
175
|
+
// decisions-from-approvals: a hold with a reason is one line in the decision journal (lib/decision-journal.js onLifecycle)
|
|
176
|
+
if (r && r.ok && r.line) { try { const d = require('./decision-journal.js').onLifecycle(root, r.line, { now }); if (d && d.ok) r.decision = d.id; } catch { /* the hold stands */ } }
|
|
177
|
+
return r;
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
/** Bring a parked initiative back. One `active` line marked as brought back through its way back. */
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* GET /api/proposals?ws&board&initiative[&grill=all] → { ok, props, found } props: lib/proposals.js viewOf (null: nothing to show); grill=all unfolds every grill finding
|
|
8
8
|
* POST /api/proposals/keep { ws, board, initiative, ids?: [id] | all: true, choices?: { <from>><to>: 'keep' | 'ignore' } }
|
|
9
9
|
* → { ok, batch, said, counts, props } ✓ one proposal, or ✓ in the header (all: every one Claude is sure of;
|
|
10
|
-
* Check these and a Jira ticket's comment never ride on it). One batch, one toast, one Undo.
|
|
10
|
+
* Check these and a Jira ticket's comment never ride on it). One batch, one toast, one Undo. The PM's ✓ also
|
|
11
|
+
* writes one line to the product's decision journal (`decision`: its id; `card` when choices were picked); Undo takes it out
|
|
11
12
|
* POST /api/proposals/drop { ws, board, initiative, sig, why? } → { ok } why: the PM's reason (the idle lab asks for one); ✕ on a proposal or on one item of it, for good (rule 7); the line
|
|
12
13
|
* also keeps its facts (PR.factsOf), so a re-sectioned task or a new day does not bring it back
|
|
13
14
|
* POST /api/proposals/undo { ws, board, batch } → { ok, back, kept } the whole batch; a task changed since keeps its change
|
|
@@ -27,6 +28,16 @@ const PR = require('./proposals.js');
|
|
|
27
28
|
const TL = require('./task-links.js');
|
|
28
29
|
const RB = require('./routes-boards.js');
|
|
29
30
|
const TLR = require('./routes-task-links.js');
|
|
31
|
+
const DJ = require('./decision-journal.js');
|
|
32
|
+
|
|
33
|
+
/** decisions-from-approvals (bet A475): what the PM's ✓ decided, in one line for the decision journal. PURE.
|
|
34
|
+
* want: the kept proposals; picked: the PM chose among a card's answers (body.choices). → { from, decided, why } */
|
|
35
|
+
function keepText(want, ini, picked) {
|
|
36
|
+
const names = (want || []).map((x) => String((x && (x.title || x.why || x.type || x.group)) || '').replace(/\s+/g, ' ').trim()).filter(Boolean);
|
|
37
|
+
const head = names.slice(0, 3).join('; ') + (names.length > 3 ? ` and ${names.length - 3} more` : '');
|
|
38
|
+
const why = (want || []).map((x) => String((x && x.why) || '').trim()).filter(Boolean)[0] || '';
|
|
39
|
+
return { from: picked ? 'card' : 'approval', decided: `${picked ? 'Picked' : 'Approved'} on ${ini}: ${head || plural((want || []).length, 'proposal', 'proposals')}`, why: why.slice(0, 300) };
|
|
40
|
+
}
|
|
30
41
|
|
|
31
42
|
const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
32
43
|
const fail = (ctx, res, status, error, extra = {}) => { ctx.json(res, { ok: false, error, ...extra }, status); return true; };
|
|
@@ -138,6 +149,7 @@ function undoCore(ctx, p, g, id) {
|
|
|
138
149
|
if (r && r.body && r.body.ok) back++; else kept++;
|
|
139
150
|
}
|
|
140
151
|
PR.append(dir, g.actor, { kind: 'undo', batch: id });
|
|
152
|
+
try { DJ.undo(p.w.root, { ref: 'proposals:' + id }, { by: g.actor && g.actor.by, via: g.actor && g.actor.via }); } catch { /* a batch PMOS kept by itself has no journal line */ }
|
|
141
153
|
// D106: the Undo of a change an agent applied by itself is a setback of its job (lib/autonomy.js), which may demote the job
|
|
142
154
|
const line = PR.readLines(PR.ledgerFile(dir)).find((l) => l.kind === 'keep' && l.batch === id);
|
|
143
155
|
let demoted = null;
|
|
@@ -528,9 +540,13 @@ const WRITES = {
|
|
|
528
540
|
const { batch, wrote, plans, failed } = keepCore(ctx, p, g, f, ini, want, isObj(body.choices) ? body.choices : {});
|
|
529
541
|
// a draft pull request that could not open (W7): nothing was written, the proposal stays open, and the page says why
|
|
530
542
|
if (failed.length && !wrote.length) return fail(ctx, res, 409, failed[0].why);
|
|
543
|
+
// the PM's ✓ is a decision: one line in the product's decision journal, undone with this batch (decisions-from-approvals)
|
|
544
|
+
const picked = isObj(body.choices) && Object.keys(body.choices).length > 0;
|
|
545
|
+
const kt = keepText(want, ini, picked);
|
|
546
|
+
const dj = DJ.logFrom(p.w.root, { ...kt, ref: 'proposals:' + batch, initiative: ini }, { by: g.actor && g.actor.by, via: g.actor && g.actor.via });
|
|
531
547
|
const v2 = view(ctx, p, ini);
|
|
532
548
|
const left = v2 ? v2.groups.flatMap((x) => x.props).filter((x) => x.section === 'check').length : 0;
|
|
533
|
-
ctx.json(res, { ok: true, batch, said: saidOf(wrote, plans, body.all === true ? left : 0), counts: { wrote: wrote.length }, props: v2, found: PR.foundOf(PR.read(dir), ini) });
|
|
549
|
+
ctx.json(res, { ok: true, batch, ...(dj.ok ? { decision: dj.id } : {}), said: saidOf(wrote, plans, body.all === true ? left : 0), counts: { wrote: wrote.length }, props: v2, found: PR.foundOf(PR.read(dir), ini) });
|
|
534
550
|
},
|
|
535
551
|
'/api/proposals/drop': (ctx, res, body, g, p) => {
|
|
536
552
|
const sig = String(body.sig || ''), ini = String(body.initiative || '');
|
|
@@ -557,8 +573,11 @@ const WRITES = {
|
|
|
557
573
|
try { const AF = require('./artefacts.js'); AF.set(AF.file(dirOf(ctx, p.w)), { scope: 'experiment:' + ini, artefact: 'lessons', field: 'line', text: `✕ dropped "${String(of.title || '').slice(0, 140)}"${why ? ': ' + why : ''}`, sources: [{ label: 'live round' }] }, { by: g.actor && /^(pm|agent):/.test(String(g.actor.by)) ? g.actor.by : 'agent:live-round' }); } catch { /* the drop line holds it */ }
|
|
558
574
|
}
|
|
559
575
|
// the reason becomes curated memory by itself, so every later run knows it (lib/corrections-memory.js)
|
|
576
|
+
// a ✕ with a reason is a decision too (decisions-from-approvals): one line in the product's decision journal
|
|
577
|
+
let decision = null;
|
|
578
|
+
if (why) { const r = DJ.logFrom(p.w.root, { from: 'drop', decided: `Dropped on ${ini}: ${String((of && (of.title || of.why)) || 'a proposal').slice(0, 200)}`, ref: `proposals-drop:${ini}:${sig}`, initiative: ini, why }, { by: g.actor && g.actor.by, via: g.actor && g.actor.via }); if (r.ok) decision = r.id; }
|
|
560
579
|
if (why) require('./corrections-memory.js').remember(p.w.root, { what: `a ${(of && (of.group || of.type)) || ''} proposal on ${ini}`.replace(/ +/g, ' '), why, source: 'proposal:' + (which.id || sig), ini });
|
|
561
|
-
ctx.json(res, { ok: true });
|
|
580
|
+
ctx.json(res, { ok: true, ...(decision ? { decision } : {}) });
|
|
562
581
|
},
|
|
563
582
|
'/api/proposals/undo': (ctx, res, body, g, p) => {
|
|
564
583
|
const r = undoCore(ctx, p, g, String(body.batch || ''));
|
|
@@ -586,7 +605,7 @@ const WRITES = {
|
|
|
586
605
|
|
|
587
606
|
module.exports = {
|
|
588
607
|
prefixes: ['/api/proposals'],
|
|
589
|
-
viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf, keepDefault,
|
|
608
|
+
viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf, keepDefault, keepText,
|
|
590
609
|
handle: async (req, res, url, ctx) => {
|
|
591
610
|
const p0 = url.pathname;
|
|
592
611
|
if (req.method === 'GET') {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.744.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.744.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -1615,3 +1615,5 @@ html.ro body.wk-on .bd-hd { display: none; } /* find and tune moved to the top
|
|
|
1615
1615
|
.bd-sigs li { padding: 6px 0; border-top: 1px solid var(--cz-hair); font-size: var(--fs-label); line-height: var(--lh-label); }
|
|
1616
1616
|
.bd-sigs li:first-child { border-top: 0; }
|
|
1617
1617
|
.bd-sigs .bd-sign { display: block; color: var(--cz-ink2); }
|
|
1618
|
+
/* Work's Ask PMOS icon (bug 2026-11-23, initiative work-ask-chat) is a computer's: a phone's top bar is one row, and its Ask PMOS is in the menu */
|
|
1619
|
+
@media (max-width: 760px) { .bd-hd .bd-ask { display: none; } }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* pm/library-keys.js — what a key and a press do on the Library page (initiative library-place, D1 and D6; A437).
|
|
2
|
+
* The page (premium-library.js) binds these to the real window and list; library-place.test.js presses the same keys on a stand-in
|
|
3
|
+
* EventTarget in node, so the tests run the handlers themselves and not a search over the source.
|
|
4
|
+
*
|
|
5
|
+
* bindSlash(target, { focus, popupOpen }) "/" anywhere but a text field, with no modifier and no popup open, puts the cursor in the search (D1)
|
|
6
|
+
* pressStep(x, { wide, pick }) a press on a row: on a desk (≥ 1200 px) the first press shows its Detail block → 'show',
|
|
7
|
+
* the second press opens it as the full popup → 'open'; a link, or a narrow screen, opens at once (D6)
|
|
8
|
+
* bindEnterOpen(target, { open }) Enter on a row's name opens the item, on any screen (D6)
|
|
9
|
+
*/
|
|
10
|
+
const TEXT = /^(INPUT|TEXTAREA|SELECT)$/;
|
|
11
|
+
|
|
12
|
+
export function slashFocuses(e, { popupOpen = false } = {}) {
|
|
13
|
+
if (!e || e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey) return false;
|
|
14
|
+
const t = e.target;
|
|
15
|
+
if (t && (t.isContentEditable || TEXT.test(t.tagName || ''))) return false;
|
|
16
|
+
return !popupOpen;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function bindSlash(target, { focus, popupOpen = () => false }) {
|
|
20
|
+
const on = (e) => { if (!slashFocuses(e, { popupOpen: popupOpen() })) return; e.preventDefault(); focus(); };
|
|
21
|
+
target.addEventListener('keydown', on);
|
|
22
|
+
return on;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function pressStep(x, { wide = false, pick = null } = {}) {
|
|
26
|
+
if (!x) return null;
|
|
27
|
+
return wide && pick !== x.id && !(x.open && x.open.url) ? 'show' : 'open';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// the row element of an event target that is a row's name (data-lb-open), or null
|
|
31
|
+
export function nameRow(e) {
|
|
32
|
+
const t = e && e.target;
|
|
33
|
+
if (!e || e.key !== 'Enter' || !t || typeof t.matches !== 'function' || !t.matches('[data-lb-open]')) return null;
|
|
34
|
+
return (typeof t.closest === 'function' && t.closest('[data-lb-i]')) || null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function bindEnterOpen(target, { open }) {
|
|
38
|
+
const on = (e) => { const row = nameRow(e); if (!row) return false; e.preventDefault(); open(row); return true; };
|
|
39
|
+
target.addEventListener('keydown', on);
|
|
40
|
+
return on;
|
|
41
|
+
}
|
|
@@ -43,9 +43,29 @@ export function keyOf(it) {
|
|
|
43
43
|
/** The chat's target (home-chat.js mountChat open): the item's name is its scope; Claude answers. */
|
|
44
44
|
export function targetOf(it, ws) {
|
|
45
45
|
const title = String((it && it.title) || 'this').slice(0, 80);
|
|
46
|
-
return { key: keyOf(it), ws: ws || undefined, title, about: title, scope: { text: title, icon: FLAG }, role: CLAUDE, rich: false,
|
|
46
|
+
return { key: keyOf(it), ws: ws || undefined, title, about: title, scope: { text: title, icon: FLAG }, role: CLAUDE, rich: false, context: contextOf(it, ws),
|
|
47
47
|
placeholder: 'Message PMOS about ' + title, empty: 'Ask about ' + title + '. PMOS reads its records and works on it in a real session.' };
|
|
48
48
|
}
|
|
49
|
+
/** What the chat is about, in the page's words, for a chat whose key the server's model has no row for (a program, a whole product):
|
|
50
|
+
* lib/briefing-premium-agent.js starts it from these words (bug 2026-11-23). An initiative's chat reads its own record and needs none. */
|
|
51
|
+
export function contextOf(it, ws) {
|
|
52
|
+
const kind = String((it && (it.scopeKind || it.kind)) || '').toLowerCase(), title = String((it && it.title) || '').replace(/\s+/g, ' ').trim().slice(0, 80);
|
|
53
|
+
if (!title || !/^(program|product)$/.test(kind)) return undefined;
|
|
54
|
+
const where = ws ? ' (workspace ' + String(ws).slice(0, 60) + ')' : '';
|
|
55
|
+
return kind === 'product'
|
|
56
|
+
? 'The product ' + title + where + ': its programs and initiatives on the Work page. Read them with pmos before you answer.'
|
|
57
|
+
: 'The program ' + title + where + ': its initiatives and milestones. Read it with pmos before you answer.';
|
|
58
|
+
}
|
|
59
|
+
/** The chat about one whole product (Work's Ask PMOS icon, bug 2026-11-23): its own conversation (board:product-<ws>), "In: <name>". */
|
|
60
|
+
export function productTarget(ws, name) {
|
|
61
|
+
return popTarget({ id: 'product-' + String(ws || ''), kind: 'board', scopeKind: 'product', title: name || ws }, ws);
|
|
62
|
+
}
|
|
63
|
+
/** Open a chat target as the page's chat: the one popup on a desk (its chat changes when it shows already), the sheet on a phone. */
|
|
64
|
+
export async function openAbout(t) {
|
|
65
|
+
if (!t) return false;
|
|
66
|
+
if (!isPhone()) { const P = await import('./cozy-popup.js'); return P.openCos(t); }
|
|
67
|
+
return openTarget(t, { title: t.title });
|
|
68
|
+
}
|
|
49
69
|
/** Home's own address for the same conversation (⋯ › Open in a new tab). */
|
|
50
70
|
const homeHref = (it, key) => '/premium.html?' + new URLSearchParams({ about: key, label: String(it.title || '').slice(0, 80) }).toString();
|
|
51
71
|
|
|
@@ -319,6 +319,27 @@ function pinSettled() {
|
|
|
319
319
|
}
|
|
320
320
|
$('#ibBody').addEventListener('click', (e) => { if (e.target.closest('[data-pvwpin],[data-pvwsug]')) pinPress(e); }, true);
|
|
321
321
|
|
|
322
|
+
/* ── Ask PMOS about the product shown (bug 2026-11-23): a product, or the products picked, get their own chat in the one popup. Not on a
|
|
323
|
+
* published read-only copy, which has no chat. ── */
|
|
324
|
+
function askAbout() {
|
|
325
|
+
if (!M || !M.board) return null;
|
|
326
|
+
if (ALL) {
|
|
327
|
+
const names = (M.board.products || []).map((p) => productName(p.ws, p.name)).filter(Boolean), some = PICK.length > 1 && names.length;
|
|
328
|
+
const here = some ? names.join(', ') : 'all products';
|
|
329
|
+
return { label: 'Ask PMOS about ' + here, open: (C) => C.openCos({ here: 'Work · ' + here }) };
|
|
330
|
+
}
|
|
331
|
+
const name = productName(M.board.ws, M.board.product || M.board.name || M.board.ws || '');
|
|
332
|
+
if (!M.board.ws || !name) return null;
|
|
333
|
+
return { label: 'Ask PMOS about ' + name, open: (C) => C.openAbout(C.productTarget(M.board.ws, name)) };
|
|
334
|
+
}
|
|
335
|
+
function drawAsk() {
|
|
336
|
+
const b = $('#bdAsk'); if (!b) return;
|
|
337
|
+
const a = window.PMOS_READONLY ? null : askAbout();
|
|
338
|
+
b.hidden = !a;
|
|
339
|
+
if (a) { b.setAttribute('aria-label', a.label); b.title = a.label; }
|
|
340
|
+
}
|
|
341
|
+
{ const b = $('#bdAsk'); if (b) b.addEventListener('click', () => { const a = askAbout(); if (a) import('./page-chat.js').then((C) => a.open(C)); }); }
|
|
342
|
+
|
|
322
343
|
/* ── the toolbar: picker, chips ───────────────────────────────────────────────────────────────────────────────────── */
|
|
323
344
|
let crumbed = false;
|
|
324
345
|
function drawHead() {
|
|
@@ -326,10 +347,11 @@ function drawHead() {
|
|
|
326
347
|
crumbed = true;
|
|
327
348
|
drawPick();
|
|
328
349
|
// the display names come in once (GET /api/workspaces): then the chip and Work's Product cells draw again with them
|
|
329
|
-
whenNames().then(() => { if (!M) return; drawPick(); if (workOn()) drawInit(); });
|
|
350
|
+
whenNames().then(() => { if (!M) return; drawPick(); drawAsk(); if (workOn()) drawInit(); });
|
|
330
351
|
const names = (M.board.products || []).map((p) => p.name), some = ALL && PICK.length > 1;
|
|
331
352
|
chatAbout('board:this-board', some ? 'the ' + names.join(', ') + ' boards' : ALL ? 'all products' : M.board.name ? 'the ' + M.board.name + ' board' : 'this board');
|
|
332
353
|
}
|
|
354
|
+
drawAsk();
|
|
333
355
|
$('#snap').textContent = M.header.text;
|
|
334
356
|
// PMOS-self: new work starts at the pmos-router skill. All products: New asks which product the initiative is for
|
|
335
357
|
$('#newIni').hidden = ALL ? (M.board.products || []).every((p) => p.self) : !!M.board.self;
|
|
@@ -27,6 +27,7 @@ import * as SC from './scope-chip.js';
|
|
|
27
27
|
const { scopeChipHtml, openScope, matches: scopeMatches, narrowed, scopeWords, whenNames } = SC;
|
|
28
28
|
import { FAMILIES, GROUPS, STATES, view, counts, passes, matches, aboutText, stateText, dayText, when, noteOf, hiddenText } from './library-model.js';
|
|
29
29
|
import { openItem } from './library-open.js';
|
|
30
|
+
import { bindSlash, bindEnterOpen, pressStep } from './library-keys.js'; // D1 and D6: the keys and presses, tested by pressing them (A437)
|
|
30
31
|
import { STEP, nextShown, moreHtml, totalOf, logMore } from './list-cap.js'; // lists stay short (A455): one step for every long list
|
|
31
32
|
|
|
32
33
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -405,7 +406,7 @@ $('lbMore').onclick = () => openMenu('lbMore', moreMenu, morePress, 'pm-menu lb-
|
|
|
405
406
|
addEventListener('pp:changed', (e) => { if (e.detail && e.detail.products) { S.P = e.detail; draw(); } });
|
|
406
407
|
function press(x) {
|
|
407
408
|
if (!x) return;
|
|
408
|
-
if (wide()
|
|
409
|
+
if (pressStep(x, { wide: wide(), pick: S.pick }) === 'show') { S.pick = x.id; draw(); return; }
|
|
409
410
|
openItem(x, { from: 'Library' });
|
|
410
411
|
}
|
|
411
412
|
async function saveName(id, name) {
|
|
@@ -448,12 +449,9 @@ body.onkeydown = (e) => {
|
|
|
448
449
|
if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); S.naming = null; draw(); }
|
|
449
450
|
return;
|
|
450
451
|
}
|
|
451
|
-
// Enter on a name opens the item, on any screen
|
|
452
|
-
if (e.key === 'Enter' && e.target.matches('[data-lb-open]')) {
|
|
453
|
-
e.preventDefault();
|
|
454
|
-
const row = e.target.closest('[data-lb-i]'); const x = row && S.shown[Number(row.dataset.lbI)]; if (x) openItem(x, { from: 'Library' });
|
|
455
|
-
}
|
|
456
452
|
};
|
|
453
|
+
// Enter on a name opens the item, on any screen
|
|
454
|
+
bindEnterOpen(body, { open: (row) => { const x = S.shown[Number(row.dataset.lbI)]; if (x) openItem(x, { from: 'Library' }); } });
|
|
457
455
|
pv.onclick = (e) => {
|
|
458
456
|
const x = S.pick && (S.items || []).find((i) => i.id === S.pick);
|
|
459
457
|
let b;
|
|
@@ -463,12 +461,7 @@ pv.onclick = (e) => {
|
|
|
463
461
|
};
|
|
464
462
|
qBox.addEventListener('input', () => { S.q = qBox.value.trim(); draw(); findByMeaning(); });
|
|
465
463
|
qBox.addEventListener('keydown', (e) => { if (e.key === 'Escape' && qBox.value) { e.stopPropagation(); qBox.value = ''; S.q = ''; S.meaning = null; draw(); } });
|
|
466
|
-
|
|
467
|
-
if (e.key !== '/' || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
468
|
-
const t = e.target; if (t && (t.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))) return;
|
|
469
|
-
if (document.body.classList.contains('cz-pop-on')) return;
|
|
470
|
-
e.preventDefault(); qBox.focus();
|
|
471
|
-
});
|
|
464
|
+
bindSlash(window, { focus: () => qBox.focus(), popupOpen: () => document.body.classList.contains('cz-pop-on') });
|
|
472
465
|
addEventListener('resize', () => { if (S.pick) drawPreview(); });
|
|
473
466
|
// the +: Ask PMOS, with the words ready to finish; PMOS adds the file, the link or the new document, fills its record and shows it to confirm
|
|
474
467
|
$('lbAdd').onclick = async () => {
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
<!-- what needs a look: one pill of dots and numbers, and its (i): the timeline's legend, the sprints and releases, the Jira read -->
|
|
51
51
|
<div class="bd-chipset" id="bdChipset"></div>
|
|
52
52
|
<div class="bd-tools">
|
|
53
|
+
<!-- Ask PMOS about the product shown (bug 2026-11-23): its own chat, in the one popup; pm/premium-board.js names it -->
|
|
54
|
+
<button type="button" class="bd-ib pm-btn bd-ask" id="bdAsk" aria-label="Ask PMOS about this product" title="Ask PMOS about this product" aria-haspopup="dialog" hidden><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z"/></svg></button>
|
|
53
55
|
<button type="button" class="bd-ib pm-btn" id="bdFind" aria-label="Find an initiative or work-item" title="Find an initiative or work-item" aria-haspopup="dialog"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M11 4a7 7 0 1 0 0 14a7 7 0 1 0 0-14M20 20l-4-4"/></svg></button>
|
|
54
56
|
<!-- the tune button: Group, Sort and the filters (owner, category, sprint), with a dot while one is on -->
|
|
55
57
|
<button type="button" class="bd-ib pm-btn" id="bdFilter" aria-label="Group, sort and filter" title="Group, sort and filter" aria-haspopup="dialog"><svg class="bd-icf" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16l-6 8v6l-4-2v-4z"/></svg><svg class="bd-ict" viewBox="0 0 24 24" aria-hidden="true"><path d="M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4"/></svg><i class="bd-pip bd-tune-pip" hidden></i></button>
|
package/workspace/server.js
CHANGED
|
@@ -10731,6 +10731,8 @@ async function handleRequest(req, res) {
|
|
|
10731
10731
|
: 'could not record the change — nothing was saved', sink, ...(wrote ? { grant, unsaved: rest } : {}) }, 500);
|
|
10732
10732
|
}
|
|
10733
10733
|
boardCache.invalidate(w.root);
|
|
10734
|
+
// decisions-from-approvals: a hold with a reason is one line in the product's decision journal; the hold's Undo takes it out
|
|
10735
|
+
try { for (const r of recs) require('./lib/decision-journal.js').onLifecycle(w.root, r); } catch { /* the lifecycle line holds the hold */ }
|
|
10734
10736
|
return json(res, bulk ? { ok: true, recorded: recs, grant, sink } : { ok: true, recorded: rec, sink });
|
|
10735
10737
|
}
|
|
10736
10738
|
if (p === '/api/doc/save' && req.method === 'POST') {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "decisions-from-approvals (bet A475): the PM approvals, card picks, drops and parks write the decision journal by themselves, with Undo (lib/decision-journal.js logFrom, undo, onLifecycle).",
|
|
3
|
+
"modules": ["decisions-from-approvals.test.js"],
|
|
4
|
+
"seconds": { "decisions-from-approvals.test.js": 2 }
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Start a chat at product and program level (bug 2026-11-23, initiative work-ask-chat, done test planning/done-tests/work-ask-chat.md W1-W4): Work's Ask PMOS icon, the program and product chat targets, and the chat route starting them from the page's words. No server, network or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"work-ask-chat.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"work-ask-chat.test.js": 1
|
|
8
|
+
}
|
|
9
|
+
}
|