create-pmos 0.755.0 → 0.757.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 +27 -136
- 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/scripts/workflow-state.js +3 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/changelog.json +26 -0
- package/workspace/guide/backlog.md +13 -2
- package/workspace/guide/home.md +1 -0
- package/workspace/lib/autonomy.js +16 -7
- package/workspace/lib/engine/workflow-state.js +3 -1
- package/workspace/lib/routes-your-move.js +50 -3
- package/workspace/lib/vendor/scripts/workflow-state.js +3 -1
- package/workspace/lib/verify-runs.js +2 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-backlog.js +45 -7
- package/workspace/public/pm/cozy-today-app.js +13 -1
- package/workspace/public/pm/cozy-today-page.css +1 -0
- package/workspace/public/pm/cozy-today-view.js +5 -2
- package/workspace/public/pm/line-view.js +85 -0
- package/workspace/public/pm/premium-board.js +2 -0
- package/workspace/test-lists/quiet-rows-line.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.757.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,32 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.757.0",
|
|
38
|
+
"at": "2026-11-24T01:28:20.135Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1706,
|
|
43
|
+
"t": "Sample PMOS's landed changes across kinds; a run alone is not eval",
|
|
44
|
+
"s": "Sample PMOS's landed changes across kinds; a run alone is not eval",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"v": "0.756.0",
|
|
51
|
+
"at": "2026-11-24T01:12:35.636Z",
|
|
52
|
+
"f": 4,
|
|
53
|
+
"prs": [
|
|
54
|
+
{
|
|
55
|
+
"n": 1704,
|
|
56
|
+
"t": "Line tab on Work and Today's dashed line (quiet rows slice B)",
|
|
57
|
+
"s": "Line tab on Work and Today's dashed line (quiet rows slice B)",
|
|
58
|
+
"k": "new"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
36
62
|
{
|
|
37
63
|
"v": "0.755.0",
|
|
38
64
|
"at": "2026-11-24T00:55:56.769Z",
|
|
@@ -411,141 +437,6 @@
|
|
|
411
437
|
}
|
|
412
438
|
}
|
|
413
439
|
]
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
"v": "0.736.0",
|
|
417
|
-
"at": "2026-11-23T06:36:26.214Z",
|
|
418
|
-
"f": 4,
|
|
419
|
-
"prs": [
|
|
420
|
-
{
|
|
421
|
-
"n": 1641,
|
|
422
|
-
"t": "Back after the chat opens a file by itself",
|
|
423
|
-
"s": "Back after the chat opens a file by itself",
|
|
424
|
-
"k": "new",
|
|
425
|
-
"try": {
|
|
426
|
-
"steps": [
|
|
427
|
-
"In a chat, ask it to open a report.",
|
|
428
|
-
"Then press Back."
|
|
429
|
-
],
|
|
430
|
-
"see": "You land on the item you were on, not on Today."
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
{
|
|
434
|
-
"n": 1640,
|
|
435
|
-
"t": "Open questions in Today's Decide tab, waiting on you and on others (A420)",
|
|
436
|
-
"s": "Open questions in Today's Decide tab, waiting on you and on others (A420)",
|
|
437
|
-
"k": "new",
|
|
438
|
-
"try": {
|
|
439
|
-
"steps": [
|
|
440
|
-
"Open Today, then the Decide tab."
|
|
441
|
-
],
|
|
442
|
-
"see": "Two groups, waiting on you and waiting on others, oldest first, each with its age.",
|
|
443
|
-
"open": "/today.html"
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
"n": 1644,
|
|
448
|
-
"t": "The item panel lists its customer signals, so a phone tap reaches them (A157)",
|
|
449
|
-
"s": "The item panel lists its customer signals, so a phone tap reaches them (A157)",
|
|
450
|
-
"k": "new",
|
|
451
|
-
"try": {
|
|
452
|
-
"steps": [
|
|
453
|
-
"On the phone, open an initiative that has customer signals, then its item panel."
|
|
454
|
-
],
|
|
455
|
-
"see": "A list of signals: who, where, and a link."
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
"n": 1645,
|
|
460
|
-
"t": "Pmos positioning, the chat keeps the positioning lines the Board shows (A328)",
|
|
461
|
-
"s": "Pmos positioning, the chat keeps the positioning lines the Board shows (A328)",
|
|
462
|
-
"k": "new",
|
|
463
|
-
"try": {
|
|
464
|
-
"steps": [
|
|
465
|
-
"In a product's chat, ask it to keep a positioning line you write."
|
|
466
|
-
],
|
|
467
|
-
"see": "The line shows in the product's positioning on Work."
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
"v": "0.735.0",
|
|
474
|
-
"at": "2026-11-23T06:26:05.595Z",
|
|
475
|
-
"f": 4,
|
|
476
|
-
"prs": [
|
|
477
|
-
{
|
|
478
|
-
"n": 1634,
|
|
479
|
-
"t": "Approve icon in the Work popup; one jira pin line in cli.md",
|
|
480
|
-
"s": "Approve icon in the Work popup; one jira pin line in cli.md",
|
|
481
|
-
"k": "fix"
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
"n": 1635,
|
|
485
|
-
"t": "Goals uses the full width and opens Ask PMOS on the right",
|
|
486
|
-
"s": "Goals uses the full width and opens Ask PMOS on the right",
|
|
487
|
-
"k": "fix",
|
|
488
|
-
"try": {
|
|
489
|
-
"steps": [
|
|
490
|
-
"Open Goals and press Ask PMOS."
|
|
491
|
-
],
|
|
492
|
-
"see": "Goals fills the width; the chat opens on the right.",
|
|
493
|
-
"open": "/premium-goals.html"
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
"n": 1612,
|
|
498
|
-
"t": "Phone initiatives as a list with their own small line, no Gantt",
|
|
499
|
-
"s": "Phone initiatives as a list with their own small line, no Gantt",
|
|
500
|
-
"k": "new",
|
|
501
|
-
"try": {
|
|
502
|
-
"steps": [
|
|
503
|
-
"On the phone, open Work's initiatives."
|
|
504
|
-
],
|
|
505
|
-
"see": "A list where each row has its own start-to-end line. No Gantt.",
|
|
506
|
-
"open": "/premium-board.html"
|
|
507
|
-
}
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
"n": 1624,
|
|
511
|
-
"t": "Pmos press-release, a press release and FAQ draft for a bet (A362)",
|
|
512
|
-
"s": "Pmos press-release, a press release and FAQ draft for a bet (A362)",
|
|
513
|
-
"k": "new",
|
|
514
|
-
"try": {
|
|
515
|
-
"steps": [
|
|
516
|
-
"In a chat, ask: draft a press release for this bet."
|
|
517
|
-
],
|
|
518
|
-
"see": "A one-page press release and FAQ from the record, for you to edit."
|
|
519
|
-
}
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
"n": 1642,
|
|
523
|
-
"t": "The case card shows a chat save at once",
|
|
524
|
-
"s": "The case card shows a chat save at once",
|
|
525
|
-
"k": "fix",
|
|
526
|
-
"try": {
|
|
527
|
-
"steps": [
|
|
528
|
-
"Open an initiative's popup.",
|
|
529
|
-
"In its chat, ask it to add a line to the case."
|
|
530
|
-
],
|
|
531
|
-
"see": "The case card shows the line without a reload."
|
|
532
|
-
}
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
"n": 1627,
|
|
536
|
-
"t": "The Light ground follows the time of day (A339)",
|
|
537
|
-
"s": "The Light ground follows the time of day (A339)",
|
|
538
|
-
"k": "new",
|
|
539
|
-
"try": {
|
|
540
|
-
"steps": [
|
|
541
|
-
"Settings, General, turn on Light through the day.",
|
|
542
|
-
"Use the Light theme."
|
|
543
|
-
],
|
|
544
|
-
"see": "The ground is cool in the morning, warm in the afternoon, dusk in the evening.",
|
|
545
|
-
"open": "/today.html?settings=general"
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
]
|
|
549
440
|
}
|
|
550
441
|
]
|
|
551
442
|
}
|
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-24T01:28:17Z"}
|
|
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-24T01:28:17Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -1324,7 +1324,9 @@ function computeWorkflowDerived(id, opts) {
|
|
|
1324
1324
|
if (by.spec.status === 'done') stage = 'spec';
|
|
1325
1325
|
if (by.contract.status === 'done') stage = 'contract';
|
|
1326
1326
|
if (by.build.status === 'done') stage = 'build';
|
|
1327
|
-
|
|
1327
|
+
// A logged run puts the stage at eval only once the build is done. A run logged during spec or
|
|
1328
|
+
// discovery work used to read as eval too, which skipped Build on every board that reads this.
|
|
1329
|
+
if (evals.length || (runs.length && by.build && by.build.status === 'done')) stage = 'eval';
|
|
1328
1330
|
if (accepted.length) stage = 'accepted';
|
|
1329
1331
|
|
|
1330
1332
|
const blockers = steps.filter((s) => s.status === 'blocked');
|
|
@@ -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-24T01:28:17Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -586,7 +586,7 @@ const IVREAD = () => {
|
|
|
586
586
|
while (Date.now() - t0 < 90000) { const r = await fetch(BASE + '/api/board-premium'); j = await r.json(); if (j.state === 'ready' || j.state === 'error') break; if (r.status !== 202) break; await sleep(1500); }
|
|
587
587
|
ok('E1 the real route answers "reading" first and then the board of this repository', !!j && j.ok && j.state === 'ready' && j.model.board.name.length > 0, JSON.stringify(j).slice(0, 200));
|
|
588
588
|
const m = j && j.model;
|
|
589
|
-
ok('E2 the real model\'s counts agree with each other (no signal counted apart, workspace grill W2): the header, the dock and the late and at-risk rows', !!m && m.dock.needs === m.initiatives.risk + m.initiatives.late && m.initiatives.on + m.initiatives.risk + m.initiatives.late + m.initiatives.hold + (m.initiatives.none || 0) === m.initiatives.open && m.initiatives.list.rows.slice(0,
|
|
589
|
+
ok('E2 the real model\'s counts agree with each other (no signal counted apart, workspace grill W2): the header, the dock and the late and at-risk rows', !!m && m.dock.needs === m.initiatives.risk + m.initiatives.late && m.initiatives.on + m.initiatives.risk + m.initiatives.late + m.initiatives.hold + (m.initiatives.none || 0) === m.initiatives.open && m.initiatives.list.rows.slice(0, Math.min(5, m.initiatives.risk + m.initiatives.late)).every((r) => r.bad), m ? JSON.stringify(m.initiatives).slice(0, 200) : '');
|
|
590
590
|
ok('E3 the real model draws no sprint and no release without a source, and no demo data', !!m && !m.sprint.name && !m.release.at && !/demo/i.test(JSON.stringify({ h: m.header, s: m.sprint, r: m.release, d: m.docs, b: m.board })));
|
|
591
591
|
ok('E3 the real model has the eight steps and a track on every row', !!m && m.steps.length === 8 && m.initiatives.list.rows.every((r) => r.track && typeof r.track.k === 'number'));
|
|
592
592
|
const post = await fetch(BASE + '/api/board-premium', { method: 'POST', headers: await T.pressHeaders(BASE), body: '{}' }).then((r) => r.status);
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.757.0",
|
|
4
|
+
"at": "2026-11-24T01:28:20.135Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1706,
|
|
9
|
+
"t": "Sample PMOS's landed changes across kinds; a run alone is not eval",
|
|
10
|
+
"s": "Sample PMOS's landed changes across kinds; a run alone is not eval",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.756.0",
|
|
17
|
+
"at": "2026-11-24T01:12:35.636Z",
|
|
18
|
+
"f": 4,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1704,
|
|
22
|
+
"t": "Line tab on Work and Today's dashed line (quiet rows slice B)",
|
|
23
|
+
"s": "Line tab on Work and Today's dashed line (quiet rows slice B)",
|
|
24
|
+
"k": "new"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
2
28
|
{
|
|
3
29
|
"v": "0.755.0",
|
|
4
30
|
"at": "2026-11-24T00:55:56.769Z",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "The Backlog"
|
|
4
4
|
description: "Every open task of your products in one list, the way Jira lists them, and the tasks PMOS takes and finishes itself."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-24
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# The Backlog
|
|
@@ -12,12 +12,23 @@ The Backlog lists every open task of the products you picked, the way Jira's bac
|
|
|
12
12
|
## Open it
|
|
13
13
|
|
|
14
14
|
1. Go to **Board**. Work shows.
|
|
15
|
-
2. Press **Backlog** on the switch at the top, **Initiatives | Backlog**. The number beside it is how many tasks are open.
|
|
15
|
+
2. Press **Backlog** on the switch at the top, **Initiatives | Line | Backlog | This sprint**. The number beside it is how many tasks are open.
|
|
16
16
|
|
|
17
17
|
On a phone the switch has its own line above the list. PMOS remembers your choice for each pick of products. A screen reader reads the switch as a set of tabs named "Work".
|
|
18
18
|
|
|
19
19
|
The Work page uses the PMOS design system (see [Layout](layout.md#the-design-system)): the switch is its Tabs, the toolbar buttons its Buttons, and the timeline its chart colours. Done is leaf green, now is blue, planned is grey, and late and the today line are the alert colour.
|
|
20
20
|
|
|
21
|
+
## The Line
|
|
22
|
+
|
|
23
|
+
Press **Line** on the switch to see every live initiative of your pick in one table, in groups by workflow station (for example Discovery, then Implementation). The address `/premium-board.html?work=line` opens it directly.
|
|
24
|
+
|
|
25
|
+
- The sentence above the table says where the line stands, for example "9 initiatives on the line. 7 move by themselves. 1 stuck."
|
|
26
|
+
- The columns are **Initiative**, **Days here** ("day 6", or "4 of 15" when the station has a limit), **Still missing to finish**, **Next move** and **State**.
|
|
27
|
+
- The tabs **All**, **Stuck**, **Can't tell** and **Your move** filter the table. A tab with nothing in it is not shown.
|
|
28
|
+
- A row that waits on you reads "your move". You answer it on Today, so it is marked here and not repeated there.
|
|
29
|
+
- Waiting for a free builder is not stuck: it reads "moving". "Can't tell" means PMOS could not place the initiative, so it leaves it alone.
|
|
30
|
+
- Press an initiative's name to open it.
|
|
31
|
+
|
|
21
32
|
## The columns
|
|
22
33
|
|
|
23
34
|
| Column | What it shows |
|
package/workspace/guide/home.md
CHANGED
|
@@ -49,6 +49,7 @@ Home, the Board, Insights and the Viewer use one typeface, Plus Jakarta Sans, wi
|
|
|
49
49
|
- **At most 5 show.** The rest are under **Can wait**, in the same order. Nothing is dropped.
|
|
50
50
|
- **At most 3 rows a day for each product.** A row from a product's own records counts toward the 3: an open question, a check, a grill finding, a date change from a meeting, a key result, or a change PMOS proposes on an initiative. A reply someone waits for, your own task and a draft never count. The rows are fixed the first time Today shows them that day. When you finish a row, nothing takes its place until tomorrow. A new row that holds up a ship date takes the place of that product's lowest row and never makes a fourth. Rows over the 3 wait under **Later** with "Waits for tomorrow". A product with nothing for you has no row.
|
|
51
51
|
- **Today's batch.** Everything other people will see (a review request, Jira tickets, a follow-up, a closed ask) is one row: "Today's batch: 5 to send". Press it to open the batch full size. **Back** returns to Today. The drafts are in groups by kind, and each one says who will see it. ✎ **Change it first** opens the draft, ✕ **Skip** drops it (with Undo), and ✓ **Approve** sends it. When more than one draft waits, PMOS suggests **Approve and send all**. Nothing is sent until you press. If no channel is connected yet, the draft stays in the batch and says so. A draft you leave for 7 days lapses and is not sent. On a phone the batch shows one draft at a time, full text first: swipe right to approve, left to skip.
|
|
52
|
+
- **The dashed line.** Your move ends with one dashed line, for example "9 more move in the line by themselves · none stuck" (or "· 1 stuck"). It counts the live initiatives of your products that do not wait on you. Press it to open the Line on Work. With nothing on the line there is no dashed line.
|
|
52
53
|
- **One press per initiative.** An initiative's proposals are one row, for example "Checkout: 6 changes to keep" with "3 dates, 2 names, 1 link" under it. Press it to see them grouped as Dates, Names, Done and Links. ✓ keeps all of them, with one Undo for the batch. ✕ drops them, then offers three reasons and **Say why**. A proposal that needs your own check keeps its own ✓ and ✕. **See every change** opens the full list on the initiative.
|
|
53
54
|
- **An ask expires after 14 days with no answer.** PMOS leaves it as it was and writes why in the initiative's History. Your move says it once: "2 asks expired after 14 days with no answer." Dates computed from your tasks never expire: PMOS reads them again each time.
|
|
54
55
|
- **Done** lists what PMOS finished by itself in the last 14 days, one line each with Undo.
|
|
@@ -387,17 +387,26 @@ function kindsOf(dirs, { now, settingsDir = null } = {}) {
|
|
|
387
387
|
const VERDICTS = Object.freeze(['PASS', 'FAIL']);
|
|
388
388
|
const CHECK_MIN_AGE = 3600000; // a change settles for an hour before it is checked, so an Undo the PM presses at once is not graded
|
|
389
389
|
|
|
390
|
-
/** The next applied change the check should grade
|
|
391
|
-
*
|
|
390
|
+
/** The next applied change the check should grade. It is a sample, not a queue (product line slice 3 follow-up, 2026-11-24): oldest
|
|
391
|
+
* first let a backlog of one kind of change spend every check of the day while the other kinds were never looked at.
|
|
392
|
+
* Eligible: not undone, not checked, older than an hour and still inside its Undo window, and class B (a judgment), or class A (upkeep
|
|
393
|
+
* with one right answer) of a job that had no check in the last SAMPLE_DAYS, so each kind of upkeep is still looked at once a week.
|
|
394
|
+
* Order: the job with the fewest checks in the last SAMPLE_DAYS first, then class B before A, then the newest (the longest Undo left).
|
|
395
|
+
* skip: refs tried already. → applied entry | null */
|
|
396
|
+
const SAMPLE_DAYS = 7;
|
|
392
397
|
function toCheck(stateDir, { now, skip = [] } = {}) {
|
|
393
398
|
const t = now == null ? Date.now() : now;
|
|
399
|
+
const all = [...fold(read(stateDir)).applied.values()];
|
|
400
|
+
const recent = new Map(); // job and product → checks in the last SAMPLE_DAYS
|
|
401
|
+
for (const a of all) if (a.checked && t - Date.parse(a.checked.at) <= SAMPLE_DAYS * DAY) recent.set(keyOf(a.job, a.product), (recent.get(keyOf(a.job, a.product)) || 0) + 1);
|
|
402
|
+
const seen = (a) => recent.get(keyOf(a.job, a.product)) || 0;
|
|
394
403
|
const out = [];
|
|
395
|
-
for (const a of
|
|
404
|
+
for (const a of all) {
|
|
396
405
|
const age = t - Date.parse(a.at);
|
|
397
|
-
if (a.
|
|
398
|
-
out.push(a);
|
|
406
|
+
if (a.undone || a.checked || !a.ref || skip.includes(a.ref) || !(age >= CHECK_MIN_AGE) || age > UNDO_DAYS * DAY) continue;
|
|
407
|
+
if (a.cls === 'B' || (a.cls === 'A' && !seen(a))) out.push(a);
|
|
399
408
|
}
|
|
400
|
-
out.sort((x, y) => Date.parse(
|
|
409
|
+
out.sort((x, y) => (seen(x) - seen(y)) || ((x.cls === 'B' ? 0 : 1) - (y.cls === 'B' ? 0 : 1)) || (Date.parse(y.at) - Date.parse(x.at)));
|
|
401
410
|
if (!out.length) return null;
|
|
402
411
|
const { rec, ...a } = out[0];
|
|
403
412
|
return a;
|
|
@@ -445,7 +454,7 @@ function restore(stateDir, { job, product }, actor, { now } = {}) {
|
|
|
445
454
|
}
|
|
446
455
|
|
|
447
456
|
module.exports = {
|
|
448
|
-
wayAt, toCheck, recordCheck, fromRuns, VERDICTS, WAYS, SHOW_UNTIL, KIND_LIST, kindOf, waysSet, autoWay, kindsOf,
|
|
457
|
+
wayAt, toCheck, SAMPLE_DAYS, recordCheck, fromRuns, VERDICTS, WAYS, SHOW_UNTIL, KIND_LIST, kindOf, waysSet, autoWay, kindsOf,
|
|
449
458
|
LEDGER, CLASSES, DRIVER_CLASS, PROPOSAL_CLASS, DEMOTE_DAYS, UNDO_DAYS, RATE_LIMIT, RATE_MIN, KINDS,
|
|
450
459
|
classOfDriver, classOfDriverProposal, classOfProposal, NO_SOURCE_WHY, logHeld, srcOf, killed, autoFor, file, read, fold, recordApplied, reasonOf, recordSetback, decide, demotedNow, notices, markSeen, done, undoOpen, restore,
|
|
451
460
|
};
|
|
@@ -1324,7 +1324,9 @@ function computeWorkflowDerived(id, opts) {
|
|
|
1324
1324
|
if (by.spec.status === 'done') stage = 'spec';
|
|
1325
1325
|
if (by.contract.status === 'done') stage = 'contract';
|
|
1326
1326
|
if (by.build.status === 'done') stage = 'build';
|
|
1327
|
-
|
|
1327
|
+
// A logged run puts the stage at eval only once the build is done. A run logged during spec or
|
|
1328
|
+
// discovery work used to read as eval too, which skipped Build on every board that reads this.
|
|
1329
|
+
if (evals.length || (runs.length && by.build && by.build.status === 'done')) stage = 'eval';
|
|
1328
1330
|
if (accepted.length) stage = 'accepted';
|
|
1329
1331
|
|
|
1330
1332
|
const blockers = steps.filter((s) => s.status === 'blocked');
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
* each smallest test that was named and has no result yet.
|
|
21
21
|
* DEFAULTS (default-decisions-with-a-deadline, lib/default-decisions.js): each question carries `default` ({ choice, due, n, say } | null),
|
|
22
22
|
* `waits` (why it has no default | null), `waiting` (days on the list) and `cost` (A27: what the wait holds up | null). The read takes the
|
|
23
|
-
* defaults due today (one batch each, with Undo in "PMOS did"), and `taken` lists them. A dry-run gap or a sign-off never defaults.
|
|
23
|
+
* defaults due today (one batch each, with Undo in "PMOS did"), and `taken` lists them. A dry-run gap or a sign-off never defaults.
|
|
24
|
+
*
|
|
25
|
+
* GET /api/line?ws=<id> → { ok, ws, rows: [lib/line.js lineOf row + ws], you: [initiative id] } (quiet-rows slice B: Work's Line
|
|
26
|
+
* tab and Today's dashed line). lineOf reads every row of the repository, so it runs in a child process and its answer is kept LINE_MS per
|
|
27
|
+
* product. you: the initiatives with a question to the PM or a check due today (they are in Your move). */
|
|
24
28
|
const YM = require('./your-move.js');
|
|
25
29
|
|
|
26
30
|
const localDay = (ms = Date.now()) => { const d = new Date(ms); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); };
|
|
@@ -115,10 +119,53 @@ function asksOf(root, now = Date.now()) {
|
|
|
115
119
|
return out;
|
|
116
120
|
}
|
|
117
121
|
|
|
122
|
+
const LINE_MS = 5 * 60e3;
|
|
123
|
+
const LINES = new Map(); // ws → { at, rows, p? }
|
|
124
|
+
/** lineOf in a child process: it reads every record and the git history of the repository, which must not hold the server's event loop. */
|
|
125
|
+
function lineChild(root, now) {
|
|
126
|
+
const { execFile } = require('child_process');
|
|
127
|
+
const src = "const L=require(" + JSON.stringify(require.resolve('./line.js')) + ");const r=L.lineOf(process.argv[1],{now:+process.argv[2]});process.stdout.write(JSON.stringify(r))";
|
|
128
|
+
return new Promise((resolve) => execFile(process.execPath, ['-e', src, root, String(now)], { cwd: root, maxBuffer: 64 * 1024 * 1024, timeout: 120000 }, (err, out) => {
|
|
129
|
+
if (err) { resolve(null); return; }
|
|
130
|
+
try { resolve(JSON.parse(out)); } catch { resolve(null); }
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
/** The product's line (lib/line.js lineOf), kept LINE_MS. A stale answer is served at once while a new read runs; the first read waits. */
|
|
134
|
+
async function lineRows(w, now = Date.now()) {
|
|
135
|
+
const c = LINES.get(w.id);
|
|
136
|
+
if (c && now - c.at < LINE_MS) return c.rows;
|
|
137
|
+
if (c && c.p) return c.rows || c.p;
|
|
138
|
+
const p = lineChild(w.root, now).then((L) => {
|
|
139
|
+
const rows = L && L.ok ? (L.rows || []).map((r) => ({ ...r, ws: w.id })) : [];
|
|
140
|
+
LINES.set(w.id, { at: Date.now(), rows });
|
|
141
|
+
console.info('[quiet-rows-line] line read ws=' + w.id + ' rows=' + rows.length);
|
|
142
|
+
return rows;
|
|
143
|
+
});
|
|
144
|
+
LINES.set(w.id, { at: c ? c.at : 0, rows: c ? c.rows : null, p });
|
|
145
|
+
return c && c.rows ? c.rows : p;
|
|
146
|
+
}
|
|
147
|
+
/** The initiatives of a product that are in Your move: a question to the PM, or a check due today. */
|
|
148
|
+
function youOf(ctx, w, today) {
|
|
149
|
+
const out = new Set();
|
|
150
|
+
try { for (const q of questions(ctx, w, today, { take: false }).questions || []) if (q.toPm && q.ini) out.add(String(q.ini)); } catch { /* none read */ }
|
|
151
|
+
try { for (const v of verdicts(ctx, w, today)) if (v.ini) out.add(String(v.ini)); } catch { /* none read */ }
|
|
152
|
+
return [...out];
|
|
153
|
+
}
|
|
154
|
+
|
|
118
155
|
module.exports = {
|
|
119
|
-
expire, questions, asksOf,
|
|
120
|
-
prefixes: ['/api/your-move'],
|
|
156
|
+
expire, questions, asksOf, lineRows,
|
|
157
|
+
prefixes: ['/api/your-move', '/api/line'],
|
|
121
158
|
handle: async (req, res, url, ctx) => {
|
|
159
|
+
if (url.pathname === '/api/line') {
|
|
160
|
+
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
161
|
+
let w = null;
|
|
162
|
+
try { w = ctx.getWs(url.searchParams.get('ws') || null); } catch { w = null; }
|
|
163
|
+
if (!w || !w.root) { ctx.json(res, { ok: false, error: 'no such workspace' }, 404); return true; }
|
|
164
|
+
let rows = [];
|
|
165
|
+
try { rows = await lineRows(w); } catch (e) { ctx.json(res, { ok: false, error: 'the line could not be read: ' + (e && e.message) }, 500); return true; }
|
|
166
|
+
ctx.json(res, { ok: true, ws: w.id, rows, you: youOf(ctx, w, localDay()) });
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
122
169
|
if (url.pathname !== '/api/your-move') return false;
|
|
123
170
|
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
124
171
|
let w = null;
|
|
@@ -1324,7 +1324,9 @@ function computeWorkflowDerived(id, opts) {
|
|
|
1324
1324
|
if (by.spec.status === 'done') stage = 'spec';
|
|
1325
1325
|
if (by.contract.status === 'done') stage = 'contract';
|
|
1326
1326
|
if (by.build.status === 'done') stage = 'build';
|
|
1327
|
-
|
|
1327
|
+
// A logged run puts the stage at eval only once the build is done. A run logged during spec or
|
|
1328
|
+
// discovery work used to read as eval too, which skipped Build on every board that reads this.
|
|
1329
|
+
if (evals.length || (runs.length && by.build && by.build.status === 'done')) stage = 'eval';
|
|
1328
1330
|
if (accepted.length) stage = 'accepted';
|
|
1329
1331
|
|
|
1330
1332
|
const blockers = steps.filter((s) => s.status === 'blocked');
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* Off: PMOS_VERIFY=off, a scratch server (PMOS_STATE_DIR set, unless PMOS_VERIFY=1), PMOS_HEADLESS=off, `pmos ai off verify` (the bg-queue switch). Runs only when deep work may run (open(now)).
|
|
23
23
|
*
|
|
24
24
|
* THE APPLIED-CHANGE CHECK (batch 29 item 9, D106). Jobs that change records by themselves open no pull request, so step 2 never grades
|
|
25
|
-
* them. When no merged run is started, one turn may instead grade ONE change an agent applied by itself (lib/autonomy.js toCheck:
|
|
26
|
-
* an hour old, inside its Undo window): headless kind `verify`, origin `verify:change:<ref>:<token>`, with PMOS_CHECK_REF and PMOS_CHECK_DIR
|
|
25
|
+
* them. When no merged run is started, one turn may instead grade ONE change an agent applied by itself (lib/autonomy.js toCheck: a sample
|
|
26
|
+
* across jobs, the least-checked kind first; class B, and class A once a week per job; an hour old, inside its Undo window): headless kind `verify`, origin `verify:change:<ref>:<token>`, with PMOS_CHECK_REF and PMOS_CHECK_DIR
|
|
27
27
|
* pinned to that change. Its one write is `pmos autonomy check <ref> --verdict PASS|FAIL`; a FAIL sends the job back to asking for 7 days.
|
|
28
28
|
* At most CHECKS_PER_DAY a day; a change tried once is not tried again that day. Off with PMOS_VERIFY_CHANGES=off.
|
|
29
29
|
* PR-BACKED RUNS: an applied line that names its run is a setback when the verifier FAILs that run (evals.jsonl) or its merge is reverted
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.757.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.757.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -21,6 +21,7 @@ import * as WS from './work-select.js'; // the bulk move with one Undo, shared
|
|
|
21
21
|
import * as IF from './inline-fields.js'; // a task's sprint and priority, set in the row (initiative inline-sprint-priority)
|
|
22
22
|
import * as LE from './live-edit.js'; // a task's status or days show at once in the list, before it is read again; a failed save is put back
|
|
23
23
|
import { noteUse } from './use-log.js'; // the sprint draft's presses, counted on this computer only (sprint-draft-capacity)
|
|
24
|
+
import * as LV from './line-view.js'; // quiet-rows slice B: the Line tab, every initiative by station (GET /api/line)
|
|
24
25
|
import * as BD from './bd-backlog-ds.js'; // the Backlog from the system's parts (WorkBacklogDS) // the sprint overview while "This sprint" is on (initiative sprint-overview)
|
|
25
26
|
|
|
26
27
|
const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
@@ -65,12 +66,15 @@ export function tabOf() {
|
|
|
65
66
|
const q = new URLSearchParams(location.search).get('work');
|
|
66
67
|
if (q === 'backlog') return 'bk';
|
|
67
68
|
if (q === 'sprint') return 'sp';
|
|
69
|
+
if (q === 'line') return 'ln';
|
|
68
70
|
if (q === 'initiatives') return 'ini';
|
|
69
71
|
const v = (get(KEY, {}) || {})[scopeKey()];
|
|
70
|
-
return v === 'bk' || v === 'sp' ? v : 'ini';
|
|
72
|
+
return v === 'bk' || v === 'sp' || v === 'ln' ? v : 'ini';
|
|
71
73
|
}
|
|
72
74
|
/** Is a task tab (Backlog or This sprint) the view now? */
|
|
73
|
-
export const on = () => tabOf()
|
|
75
|
+
export const on = () => tabOf() === 'bk' || tabOf() === 'sp';
|
|
76
|
+
/** Is the Line tab the view now? (quiet-rows slice B) */
|
|
77
|
+
export const lineOn = () => tabOf() === 'ln';
|
|
74
78
|
function setOn(v) {
|
|
75
79
|
v = v === true ? 'bk' : v === false ? 'ini' : v;
|
|
76
80
|
const m = get(KEY, {}) || {}; m[scopeKey()] = v; put(KEY, m);
|
|
@@ -119,7 +123,8 @@ export async function load() {
|
|
|
119
123
|
/* ── the switch in Work's header ──────────────────────────────────────────────────────────────────────────────── */
|
|
120
124
|
/** Work's three tab names: a desk says "This sprint" and no count; a phone says "Backlog 14" and "Sprint" (PhoneWorkDS, job 1540).
|
|
121
125
|
* Zero is silence: no count when the Backlog is empty or not read yet. */
|
|
122
|
-
|
|
126
|
+
// the Line (quiet-rows-line) is a five-column table for a desk; a phone keeps its three tabs (Today's dashed line is desk-only too)
|
|
127
|
+
export const tabNames = (phone, n) => [['ini', 'Initiatives'], ...(phone ? [] : [['ln', 'Line']]), ['bk', 'Backlog' + (phone && n > 0 ? ` <span class="bk-swn">${Number(n)}</span>` : '')], ['sp', phone ? 'Sprint' : 'This sprint']];
|
|
123
128
|
const phoneNow = () => typeof matchMedia === 'function' && matchMedia('(max-width: 760px)').matches;
|
|
124
129
|
function drawSwitch() {
|
|
125
130
|
if (!sw) return;
|
|
@@ -130,16 +135,49 @@ function drawSwitch() {
|
|
|
130
135
|
sw.innerHTML = tabNames(ph, ph && DATA ? backlogOf().length : 0).map(([k, n]) => tb(k, n)).join('');
|
|
131
136
|
}
|
|
132
137
|
function apply() {
|
|
133
|
-
const bk = on();
|
|
138
|
+
const bk = on(), ln = lineOn();
|
|
134
139
|
if (tabOf() === 'sp') CHIPS.add('sprint');
|
|
135
140
|
document.body.classList.toggle('sp-on', tabOf() === 'sp');
|
|
136
|
-
document.body.classList.toggle('bk-on', bk);
|
|
137
|
-
if (host) host.hidden = !bk;
|
|
141
|
+
document.body.classList.toggle('bk-on', bk || ln);
|
|
142
|
+
if (host) host.hidden = !(bk || ln);
|
|
138
143
|
drawSwitch();
|
|
144
|
+
if (ln) { closeAll(); drawLine(); return; }
|
|
139
145
|
if (bk) { if (!DATA || scopeKey() !== lastScope) { lastScope = scopeKey(); host.innerHTML = '<p class="bk-wait">Reading the tasks…</p>'; load(); } else draw(); }
|
|
140
146
|
else closeAll();
|
|
141
147
|
}
|
|
142
148
|
|
|
149
|
+
/* ── the Line tab (quiet-rows slice B, board QuietLine) ── every live initiative of the pick by station, from GET /api/line ── */
|
|
150
|
+
const LN = { tab: '', got: null, key: '', used: false };
|
|
151
|
+
async function readLine() {
|
|
152
|
+
const ws = [...new Set(A.scope().map((s) => s.ws || ''))];
|
|
153
|
+
const got = await Promise.all(ws.map((w) => fetch('/api/line' + (w ? '?ws=' + encodeURIComponent(w) : ''), { credentials: 'same-origin' }).then((r) => r.json()).catch(() => null)));
|
|
154
|
+
return got.filter((r) => r && r.ok).map((r) => ({ ws: r.ws, rows: r.rows || [], you: r.you || [] }));
|
|
155
|
+
}
|
|
156
|
+
function drawLine() {
|
|
157
|
+
if (!host) return;
|
|
158
|
+
const k = scopeKey();
|
|
159
|
+
if (!LN.used) { LN.used = true; noteUse('qr-line'); console.info('[quiet-rows-line] line tab opened'); } // the health number: one open per page load
|
|
160
|
+
if (!LN.got || LN.key !== k) {
|
|
161
|
+
LN.key = k; host.innerHTML = '<p class="bk-wait">Reading the line…</p>';
|
|
162
|
+
readLine().then((g) => { LN.got = g; if (lineOn()) drawLine(); });
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const rows = LN.got.flatMap((L) => L.rows.map((r) => ({ ...r, ws: L.ws })));
|
|
166
|
+
const you = new Set(LN.got.flatMap((L) => L.you.map((id) => L.ws + '|' + id)));
|
|
167
|
+
const M = LV.lineModel(rows, { you, tab: LN.tab });
|
|
168
|
+
const one = A.scope().length === 1 ? A.scope()[0].name || '' : '';
|
|
169
|
+
host.innerHTML = LV.lineHtml(M, { name: one, say: LV.sayOf(M) });
|
|
170
|
+
}
|
|
171
|
+
/** A press in the Line tab: a tab, or a row's name (opens the initiative). true when it was one. */
|
|
172
|
+
function linePress(e) {
|
|
173
|
+
if (!lineOn()) return false;
|
|
174
|
+
const tb = e.target.closest('[data-line-tab]');
|
|
175
|
+
if (tb) { LN.tab = tb.dataset.lineTab; drawLine(); return true; }
|
|
176
|
+
const b = e.target.closest('[data-line-ini]');
|
|
177
|
+
if (b) { if (A && A.openIni) A.openIni(b.dataset.lineIni, b.dataset.lineWs || ''); return true; }
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
143
181
|
/* ── the list ─────────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
144
182
|
const partB = () => true;
|
|
145
183
|
function draw() {
|
|
@@ -746,7 +784,7 @@ export function sync(api) {
|
|
|
746
784
|
sw.addEventListener('click', (e) => { const b = e.target.closest('[data-bksw]'); if (b) setOn(b.dataset.bksw); });
|
|
747
785
|
host = document.createElement('div'); host.id = 'bkBody'; host.className = 'bk-host'; host.hidden = true;
|
|
748
786
|
ib.insertAdjacentElement('afterend', host);
|
|
749
|
-
host.addEventListener('click', (e) => { press(e); });
|
|
787
|
+
host.addEventListener('click', (e) => { if (linePress(e)) return; press(e); });
|
|
750
788
|
host.addEventListener('change', (e) => { if (e.target.closest('[data-bkck]')) press(e); });
|
|
751
789
|
host.addEventListener('keydown', (e) => { const c = e.target.closest('[data-bkcap]'); if (c && e.key === 'Enter') { e.preventDefault(); capture(c); } });
|
|
752
790
|
dragWire();
|
|
@@ -40,6 +40,7 @@ export function mountToday(ctx) {
|
|
|
40
40
|
draw();
|
|
41
41
|
readReports();
|
|
42
42
|
readQuestions();
|
|
43
|
+
readLine();
|
|
43
44
|
}
|
|
44
45
|
/* open-questions-today (A420, board QuestionsA): every product's register (GET /api/open-questions), one list for the Decide tab. A product
|
|
45
46
|
* that does not answer is left out; nothing is guessed. Read-only: taking a default and putting it off a week are slice 2. */
|
|
@@ -55,6 +56,16 @@ export function mountToday(ctx) {
|
|
|
55
56
|
X.questions = lines;
|
|
56
57
|
draw();
|
|
57
58
|
}
|
|
59
|
+
/* quiet-rows-line (board QuietLine): each product's line (GET /api/line), for the dashed line at the end of Your move. A product that does not
|
|
60
|
+
* answer is left out; with nothing on the line there is no dashed line (zero is silence). */
|
|
61
|
+
async function readLine() {
|
|
62
|
+
const P = ((ctx.S.M && ctx.S.M.products) || []).filter((p) => p && p.model);
|
|
63
|
+
const W = [...new Set((P.length ? P.map((p) => p.ws || ctx.boardWs() || '') : [ctx.boardWs() || '']))];
|
|
64
|
+
const got = await Promise.all(W.map((ws) => ctx.pmGet('/api/line' + (ws ? '?ws=' + encodeURIComponent(ws) : '')).catch(() => null)));
|
|
65
|
+
const lines = got.filter((r) => r && r.ok && Array.isArray(r.rows)).map((r) => ({ ws: r.ws || '', rows: r.rows, you: r.you || [] }));
|
|
66
|
+
if (JSON.stringify(lines) === JSON.stringify(X.lines || [])) return;
|
|
67
|
+
X.lines = lines; draw();
|
|
68
|
+
}
|
|
58
69
|
// the reports that go out today, at their time (GET /api/events-place; 202 while a Board is read: ask again in a moment, three times)
|
|
59
70
|
async function readReports(n = 0) {
|
|
60
71
|
const r = await ctx.pmGet('/api/events-place').catch(() => null);
|
|
@@ -129,7 +140,7 @@ export function mountToday(ctx) {
|
|
|
129
140
|
return;
|
|
130
141
|
}
|
|
131
142
|
el.classList.remove('tdp');
|
|
132
|
-
const html = TP.pageHtml(L, A, { draft, overview: O, job: X.job, open: X.open || !!X.job, ymOpen: X.ymOpen, handled: X.job && X.job !== 'Reply' ? [] : handled(), hopen: X.hopen, sopen: [...X.sopen], filed: filedLine() });
|
|
143
|
+
const html = TP.pageHtml(L, A, { draft, overview: O, job: X.job, open: X.open || !!X.job, ymOpen: X.ymOpen, handled: X.job && X.job !== 'Reply' ? [] : handled(), hopen: X.hopen, sopen: [...X.sopen], filed: filedLine(), lines: X.lines || null });
|
|
133
144
|
if (html === X.html && el.firstChild) return;
|
|
134
145
|
X.html = html;
|
|
135
146
|
const st = el.parentNode ? el.parentNode.scrollTop : 0;
|
|
@@ -398,6 +409,7 @@ export function mountToday(ctx) {
|
|
|
398
409
|
wireSwipe(el, { on: phone, act: (row, way) => { const act = row.dataset[way === 'right' ? 'swRight' : 'swLeft']; if (act) run(act, row.dataset.key || '', { dataset: {}, disabled: false, isConnected: false }); } });
|
|
399
410
|
}
|
|
400
411
|
async function run(act, key, b) {
|
|
412
|
+
if (act === 'line') { console.info('[quiet-rows-line] dashed line opened'); return; } // the link opens Work › Line, which counts the open (qr-line)
|
|
401
413
|
if (act === 'cal') { ctx.openCalendar(); return; }
|
|
402
414
|
// the phone (Ph2_today): Record on the next event starts its recording; with no event, a recording of its own (PMOS names it after)
|
|
403
415
|
if (act === 'rec' || act === 'rec-ev') {
|
|
@@ -58,6 +58,7 @@ button.td-t:focus-visible, .td-ln:focus-visible, .td-evl:focus-visible { outline
|
|
|
58
58
|
.ym-n { flex: none; min-width: var(--space-16); text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
|
|
59
59
|
.td-li .ym-why { display: flex; align-items: center; gap: var(--space-4); }
|
|
60
60
|
.ym-why .pm-star { flex: none; color: var(--blue); }
|
|
61
|
+
.ym-line { display: block; border: 1px dashed var(--muted); text-decoration: none; color: var(--muted); } /* quiet-rows slice B: the rest of the line, one dashed line */
|
|
61
62
|
|
|
62
63
|
/* the agenda: each event at its time, the now line where it falls */
|
|
63
64
|
.td-evl { font-size: var(--fs-meta); color: var(--blue); }
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* a Summary block for the meeting PMOS recorded and filed, with one Suggestion (keep it filed, or take it out).
|
|
17
17
|
* Every icon-only button has an aria-label. The UI says PMOS. Text from records goes through esc(). */
|
|
18
18
|
|
|
19
|
+
import { dashModel as lineDash, dashHtml as lineDashHtml } from './line-view.js'; // quiet-rows-line: Your move ends with the line's dashed line
|
|
19
20
|
import { groupsHtml as questionGroups, phoneGroupsHtml as phoneQuestionGroups } from './open-questions-view.js'; // open-questions-today (A420)
|
|
20
21
|
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
21
22
|
const svg = (d, w = 15, sw = 1.9) => `<svg aria-hidden="true" width="${w}" height="${w}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${sw}" stroke-linecap="round" stroke-linejoin="round"><path d="${d}"/></svg>`;
|
|
@@ -138,7 +139,7 @@ export function moveRowHtml(r, n, o = {}) {
|
|
|
138
139
|
/** "4 more, in the same order · the next one: <title>, <age>". */
|
|
139
140
|
const nextWord = (r) => r.title + (ageOf(r) ? ', ' + plural(ageOf(r), 'day', 'days') : '');
|
|
140
141
|
/** The Your move group: the heading, five rows, the fold line (open: the rest, in the same order). '' when nothing waits (zero is
|
|
141
|
-
* silence). rows: the ranked rows (logModel().move, filtered by the tab). o: { ymOpen, sopen } */
|
|
142
|
+
* silence). rows: the ranked rows (logModel().move, filtered by the tab). o: { ymOpen, sopen, lines } */
|
|
142
143
|
export function moveHtml(rows, o = {}) {
|
|
143
144
|
if (!rows || !rows.length) return '';
|
|
144
145
|
const so = new Set(o.sopen || []), shown = rows.slice(0, YM_SHOW), rest = rows.slice(YM_SHOW);
|
|
@@ -150,6 +151,8 @@ export function moveHtml(rows, o = {}) {
|
|
|
150
151
|
if (rest.length && o.ymOpen) h += rest.map((r, i) => moveRowHtml(r, YM_SHOW + i + 1, { sopen: so.has(r.key) })).join('');
|
|
151
152
|
h += '</div>';
|
|
152
153
|
if (rest.length) h += `<button type="button" class="td-fold pm-fold ym-fold" data-td="ym-fold" aria-expanded="${!!o.ymOpen}">${esc(rest.length + ' more, in the same order')} <span class="td-n">${esc('· the next one: ' + nextWord(rest[0]))}</span>${ic(I.more, 14)}</button>`;
|
|
154
|
+
// quiet-rows-line (board QuietLine): the last line, dashed: what moves in the line by itself, which opens Work › Line. o.lines: GET /api/line
|
|
155
|
+
h += lineDashHtml(lineDash(o.lines));
|
|
153
156
|
return h;
|
|
154
157
|
}
|
|
155
158
|
/** The jobs the log's Tabs filter by, in order. */
|
|
@@ -172,7 +175,7 @@ export function logHtml(L, o = {}) {
|
|
|
172
175
|
const one = (r, lit) => (r.members ? rowHtml(r, { sopen: so.has(r.key), lit }) + (so.has(r.key) ? r.members.map((m) => rowHtml(m)).join('') : '') : rowHtml(r, { lit }));
|
|
173
176
|
const today = pick(L.todayRows), wait = pick(L.wait);
|
|
174
177
|
let body = job === 'Decide' ? questionGroups(L.questions) : '';
|
|
175
|
-
body += moveHtml(pick(L.move || L.first), o);
|
|
178
|
+
body += moveHtml(pick(L.move || L.first), job ? { ...o, lines: null } : o);
|
|
176
179
|
if (today.length) body += `<div class="td-gr pm-group">Today</div><div class="rows">${today.map((r) => one(r)).join('')}</div>`;
|
|
177
180
|
if (wait.length) {
|
|
178
181
|
const oldest = Math.max(0, ...wait.map((r) => r.carried || 0));
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* pm/line-view.js — the Line tab on Work and Today's dashed line (initiative quiet-rows-line, quiet rows slice B; board QuietLine on the
|
|
2
|
+
* main canvas, In development). Pure: Node imports it (quiet-rows-line.test.js).
|
|
3
|
+
*
|
|
4
|
+
* lineModel(rows, { you, tab }) → { groups: [{ key, name, n, rows }], counts: { all, stuck, cant, you }, tab, live }
|
|
5
|
+
* lineHtml(M, o) → the Line block: Tabs (All, Stuck, Can't tell, Your move) and one table grouped by station
|
|
6
|
+
* dashModel(lines) → { n, stuck, text } | null Today's dashed line under Your move ("9 more move in the line by themselves · 1 stuck")
|
|
7
|
+
* dashHtml(D) → the dashed line, a link to /premium-board.html?work=line
|
|
8
|
+
*
|
|
9
|
+
* rows: lib/line.js lineOf rows (GET /api/line), each with its product (ws). you: Set of '<ws>|<initiative>' that have a Your move row (a question
|
|
10
|
+
* to the PM, a check due). A row in Your move is marked "your move" here and not repeated on Today. Waiting for capacity is never stuck: it
|
|
11
|
+
* reads moving. "Can't tell" never moves an item and never raises a row. The UI says PMOS. Text from records goes through esc(). */
|
|
12
|
+
export const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
13
|
+
const plural = (n, a, b) => n + ' ' + (n === 1 ? a : b);
|
|
14
|
+
const cap1 = (s) => String(s || '').replace(/^[a-z]/, (c) => c.toUpperCase());
|
|
15
|
+
|
|
16
|
+
export const TABS = [['', 'All', 'all'], ['stuck', 'Stuck', 'stuck'], ['cant', 'Can’t tell', 'cant'], ['you', 'Your move', 'you']];
|
|
17
|
+
const STATE_WORD = { you: 'your move', stuck: 'stuck', cant: 'can’t tell', moving: 'moving' };
|
|
18
|
+
|
|
19
|
+
/** One row's state: your move first, then the line's flag. */
|
|
20
|
+
export function stateOf(r, you) {
|
|
21
|
+
if (you && you.has((r.ws || '') + '|' + r.id)) return 'you';
|
|
22
|
+
if (r.flag === 'stuck') return 'stuck';
|
|
23
|
+
if (r.flag === 'cant-tell') return 'cant';
|
|
24
|
+
return 'moving';
|
|
25
|
+
}
|
|
26
|
+
/** Days here: "day 6" with no number limit, "4 of 15" against one; '' when no record says. */
|
|
27
|
+
export function daysWord(r) {
|
|
28
|
+
if (r.daysThere == null) return r.quietDays != null ? 'quiet ' + plural(r.quietDays, 'day', 'days') : '';
|
|
29
|
+
return typeof r.limit === 'number' && r.limit > 0 ? r.daysThere + ' of ' + r.limit : 'day ' + r.daysThere;
|
|
30
|
+
}
|
|
31
|
+
export function lineModel(rows, o = {}) {
|
|
32
|
+
const you = o.you instanceof Set ? o.you : new Set(o.you || []);
|
|
33
|
+
const live = (rows || []).filter((r) => r && r.id && r.live);
|
|
34
|
+
const all = live.map((r) => ({ ...r, state: stateOf(r, you) }));
|
|
35
|
+
const counts = { all: all.length, stuck: all.filter((r) => r.state === 'stuck').length, cant: all.filter((r) => r.state === 'cant').length, you: all.filter((r) => r.state === 'you').length };
|
|
36
|
+
const tab = TABS.some(([k]) => k === o.tab) && (o.tab === '' || counts[o.tab]) ? o.tab : '';
|
|
37
|
+
const shown = tab ? all.filter((r) => r.state === tab) : all;
|
|
38
|
+
const by = new Map();
|
|
39
|
+
for (const r of shown) {
|
|
40
|
+
const st = r.station || { key: '', name: 'No station', n: 999 };
|
|
41
|
+
const k = (st.n == null ? 999 : st.n) + '|' + String(st.name || '').toLowerCase();
|
|
42
|
+
if (!by.has(k)) by.set(k, { key: k, name: st.name || 'No station', n: st.n == null ? 999 : st.n, rows: [] });
|
|
43
|
+
by.get(k).rows.push(r);
|
|
44
|
+
}
|
|
45
|
+
const groups = [...by.values()].sort((a, b) => a.n - b.n || a.name.localeCompare(b.name));
|
|
46
|
+
for (const g of groups) g.rows.sort((a, b) => String(a.title).localeCompare(String(b.title)));
|
|
47
|
+
return { groups, counts, tab, live: all.length };
|
|
48
|
+
}
|
|
49
|
+
/** The Line block. M: lineModel(). o: { name: the product's name, say: a line above the table (Where it stands) } */
|
|
50
|
+
export function lineHtml(M, o = {}) {
|
|
51
|
+
if (!M || !M.live) return `<section class="pm-block ln" aria-label="The line"><p class="pm-meta">No initiative is on a workflow yet, so the line is empty.</p></section>`;
|
|
52
|
+
const tabs = TABS.filter(([k, , c]) => k === '' || M.counts[c]).map(([k, n, c]) => `<button type="button" class="pm-tab${M.tab === k ? ' on' : ''}" role="tab" aria-selected="${M.tab === k}" data-line-tab="${k}">${esc(n)} <span class="pm-meta">${M.counts[c]}</span></button>`).join('');
|
|
53
|
+
const head = `<div class="ln-row ln-head" role="row"><span role="columnheader">Initiative</span><span role="columnheader">Days here</span><span role="columnheader">Still missing to finish</span><span role="columnheader">Next move</span><span role="columnheader">State</span></div>`;
|
|
54
|
+
const body = M.groups.map((g) => `<div class="ln-row pm-group" role="row"><span role="cell">${esc(g.name)} <span class="pm-meta">${g.rows.length}</span></span></div>`
|
|
55
|
+
+ g.rows.map((r) => `<div class="ln-row pm-li ln-${r.state}" role="row"><span role="cell"><button type="button" class="t" data-line-ini="${esc(r.id)}" data-line-ws="${esc(r.ws || '')}">${esc(r.title || r.id)}</button></span>`
|
|
56
|
+
+ `<span role="cell" class="pm-meta">${esc(daysWord(r))}</span><span role="cell">${esc((r.missing || []).join('; '))}</span><span role="cell">${esc(cap1(r.next || ''))}</span>`
|
|
57
|
+
+ `<span role="cell"><span class="pm-badge${r.state === 'stuck' ? ' alert' : ''}" title="${esc(r.why || '')}">${esc(STATE_WORD[r.state])}</span></span></div>`).join('')).join('');
|
|
58
|
+
return `<section class="pm-block list ln" aria-label="The line">${o.say ? `<p class="ln-say">${esc(o.say)}</p>` : ''}<div class="pm-tabs" role="tablist" aria-label="Show">${tabs}</div>`
|
|
59
|
+
+ `<div class="ln-t" role="table" aria-label="${esc((o.name ? o.name + ': ' : '') + 'initiatives by station')}">${head}${body}</div></section>`;
|
|
60
|
+
}
|
|
61
|
+
/** Where it stands, one sentence over the table. */
|
|
62
|
+
export function sayOf(M) {
|
|
63
|
+
if (!M || !M.live) return '';
|
|
64
|
+
const moving = M.live - M.counts.you - M.counts.stuck - M.counts.cant;
|
|
65
|
+
return [plural(M.live, 'initiative', 'initiatives') + ' on the line.', moving ? moving + (moving === 1 ? ' moves by itself.' : ' move by themselves.') : '',
|
|
66
|
+
M.counts.you ? M.counts.you + ' wait' + (M.counts.you === 1 ? 's' : '') + ' on you, already in Your move.' : '',
|
|
67
|
+
M.counts.stuck ? M.counts.stuck + ' stuck.' : '', M.counts.cant ? M.counts.cant + ' can’t be placed, so PMOS leaves ' + (M.counts.cant === 1 ? 'it' : 'them') + ' alone.' : ''].filter(Boolean).join(' ');
|
|
68
|
+
}
|
|
69
|
+
/** Today's dashed line. lines: [{ ws, rows, you: [initiative id] }]. null when nothing is on the line (zero is silence). */
|
|
70
|
+
export function dashModel(lines) {
|
|
71
|
+
let n = 0, stuck = 0, live = 0;
|
|
72
|
+
for (const L of lines || []) {
|
|
73
|
+
const you = new Set((L.you || []).map(String));
|
|
74
|
+
for (const r of L.rows || []) {
|
|
75
|
+
if (!r || !r.live) continue;
|
|
76
|
+
live++;
|
|
77
|
+
if (you.has(String(r.id))) continue;
|
|
78
|
+
n++; if (r.flag === 'stuck') stuck++;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!live) return null;
|
|
82
|
+
return { n, stuck, text: n + ' more move in the line by themselves · ' + (stuck ? stuck + ' stuck' : 'none stuck') };
|
|
83
|
+
}
|
|
84
|
+
export const LINE_HREF = '/premium-board.html?work=line';
|
|
85
|
+
export const dashHtml = (D) => (D ? `<a class="td-fold pm-fold ym-line" href="${LINE_HREF}" data-td="line">${esc(D.text)}</a>` : '');
|
|
@@ -1563,6 +1563,8 @@ const bkApi = () => ({
|
|
|
1563
1563
|
scope: () => (M.board.all ? (M.board.products || []).map((p) => ({ ws: p.ws, board: p.id || '', name: p.name })) : [{ ws: M.board.ws || '', board: M.board.id || '', name: M.board.product || M.board.name || '' }]),
|
|
1564
1564
|
// CLASSIC (lib/classic-board.js) is the test seam of the four Board views: Work and its Backlog switch are not there
|
|
1565
1565
|
post: pmPost, say, reload: () => load(), readonly: !!window.PMOS_READONLY || CLASSIC,
|
|
1566
|
+
// the Line tab (quiet-rows slice B): a row opens its initiative, as a row of Initiatives does
|
|
1567
|
+
openIni: (id, ws) => { const r = (M.rows || []).find((x) => x.id === id && x.track && (!ws || (x.ws || M.board.ws) === ws)); if (r) openIni(r); else say('Open ' + id + ' from Initiatives.'); },
|
|
1566
1568
|
// the sprint band (pm/bd-sprint.js): Read Jira again is the Board's own; "Make a home" opens New initiative with the theme's name
|
|
1567
1569
|
readJira: () => refreshJira(null),
|
|
1568
1570
|
newInitiative: async (name, from) => {
|