create-pmos 0.785.0 → 0.787.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 +68 -27
- 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 +67 -0
- package/workspace/guide/cli.md +11 -0
- package/workspace/guide/home.md +5 -2
- package/workspace/guide/jira.md +8 -0
- package/workspace/guide/settings-and-switches.md +1 -1
- package/workspace/lib/features.json +31 -0
- package/workspace/lib/jev-command.js +88 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/quiet-cli.js +81 -0
- package/workspace/lib/quiet-sweep.js +228 -0
- package/workspace/lib/routes-backlog.js +21 -1
- package/workspace/lib/routes-slash.js +57 -14
- package/workspace/lib/routes-your-move.js +39 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/action-keys.js +5 -1
- package/workspace/public/pm/bd-sprint.js +29 -1
- package/workspace/public/pm/cozy-home.css +2 -0
- package/workspace/public/pm/cozy-jl.js +6 -2
- package/workspace/public/pm/cozy-nav.js +4 -2
- package/workspace/public/pm/feature-match.js +77 -0
- package/workspace/public/pm/features-dir.js +83 -0
- package/workspace/public/pm/goal-chat.js +10 -7
- package/workspace/public/pm/home-app.js +9 -1
- package/workspace/public/pm/home-chat.js +49 -7
- package/workspace/public/pm/live-feed.js +1 -0
- package/workspace/public/pm/palette-all.js +12 -3
- package/workspace/public/pm/premium-shell.js +6 -3
- package/workspace/public/pm/premium-vw-features.css +17 -0
- package/workspace/public/pm/premium-vw-open.js +2 -1
- package/workspace/public/pm/premium-vw-page.js +2 -1
- package/workspace/public/pm/quiet-view.js +107 -0
- package/workspace/test-lists/feature-directory.json +9 -0
- package/workspace/test-lists/quiet-sweep.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.787.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,73 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.787.0",
|
|
38
|
+
"at": "2026-11-24T17:51:02.745Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1772,
|
|
43
|
+
"t": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
44
|
+
"s": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"h": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
47
|
+
"try": {
|
|
48
|
+
"steps": [
|
|
49
|
+
"On Today, type / in the chat and pick Why this work exists",
|
|
50
|
+
"Type 'what if the API task slips a week' and press Tab on the suggestion",
|
|
51
|
+
"Press Ctrl+K, type features, and open What PMOS can do"
|
|
52
|
+
],
|
|
53
|
+
"see": "The / menu lists PMOS commands first, each with its name and one line; the typed sentence turns into /rehearse; the directory lists features by job with New since you last looked on top",
|
|
54
|
+
"open": "/today.html"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"v": "0.786.0",
|
|
61
|
+
"at": "2026-11-24T17:39:55.270Z",
|
|
62
|
+
"f": 4,
|
|
63
|
+
"prs": [
|
|
64
|
+
{
|
|
65
|
+
"n": 1779,
|
|
66
|
+
"t": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
67
|
+
"s": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
68
|
+
"k": "new",
|
|
69
|
+
"h": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
70
|
+
"try": {
|
|
71
|
+
"steps": [
|
|
72
|
+
"Open Today and press the row that says how many initiatives are quiet 30 days or more",
|
|
73
|
+
"Press Park on one row, then Undo in the message",
|
|
74
|
+
"Open Work and find an initiative you parked or closed"
|
|
75
|
+
],
|
|
76
|
+
"see": "One list of quiet initiatives, most quiet first, each with Keep, Park and Close; the row leaves the list at once, Undo puts it back, and Work shows the parked one on hold",
|
|
77
|
+
"open": "/today.html"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"n": 1788,
|
|
82
|
+
"t": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
83
|
+
"s": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
84
|
+
"k": "new",
|
|
85
|
+
"h": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
86
|
+
"try": {
|
|
87
|
+
"steps": [
|
|
88
|
+
"Open Work, then Backlog, and press the sprint name to pick a past sprint",
|
|
89
|
+
"Read the One change block beside Lessons, or ask the chat on Today: what was the retro of our last sprint?"
|
|
90
|
+
],
|
|
91
|
+
"see": "The block (and the chat) give done of total, why work was carried (never started, started, in review, carried twice, added after the start), names one change for the next sprint, and for a sprint…",
|
|
92
|
+
"open": "/premium-board.html"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"n": 1789,
|
|
97
|
+
"t": "A published read-only Board opens no live stream",
|
|
98
|
+
"s": "A published read-only Board opens no live stream",
|
|
99
|
+
"k": "fix"
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
36
103
|
{
|
|
37
104
|
"v": "0.785.0",
|
|
38
105
|
"at": "2026-11-24T17:13:04.909Z",
|
|
@@ -395,32 +462,6 @@
|
|
|
395
462
|
"k": "new"
|
|
396
463
|
}
|
|
397
464
|
]
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
"v": "0.767.0",
|
|
401
|
-
"at": "2026-11-24T07:34:38.820Z",
|
|
402
|
-
"f": 4,
|
|
403
|
-
"prs": [
|
|
404
|
-
{
|
|
405
|
-
"n": 1727,
|
|
406
|
-
"t": "Let the work breakdown Gantt scroll sideways",
|
|
407
|
-
"s": "Let the work breakdown Gantt scroll sideways",
|
|
408
|
-
"k": "fix"
|
|
409
|
-
}
|
|
410
|
-
]
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
"v": "0.766.0",
|
|
414
|
-
"at": "2026-11-24T07:23:50.157Z",
|
|
415
|
-
"f": 4,
|
|
416
|
-
"prs": [
|
|
417
|
-
{
|
|
418
|
-
"n": 1723,
|
|
419
|
-
"t": "The chat beside a task is about the task",
|
|
420
|
-
"s": "The chat beside a task is about the task",
|
|
421
|
-
"k": "fix"
|
|
422
|
-
}
|
|
423
|
-
]
|
|
424
465
|
}
|
|
425
466
|
]
|
|
426
467
|
}
|
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-24T17:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T17:50:59Z"}
|
|
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-24T17:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T17:50:59Z"}
|
|
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-24T17:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T17:50:59Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,71 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.787.0",
|
|
4
|
+
"at": "2026-11-24T17:51:02.745Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1772,
|
|
9
|
+
"t": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
10
|
+
"s": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"h": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
13
|
+
"try": {
|
|
14
|
+
"steps": [
|
|
15
|
+
"On Today, type / in the chat and pick Why this work exists",
|
|
16
|
+
"Type 'what if the API task slips a week' and press Tab on the suggestion",
|
|
17
|
+
"Press Ctrl+K, type features, and open What PMOS can do"
|
|
18
|
+
],
|
|
19
|
+
"see": "The / menu lists PMOS commands first, each with its name and one line; the typed sentence turns into /rehearse; the directory lists features by job with New since you last looked on top",
|
|
20
|
+
"open": "/today.html"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"v": "0.786.0",
|
|
27
|
+
"at": "2026-11-24T17:39:55.270Z",
|
|
28
|
+
"f": 4,
|
|
29
|
+
"prs": [
|
|
30
|
+
{
|
|
31
|
+
"n": 1779,
|
|
32
|
+
"t": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
33
|
+
"s": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
34
|
+
"k": "new",
|
|
35
|
+
"h": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
36
|
+
"try": {
|
|
37
|
+
"steps": [
|
|
38
|
+
"Open Today and press the row that says how many initiatives are quiet 30 days or more",
|
|
39
|
+
"Press Park on one row, then Undo in the message",
|
|
40
|
+
"Open Work and find an initiative you parked or closed"
|
|
41
|
+
],
|
|
42
|
+
"see": "One list of quiet initiatives, most quiet first, each with Keep, Park and Close; the row leaves the list at once, Undo puts it back, and Work shows the parked one on hold",
|
|
43
|
+
"open": "/today.html"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"n": 1788,
|
|
48
|
+
"t": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
49
|
+
"s": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
50
|
+
"k": "new",
|
|
51
|
+
"h": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
52
|
+
"try": {
|
|
53
|
+
"steps": [
|
|
54
|
+
"Open Work, then Backlog, and press the sprint name to pick a past sprint",
|
|
55
|
+
"Read the One change block beside Lessons, or ask the chat on Today: what was the retro of our last sprint?"
|
|
56
|
+
],
|
|
57
|
+
"see": "The block (and the chat) give done of total, why work was carried (never started, started, in review, carried twice, added after the start), names one change for the next sprint, and for a sprint…",
|
|
58
|
+
"open": "/premium-board.html"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"n": 1789,
|
|
63
|
+
"t": "A published read-only Board opens no live stream",
|
|
64
|
+
"s": "A published read-only Board opens no live stream",
|
|
65
|
+
"k": "fix"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
2
69
|
{
|
|
3
70
|
"v": "0.785.0",
|
|
4
71
|
"at": "2026-11-24T17:13:04.909Z",
|
package/workspace/guide/cli.md
CHANGED
|
@@ -441,6 +441,17 @@ An initiative on hold keeps why it is parked and what brings it back: a return d
|
|
|
441
441
|
- `pmos parked hold <id> --why "<reason>"` parks an initiative. `--back <YYYY-MM-DD>` sets a return day. `--after <id>` names the initiative that must finish first.
|
|
442
442
|
- `pmos parked back <id>` brings it back to the Roadmap. To undo, park it again.
|
|
443
443
|
- `pmos parked coverage` shows how many parked initiatives say why and what brings them back, and the percent on the last line.
|
|
444
|
+
|
|
445
|
+
### pmos quiet: the weekly sweep of quiet work
|
|
446
|
+
|
|
447
|
+
Once a week Today shows how many initiatives had no change in 30 days or more. The chat answers the same list from a terminal.
|
|
448
|
+
|
|
449
|
+
- `pmos quiet list` shows the quiet initiatives, most quiet first. Each one shows what PMOS suggests: **Close** when it is on its workflow's last stage, else **Park**.
|
|
450
|
+
- `pmos quiet keep <id>` keeps it. The sweep does not show it again for 30 days.
|
|
451
|
+
- `pmos quiet park <id>` parks it. The reason says how long it was quiet. Use `--why "<reason>"` to give your own reason.
|
|
452
|
+
- `pmos quiet close <id>` closes it. Use `--why "<reason>"` to say why.
|
|
453
|
+
- `pmos quiet undo <id>` undoes the newest answer of that initiative.
|
|
454
|
+
|
|
444
455
|
### pmos rehearse: rehearse a change
|
|
445
456
|
|
|
446
457
|
- `pmos rehearse move <task> --by <days>` — the task moves later by whole days, or earlier with a minus (`--by -2`).
|
package/workspace/guide/home.md
CHANGED
|
@@ -55,6 +55,7 @@ Today, Work, Insights and the Viewer use one typeface, Plus Jakarta Sans, with t
|
|
|
55
55
|
- **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.
|
|
56
56
|
- **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.
|
|
57
57
|
- **Done** lists what PMOS finished by itself in the last 14 days, one line each with Undo.
|
|
58
|
+
- **Quiet work, once a week.** One row says how many initiatives had no change in 30 days or more on all your products, for example "37 initiatives quiet 30 days or more". Press it to see one list, most quiet first. Each row says how long it was quiet and on which stage, and what PMOS suggests (✦): **Close** when it is on its workflow's last stage, else **Park**. Each row has three presses: **Keep** (still on; the sweep leaves it alone for 30 days), **Park** (on hold, with a reason that says how long it was quiet) and **Close**. The row leaves the list at once, and the message shows **Undo**. An initiative that waits on another live initiative is not quiet. After you open the list, the row goes away until next week. With nothing quiet, there is no row. From a terminal: `pmos quiet list`.
|
|
58
59
|
- **What moved last week.** Once a week, one row says how many dates and scope changes (tasks added, removed or put back) happened last week on all your products, and how many have no source, for example "Last week: 14 moves in dates and scope" with "3 with no source. See who to ask." under it. Press it to see one list, grouped by product, with the moves that have no source first. Each move shows its source (your own change, the tracker, or the Jira ticket, meeting note or document it names), or **No source** and the owner to ask. A move PMOS made with no reason is always **No source**. A moved date also says how far it is from the task's first plan, for example "30 days behind the first plan (due 1 Nov)", so a slip stays in sight after the date moves. After you open the list, the row goes away until next week. In a week with no moves, there is no row. From a terminal: `node workspace/lib/week-moves.js list` in a product's repository, or `--week <Monday>` for an earlier week.
|
|
59
60
|
- An outbox draft opens with who it is for and the words. **Copy** puts the words on the clipboard, so you send them from your own tool. ✕ discards it, with Undo. Nothing leaves PMOS by itself.
|
|
60
61
|
|
|
@@ -159,7 +160,7 @@ Press the name in the Viewer's header. The name becomes a field.
|
|
|
159
160
|
|
|
160
161
|
- Type the new name. Press Enter or the check to save it. Press Esc to stop without a change. An empty name is not saved.
|
|
161
162
|
- The new name shows at once in the list, the chat header, the Viewer, Work and the Timeline. The message **Renamed** has **Undo**.
|
|
162
|
-
- **A change from the chat shows at once.** When you ask the chat to add, move, close or delete a task, the row changes on Today, Work and an open task popup within a second, without the page reading its lists again. A change you make in one tab of the workspace shows in its other open tabs as soon as it is saved. A change that is not saved does not show in the other tabs.
|
|
163
|
+
- **A change from the chat shows at once.** When you ask the chat to add, move, close or delete a task, the row changes on Today, Work and an open task popup within a second, without the page reading its lists again. A change you make in one tab of the workspace shows in its other open tabs as soon as it is saved. A change that is not saved does not show in the other tabs. A published read-only Board does not follow these changes: it shows the board as it was published.
|
|
163
164
|
- An initiative of another product renames in that product's own repository, the same as on Work.
|
|
164
165
|
- Only the name changes. The id, the record file, the links and the history stay the same.
|
|
165
166
|
- An initiative with a Jira epic shows **Rename the Jira epic too**. It is off by default. When you select it, Today opens the initiative's chat with the request typed. Send it to let your agent rename the epic in Jira. PMOS does not change Jira itself.
|
|
@@ -181,6 +182,7 @@ Some features, such as Notes, open as a plain card in the Viewer. Each one works
|
|
|
181
182
|
## Search, Guide and Settings
|
|
182
183
|
|
|
183
184
|
- **Guide** (the **?** icon in the menu) opens this guide in the Viewer.
|
|
185
|
+
- **What PMOS can do** lists every feature by job, each with how to reach it: its command (press it to put it in the chat box), its page, or its keys. Open it from Ctrl K (type "features"), from the ? key list, or from the guide. Features new since you last looked come first.
|
|
184
186
|
- **Search** (Ctrl K or ⌘K, or `/`) finds initiatives, documents, sessions and files in your work. It always reads the repository and all its worktrees, so it has no worktree picker. It also reaches every page, each Settings section, the themes and the actions of the item you last pointed at: type "lib" to go to Library, or "conn" for Settings › Connectors.
|
|
185
187
|
- **Dates** show the year only when the year is not this year, for example "Jun 23 ’27". New for you shows a due date as "due 25 Nov".
|
|
186
188
|
- **Settings** holds the workspace settings. **General** holds the theme (Light, Dark or Auto) and **Product**, which names the product the page reads. **Connectors** shows when PMOS last read each source. A source that is old or failed has an amber dot and ↻ to read it again. ↻ in the Connectors header reads every source again. While a source is old, an amber box at the top of Settings names it, with ↻.
|
|
@@ -234,7 +236,8 @@ There is no My work page. The list on Today is your list:
|
|
|
234
236
|
- A conversation opens at its latest message.
|
|
235
237
|
- A file that you send shows as a chip in your message, with a small picture for a photo. Press the chip to open the file beside the conversation.
|
|
236
238
|
- Your message shows as you typed it. Markdown that you paste (headings, lists, bold, code, tables) shows formatted.
|
|
237
|
-
- Type `/` to see
|
|
239
|
+
- 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.
|
|
240
|
+
- 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.
|
|
238
241
|
- The mic types what you say into the box. **Stop** keeps the words, and **Discard** puts the box back. Both end listening at once.
|
|
239
242
|
- 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.
|
|
240
243
|
|
package/workspace/guide/jira.md
CHANGED
|
@@ -243,6 +243,14 @@ pmos jira query --sprint "<name>"
|
|
|
243
243
|
pmos jira sync --sprint "<name>" --from <file|->
|
|
244
244
|
```
|
|
245
245
|
|
|
246
|
+
A past sprint that PMOS saw open and then closed also shows **✦ One change** beside Lessons. PMOS writes it from its own close numbers:
|
|
247
|
+
|
|
248
|
+
- **Carried**: why work moved on: never started, started, in review, carried two sprints in a row, or added after the start.
|
|
249
|
+
- **The change**: one change for the next sprint, aimed at the biggest reason with 2 or more tickets, and the number it should bring down. ✕ drops it. Undo takes the drop back.
|
|
250
|
+
- **The check**: when the previous sprint had a change, whether it helped, with its number before and after.
|
|
251
|
+
|
|
252
|
+
The chat answers and changes the same block with `pmos sprint retro` and `pmos sprint change` ([the command reference](cli.md)).
|
|
253
|
+
|
|
246
254
|
## Each sprint's goal and summary
|
|
247
255
|
|
|
248
256
|
The check then writes a goal and a short summary for each sprint, from the tickets it read. The Sprints tab shows them above the sprint's items, with one row for each group of related work.
|
|
@@ -77,7 +77,7 @@ When PMOS sees a pattern, one suggestion opens the section, with **Why**, **PMOS
|
|
|
77
77
|
At the bottom of **General**, **Extras** has three rows. Press the arrow on a row to open its settings; the back arrow returns to General.
|
|
78
78
|
|
|
79
79
|
- **Adler ›**: how much of Adler you see (Full, Face only or Off), motion, celebrations, Quiet after, and Dress for the day. See [Adler, PMOS's face](layout.md).
|
|
80
|
-
- **Jev and Laya ›**: the TypeSafe key for Jev, the local model Laya, and the switches for each repository: whether Jev may read it, sort documents, check claims and label notes.
|
|
80
|
+
- **Jev and Laya ›**: the TypeSafe key for Jev, the local model Laya, and the switches for each repository: whether Jev may read it, sort documents, suggest commands from the words you type in the chat (off until you turn it on), check claims and label notes.
|
|
81
81
|
- **Use log ›**: what PMOS notes on this computer about how you use it: the pages you open and the buttons you press, kept 30 days. A button is noted by its code name, never by its text or anything you typed. The log stays in the PMOS folder on this computer and is never sent. The panel shows the last 30 days (days, page opens, presses, and the pages and buttons you use most). Press **Clear** to empty it.
|
|
82
82
|
- **Hidden buttons**: after 14 days, when a page has buttons you saw on many days and never pressed, PMOS offers on that page to hide them (✦, Yes or No; while it shows, those buttons are outlined). Yes hides them and a Toast offers Undo; No keeps them, and PMOS does not suggest them again. Every hidden button is listed here with **Show**, and **Show all** puts them all back. Buttons in the menu, a list, a table, a dialog or a form are never suggested.
|
|
83
83
|
- **Ease check ›**: how easy each page is for you, read from the use log on this computer. For each page, PMOS takes the button you press most there as the page's main task, and shows the usual number of presses and seconds from opening the page to that press. A page over 3 presses or 10 seconds is listed first as slow. It reads the last 14 days, and a page needs 3 visits that reach its main task before it shows. Nothing is sent.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"about": "The user features of PMOS, one row each, for the chat's / menu, the typed-words suggestion, the What PMOS can do directory, Ctrl+K and the ? sheet (initiative feature-directory). Only audience user rows are shown. A row with cmd names a pmos verb (lib/pmos-verbs.js) that its prompt runs; place is a page key of the menu (pm/cozy-nav.js). since is the first version that has the feature. features.test.js F1 checks every row.",
|
|
3
|
+
"groups": ["Plan and decide", "Before you ship", "Catch up", "Your product", "What PMOS did", "Find your way"],
|
|
4
|
+
"features": [
|
|
5
|
+
{"id": "goal", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Give PMOS a goal", "say": "PMOS asks a few questions, then works on the goal after you press Start.", "cmd": "/goal", "phrases": ["work on this until", "keep going until", "make it happen"], "since": "0.560.0"},
|
|
6
|
+
{"id": "why", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Why this work exists", "say": "Three lines on an initiative or a task: its goal, its problem and the evidence.", "cmd": "/why", "verb": "why", "hint": "<initiative or task>", "phrases": ["why does this exist", "why are we doing", "why are we building", "what is the point of", "reason for this work", "why this initiative"], "phone": true, "since": "0.700.0"},
|
|
7
|
+
{"id": "rehearse", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Rehearse a change", "say": "Move a task by some days and see what else slips, before anything changes.", "cmd": "/rehearse", "verb": "rehearse", "sub": "move", "hint": "<task> <days>", "place": "board", "phrases": ["what if slips", "what happens if slips", "what if move", "push back", "delay by", "slips a week", "what breaks if", "move the date", "what if we cut"], "since": "0.600.0"},
|
|
8
|
+
{"id": "decisions", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Decision journal", "say": "Write one line per decision, with what you expect and the date to check it.", "cmd": "/decide", "verb": "decisions", "sub": "add", "hint": "<the decision>", "phrases": ["we decided", "log a decision", "record a decision", "note the decision", "decision journal", "list decisions"], "since": "0.640.0"},
|
|
9
|
+
{"id": "questions", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Open questions", "say": "Every question nobody has answered yet, oldest first, in one list.", "cmd": "/questions", "verb": "questions", "phrases": ["open questions", "unanswered questions", "what is still open", "questions nobody answered", "what do we not know"], "phone": true, "since": "0.660.0"},
|
|
10
|
+
{"id": "press-release", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Press release and FAQ", "say": "A one-page press release and FAQ for a bet, drafted from its record, for you to edit.", "cmd": "/press-release", "verb": "press-release", "hint": "<initiative>", "phrases": ["press release", "working backwards", "write the faq", "announce this"], "since": "0.690.0"},
|
|
11
|
+
{"id": "launch", "audience": "user", "status": "ga", "group": "Before you ship", "name": "What is not ready", "say": "Before a launch date: the tasks, sign-offs and documents still open.", "cmd": "/launch", "verb": "launch", "sub": "check", "hint": "<initiative>", "phrases": ["ready to launch", "what is not ready", "before launch", "launch checklist", "can we ship", "ready to ship", "is it ready for launch"], "since": "0.650.0"},
|
|
12
|
+
{"id": "ready", "audience": "user", "status": "ga", "group": "Before you ship", "name": "Ready for engineers", "say": "The five basics the engineers need before the tickets go to them.", "cmd": "/ready", "verb": "ready", "sub": "check", "hint": "<initiative>", "phrases": ["ready for engineering", "ready for engineers", "ready for dev", "hand over to engineers", "ready for development"], "since": "0.650.0"},
|
|
13
|
+
{"id": "critic", "audience": "user", "status": "ga", "group": "Before you ship", "name": "Critic before you share", "say": "Reads a document as a sceptical reviewer and lists the hardest questions.", "cmd": "/critic", "verb": "critic", "hint": "<document>", "phrases": ["poke holes", "review this doc", "critique this", "before I share", "hardest questions", "sceptical review", "skeptical review", "what would they ask"], "since": "0.680.0"},
|
|
14
|
+
{"id": "missed", "audience": "user", "status": "ga", "group": "Catch up", "name": "What you might have missed", "say": "What each of the last weeks would have shown you, in one list.", "cmd": "/missed", "verb": "drift", "sub": "show", "phrases": ["what did I miss", "what have I missed", "catch me up", "while I was away", "what changed this week", "what changed since"], "phone": true, "since": "0.620.0"},
|
|
15
|
+
{"id": "past", "audience": "user", "status": "ga", "group": "Catch up", "name": "Ask about the past", "say": "The decisions, notes and records that answer a question, each with its source.", "cmd": "/past", "verb": "past", "sub": "ask", "hint": "<question>", "phrases": ["when did we decide", "why did we decide", "who decided", "what did we agree", "last time we", "history of"], "phone": true, "since": "0.630.0"},
|
|
16
|
+
{"id": "parked", "audience": "user", "status": "ga", "group": "Catch up", "name": "Parked work", "say": "Each initiative on hold, why it is parked and what brings it back.", "cmd": "/parked", "verb": "parked", "sub": "list", "phrases": ["parked work", "what is on hold", "what is parked", "paused initiatives"], "since": "0.700.0"},
|
|
17
|
+
{"id": "people", "audience": "user", "status": "ga", "group": "Catch up", "name": "People you work with", "say": "Each person with their role, how often you talk and their tone.", "cmd": "/people", "verb": "people", "sub": "list", "phrases": ["who do I work with", "stakeholders list", "people on this", "who is involved"], "since": "0.610.0"},
|
|
18
|
+
{"id": "strategy", "audience": "user", "status": "ga", "group": "Your product", "name": "Five-line strategy", "say": "Who it is for, the problem, the bet, how you win and what you will not do.", "cmd": "/strategy", "verb": "strategy", "sub": "show", "place": "board", "phrases": ["our strategy", "product strategy", "draft the strategy", "how we win"], "since": "0.776.0"},
|
|
19
|
+
{"id": "positioning", "audience": "user", "status": "ga", "group": "Your product", "name": "Positioning and key messages", "say": "A positioning statement and key messages, each citing a strategy line.", "cmd": "/positioning", "verb": "positioning", "sub": "list", "phrases": ["positioning statement", "key messages", "messaging for"], "since": "0.740.0"},
|
|
20
|
+
{"id": "principles", "audience": "user", "status": "ga", "group": "Your product", "name": "Product principles", "say": "Four to six principles drafted from your past decisions, each citing them.", "cmd": "/principles", "verb": "principles", "sub": "list", "phrases": ["product principles", "our principles", "design principles for"], "since": "0.720.0"},
|
|
21
|
+
{"id": "glossary", "audience": "user", "status": "ga", "group": "Your product", "name": "Glossary", "say": "The product's own words; every page shows a word's meaning on hover.", "cmd": "/glossary", "verb": "glossary", "sub": "list", "hint": "<word>", "phrases": ["define the word", "glossary", "add to glossary", "meaning of the word"], "since": "0.690.0"},
|
|
22
|
+
{"id": "health", "audience": "user", "status": "ga", "group": "Your product", "name": "Health score", "say": "This product's health from 0 to 100, and the three parts that make it.", "cmd": "/health", "verb": "health", "sub": "score", "phrases": ["health score", "how healthy is", "product health"], "phone": true, "since": "0.737.0"},
|
|
23
|
+
{"id": "outcomes", "audience": "user", "status": "ga", "group": "Your product", "name": "Did it work?", "say": "Each initiative's expected outcome and the date to check it.", "cmd": "/outcomes", "verb": "outcomes", "sub": "list", "phrases": ["did it work", "expected outcome", "outcomes due", "check the outcome"], "since": "0.640.0"},
|
|
24
|
+
{"id": "changed", "audience": "user", "status": "ga", "group": "What PMOS did", "name": "What PMOS changed by itself", "say": "Every change PMOS made on its own today, with its source and its Undo.", "cmd": "/changed", "verb": "factory", "sub": "today", "phrases": ["what did pmos change", "what did you change", "changes pmos made", "what did the agents do"], "phone": true, "since": "0.700.0"},
|
|
25
|
+
{"id": "autonomy", "audience": "user", "status": "ga", "group": "What PMOS did", "name": "What agents applied", "say": "What agents applied by themselves in the last 14 days, each with its Undo.", "cmd": "/applied", "verb": "autonomy", "sub": "status", "phrases": ["what did agents apply", "applied by themselves", "auto applied"], "since": "0.680.0"},
|
|
26
|
+
{"id": "describe", "audience": "user", "status": "ga", "group": "Plan and decide", "name": "Task descriptions", "say": "What, why and done-when for each task, drafted from its sources.", "cmd": "/describe", "verb": "task", "sub": "describe", "hint": "<task>", "place": "board", "phrases": ["describe this task", "task description", "write the description", "what is this task about"], "since": "0.770.0"},
|
|
27
|
+
{"id": "search", "audience": "user", "status": "ga", "group": "Find your way", "name": "Search and ask", "say": "Ctrl+K finds work, pages and features, and answers questions from your files.", "keys": "Ctrl K", "since": "0.737.0"},
|
|
28
|
+
{"id": "action-keys", "audience": "user", "status": "ga", "group": "Find your way", "name": "Keys for the five common actions", "say": "Yes, open, next sprint, park and undo, one key each. Press ? to see them.", "keys": "?", "since": "0.730.0"},
|
|
29
|
+
{"id": "guide", "audience": "user", "status": "ga", "group": "Find your way", "name": "The Guide", "say": "How each part of PMOS works, page by page.", "action": "guide", "since": "0.500.0"}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* jev-command.js — ask Jev which PMOS command plain typed words ask for, only when the local match cannot tell
|
|
3
|
+
* (initiative feature-directory, done test F5). The bridge between the chat box and the one TypeSafe module (lib/typesafe.js);
|
|
4
|
+
* like lib/jev-route.js it opens no client of its own, and no-network.test.js holds it to that.
|
|
5
|
+
*
|
|
6
|
+
* Three gates, all required: a saved key, D79 consent for the repository, and the "suggest commands with Jev" switch (`suggest`,
|
|
7
|
+
* default OFF). With any one shut nothing is sent and the answer is { cmd: null }. Text the secret scan matches, or that names an
|
|
8
|
+
* excluded path, is withheld the same way. At most MAX_CHARS of the typed words leave the machine, nothing else: no path, no file.
|
|
9
|
+
*
|
|
10
|
+
* Jev gets one Choice question over the command ids plus `none`. An answer under BAR, or within GAP of the next option, is no
|
|
11
|
+
* suggestion: a wrong suggestion costs more than none. Jev does not treat its input as hostile, so the answer only ever names one
|
|
12
|
+
* of the listed commands, and the PM still presses Tab to take it.
|
|
13
|
+
*
|
|
14
|
+
* The switch is kept beside the other settings, in <state>/feature-suggest.json ({ repos: { <root>: true } }), one boolean per repository.
|
|
15
|
+
*
|
|
16
|
+
* switchOf(stateDir, root) → boolean · setSwitch(stateDir, root, on) → { ok } | { ok: false, error }
|
|
17
|
+
* gates({ key, flags }) → { open, missing }
|
|
18
|
+
* suggest({ text, cmds, key, flags, ask?, askOpts? }) → Promise<{ ok: true, cmd: string|null, sent: boolean, why?: string }> never throws */
|
|
19
|
+
const fs = require('fs');
|
|
20
|
+
const path = require('path');
|
|
21
|
+
const typesafe = require('./typesafe');
|
|
22
|
+
const scanner = require('./secret-scan');
|
|
23
|
+
|
|
24
|
+
const FILE = 'feature-suggest.json';
|
|
25
|
+
function readSw(stateDir) { try { const j = JSON.parse(fs.readFileSync(path.join(stateDir, FILE), 'utf8')); return j && typeof j.repos === 'object' && j.repos ? j : { repos: {} }; } catch { return { repos: {} }; } }
|
|
26
|
+
function switchOf(stateDir, root) { return !!(stateDir && root && readSw(stateDir).repos[root] === true); }
|
|
27
|
+
function setSwitch(stateDir, root, on) {
|
|
28
|
+
if (!stateDir || !root || typeof on !== 'boolean') return { ok: false, error: 'a repository and true or false are needed' };
|
|
29
|
+
const j = readSw(stateDir);
|
|
30
|
+
if (on) j.repos[root] = true; else delete j.repos[root];
|
|
31
|
+
try { fs.mkdirSync(stateDir, { recursive: true }); const tmp = path.join(stateDir, FILE + '.' + process.pid + '.tmp'); fs.writeFileSync(tmp, JSON.stringify(j, null, 2) + '\n'); fs.renameSync(tmp, path.join(stateDir, FILE)); return { ok: true }; }
|
|
32
|
+
catch (e) { return { ok: false, error: String((e && e.message) || e).slice(0, 200) }; }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const MAX_CHARS = 400;
|
|
36
|
+
const BAR = 0.6;
|
|
37
|
+
const GAP = 0.15;
|
|
38
|
+
const INSTRUCTIONS = 'Which one of these PMOS commands does the message ask for? Answer none when it asks for something else, or for no command at all.';
|
|
39
|
+
|
|
40
|
+
function gates({ key, flags = {} }) {
|
|
41
|
+
const missing = [];
|
|
42
|
+
if (!typesafe.validKey(key)) missing.push('key');
|
|
43
|
+
if (!flags.consent) missing.push('consent');
|
|
44
|
+
if (!flags.suggest) missing.push('suggest');
|
|
45
|
+
return { open: missing.length === 0, missing };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The options of the Choice question: each command's id (its name without the /) with its name and line, plus none. */
|
|
49
|
+
function optionsOf(cmds) {
|
|
50
|
+
const o = {};
|
|
51
|
+
for (const c of cmds || []) if (c && c.cmd && c.verb) o[c.cmd.slice(1)] = `${c.name}: ${c.say}`;
|
|
52
|
+
o.none = 'Something else, or no command';
|
|
53
|
+
return o;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The leading option and its lead over the next, from a defensively read answer. Pure. */
|
|
57
|
+
function pick(ans, options) {
|
|
58
|
+
if (!ans || typeof ans !== 'object') return null;
|
|
59
|
+
const p = {};
|
|
60
|
+
const put = (k, v) => { const n = Number(v); if (Object.prototype.hasOwnProperty.call(options, k) && Number.isFinite(n) && n >= 0 && n <= 1) p[k] = n; };
|
|
61
|
+
const raw = ans.probabilities || ans.distribution;
|
|
62
|
+
if (Array.isArray(raw)) { for (const x of raw) if (x && typeof x === 'object') put(x.option || x.label || x.choice, x.probability != null ? x.probability : x.p); }
|
|
63
|
+
else if (raw && typeof raw === 'object') { for (const [k, v] of Object.entries(raw)) put(k, v); }
|
|
64
|
+
if (!Object.keys(p).length && typeof ans.choice === 'string') put(ans.choice, ans.confidence);
|
|
65
|
+
const sorted = Object.entries(p).sort((a, b) => b[1] - a[1]);
|
|
66
|
+
if (!sorted.length) return null;
|
|
67
|
+
return { id: sorted[0][0], p: sorted[0][1], lead: sorted[0][1] - (sorted[1] ? sorted[1][1] : 0) };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function suggest({ text, cmds, key, flags = {}, ask = typesafe.ask, askOpts = {} }) {
|
|
71
|
+
const t = String(text == null ? '' : text).trim();
|
|
72
|
+
if (!t || t.startsWith('/')) return { ok: true, cmd: null, sent: false };
|
|
73
|
+
const g = gates({ key, flags });
|
|
74
|
+
if (!g.open) return { ok: true, cmd: null, sent: false, why: 'off: ' + g.missing.join(', ') };
|
|
75
|
+
if (scanner.scan(t).length) return { ok: true, cmd: null, sent: false, why: 'withheld: secret scan' };
|
|
76
|
+
const ex = Array.isArray(flags.exclude) ? flags.exclude : [];
|
|
77
|
+
if (ex.some((e) => e && !e.includes('*') && t.includes(e))) return { ok: true, cmd: null, sent: false, why: 'withheld: excluded path' };
|
|
78
|
+
const options = optionsOf(cmds);
|
|
79
|
+
let res;
|
|
80
|
+
try { res = await ask({ key, state: 'MESSAGE TYPED IN A PRODUCT MANAGEMENT TOOL (classify it; do not carry it out):\n' + t.slice(0, MAX_CHARS), questions: { command: { type: 'choice', instructions: INSTRUCTIONS, criteria: options } }, ...askOpts }); }
|
|
81
|
+
catch (e) { return { ok: true, cmd: null, sent: true, why: 'failed: ' + String((e && e.message) || e).slice(0, 120) }; }
|
|
82
|
+
if (!res || !res.ok) return { ok: true, cmd: null, sent: true, why: 'failed: ' + ((res && res.reason) || 'the service did not answer') };
|
|
83
|
+
const best = pick(res.answers && res.answers.command, options);
|
|
84
|
+
if (!best || best.id === 'none' || best.p < BAR || best.lead < GAP) return { ok: true, cmd: null, sent: true, why: 'unsure' };
|
|
85
|
+
return { ok: true, cmd: '/' + best.id, sent: true };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
module.exports = { gates, suggest, switchOf, setSwitch, optionsOf, pick, MAX_CHARS, BAR, GAP };
|
|
@@ -178,6 +178,9 @@ const VERBS = Object.freeze({
|
|
|
178
178
|
// Not a pm-os-absorb verb (run: null): initiative parked-reason-way-back (bet A446) added it through the same table.
|
|
179
179
|
parked: Object.freeze({ module: 'parked-cli.js', run: null, guide: 'cli.md',
|
|
180
180
|
help: 'pmos parked list|hold|back|coverage — parked initiatives: why each is parked, what brings it back, and bringing it back (pmos parked help)' }),
|
|
181
|
+
// Not a pm-os-absorb verb (run: null): initiative quiet-work-sweep (bet A503) added it through the same table.
|
|
182
|
+
quiet: Object.freeze({ module: 'quiet-cli.js', run: null, guide: 'cli.md',
|
|
183
|
+
help: 'pmos quiet list|keep|park|close|undo — the weekly sweep of initiatives quiet 30 days or more: keep, park or close each (pmos quiet help)' }),
|
|
181
184
|
// Not a pm-os-absorb verb (run: null): chief-unit-owners (Wawan 2026-11-18) added both through the same table.
|
|
182
185
|
units: Object.freeze({ module: 'units-cli.js', run: null, guide: 'cli.md',
|
|
183
186
|
help: 'pmos units [list|show <unit>] — the programs, products and projects, who owns each initiative, and each owner\'s brief (pmos units help)' }),
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* quiet-cli.js — `pmos quiet`: the weekly sweep of quiet work (initiative quiet-work-sweep, bet A503; lib/quiet-sweep.js).
|
|
3
|
+
*
|
|
4
|
+
* pmos quiet list [--json] the initiatives quiet 30 days or more, most quiet first, each with what PMOS suggests
|
|
5
|
+
* pmos quiet keep <id> still on: the sweep leaves it alone for 30 days
|
|
6
|
+
* pmos quiet park <id> [--why "<reason>"] park it (one on-hold line; the reason says how long it was quiet unless you give one)
|
|
7
|
+
* pmos quiet close <id> [--why "<reason>"] close it (one closed line)
|
|
8
|
+
* pmos quiet undo <id> undo the newest sweep answer of that initiative
|
|
9
|
+
* every command: [--root <dir>] (default: this repository)
|
|
10
|
+
*
|
|
11
|
+
* The chat's way to answer the same list Today shows; the agent runs keep, park and close only after the PM said so in the chat.
|
|
12
|
+
* Exit codes: 0 done, 1 refused, 2 usage. Nothing is sent. */
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const { execFileSync } = require('child_process');
|
|
15
|
+
const Q = require('./quiet-sweep.js');
|
|
16
|
+
|
|
17
|
+
const COMMANDS = { quiet: ['list', 'keep', 'park', 'close', 'undo'] };
|
|
18
|
+
const USAGE = [
|
|
19
|
+
'usage: pmos quiet list|keep|park|close|undo — the weekly sweep of initiatives quiet 30 days or more',
|
|
20
|
+
' pmos quiet list [--json] the quiet initiatives, most quiet first, with what PMOS suggests',
|
|
21
|
+
' pmos quiet keep <id> still on: the sweep leaves it alone for 30 days',
|
|
22
|
+
' pmos quiet park <id> [--why "<reason>"] park it with a reason',
|
|
23
|
+
' pmos quiet close <id> [--why "<reason>"] close it',
|
|
24
|
+
' pmos quiet undo <id> undo the newest sweep answer of that initiative',
|
|
25
|
+
'Today shows the same list once a week. Run it in the product\'s repository, or pass --root <dir>.',
|
|
26
|
+
];
|
|
27
|
+
const ALLOWED = { list: ['json', 'root'], keep: ['json', 'root'], park: ['json', 'root', 'why'], close: ['json', 'root', 'why'], undo: ['json', 'root'] };
|
|
28
|
+
const BOOL = new Set(['json']);
|
|
29
|
+
const SAID = { keep: 'kept: the sweep leaves it alone for 30 days', park: 'parked', close: 'closed', undo: 'undone' };
|
|
30
|
+
|
|
31
|
+
function parse(args) {
|
|
32
|
+
const pos = [], flags = {};
|
|
33
|
+
for (let i = 0; i < args.length; i++) {
|
|
34
|
+
const a = args[i];
|
|
35
|
+
if (!a.startsWith('--')) { pos.push(a); continue; }
|
|
36
|
+
const k = a.slice(2);
|
|
37
|
+
if (BOOL.has(k)) flags[k] = true;
|
|
38
|
+
else flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
|
|
39
|
+
}
|
|
40
|
+
return { pos, flags };
|
|
41
|
+
}
|
|
42
|
+
function repoRoot(cwd) {
|
|
43
|
+
try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; } catch { return cwd; }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async function run(argv, { say = (s) => console.log(s), env = process.env, cwd = process.cwd(), now = Date.now(), isTTY, sweep } = {}) {
|
|
47
|
+
const args = argv[0] === 'quiet' ? argv.slice(1) : argv.slice();
|
|
48
|
+
const sub = args[0];
|
|
49
|
+
if (!sub || ['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return sub ? 0 : 1; }
|
|
50
|
+
if (!COMMANDS.quiet.includes(sub)) { say(`unknown quiet command "${sub}". Use one of: ${COMMANDS.quiet.join(', ')}`); return 2; }
|
|
51
|
+
const { pos, flags } = parse(args.slice(1));
|
|
52
|
+
for (const k of Object.keys(flags)) if (!ALLOWED[sub].includes(k)) { say(`✗ --${k} is not an option of pmos quiet ${sub}`); return 2; }
|
|
53
|
+
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
54
|
+
const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
|
|
55
|
+
|
|
56
|
+
if (sub === 'list') {
|
|
57
|
+
if (pos.length) return fail('pmos quiet list takes no argument', 2);
|
|
58
|
+
const s = (sweep || Q.sweepRoot)(root, { now });
|
|
59
|
+
if (!s.ok) return fail(s.error);
|
|
60
|
+
if (flags.json) { say(JSON.stringify(s)); return 0; }
|
|
61
|
+
if (!s.total) { say('Nothing is quiet 30 days or more.'); return 0; }
|
|
62
|
+
say(`${s.total} of ${s.live} live initiatives quiet ${Q.QUIET_DAYS} days or more`);
|
|
63
|
+
for (const it of s.items.slice(0, 50)) say(` ✦ ${it.suggest === 'close' ? 'Close' : 'Park'} · ${it.id} — ${it.title}\n ${it.why}`);
|
|
64
|
+
if (s.total > 50) say(` … ${s.total - 50} more`);
|
|
65
|
+
say('\nAnswer one: pmos quiet keep|park|close <id>');
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (pos.length !== 1) return fail(`usage: pmos quiet ${sub} <id>${sub === 'park' || sub === 'close' ? ' [--why "<reason>"]' : ''}`, 2);
|
|
70
|
+
const id = pos[0];
|
|
71
|
+
const a = require('./actor.js').fromCli({ isTTY: isTTY === undefined ? !!(process.stdin.isTTY && process.stdout.isTTY) : isTTY, env });
|
|
72
|
+
const opts = { now, by: a.by, via: a.via };
|
|
73
|
+
const r = sub === 'keep' ? Q.keep(root, { id }, opts) : sub === 'park' ? Q.park(root, { id, why: flags.why }, opts)
|
|
74
|
+
: sub === 'close' ? Q.close(root, { id, why: flags.why }, opts) : Q.undo(root, { id }, opts);
|
|
75
|
+
if (!r.ok) return fail(r.error);
|
|
76
|
+
if (flags.json) { say(JSON.stringify({ ok: true, file: r.file, line: r.line })); return 0; }
|
|
77
|
+
say(`${Q.TAG} ✓ ${id} ${SAID[sub]} (${r.file}). Undo: pmos quiet undo ${id}. Commit it to keep it.`);
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
module.exports = { run, COMMANDS, USAGE };
|