create-pmos 0.824.0 → 0.825.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 +78 -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/changelog.json +77 -12
- package/workspace/guide/cli.md +9 -0
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/settings-and-switches.md +2 -0
- package/workspace/lib/autonomy-cli.js +14 -2
- package/workspace/lib/connector-data.js +138 -0
- package/workspace/lib/connectors-cli.js +6 -0
- package/workspace/lib/does-alone.js +67 -0
- package/workspace/lib/mention-cli.js +36 -2
- package/workspace/lib/name-links.js +203 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-autonomy.js +9 -0
- package/workspace/lib/routes-connector-data.js +17 -0
- package/workspace/lib/routes-today-log.js +8 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/connector-data.js +47 -0
- package/workspace/public/pm/cozy-name-links.js +118 -0
- package/workspace/public/pm/cozy-settings.js +42 -7
- package/workspace/public/pm/cozy-today-app.js +26 -0
- package/workspace/public/pm/cozy-today-page.css +5 -0
- package/workspace/public/pm/cozy-today-view.js +8 -3
- package/workspace/public/pm/cozy-today.css +9 -0
- package/workspace/public/pm/home-chat.js +16 -1
- package/workspace/public/pm/home-hold.js +121 -0
- package/workspace/test-lists/connector-data.json +9 -0
- package/workspace/test-lists/does-alone.json +9 -0
- package/workspace/test-lists/hold-to-talk.json +9 -0
- package/workspace/test-lists/name-links.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.825.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,80 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.825.0",
|
|
38
|
+
"at": "2026-11-25T10:33:55.582Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1939,
|
|
43
|
+
"t": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
|
|
44
|
+
"s": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"i": "does-alone",
|
|
47
|
+
"try": {
|
|
48
|
+
"steps": [
|
|
49
|
+
"Open Today, then Settings (the gear) › How PMOS decides › What PMOS does alone.",
|
|
50
|
+
"Read the rows: each kind of change says what PMOS does and since when.",
|
|
51
|
+
"Press the arrow on Task names, then open Work and check a task name PMOS changed still has Undo."
|
|
52
|
+
],
|
|
53
|
+
"see": "One table: each kind of change says Does it, Undo or Asks you and since when, the always-ask rows have no button, and D106 opens the guide.",
|
|
54
|
+
"open": "/today.html"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"n": 1949,
|
|
59
|
+
"t": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
|
|
60
|
+
"s": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
|
|
61
|
+
"k": "new",
|
|
62
|
+
"h": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
|
|
63
|
+
"try": {
|
|
64
|
+
"steps": [
|
|
65
|
+
"Open Today",
|
|
66
|
+
"In the capture line type a line that names a person from People or a meeting you took notes in, for example 'Follow up on Azhar's notes…",
|
|
67
|
+
"Point at or tap the underlined name"
|
|
68
|
+
],
|
|
69
|
+
"see": "The names that match one record are underlined. A small card shows the record (a meeting's date, people and notes) with one press: Open the notes, Open the document, or Ask PMOS about the person. A…",
|
|
70
|
+
"open": "/today.html"
|
|
71
|
+
},
|
|
72
|
+
"i": "name-links"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"n": 1953,
|
|
76
|
+
"t": "What each connector reads and writes (job #1920, A150)",
|
|
77
|
+
"s": "What each connector reads and writes (job #1920, A150)",
|
|
78
|
+
"k": "new",
|
|
79
|
+
"h": "What each connector reads and writes (job #1920, A150)",
|
|
80
|
+
"try": {
|
|
81
|
+
"steps": [
|
|
82
|
+
"On Today, open Settings from the rail and go to Connectors.",
|
|
83
|
+
"Read the one line under Jira (or any connector you have).",
|
|
84
|
+
"Press the arrow on that row to open its page."
|
|
85
|
+
],
|
|
86
|
+
"see": "Each connected row says in one line what PMOS reads and writes. The page shows What PMOS reads, What PMOS writes and What leaves this computer, with a switch only where PMOS can really stop the read.",
|
|
87
|
+
"open": "/today.html"
|
|
88
|
+
},
|
|
89
|
+
"i": "connector-data"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"n": 1941,
|
|
93
|
+
"t": "Hold the phone chat mic to talk (job #1891, A13)",
|
|
94
|
+
"s": "Hold the phone chat mic to talk (job #1891, A13)",
|
|
95
|
+
"k": "new",
|
|
96
|
+
"h": "Hold the phone chat mic to talk (job #1891, A13)",
|
|
97
|
+
"try": {
|
|
98
|
+
"steps": [
|
|
99
|
+
"On a phone, open Today and its chat.",
|
|
100
|
+
"Press and hold the mic, say what to change (for example: move <one of your tasks> a day), and let go.",
|
|
101
|
+
"Press Undo under PMOS's answer, then hold again and slide left before letting go."
|
|
102
|
+
],
|
|
103
|
+
"see": "Your words show above the mic while you hold it; letting go sends them like typing, so the change is done with Undo (a question gets an answer); sliding left cancels and nothing is sent.",
|
|
104
|
+
"open": "/today.html"
|
|
105
|
+
},
|
|
106
|
+
"i": "hold-to-talk"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
36
110
|
{
|
|
37
111
|
"v": "0.824.0",
|
|
38
112
|
"at": "2026-11-25T09:50:46.868Z",
|
|
@@ -43,22 +117,14 @@
|
|
|
43
117
|
"t": "Job-graph lists report-variants, so main is green again",
|
|
44
118
|
"s": "Job-graph lists report-variants, so main is green again",
|
|
45
119
|
"k": "fix",
|
|
46
|
-
"i": "report-three-audiences"
|
|
47
|
-
"try": {
|
|
48
|
-
"steps": [
|
|
49
|
-
"On Today, ask the chat: Make the weekly report for executives, engineers and customers.",
|
|
50
|
-
"Open Work, find the weekly report and open the version for executives.",
|
|
51
|
-
"Compare a number and an initiative id with the draft."
|
|
52
|
-
],
|
|
53
|
-
"see": "Three versions sit beside the draft. Each one says who it is for, every number in it is in the draft, and it ends with the draft's sources.",
|
|
54
|
-
"open": "/today.html"
|
|
55
|
-
}
|
|
120
|
+
"i": "report-three-audiences"
|
|
56
121
|
},
|
|
57
122
|
{
|
|
58
123
|
"n": 1922,
|
|
59
124
|
"t": "Balance meter on Work's Initiatives and Backlog lists (job #1859, board BalanceDS)",
|
|
60
125
|
"s": "Balance meter on Work's Initiatives and Backlog lists (job #1859, board BalanceDS)",
|
|
61
126
|
"k": "new",
|
|
127
|
+
"i": "balance-meter",
|
|
62
128
|
"h": "Balance meter on Work's Initiatives and Backlog lists (job #1859, board BalanceDS)",
|
|
63
129
|
"try": {
|
|
64
130
|
"steps": [
|
|
@@ -68,8 +134,7 @@
|
|
|
68
134
|
],
|
|
69
135
|
"see": "On Work, the bar and its counts sit under each list header, largest first. A press shows only that kind, and a second press shows all of them again. A ✦ note shows only when one kind is over 60% of…",
|
|
70
136
|
"open": "/premium-board.html"
|
|
71
|
-
}
|
|
72
|
-
"i": "balance-meter"
|
|
137
|
+
}
|
|
73
138
|
}
|
|
74
139
|
]
|
|
75
140
|
},
|
|
@@ -484,19 +549,6 @@
|
|
|
484
549
|
"k": "fix"
|
|
485
550
|
}
|
|
486
551
|
]
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
"v": "0.795.0",
|
|
490
|
-
"at": "2026-11-24T19:57:25.188Z",
|
|
491
|
-
"f": 4,
|
|
492
|
-
"prs": [
|
|
493
|
-
{
|
|
494
|
-
"n": 1810,
|
|
495
|
-
"t": "A launch check with no tracker reading is \"not checked\", never \"ready\" (job #1799, A172)",
|
|
496
|
-
"s": "A launch check with no tracker reading is \"not checked\", never \"ready\" (job #1799, A172)",
|
|
497
|
-
"k": "fix"
|
|
498
|
-
}
|
|
499
|
-
]
|
|
500
552
|
}
|
|
501
553
|
]
|
|
502
554
|
}
|
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-25T10:33:51Z"}
|
|
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-25T10:33:51Z"}
|
|
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-25T10:33:51Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,78 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.825.0",
|
|
4
|
+
"at": "2026-11-25T10:33:55.582Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1939,
|
|
9
|
+
"t": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
|
|
10
|
+
"s": "Settings › What PMOS does alone, one read-only table of each kind of action (A513)",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"i": "does-alone",
|
|
13
|
+
"try": {
|
|
14
|
+
"steps": [
|
|
15
|
+
"Open Today, then Settings (the gear) › How PMOS decides › What PMOS does alone.",
|
|
16
|
+
"Read the rows: each kind of change says what PMOS does and since when.",
|
|
17
|
+
"Press the arrow on Task names, then open Work and check a task name PMOS changed still has Undo."
|
|
18
|
+
],
|
|
19
|
+
"see": "One table: each kind of change says Does it, Undo or Asks you and since when, the always-ask rows have no button, and D106 opens the guide.",
|
|
20
|
+
"open": "/today.html"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"n": 1949,
|
|
25
|
+
"t": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
|
|
26
|
+
"s": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
|
|
27
|
+
"k": "new",
|
|
28
|
+
"h": "Names in a Today line link to the person, meeting or document (job #1915, A536)",
|
|
29
|
+
"try": {
|
|
30
|
+
"steps": [
|
|
31
|
+
"Open Today",
|
|
32
|
+
"In the capture line type a line that names a person from People or a meeting you took notes in, for example 'Follow up on Azhar's notes…",
|
|
33
|
+
"Point at or tap the underlined name"
|
|
34
|
+
],
|
|
35
|
+
"see": "The names that match one record are underlined. A small card shows the record (a meeting's date, people and notes) with one press: Open the notes, Open the document, or Ask PMOS about the person. A…",
|
|
36
|
+
"open": "/today.html"
|
|
37
|
+
},
|
|
38
|
+
"i": "name-links"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"n": 1953,
|
|
42
|
+
"t": "What each connector reads and writes (job #1920, A150)",
|
|
43
|
+
"s": "What each connector reads and writes (job #1920, A150)",
|
|
44
|
+
"k": "new",
|
|
45
|
+
"h": "What each connector reads and writes (job #1920, A150)",
|
|
46
|
+
"try": {
|
|
47
|
+
"steps": [
|
|
48
|
+
"On Today, open Settings from the rail and go to Connectors.",
|
|
49
|
+
"Read the one line under Jira (or any connector you have).",
|
|
50
|
+
"Press the arrow on that row to open its page."
|
|
51
|
+
],
|
|
52
|
+
"see": "Each connected row says in one line what PMOS reads and writes. The page shows What PMOS reads, What PMOS writes and What leaves this computer, with a switch only where PMOS can really stop the read.",
|
|
53
|
+
"open": "/today.html"
|
|
54
|
+
},
|
|
55
|
+
"i": "connector-data"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"n": 1941,
|
|
59
|
+
"t": "Hold the phone chat mic to talk (job #1891, A13)",
|
|
60
|
+
"s": "Hold the phone chat mic to talk (job #1891, A13)",
|
|
61
|
+
"k": "new",
|
|
62
|
+
"h": "Hold the phone chat mic to talk (job #1891, A13)",
|
|
63
|
+
"try": {
|
|
64
|
+
"steps": [
|
|
65
|
+
"On a phone, open Today and its chat.",
|
|
66
|
+
"Press and hold the mic, say what to change (for example: move <one of your tasks> a day), and let go.",
|
|
67
|
+
"Press Undo under PMOS's answer, then hold again and slide left before letting go."
|
|
68
|
+
],
|
|
69
|
+
"see": "Your words show above the mic while you hold it; letting go sends them like typing, so the change is done with Undo (a question gets an answer); sliding left cancels and nothing is sent.",
|
|
70
|
+
"open": "/today.html"
|
|
71
|
+
},
|
|
72
|
+
"i": "hold-to-talk"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
2
76
|
{
|
|
3
77
|
"v": "0.824.0",
|
|
4
78
|
"at": "2026-11-25T09:50:46.868Z",
|
|
@@ -9,22 +83,14 @@
|
|
|
9
83
|
"t": "Job-graph lists report-variants, so main is green again",
|
|
10
84
|
"s": "Job-graph lists report-variants, so main is green again",
|
|
11
85
|
"k": "fix",
|
|
12
|
-
"i": "report-three-audiences"
|
|
13
|
-
"try": {
|
|
14
|
-
"steps": [
|
|
15
|
-
"On Today, ask the chat: Make the weekly report for executives, engineers and customers.",
|
|
16
|
-
"Open Work, find the weekly report and open the version for executives.",
|
|
17
|
-
"Compare a number and an initiative id with the draft."
|
|
18
|
-
],
|
|
19
|
-
"see": "Three versions sit beside the draft. Each one says who it is for, every number in it is in the draft, and it ends with the draft's sources.",
|
|
20
|
-
"open": "/today.html"
|
|
21
|
-
}
|
|
86
|
+
"i": "report-three-audiences"
|
|
22
87
|
},
|
|
23
88
|
{
|
|
24
89
|
"n": 1922,
|
|
25
90
|
"t": "Balance meter on Work's Initiatives and Backlog lists (job #1859, board BalanceDS)",
|
|
26
91
|
"s": "Balance meter on Work's Initiatives and Backlog lists (job #1859, board BalanceDS)",
|
|
27
92
|
"k": "new",
|
|
93
|
+
"i": "balance-meter",
|
|
28
94
|
"h": "Balance meter on Work's Initiatives and Backlog lists (job #1859, board BalanceDS)",
|
|
29
95
|
"try": {
|
|
30
96
|
"steps": [
|
|
@@ -34,8 +100,7 @@
|
|
|
34
100
|
],
|
|
35
101
|
"see": "On Work, the bar and its counts sit under each list header, largest first. A press shows only that kind, and a second press shows all of them again. A ✦ note shows only when one kind is over 60% of…",
|
|
36
102
|
"open": "/premium-board.html"
|
|
37
|
-
}
|
|
38
|
-
"i": "balance-meter"
|
|
103
|
+
}
|
|
39
104
|
}
|
|
40
105
|
]
|
|
41
106
|
},
|
package/workspace/guide/cli.md
CHANGED
|
@@ -94,6 +94,8 @@ These commands post nothing:
|
|
|
94
94
|
- `pmos mention landed <id> --text "<Samuel’s tag landed.>"` says that the promise landed.
|
|
95
95
|
- `pmos mention answered <id> --who "<name>" --text "<their line>" [--on <ISO>]` says that someone else answered and the asker accepted it. The ask leaves Today into PMOS handled, with the line quoted and Undo.
|
|
96
96
|
- `pmos mention looks <id> --who "<name>" --text "<their line>" [--on <ISO>]` says that someone else may have answered, with their line quoted. Today shows it under the ask with ✓ ✕; nothing closes until you confirm.
|
|
97
|
+
- `pmos mention names "<line>"` prints which names in a line link, and to which record: a person in People, a meeting with notes, or a document in the Library. A name links only when it matches one record. Today draws the same links.
|
|
98
|
+
- `pmos mention plain "<name>"` keeps a name plain: it never links. `--undo` lets it link again.
|
|
97
99
|
|
|
98
100
|
### pmos lead: PMOS's leads in popups
|
|
99
101
|
|
|
@@ -244,6 +246,7 @@ Before you share a spec, a strategy, a roadmap or a report, PMOS reads it as a s
|
|
|
244
246
|
### pmos autonomy: what agents applied by themselves
|
|
245
247
|
|
|
246
248
|
- `pmos autonomy status` lists what agents applied in the last 14 days (D106), each with its id, and the jobs that went back to propose.
|
|
249
|
+
- `pmos autonomy alone` lists what PMOS does alone: each kind of action, what PMOS does now, since when, and the decision (D106). It is the same table as Settings › How PMOS decides › What PMOS does alone, and it only reads. Add `--json` for the rows.
|
|
247
250
|
- `pmos autonomy restore <job>` ends a job's 7 days back at propose early.
|
|
248
251
|
- `pmos autonomy check <ref> --verdict PASS|FAIL --why "<one line>"` records the grade of one change PMOS made by itself. Only the check run that PMOS starts for that change can use it. A FAIL counts like an Undo.
|
|
249
252
|
- Undo a change of the Initiative Driver with `pmos driver undo <proposal>`. A ✦ change is undone on its initiative's ✦.
|
|
@@ -1109,6 +1112,12 @@ Before the tickets of an initiative go to the engineers, `pmos ready` shows whic
|
|
|
1109
1112
|
- `pmos refresh since <source>` says **ask first** or **read in full**, with the reason and the time of the last read. `<source>` is calendar, jira, mywork or tools.
|
|
1110
1113
|
- `pmos refresh same <source>` keeps the stored read as it is and moves its read time to now. For Your tools, `--only slack,mail` confirms only those tools. It refuses when a read in full is due.
|
|
1111
1114
|
|
|
1115
|
+
### pmos connectors: what each connector reads and writes
|
|
1116
|
+
|
|
1117
|
+
- `pmos connectors data` lists each connector PMOS uses, with one line on what PMOS reads and writes through it. It only reads.
|
|
1118
|
+
- `pmos connectors data <connector>` prints the connector's three parts: what PMOS reads, what PMOS writes and what leaves this computer. Add `--json` for a script. Settings › Connectors shows the same, from the same list.
|
|
1119
|
+
- A read with a switch is turned on or off with `pmos proactive settings --brief-source NAME=on|off`, the same switch as on the page. A read with no switch says "Read while connected". Writes are standing rules, not switches.
|
|
1120
|
+
|
|
1112
1121
|
## Background work and schedules
|
|
1113
1122
|
|
|
1114
1123
|
### pmos proactive: Today and the proactive engine
|
package/workspace/guide/home.md
CHANGED
|
@@ -243,6 +243,7 @@ There is no My work page. The list on Today is your list:
|
|
|
243
243
|
- Type `/` to see the commands. PMOS's own come first, each with its name and one line: the ones for the page you are on, then the others (`/why`, `/rehearse`, `/missed`, `/critic` and more), then one `/pmos:` command for each button a PMOS card has (`/pmos:task-set` moves a task's dates; the list comes from the card catalog). Pick one and its arguments show above the box, for example `/rehearse <task> <days>`. When you send it, PMOS runs the matching `pmos` command and answers from what it prints. The session's own commands (`/compact`, `/model` and the rest) show once you type a letter of their name, then the commands and skills in the workspace's `.claude` folder and in your own `~/.claude` folder.
|
|
244
244
|
- Type in plain words and PMOS suggests the command they ask for, above the box: "what if the API task slips a week" suggests `/rehearse`. Press Tab to take it, or keep typing to ignore it. The suggestion is matched on this computer. When nothing matches and **Suggest commands** is on in Settings › Jev and Laya, Jev is asked which command fits.
|
|
245
245
|
- The mic types what you say into the box. **Stop** keeps the words, and **Discard** puts the box back. Both end listening at once.
|
|
246
|
+
- **Hold to talk, on a phone.** Press and hold the mic in the chat. Your words show while you talk. Let go to send them, the same as typed text. Slide left before you let go to cancel, and the box goes back as it was. If PMOS heard no words, nothing is sent. A short tap opens the **Speak to PMOS** sheet, as before.
|
|
246
247
|
- When Claude Code asks whether to trust the folder of a new chat, the chat shows the ask as a card: **Trust this folder** or **No, end the session**. Your first message waits until you answer, for up to 15 minutes, and is then sent. It is never typed into the question.
|
|
247
248
|
|
|
248
249
|
## Documents
|
|
@@ -56,6 +56,8 @@ PMOS picks the way by itself. A new kind is **Show me** until you keep 3 of its
|
|
|
56
56
|
|
|
57
57
|
When PMOS sees a pattern, one suggestion opens the section, with **Why**, **PMOS will**, **What changes** and **Based on**. It comes only from real counts: a kind PMOS made at least 5 times and you never undid can go **Quietly**; a kind you set to **Quietly** and then undid twice can go **Ask first**. ✓ sets the way, ✕ hides that suggestion on this computer, and the pencil takes you to the kind's own row.
|
|
58
58
|
|
|
59
|
+
**What PMOS does alone** is the first row of the section. Its arrow opens one read-only table with every kind of action. Each row says what PMOS does now (**Does it, Undo**, **Does it and shows you, Undo**, **Asks you**, or **Once a day, in one batch** for what others see), since when (auto, you set it, asks until a date after two Undos, or always), and the decision behind it: **D106** opens the guide page that explains it. The arrow on a kind takes you back to its way, where you change it. The rows that always ask have no arrow. One ✦ line says how many times this week PMOS went back to asking by itself after your Undos. The chat reads the same table with `pmos autonomy alone`.
|
|
60
|
+
|
|
59
61
|
**Always yours** lists the calls PMOS never makes by itself, whatever it has learned: a new request, a verdict on an outcome, a message to people, a move the team reads in Jira or on Work, and a merge, a delete or spend.
|
|
60
62
|
|
|
61
63
|
**Lessons** lists what PMOS got wrong and what it changed, newest first, from the Lessons of every product. The list is folded: press **See the lessons** to open it. The first line says what went wrong; the next says what changed.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* autonomy-cli.js — `pmos autonomy`: what agents do by themselves (D106, lib/autonomy.js).
|
|
3
3
|
*
|
|
4
4
|
* pmos autonomy status [--json] [--root <dir>] the changes applied by agents in the last 14 days, and the jobs back to propose
|
|
5
|
+
* pmos autonomy alone [--json] [--root <dir>] what PMOS does alone, one row per kind of action (lib/does-alone.js; read-only)
|
|
5
6
|
* pmos autonomy restore <job> [--product <ws>] end a job's demotion early (PM or agent, D98)
|
|
6
7
|
* pmos autonomy check <ref> --verdict PASS|FAIL --why "<one line>" the verifier's grade of one applied change (batch 29 item 9).
|
|
7
8
|
* Only inside the check run the server started for that change: PMOS_CHECK_REF and PMOS_CHECK_DIR pin the change and its
|
|
@@ -14,10 +15,11 @@ const A = require('./autonomy.js');
|
|
|
14
15
|
const D = require('./driver.js');
|
|
15
16
|
const actorLib = require('./actor.js');
|
|
16
17
|
|
|
17
|
-
const COMMANDS = { autonomy: ['status', 'restore', 'check'] };
|
|
18
|
+
const COMMANDS = { autonomy: ['status', 'alone', 'restore', 'check'] };
|
|
18
19
|
const USAGE = [
|
|
19
|
-
'usage: pmos autonomy status|restore|check — what agents do by themselves (class A and B, with Undo)',
|
|
20
|
+
'usage: pmos autonomy status|alone|restore|check — what agents do by themselves (class A and B, with Undo)',
|
|
20
21
|
' pmos autonomy status [--json] the changes agents applied in the last 14 days, and the jobs back to propose',
|
|
22
|
+
' pmos autonomy alone [--json] what PMOS does alone: each kind of action, what PMOS does and since when',
|
|
21
23
|
' pmos autonomy restore <job> [--product <ws>] end a job\'s demotion early',
|
|
22
24
|
' pmos autonomy check <ref> --verdict PASS|FAIL --why "<one line>" inside a check run only: the grade of the change it checks',
|
|
23
25
|
'Class C (a message to a person, a Jira move others see, a merge into a product repository, a delete, spend) always waits for you.',
|
|
@@ -53,6 +55,16 @@ function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), env = pro
|
|
|
53
55
|
for (const a of done) say(` ${a.at.slice(0, 16).replace('T', ' ')} · ${a.job} · class ${a.cls || '?'} · ${a.ref} — ${a.title}`);
|
|
54
56
|
return 0;
|
|
55
57
|
}
|
|
58
|
+
if (verb === 'alone') {
|
|
59
|
+
let settingsDir = null; try { settingsDir = require('./state-root.js').defaultRoot({ env }); } catch { settingsDir = null; }
|
|
60
|
+
const r = require('./does-alone.js').aloneOf([dir], { now, env, settingsDir });
|
|
61
|
+
if (flag(args, 'json')) { say(JSON.stringify(r)); return 0; }
|
|
62
|
+
if (r.off) say(`PMOS does nothing alone now: ${r.off}.`);
|
|
63
|
+
for (const x of r.rows) say(` ${x.what} · ${x.pmos} · ${x.since}`);
|
|
64
|
+
if (r.line) say('✦ ' + r.line);
|
|
65
|
+
say(`Decision: ${require('./does-alone.js').DECISION.id}. Change a kind's way in Settings › How PMOS decides.`);
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
56
68
|
const job = args[1] && !args[1].startsWith('--') ? args[1] : null;
|
|
57
69
|
if (!job) { say('usage: pmos autonomy restore <job> [--product <ws>]'); return 2; }
|
|
58
70
|
const a = actorLib.fromCli({ isTTY: isTTY === undefined ? !!(process.stdin.isTTY && process.stdout.isTTY) : isTTY, env });
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* connector-data.js — what each connector reads and writes (initiative connector-data, idea A150; board ConnDataDS). THE ONE LIST that
|
|
3
|
+
* Settings › Connectors (pm/connector-data.js), `pmos connectors data` and the drift test (connector-data.test.js) read.
|
|
4
|
+
*
|
|
5
|
+
* REGISTRY one entry per connector PMOS uses: { id, name, match, reads[], writes[], line }
|
|
6
|
+
* reads[] { id, what, detail, switch, skills } switch: the brief source in Settings that stops the read (proactive.js
|
|
7
|
+
* BRIEF_SOURCES), or null when PMOS cannot stop it yet: then the page says "Read while connected" and shows no switch.
|
|
8
|
+
* writes[] { what, skills } the standing rules; never a switch. An entry that writes nothing has [].
|
|
9
|
+
* NOT_CONNECTORS brief sources that are not connectors (your websites, the open web)
|
|
10
|
+
* byId(id) · ofLabel(label) the entry for a source id, or for a connected connector's name ("claude.ai Atlassian MCP" → jira)
|
|
11
|
+
* toolService(tool) the entry id a connector tool belongs to (mcp__claude_ai_Gmail__get_thread → mail), or null
|
|
12
|
+
* leaves(entry) the "What leaves this computer" text: AI work goes through the person's own AI account
|
|
13
|
+
* view(entry, { settings, read, connected }) → what the page and the command show, with each switch's state and the last read
|
|
14
|
+
* viewAll(rt, connectedNames) → every entry's view, for GET /api/connector-data
|
|
15
|
+
* textOf(view) · lines(views) the command's plain text
|
|
16
|
+
*
|
|
17
|
+
* Plain words only (done test D1): no tool name, no field name. When a skill starts reading or writing through a connector, add it here;
|
|
18
|
+
* the test fails until you do.
|
|
19
|
+
*/
|
|
20
|
+
const SEP = ' · ';
|
|
21
|
+
|
|
22
|
+
const REGISTRY = Object.freeze([
|
|
23
|
+
{ id: 'jira', name: 'Jira', match: /jira|atlassian/i, line: "Reads your initiatives' tasks · writes only what you move or approve",
|
|
24
|
+
reads: [
|
|
25
|
+
{ id: 'tasks', what: 'Tasks of your initiatives', detail: 'title, status, sprint and subtasks · for Work and This sprint', switch: null, skills: ['jira-sync'] },
|
|
26
|
+
{ id: 'mine', what: 'Open tickets assigned to you', detail: 'with their comments and links · for My work', switch: null, skills: ['my-work-read'] },
|
|
27
|
+
{ id: 'mentions', what: 'Tickets and comments that mention you', detail: 'who asked, where, and the link · for the Briefing and Mentions', switch: 'jira', skills: ['sources-read'] },
|
|
28
|
+
],
|
|
29
|
+
writes: [
|
|
30
|
+
{ what: 'Status, only for a ticket you move in PMOS.', skills: ['jira-move'] },
|
|
31
|
+
{ what: 'Epic and acceptance criteria, only on tickets assigned to you, after you approve them.', skills: ['jira-epic', 'jira-criteria'] },
|
|
32
|
+
{ what: 'New tickets and their edits, only the ones you select and send.', skills: ['jira-push'] },
|
|
33
|
+
] },
|
|
34
|
+
{ id: 'confluence', name: 'Confluence', match: /confluence|atlassian/i, line: 'Reads pages your initiatives link · writes nothing',
|
|
35
|
+
reads: [{ id: 'pages', what: 'Pages your initiatives link, and pages that mention you', detail: 'title, who changed it, and the link · for the Briefing', switch: 'confluence', skills: ['sources-read'] }],
|
|
36
|
+
writes: [] },
|
|
37
|
+
{ id: 'slack', name: 'Slack', match: /slack/i, line: 'Reads threads that mention you · writes nothing',
|
|
38
|
+
reads: [{ id: 'mentions', what: 'Threads that mention you', detail: 'who asked, where, and the link · for the Briefing and Mentions', switch: 'slack', skills: ['sources-read'] }],
|
|
39
|
+
writes: [] },
|
|
40
|
+
{ id: 'calendar', name: 'Google Calendar', match: /calendar/i, line: 'Reads your meetings · writes nothing',
|
|
41
|
+
reads: [{ id: 'meetings', what: 'Your meetings', detail: 'title, time and who comes, today and the next 14 days · for Today and Events', switch: 'calendar', skills: ['calendar-sync'] }],
|
|
42
|
+
writes: [] },
|
|
43
|
+
{ id: 'mail', name: 'Mail', match: /gmail|outlook|\bmail\b/i, line: 'Reads subjects of mail that waits on you · writes nothing',
|
|
44
|
+
reads: [{ id: 'waiting', what: 'Mail that waits on you', detail: 'subject and sender only; a message is never copied · for the Briefing', switch: 'mail', skills: ['sources-read'] }],
|
|
45
|
+
writes: [] },
|
|
46
|
+
{ id: 'wispr', name: 'Wispr Flow', match: /wispr/i, line: 'Reads your meeting notes · writes nothing',
|
|
47
|
+
reads: [{ id: 'notes', what: "Today's and yesterday's meeting notes", detail: 'what was decided and what is still open · for the Briefing', switch: 'wispr', skills: ['sources-read'] }],
|
|
48
|
+
writes: [] },
|
|
49
|
+
{ id: 'github', name: 'GitHub', match: /github/i, line: 'Reads pull requests that wait on you · writes nothing',
|
|
50
|
+
reads: [{ id: 'waiting', what: 'Pull requests and issues that wait on you', detail: 'reviews asked of you, failed checks, issues assigned to you · for the Briefing', switch: 'github', skills: ['sources-read'] }],
|
|
51
|
+
writes: [] },
|
|
52
|
+
{ id: 'drive', name: 'Google Drive', match: /drive/i, line: 'Reads files shared with you · writes nothing',
|
|
53
|
+
reads: [{ id: 'files', what: 'Files shared with you or changed', detail: 'name, who changed it, and the link · for the Briefing', switch: 'drive', skills: ['sources-read'] }],
|
|
54
|
+
writes: [] },
|
|
55
|
+
{ id: 'figma', name: 'Figma', match: /figma/i, line: 'Reads design files that ask for you · writes nothing',
|
|
56
|
+
reads: [{ id: 'files', what: 'Files you own or were asked to look at', detail: 'new comments and the link · for the Briefing', switch: 'figma', skills: ['sources-read'] }],
|
|
57
|
+
writes: [] },
|
|
58
|
+
].map((e) => Object.freeze({ ...e, reads: Object.freeze(e.reads.map((r) => Object.freeze(r))), writes: Object.freeze(e.writes.map((w) => Object.freeze(w))) })));
|
|
59
|
+
|
|
60
|
+
const NOT_CONNECTORS = Object.freeze(['website', 'web']);
|
|
61
|
+
const BY_ID = new Map(REGISTRY.map((e) => [e.id, e]));
|
|
62
|
+
const byId = (id) => BY_ID.get(String(id || '')) || null;
|
|
63
|
+
const labelOf = (name) => String(name || '').replace(/^claude\.ai\s+/i, '').trim();
|
|
64
|
+
/** The entry for a connected connector's name. Atlassian backs Jira and Confluence: the first match is Jira. */
|
|
65
|
+
const ofLabel = (name) => REGISTRY.find((e) => e.match.test(labelOf(name))) || null;
|
|
66
|
+
/** Every entry a connector name backs (Atlassian → Jira and Confluence). */
|
|
67
|
+
const allOfLabel = (name) => REGISTRY.filter((e) => e.match.test(labelOf(name)));
|
|
68
|
+
|
|
69
|
+
// A connector tool's server part (mcp__claude_ai_<server>__<tool>) → the entry. Atlassian tools that name Confluence are Confluence's.
|
|
70
|
+
const SERVERS = [[/^Atlassian(_MCP)?$/i, (t) => (/confluence/i.test(t) ? 'confluence' : 'jira')], [/slack/i, () => 'slack'], [/calendar/i, () => 'calendar'],
|
|
71
|
+
[/gmail|outlook/i, () => 'mail'], [/drive/i, () => 'drive'], [/figma/i, () => 'figma'], [/github/i, () => 'github'], [/wispr/i, () => 'wispr']];
|
|
72
|
+
function toolService(tool) {
|
|
73
|
+
const m = /^mcp__claude_ai_(.+?)__(.+)$/.exec(String(tool || ''));
|
|
74
|
+
if (!m) return null;
|
|
75
|
+
const hit = SERVERS.find(([re]) => re.test(m[1]));
|
|
76
|
+
return hit ? hit[1](m[2]) : null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const leaves = (e) => `PMOS reads ${e.name} through the connector in your own AI account and keeps its copy on this computer, in PMOS's own folder. `
|
|
80
|
+
+ 'When PMOS writes a summary or a suggestion from it, that text goes through your own AI account. Nothing goes to the PMOS makers, and there is no telemetry.';
|
|
81
|
+
|
|
82
|
+
/** What the page and the command show for one entry. settings: Settings (briefSources); read: the stored read (lib/source-reads.js) or null. */
|
|
83
|
+
function view(e, { settings = null, read = null, connected = true } = {}) {
|
|
84
|
+
const S = settings || require('./proactive.js').normalizeSettings({}).settings; // no saved Settings: the defaults PMOS uses
|
|
85
|
+
const on = (S && S.briefSources) || {};
|
|
86
|
+
const items = read && Array.isArray(read.items) ? read.items.length : null;
|
|
87
|
+
return {
|
|
88
|
+
id: e.id, name: e.name, line: e.line, match: e.match.source, connected: !!connected,
|
|
89
|
+
reads: e.reads.map((r) => ({ id: r.id, what: r.what, detail: r.detail, switch: r.switch, on: r.switch ? on[r.switch] === true : true })),
|
|
90
|
+
writes: e.writes.map((w) => w.what),
|
|
91
|
+
leaves: leaves(e),
|
|
92
|
+
lastRead: read && read.read_at ? { at: read.read_at, items } : null,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Every entry's view for the runtime folder `rt`. connectedNames: the connectors the session has; an entry no name backs is not connected. */
|
|
97
|
+
function viewAll(rt, connectedNames) {
|
|
98
|
+
// Settings as /api/proactive/settings saves them (<runtime>/proactive-settings.json), normalised like routes-mentions.js reads them
|
|
99
|
+
let settings = null;
|
|
100
|
+
try { const n = require('./proactive.js').normalizeSettings(JSON.parse(require('fs').readFileSync(require('path').join(rt, 'proactive-settings.json'), 'utf8'))); settings = n.ok ? n.settings : null; } catch { settings = null; }
|
|
101
|
+
const SR = require('./source-reads.js');
|
|
102
|
+
const names = Array.isArray(connectedNames) ? connectedNames : null;
|
|
103
|
+
const conn = names ? new Set(names.flatMap((n) => allOfLabel(n).map((e) => e.id))) : null;
|
|
104
|
+
return REGISTRY.map((e) => view(e, { settings, read: SR.SOURCES.includes(e.id) ? SR.read(rt, e.id) : null, connected: conn ? conn.has(e.id) : true }));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function textOf(v) {
|
|
108
|
+
const out = [v.name + (v.lastRead ? ` (last read ${v.lastRead.at})` : ''), '', 'What PMOS reads'];
|
|
109
|
+
for (const r of v.reads) out.push(`- ${r.what}: ${r.detail}. ${r.switch ? (r.on ? 'On' : 'Off') + ` (pmos proactive settings --brief-source ${r.switch}=on|off)` : 'Read while connected.'}`);
|
|
110
|
+
out.push('', 'What PMOS writes');
|
|
111
|
+
if (!v.writes.length) out.push('- Nothing.'); else for (const w of v.writes) out.push('- ' + w);
|
|
112
|
+
out.push('', 'What leaves this computer', v.leaves);
|
|
113
|
+
return out.join('\n');
|
|
114
|
+
}
|
|
115
|
+
const lines = (views) => views.map((v) => `${v.id.padEnd(11)}${v.name}: ${v.line}${v.connected ? '' : SEP + 'not connected'}`).join('\n');
|
|
116
|
+
|
|
117
|
+
const USAGE = 'pmos connectors data [<connector>] [--json] what PMOS reads and writes through each connector (read only). '
|
|
118
|
+
+ 'A read switch: pmos proactive settings --brief-source NAME=on|off. Connectors: ' + REGISTRY.map((e) => e.id).join(', ');
|
|
119
|
+
|
|
120
|
+
/** `pmos connectors data [<id>] [--json]`. call(method, path) reaches the running server; without one the list prints with no switch state. */
|
|
121
|
+
async function run(argv, { say = console.log, call = async () => null } = {}) {
|
|
122
|
+
const args = argv[0] === 'connectors' ? argv.slice(1) : argv;
|
|
123
|
+
const json = args.includes('--json'), rest = args.filter((a) => a !== '--json');
|
|
124
|
+
if (rest[0] !== 'data' || rest.length > 2) { say(USAGE); return rest[0] === 'help' || !rest.length ? 0 : 2; }
|
|
125
|
+
const id = rest[1];
|
|
126
|
+
if (id && !byId(id)) { say(`no connector "${id}" — one of ${REGISTRY.map((e) => e.id).join(', ')}`); return 1; }
|
|
127
|
+
const r = await call('GET', '/api/connector-data').catch(() => null);
|
|
128
|
+
const views = r && r.ok && Array.isArray(r.connectors) ? r.connectors : REGISTRY.map((e) => view(e));
|
|
129
|
+
const pick = id ? views.filter((v) => v.id === id) : views;
|
|
130
|
+
if (json) { say(JSON.stringify(id ? pick[0] : pick, null, 2)); return 0; }
|
|
131
|
+
if (!(r && r.ok)) say('(No workspace server runs, so the switches show their defaults and no last read.)');
|
|
132
|
+
say(id ? textOf(pick[0]) : lines(pick));
|
|
133
|
+
return 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const COMMANDS = Object.freeze({ connectors: ['data'] });
|
|
137
|
+
|
|
138
|
+
module.exports = { COMMANDS, REGISTRY, NOT_CONNECTORS, byId, ofLabel, allOfLabel, toolService, leaves, view, viewAll, textOf, lines, run, USAGE };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* connectors-cli.js — `pmos connectors data [<connector>] [--json]` (initiative connector-data, A150): the verb module lib/pmos-verbs.js
|
|
3
|
+
* runs. The list, the views and the text are lib/connector-data.js, the one list Settings › Connectors reads too. */
|
|
4
|
+
const CD = require('./connector-data.js');
|
|
5
|
+
|
|
6
|
+
module.exports = { run: CD.run, COMMANDS: CD.COMMANDS, USAGE: CD.USAGE };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* does-alone.js — one page: what PMOS may do alone (initiative does-alone, job #1890, idea A513; board BatchPagesDS panel 2, agreed
|
|
3
|
+
* 2026-11-25; done test planning/done-tests/does-alone.md).
|
|
4
|
+
*
|
|
5
|
+
* WHAT IT IS. A read-only list of today's rules, one row per kind of action, in plain words: what PMOS does now, since when, and the
|
|
6
|
+
* decision behind it. The kinds and their ways are lib/autonomy.js's own (KIND_LIST, kindsOf, the PM's claude.ways), so this page and
|
|
7
|
+
* Settings › How PMOS decides never disagree. Then the fixed rows: what others see waits for the daily press, and the calls that always
|
|
8
|
+
* ask. Nothing here is set: a kind's way is changed in How PMOS decides (pm/cozy-settings.js).
|
|
9
|
+
*
|
|
10
|
+
* FIXED · DECISION · pmosOf(way) PURE · sinceOf(k) PURE · rowsOf(kinds, { off }) PURE → [row] · stopsOf(lines, { now }) PURE → [kind label]
|
|
11
|
+
* lineOf(stops) PURE → the ✦ line | null · aloneOf(dirs, { now, env, settingsDir }) → { ok, off, rows, stops, line } READ-ONLY
|
|
12
|
+
* row: { key, what, pmos, since, fixed, decision: { id, page } }
|
|
13
|
+
*
|
|
14
|
+
* It writes nothing: no ledger line, no setting. GET /api/autonomy/alone (lib/routes-autonomy.js) and `pmos autonomy alone` read it. */
|
|
15
|
+
const A = require('./autonomy.js');
|
|
16
|
+
|
|
17
|
+
const DAY = 86400000;
|
|
18
|
+
const DECISION = Object.freeze({ id: 'D106', page: 'agent-capabilities' }); // Full autonomy now (2026-11-08): the guide page explains it
|
|
19
|
+
const FIXED = Object.freeze([
|
|
20
|
+
Object.freeze({ key: 'others', what: 'Anything others see: stages and dates in Jira or on Work', pmos: 'Once a day, in one batch' }),
|
|
21
|
+
Object.freeze({ key: 'sends', what: 'Messages to people, Jira writes, merges, deletes and spend', pmos: 'Asks you' }),
|
|
22
|
+
Object.freeze({ key: 'calls', what: 'Starting a new request, and saying if an outcome worked', pmos: 'Asks you' }),
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
/** PURE. What PMOS does for a way. */
|
|
26
|
+
const pmosOf = (way) => (way === 'quiet' ? 'Does it, Undo' : way === 'show' ? 'Does it and shows you, Undo' : 'Asks you');
|
|
27
|
+
const dayOf = (iso) => { const t = Date.parse(iso || ''); return Number.isFinite(t) ? new Date(t).toLocaleDateString('en-GB', { day: 'numeric', month: 'short', timeZone: 'UTC' }) : ''; };
|
|
28
|
+
/** PURE. Since when: the PM's way, a demotion's end, or the automatic way. */
|
|
29
|
+
const sinceOf = (k) => (k.set ? 'you set it' : k.until ? 'asks until ' + dayOf(k.until) : 'auto');
|
|
30
|
+
|
|
31
|
+
/** PURE. One row per kind (KIND_LIST order), its way from kindsOf when it has one, then the fixed rows. off: every row asks. */
|
|
32
|
+
function rowsOf(kinds = [], { off = null } = {}) {
|
|
33
|
+
const by = new Map((kinds || []).map((k) => [k.kind, k]));
|
|
34
|
+
const rows = A.KIND_LIST.map((x) => {
|
|
35
|
+
const k = by.get(x.key) || { kind: x.key, set: null, until: null, way: A.autoWay({ kept: 0, demoted: false }) };
|
|
36
|
+
return { key: x.key, what: x.label, pmos: off ? 'Asks you' : pmosOf(k.way), since: off ? 'switched off' : sinceOf(k), fixed: false, decision: DECISION };
|
|
37
|
+
});
|
|
38
|
+
return [...rows, ...FIXED.map((f) => ({ key: f.key, what: f.what, pmos: f.pmos, since: 'always', fixed: true, decision: DECISION }))];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** PURE. The kinds PMOS went back to asking for by itself in the last 7 days (a demote line), one entry per line, newest first. */
|
|
42
|
+
function stopsOf(lines = [], { now } = {}) {
|
|
43
|
+
const t = now == null ? Date.now() : now;
|
|
44
|
+
return (lines || []).filter((l) => l && l.ev === 'demote' && t - Date.parse(l.at) <= 7 * DAY && t >= Date.parse(l.at))
|
|
45
|
+
.sort((a, b) => String(b.at).localeCompare(String(a.at)))
|
|
46
|
+
.map((l) => { const kk = A.kindOf(l.job); const x = A.KIND_LIST.find((y) => y.key === kk); return x ? x.label : String(l.job); });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** PURE. The ✦ line, or null (zero is silence). */
|
|
50
|
+
function lineOf(stops = []) {
|
|
51
|
+
if (!stops.length) return null;
|
|
52
|
+
const names = [...new Set(stops)];
|
|
53
|
+
return `PMOS went back to asking by itself ${stops.length === 1 ? 'once' : stops.length + ' times'} this week, after your Undos (${names.slice(0, 3).join(', ')}${names.length > 3 ? ' and ' + (names.length - 3) + ' more' : ''}).`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** READ-ONLY. The page over the given state folders. */
|
|
57
|
+
function aloneOf(dirs = [], { now, env = process.env, settingsDir = null } = {}) {
|
|
58
|
+
const off = A.killed({ env, settingsDir });
|
|
59
|
+
const kinds = A.kindsOf(dirs, { now, settingsDir });
|
|
60
|
+
const set = A.waysSet(settingsDir);
|
|
61
|
+
// kindsOf lists only the kinds with a change or a set way; a set way with no change is in it already, so the rest are automatic
|
|
62
|
+
for (const [kk, w] of Object.entries(set)) if (!kinds.some((k) => k.kind === kk)) kinds.push({ kind: kk, set: w, way: w, until: null });
|
|
63
|
+
const stops = stopsOf((dirs || []).flatMap((d) => A.read(d)), { now });
|
|
64
|
+
return { ok: true, off: off || null, rows: rowsOf(kinds, { off }), stops, line: off ? null : lineOf(stops) };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
module.exports = { FIXED, DECISION, pmosOf, sinceOf, rowsOf, stopsOf, lineOf, aloneOf };
|