create-pmos 0.786.0 → 0.788.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 +46 -33
- 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 +45 -0
- package/workspace/guide/agent-capabilities.md +1 -0
- package/workspace/guide/claude-proposes.md +1 -0
- package/workspace/guide/home.md +3 -1
- 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/proposals.js +13 -2
- package/workspace/lib/routes-boards.js +1 -0
- package/workspace/lib/routes-proposals.js +30 -7
- package/workspace/lib/routes-slash.js +57 -14
- package/workspace/lib/stuck-next.js +82 -0
- 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/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-chat.js +49 -7
- package/workspace/public/pm/ini-props.js +4 -3
- 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/test-lists/feature-directory.json +9 -0
- package/workspace/test-lists/stuck-next-step.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.788.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,51 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.788.0",
|
|
38
|
+
"at": "2026-11-24T18:07:52.786Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1783,
|
|
43
|
+
"t": "Stuck work gets one prepared next step under the ✦",
|
|
44
|
+
"s": "Stuck work gets one prepared next step under the ✦",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"try": {
|
|
47
|
+
"steps": [
|
|
48
|
+
"On Work, open an initiative that has a task In progress with no change for two weeks",
|
|
49
|
+
"Press its ✦ and find Stuck",
|
|
50
|
+
"Press ✓ on the prepared step, then Undo on the toast"
|
|
51
|
+
],
|
|
52
|
+
"see": "Stuck lists the task with one step: a drafted note to its owner, or park it. ✓ parks the task (or puts the note in the Outbox, unsent); Undo puts it back",
|
|
53
|
+
"open": "/premium-board.html"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"v": "0.787.0",
|
|
60
|
+
"at": "2026-11-24T17:51:02.745Z",
|
|
61
|
+
"f": 4,
|
|
62
|
+
"prs": [
|
|
63
|
+
{
|
|
64
|
+
"n": 1772,
|
|
65
|
+
"t": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
66
|
+
"s": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
67
|
+
"k": "new",
|
|
68
|
+
"h": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
69
|
+
"try": {
|
|
70
|
+
"steps": [
|
|
71
|
+
"On Today, type / in the chat and pick Why this work exists",
|
|
72
|
+
"Type 'what if the API task slips a week' and press Tab on the suggestion",
|
|
73
|
+
"Press Ctrl+K, type features, and open What PMOS can do"
|
|
74
|
+
],
|
|
75
|
+
"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",
|
|
76
|
+
"open": "/today.html"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
36
81
|
{
|
|
37
82
|
"v": "0.786.0",
|
|
38
83
|
"at": "2026-11-24T17:39:55.270Z",
|
|
@@ -420,38 +465,6 @@
|
|
|
420
465
|
}
|
|
421
466
|
}
|
|
422
467
|
]
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
"v": "0.768.0",
|
|
426
|
-
"at": "2026-11-24T07:49:37.442Z",
|
|
427
|
-
"f": 4,
|
|
428
|
-
"prs": [
|
|
429
|
-
{
|
|
430
|
-
"n": 1731,
|
|
431
|
-
"t": "The workflow decides the kind of work, not a legacy type: feature",
|
|
432
|
-
"s": "The workflow decides the kind of work, not a legacy type: feature",
|
|
433
|
-
"k": "fix"
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
"n": 1730,
|
|
437
|
-
"t": "Drag to nest, take out and reorder in the Gantt, like the List",
|
|
438
|
-
"s": "Drag to nest, take out and reorder in the Gantt, like the List",
|
|
439
|
-
"k": "new"
|
|
440
|
-
}
|
|
441
|
-
]
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
"v": "0.767.0",
|
|
445
|
-
"at": "2026-11-24T07:34:38.820Z",
|
|
446
|
-
"f": 4,
|
|
447
|
-
"prs": [
|
|
448
|
-
{
|
|
449
|
-
"n": 1727,
|
|
450
|
-
"t": "Let the work breakdown Gantt scroll sideways",
|
|
451
|
-
"s": "Let the work breakdown Gantt scroll sideways",
|
|
452
|
-
"k": "fix"
|
|
453
|
-
}
|
|
454
|
-
]
|
|
455
468
|
}
|
|
456
469
|
]
|
|
457
470
|
}
|
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-24T18:07:48Z"}
|
|
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-24T18:07:48Z"}
|
|
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-24T18:07:48Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.788.0",
|
|
4
|
+
"at": "2026-11-24T18:07:52.786Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1783,
|
|
9
|
+
"t": "Stuck work gets one prepared next step under the ✦",
|
|
10
|
+
"s": "Stuck work gets one prepared next step under the ✦",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"try": {
|
|
13
|
+
"steps": [
|
|
14
|
+
"On Work, open an initiative that has a task In progress with no change for two weeks",
|
|
15
|
+
"Press its ✦ and find Stuck",
|
|
16
|
+
"Press ✓ on the prepared step, then Undo on the toast"
|
|
17
|
+
],
|
|
18
|
+
"see": "Stuck lists the task with one step: a drafted note to its owner, or park it. ✓ parks the task (or puts the note in the Outbox, unsent); Undo puts it back",
|
|
19
|
+
"open": "/premium-board.html"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"v": "0.787.0",
|
|
26
|
+
"at": "2026-11-24T17:51:02.745Z",
|
|
27
|
+
"f": 4,
|
|
28
|
+
"prs": [
|
|
29
|
+
{
|
|
30
|
+
"n": 1772,
|
|
31
|
+
"t": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
32
|
+
"s": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
33
|
+
"k": "new",
|
|
34
|
+
"h": "Find every feature — PMOS / commands, typed-words suggestion and What PMOS can do",
|
|
35
|
+
"try": {
|
|
36
|
+
"steps": [
|
|
37
|
+
"On Today, type / in the chat and pick Why this work exists",
|
|
38
|
+
"Type 'what if the API task slips a week' and press Tab on the suggestion",
|
|
39
|
+
"Press Ctrl+K, type features, and open What PMOS can do"
|
|
40
|
+
],
|
|
41
|
+
"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",
|
|
42
|
+
"open": "/today.html"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
2
47
|
{
|
|
3
48
|
"v": "0.786.0",
|
|
4
49
|
"at": "2026-11-24T17:39:55.270Z",
|
|
@@ -117,6 +117,7 @@ A loop never sends a message, moves a Jira ticket, merges into a product reposit
|
|
|
117
117
|
| [You decided this before](claude-proposes.md) | You add an initiative that repeats an earlier decision | `DECISIONS.md`, the decision records, the PM journal, `planning/out-of-scope/` and the initiative records | The initiative's ✦ | `pmos ai off past-repeat` |
|
|
118
118
|
| [✦ drafts](claude-proposes.md#drafts-from-a-) | You press ✓ on a ✦ that offers a draft: a line of the Overview, a program's For or Goal, the documents a gate needs, a goal or initiatives from the strategy, an outcome verdict or a goal's name. One short run for each press. | The records in the product's folder. It writes nothing and sends nothing. | The row you pressed: "PMOS is drafting it", then the draft | Press ✕ on the draft. Nothing is kept until you keep it. |
|
|
119
119
|
| [Report readers](claude-proposes.md) | A report draft is written | The draft, read as the CFO, the engineering lead and the sceptic | The ✦ of each initiative the question quotes | `pmos ai off report-readers` |
|
|
120
|
+
| [Stuck work](claude-proposes.md) | Each time you open an initiative's ✦. No run, no model. | The tasks' own state days, and the last change of each Jira ticket | "Stuck" under the initiative's ✦: a drafted note to the owner, or Park | Press ✕ on the step. Nothing is sent: a note waits in the Outbox. |
|
|
120
121
|
| [Initiative descriptions](claude-proposes.md) | Once a day. At most 3 drafts a day for each product. | The PRD's first Problem or Why paragraph, or the record's own first paragraph | "Description" under the initiative's ✦ | `pmos ai off descriptions`. `PMOS_DESCRIPTIONS=off` |
|
|
121
122
|
| [Expected outcomes](claude-proposes.md) | Once a day. At most 3 drafts a day for each product. When a check date passes: the verdict, from the goal's reading or one short run. | The PRD's success criteria, or the anchored key result. For a verdict: the goal's reading, or the lines the run cites | "Expected outcome" under the initiative's ✦. A verdict is recorded with Undo. Your move when PMOS cannot tell. | `pmos ai off outcomes`. `PMOS_OUTCOMES=off` |
|
|
122
123
|
| [Metric drafts](claude-proposes.md) | A product with no North Star, the first 14 days of a quarter, a program with no goal, and an initiative that gets a PRD | The last 8 weeks of real readings | The page of that product, program or initiative | `PMOS_METRIC_DRAFT=off` |
|
|
@@ -19,6 +19,7 @@ Press the ✦ to open "PMOS proposes N" in the Viewer. On a desk the chat stays
|
|
|
19
19
|
- **Check these.** A maybe match, with its reason, and an item that is already in another initiative. A duplicate is linked, never copied. These need their own ✓.
|
|
20
20
|
- **Not placed.** What PMOS could not fit. It is kept under Linked.
|
|
21
21
|
- **Dates.** Each morning, and whenever a date passes, PMOS proposes new dates for tasks that are late or at risk (due within 3 days and not started), one proposal per stage. Each line names the task and its two days: "Move <task> from 24 Nov to 27 Nov". The reason is one line with its source. When PMOS finds no reason, it says "No reason found" and offers to ask the owner. When a new date reaches a task that waits on it, the proposal shows the link: keep it (the waiting task moves too) or ignore it (it stays and the two overlap). PMOS marks the one it recommends with a small ✦.
|
|
22
|
+
- **Stuck.** A task that is In progress and has not changed for 14 days gets one prepared next step. When someone else owns it, PMOS drafts a short note to them that names the task and the day it last moved: ✓ puts the note in the Outbox, and nothing is sent until you send it. When you own it, or nobody does, ✓ parks it back in To do with the reason. A Jira ticket is never changed: both steps are drafted comments. Undo moves the task back to In progress and takes the note out of the Outbox. ✕ hides the step until the task changes again.
|
|
22
23
|
- **Cut to keep the date.** When an initiative's open tasks will finish after its date, and that date is still ahead, PMOS proposes "Cut 3 tasks to keep 12 Dec". It lists the tasks that finish after the date, and any task that waits on one of them. Each line shows when the task would end, where it moves to, and what the cut costs: "the PRD names it" (listed last) or a Jira ticket (PMOS drafts a comment and does not change the ticket). A ◇ milestone is never cut. Keep moves each task to the first working day after the date, with the same length, and adds a note that says why. Undo puts the dates and the notes back. This proposal is never in Keep all, and PMOS never applies it by itself. Remove a task you want to keep with its ✕. The date is the initiative's committed end, or else the latest due date of its tasks. Count the cuts you kept with `node lib/scope-cuts.js count`.
|
|
23
24
|
- **Status.** "Looks done" when the evidence says the work happened, such as an email that was sent.
|
|
24
25
|
- **Names.** Tidy names: the WBS number kept, verb first, about 7 words, no "+" and no brackets. The detail that is cut goes to the task's notes.
|
package/workspace/guide/home.md
CHANGED
|
@@ -182,6 +182,7 @@ Some features, such as Notes, open as a plain card in the Viewer. Each one works
|
|
|
182
182
|
## Search, Guide and Settings
|
|
183
183
|
|
|
184
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.
|
|
185
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.
|
|
186
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".
|
|
187
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 ↻.
|
|
@@ -235,7 +236,8 @@ There is no My work page. The list on Today is your list:
|
|
|
235
236
|
- A conversation opens at its latest message.
|
|
236
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.
|
|
237
238
|
- Your message shows as you typed it. Markdown that you paste (headings, lists, bold, code, tables) shows formatted.
|
|
238
|
-
- 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.
|
|
239
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.
|
|
240
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.
|
|
241
243
|
|
|
@@ -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 };
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
* live the live round's ask (lib/live-round.js askOf): type new "PMOS will show 3 ways: A …, B …, C …" (data { brief, directions }) or type
|
|
37
37
|
* feedback "Round n of B: …" (data { brief, base, round }). No items; section 'check'. ✓ starts the round (lib/live-round.js),
|
|
38
38
|
* whose result is a prototyped or improved proposal with data.live (its slots: working, made, not made). Undo stops it
|
|
39
|
+
* stuck computed like the dates, never filed (lib/stuck-next.js, stuck-next-step): a task In progress with no change for 14 days. type
|
|
40
|
+
* nudge (a drafted note to its owner, queued in the Outbox on ✓) or park (✓ sets To do with the reason). One item; section
|
|
41
|
+
* 'check'; kept as id:sig, so the step comes back when the task changes again
|
|
39
42
|
* grill what Claude found when it grilled the initiative by itself (lib/grill.js): type = the angle, no items, a next step in data.next;
|
|
40
43
|
* always section 'check' (its own ✓, never Keep all). 3 show, best rank first; the group's `more` counts the rest and
|
|
41
44
|
* `hidden` carries them short (id, type, title, why, at, sig), for Your move's ranked list (pm/move-rank.js)
|
|
@@ -428,7 +431,9 @@ function foundOf(F, ini) {
|
|
|
428
431
|
function taskOf(x) {
|
|
429
432
|
const s = dn(x.start), e = dn(x.end != null ? x.end : x.due);
|
|
430
433
|
return { uid: x.uid || x.key, title: str(x.title), ini: str(x.ini), status: str(x.status) || 'To do', s: s == null ? e : s, e: e == null ? s : e, hasStart: s != null,
|
|
431
|
-
jira: x.src === 'jira' || !!x.jira, ms: !!x.milestone, closed: CLOSED.has(x.status), sec: str(x.section) || str(x.itemStage) || '', owner: str(x.owner), notes: str(x.notes), kind: str(x.kind)
|
|
434
|
+
jira: x.src === 'jira' || !!x.jira, ms: !!x.milestone, closed: CLOSED.has(x.status), sec: str(x.section) || str(x.itemStage) || '', owner: str(x.owner), notes: str(x.notes), kind: str(x.kind),
|
|
435
|
+
// when it last changed and who has it in Jira: lib/stuck-next.js reads them (stuck-next-step)
|
|
436
|
+
...(x.since ? { since: str(x.since) } : {}), ...(x.updated ? { updated: str(x.updated) } : {}), ...(x.assignee ? { assignee: str(x.assignee) } : {}) };
|
|
432
437
|
}
|
|
433
438
|
function lateOf(t, today) {
|
|
434
439
|
if (t.closed || t.e == null || t.kind === 'Epic') return '';
|
|
@@ -518,7 +523,7 @@ function datesOf(ini, T, o = {}) {
|
|
|
518
523
|
}
|
|
519
524
|
|
|
520
525
|
/* ── what r.props carries ── */
|
|
521
|
-
const ORDER = { build: -3, harness: -2.5, description: -2, outcome: -1, live: -0.7, prototyped: -0.6, improved: -0.5, scanned: -0.4, found: 0, dates: 1, scope: 1.5, status: 2, names: 3, links: 4, grill: 5 };
|
|
526
|
+
const ORDER = { build: -3, harness: -2.5, description: -2, outcome: -1, live: -0.7, prototyped: -0.6, improved: -0.5, scanned: -0.4, found: 0, dates: 1, scope: 1.5, stuck: 1.6, status: 2, names: 3, links: 4, grill: 5 };
|
|
522
527
|
const GRILL_SHOWN = 3;
|
|
523
528
|
/**
|
|
524
529
|
* One initiative's proposals, as the ✦ and the Viewer draw them, or null when there is nothing to show.
|
|
@@ -550,6 +555,12 @@ function viewOf(F, ini, o = {}) {
|
|
|
550
555
|
const grillHidden = o.grillAll ? [] : grill.slice(GRILL_SHOWN).map((p) => ({ id: p.id, group: 'grill', type: p.type, title: p.title, why: p.why, at: p.at, sig: p.sig, sources: p.sources, data: p.data, items: [] }));
|
|
551
556
|
if (!o.grillAll) for (const p of grill.slice(GRILL_SHOWN)) props.splice(props.indexOf(p), 1);
|
|
552
557
|
if (today != null) for (const p of datesOf(ini, T, { today, filed: [...F.props.values()].filter((x) => x.group === 'dates' && x.ini === ini), stages: o.stages, links: o.links, settle: o.settle, drops: F.drops })) if (!kept.has(p.id + ':' + p.sig)) props.push(p);
|
|
558
|
+
// stuck work (stuck-next-step): one prepared step per task In progress with no change for 14 days, computed fresh like the dates
|
|
559
|
+
if (today != null) for (const p of require('./stuck-next.js').propsOf(ini, T, { today, drops: F.drops, me: o.me, pmName: o.pmName })) {
|
|
560
|
+
if (kept.has(p.id + ':' + p.sig)) continue;
|
|
561
|
+
p.items = p.items.filter((x) => !F.drops.has(itemSig(p, x)));
|
|
562
|
+
if (p.items.length) props.push(p);
|
|
563
|
+
}
|
|
553
564
|
// the scope cuts that save the date (lib/scope-cuts.js, idea A43): computed fresh like the dates ✦, never filed; its own ✓ (class C)
|
|
554
565
|
if (today != null && o.limit != null) {
|
|
555
566
|
for (const p of require('./scope-cuts.js').cutsOf(ini, T, { today: o.today, limit: o.limit, links: o.links, named: o.named })) {
|
|
@@ -836,6 +836,7 @@ function jiraFacts(rd) {
|
|
|
836
836
|
if (rd.points != null && rd.points !== '') o.points = rd.points;
|
|
837
837
|
if (rd.status) o.jiraStatus = String(rd.status);
|
|
838
838
|
if (rd.url) o.url = String(rd.url);
|
|
839
|
+
if (rd.updated) o.updated = String(rd.updated); // when the ticket last changed: a stuck ticket (lib/stuck-next.js)
|
|
839
840
|
return o;
|
|
840
841
|
}
|
|
841
842
|
/** The work items of a board: its PMOS tasks (the ledger and the initiatives' breakdown items) and, with Build and deliver on, the Jira items of its initiatives
|
|
@@ -62,10 +62,14 @@ function view(ctx, p, ini, f, o = {}) {
|
|
|
62
62
|
let linkProps = [];
|
|
63
63
|
try { const lv = TL.viewOf(LF, ini, { T: f.T, today: todayIso(), limit: f.limit, src: TLR.sourcesOf(p.w.root, ini, f.items) }); linkProps = lv ? lv.proposals : []; } catch { linkProps = []; }
|
|
64
64
|
const T = new Map(); for (const x of f.items) { if (!x || !(x.uid || x.key)) continue; const t = PR.taskOf(x); T.set(t.uid, t); }
|
|
65
|
+
// the PM's own name: a stuck task of theirs offers Park, never a nudge to themselves (stuck-next-step)
|
|
66
|
+
let me = '', pmName = '';
|
|
67
|
+
try { me = require('./actor.js').PM_SLUG || ''; } catch { me = ''; }
|
|
68
|
+
try { pmName = require('./routes-board-publish.js').sharedBy() || ''; } catch { pmName = ''; }
|
|
65
69
|
// the scope cuts (lib/scope-cuts.js): the committed end, and the PRD's words to say which cut costs more
|
|
66
70
|
const prd = (() => { try { return TLR.prdText(p.w.root, ini) || ''; } catch { return ''; } })();
|
|
67
71
|
const named = (title) => { const t = String(title || '').replace(/^\d+(\.\d+)*\s+/, '').trim(); return t.length >= 6 && prd.toLowerCase().includes(t.toLowerCase()); };
|
|
68
|
-
return PR.viewOf(F, ini, { T, today: todayIso(), stages: stagesOf(ctx, p, ini), links, settle: TL.settle, linkProps, grillAll: !!o.grillAll, limit: limitOf(f, T, ini), named });
|
|
72
|
+
return PR.viewOf(F, ini, { T, today: todayIso(), stages: stagesOf(ctx, p, ini), links, settle: TL.settle, linkProps, grillAll: !!o.grillAll, limit: limitOf(f, T, ini), named, me, pmName });
|
|
69
73
|
}
|
|
70
74
|
/** The date the scope cuts keep: the initiative's committed end (its plan items), else the plan end its tasks make, as the Board's row
|
|
71
75
|
* shows it (routes-boards boardRow: the latest due date of its tasks). → day number | null */
|
|
@@ -109,10 +113,11 @@ function keepCore(ctx, p, g, f, ini, want, choices = {}, extra = {}) {
|
|
|
109
113
|
if ((x.group === 'prototyped' || x.group === 'improved') && !w.length && x.failed) { failed.push({ id: x.id, why: x.failed }); continue; } // a round still being made stays open
|
|
110
114
|
wrote.push(...w);
|
|
111
115
|
if (x.group === 'dates' && x.plan && w.some((y) => y.op === 'dates')) plans++;
|
|
112
|
-
keptIds.push(x.group === 'dates' || x.group === 'scope' ? x.id + ':' + x.sig : x.id); // computed fresh: kept while its signature holds
|
|
116
|
+
keptIds.push(x.group === 'dates' || x.group === 'scope' || x.group === 'stuck' ? x.id + ':' + x.sig : x.id); // computed fresh: kept while its signature holds
|
|
113
117
|
if (x.group === 'scope' && w.length) console.error(`${require('./scope-cuts.js').TAG} kept ${ini}: ${w.filter((y) => y.op === 'dates').length} moved to after ${(x.data && x.data.date) || ''}`);
|
|
118
|
+
if (x.group === 'stuck') require('./stuck-next.js').say('kept ' + x.type + ' on ' + ini);
|
|
114
119
|
}
|
|
115
|
-
for (const a of outbox) { const id = toOutbox(ctx, a); if (id) wrote.push({ op: 'outbox', task: a.task, entry: id, why: a.text }); }
|
|
120
|
+
for (const a of outbox) { const id = toOutbox(ctx, a); if (id) wrote.push({ op: 'outbox', task: a.task, entry: id, why: a.text, ...(a.nudge ? { nudge: true } : {}) }); }
|
|
116
121
|
const batch = PR.newBatch();
|
|
117
122
|
PR.append(dir, g.actor, { kind: 'keep', ini, board: p.board.id, batch, ids: keptIds, wrote, ...extra });
|
|
118
123
|
return { batch, wrote, plans, keptIds, failed };
|
|
@@ -143,6 +148,8 @@ function undoCore(ctx, p, g, id) {
|
|
|
143
148
|
else if (w.op === 'link') { TL.append(dir, g.actor, { kind: 'unlink', from: w.from, to: w.to }); back++; continue; }
|
|
144
149
|
else if (w.op === 'prd') { try { const file = path.resolve(p.w.root, w.file), text = fs.readFileSync(file, 'utf8'); if (text.includes(w.to)) { fs.writeFileSync(file, text.split(w.to).join(w.from)); back++; } else kept++; } catch { kept++; } continue; }
|
|
145
150
|
else if (w.op === 'doc' || w.op === 'linked' || w.op === 'ran') { back++; continue; } // the fold leaves an undone batch out
|
|
151
|
+
// a stuck task's nudge (stuck-next-step): Undo discards the draft it queued; any other drafted comment waits in the outbox, where the PM drops it
|
|
152
|
+
else if (w.op === 'outbox' && w.nudge && w.entry) { try { require('./outbox-store.js').appendEvent(ctx.runtimeDir, { event: 'discarded', id: w.entry }, new Date()); back++; } catch { kept++; } continue; }
|
|
146
153
|
else if (w.op === 'outbox') { kept++; continue; } // a drafted comment waits in the outbox, where the PM drops it
|
|
147
154
|
else if (w.op === 'description') { const r2 = require('./initiative-writer.js').restoreDescription(p.w.root, k.ini, w.from || '', w.to || '', { actor: g.actor }); if (r2.ok && !r2.kept) back++; else kept++; continue; } // a record edited since keeps its edit
|
|
148
155
|
else if (w.op === 'life') { const r2 = require('./outcomes.js').setLife(p.w.root, k.ini, w.from === 'cancelled' ? 'cancelled' : 'active', 'Undo: PMOS ✦ stopped it', g.actor); if (r2.ok) back++; else kept++; continue; }
|
|
@@ -476,6 +483,16 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
|
|
|
476
483
|
const mine = own && x.data && x.data.next && own !== x.data.next ? { edited: { from: String(x.data.next).slice(0, 200), to: own } } : {};
|
|
477
484
|
if (W.ok(r)) add({ op: 'add', task: r.body.item && (r.body.item.uid || r.body.item.id), title: next, to: { start: '', due: '' }, ...mine });
|
|
478
485
|
}
|
|
486
|
+
} else if (x.group === 'stuck') {
|
|
487
|
+
// stuck work (stuck-next-step): park moves a PMOS task back to To do with the reason; a nudge is a drafted note in the Outbox, never
|
|
488
|
+
// sent. A Jira ticket is never written: both its steps are drafted comments
|
|
489
|
+
for (const it of items) {
|
|
490
|
+
const t = f.T.get(it.task); if (!t || t.closed) continue;
|
|
491
|
+
if (it.step === 'nudge') { outbox.push(t.jira ? { task: it.task, text: it.text } : { task: it.task, text: it.text, channel: 'team-note', recipient: it.to || t.owner, subject: 'About ' + t.title, nudge: true }); continue; }
|
|
492
|
+
if (t.jira) { outbox.push({ task: it.task, text: it.text + ' Could you move ' + it.task + ' back to To do, or tell me the next step?' }); continue; }
|
|
493
|
+
const r = RB.taskState(ctx, { ws: p.w.id, board: p.board.id, task: it.task, state: 'To do', why: it.text }, g);
|
|
494
|
+
if (W.ok(r)) add({ op: 'state', task: it.task, title: t.title, from: t.status, to: 'To do' });
|
|
495
|
+
}
|
|
479
496
|
} else if (x.group === 'scope') {
|
|
480
497
|
// the scope cuts that save the date (lib/scope-cuts.js): each task moves to after the date, with a note saying why; Undo puts both back
|
|
481
498
|
const SC = require('./scope-cuts.js'), note = SC.noteOf(x), date = (x.data && x.data.date) || '';
|
|
@@ -524,12 +541,13 @@ function prdRename(root, ini, from, to) {
|
|
|
524
541
|
return { file: path.relative(root, file), n };
|
|
525
542
|
} catch { return null; }
|
|
526
543
|
}
|
|
527
|
-
/** A drafted Jira comment for a ticket Claude would change: it goes to the outbox, never to Jira (rule 8).
|
|
544
|
+
/** A drafted Jira comment for a ticket Claude would change: it goes to the outbox, never to Jira (rule 8). ask.channel 'team-note' with a
|
|
545
|
+
* recipient: a note to a teammate (a stuck task's nudge, stuck-next-step). Nothing is sent. */
|
|
528
546
|
function toOutbox(ctx, ask) {
|
|
529
547
|
try {
|
|
530
548
|
const { repoScript } = require('./repo-script.js');
|
|
531
549
|
const outbox = require(repoScript('outbox.js')), store = require('./outbox-store.js');
|
|
532
|
-
const e = outbox.draftOutbox({ channel: 'jira-write', recipient: ask.task, subject: 'About ' + ask.task, body: ask.text, origin: 'pm' });
|
|
550
|
+
const e = outbox.draftOutbox({ channel: ask.channel || 'jira-write', recipient: ask.recipient || ask.task, subject: ask.subject || 'About ' + ask.task, body: ask.text, origin: 'pm' });
|
|
533
551
|
const entry = { id: 'out-' + crypto.randomBytes(6).toString('hex'), ...e };
|
|
534
552
|
store.appendEvent(ctx.runtimeDir, { event: 'queued', ...entry }, new Date());
|
|
535
553
|
return entry.id;
|
|
@@ -545,9 +563,13 @@ function saidOf(wrote, plans, left) {
|
|
|
545
563
|
if (cutN) bits.push((bits.length ? 'moved ' : 'Moved ') + plural(cutN, 'task', 'tasks') + ' to after ' + PR.md(PR.dn(cuts[0].cut)));
|
|
546
564
|
const moved = new Set(wrote.filter((w) => w.op === 'dates' && !w.scope).map((w) => w.task)).size;
|
|
547
565
|
if (moved) bits.push((bits.length ? 'moved ' : 'Moved ') + plural(moved, 'task', 'tasks') + (plans ? ' and ' + plural(plans, 'plan', 'plans') : ''));
|
|
548
|
-
|
|
566
|
+
const parked = wrote.filter((w) => w.op === 'state' && w.to === 'To do').length, ticked = n('state') - parked; // park: a stuck task (stuck-next-step)
|
|
567
|
+
if (ticked) bits.push((bits.length ? 'ticked ' : 'Ticked ') + ticked + ' done');
|
|
568
|
+
if (parked) bits.push((bits.length ? 'parked ' : 'Parked ') + plural(parked, 'task', 'tasks') + ' in To do');
|
|
549
569
|
if (n('rename')) bits.push((bits.length ? 'renamed ' : 'Renamed ') + n('rename'));
|
|
550
|
-
|
|
570
|
+
const notes = wrote.filter((w) => w.op === 'outbox' && w.nudge).length, jc = n('outbox') - notes;
|
|
571
|
+
if (jc) bits.push(plural(jc, 'Jira comment', 'Jira comments') + ' drafted');
|
|
572
|
+
if (notes) bits.push(plural(notes, 'note', 'notes') + ' drafted in the Outbox, not sent');
|
|
551
573
|
// a refuted outcome's next step (launch simulation W2)
|
|
552
574
|
if (n('created')) bits.push((bits.length ? 'started ' : 'Started ') + 'the next experiment');
|
|
553
575
|
if (wrote.some((w) => w.op === 'life' && w.to === 'cancelled')) bits.push((bits.length ? 'stopped ' : 'Stopped ') + 'this one');
|
|
@@ -623,6 +645,7 @@ const WRITES = {
|
|
|
623
645
|
// the PM's reason, when given (the idle lab's ✕ asks for one; Claude learns from it)
|
|
624
646
|
const why = typeof body.why === 'string' ? body.why.replace(/\s+/g, ' ').trim().slice(0, 300) : '';
|
|
625
647
|
PR.append(dirOf(ctx, p.w), g.actor, { kind: 'drop', ini, sig, ...which, ...(facts.length ? { facts } : {}), ...(why ? { why } : {}) });
|
|
648
|
+
if (of && of.group === 'stuck') require('./stuck-next.js').say('dropped ' + of.type + ' on ' + ini);
|
|
626
649
|
// a live round or its ask (lib/live-round.js): the ✕ is a Lessons line of the experiment, with the reason when given
|
|
627
650
|
if (of && (of.group === 'live' || ((of.group === 'prototyped' || of.group === 'improved') && of.data && of.data.live))) {
|
|
628
651
|
try { const AF = require('./artefacts.js'); AF.set(AF.file(dirOf(ctx, p.w)), { scope: 'experiment:' + ini, artefact: 'lessons', field: 'line', text: `✕ dropped "${String(of.title || '').slice(0, 140)}"${why ? ': ' + why : ''}`, sources: [{ label: 'live round' }] }, { by: g.actor && /^(pm|agent):/.test(String(g.actor.by)) ? g.actor.by : 'agent:live-round' }); } catch { /* the drop line holds it */ }
|