create-pmos 0.492.0 → 0.494.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 +75 -27
- package/payload/KIT-VERSION +1 -1
- package/payload/mods/pmos-cockpit/README.md +1 -1
- package/payload/mods/pmos-cockpit/hooks/lib/guard.mjs +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-initiative-test.js +2 -1
- package/workspace/changelog.json +74 -0
- package/workspace/fixtures/initiatives-api/list.json +0 -4
- package/workspace/fixtures/initiatives-api/roadmap.json +255 -275
- package/workspace/fixtures/initiatives-api/sheet.json +2 -3
- package/workspace/fixtures/report-api/draft.json +4 -4
- package/workspace/fixtures/reports-page/draft-biweekly-2026-10-16.md +4 -4
- package/workspace/guide/board.md +2 -2
- package/workspace/guide/briefing-premium.md +2 -0
- package/workspace/guide/claude-proposes.md +2 -2
- package/workspace/guide/data-freshness.md +3 -1
- package/workspace/guide/index.md +2 -2
- package/workspace/guide/initiative-boards.md +2 -2
- package/workspace/guide/initiatives-roadmap.md +38 -39
- package/workspace/guide/initiatives-screen.md +22 -20
- package/workspace/guide/initiatives-timeline.md +7 -9
- package/workspace/guide/integrated-work.md +7 -8
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/lifecycle.md +2 -2
- package/workspace/guide/notes.md +1 -1
- package/workspace/guide/pm-only-acts.md +5 -5
- package/workspace/guide/pm-only-lines.md +3 -3
- package/workspace/guide/report-slides.md +14 -1
- package/workspace/guide/reports.md +4 -2
- package/workspace/guide/today.md +2 -2
- package/workspace/guide/your-impact.md +6 -7
- package/workspace/lib/board-cli.js +1 -1
- package/workspace/lib/board-fold.js +6 -6
- package/workspace/lib/board-premium.js +3 -3
- package/workspace/lib/board-trail.js +30 -3
- package/workspace/lib/calendar-tidy.js +1 -1
- package/workspace/lib/core-docs.js +2 -2
- package/workspace/lib/engine/boards.js +11 -11
- package/workspace/lib/engine/signals/detectors.js +13 -13
- package/workspace/lib/engine/signals/facts.js +5 -3
- package/workspace/lib/git-shape.js +21 -0
- package/workspace/lib/grill-runs.js +21 -6
- package/workspace/lib/grill.js +1 -1
- package/workspace/lib/health-rules-factory.js +13 -14
- package/workspace/lib/health-rules-plan.js +8 -7
- package/workspace/lib/impact.js +29 -16
- package/workspace/lib/initiative-cli.js +59 -63
- package/workspace/lib/initiative-needs.js +6 -6
- package/workspace/lib/initiative-premium.js +2 -2
- package/workspace/lib/initiative-writer.js +2 -2
- package/workspace/lib/lifecycle-stage.js +39 -0
- package/workspace/lib/page-warm.js +68 -0
- package/workspace/lib/placements.js +117 -95
- package/workspace/lib/plan-rules.js +7 -5
- package/workspace/lib/pm-guard.js +1 -3
- package/workspace/lib/pm-lines-needs.js +1 -1
- package/workspace/lib/report-design.js +6 -1
- package/workspace/lib/report-draft.js +17 -16
- package/workspace/lib/report-export.js +148 -9
- package/workspace/lib/report-pyramid.js +434 -0
- package/workspace/lib/report-slides-data.js +11 -7
- package/workspace/lib/report-structure.js +5 -1
- package/workspace/lib/report-templates.js +81 -20
- package/workspace/lib/routes-boards.js +9 -8
- package/workspace/lib/routes-brief-page.js +20 -3
- package/workspace/lib/routes-grill.js +10 -4
- package/workspace/lib/routes-impact.js +12 -4
- package/workspace/lib/routes-initiatives.js +29 -43
- package/workspace/lib/routes-notes.js +24 -15
- package/workspace/lib/routes-programs.js +6 -4
- package/workspace/lib/routes-report-design.js +15 -0
- package/workspace/lib/routes-report-flow.js +106 -17
- package/workspace/lib/routes-report-setups.js +2 -1
- package/workspace/lib/routes-report-structure.js +3 -0
- package/workspace/lib/split-merge.js +2 -3
- package/workspace/lib/wf-bridge.js +5 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-report-tab-test.js +5 -1
- package/workspace/public/pm/cozy-vw-rp.css +12 -0
- package/workspace/public/pm/fetch-share.js +38 -0
- package/workspace/public/pm/home-app.js +21 -3
- package/workspace/public/pm/home-chat.js +5 -4
- package/workspace/public/pm/home-impact.css +23 -13
- package/workspace/public/pm/home-impact.js +49 -32
- package/workspace/public/pm/home-ini.css +2 -0
- package/workspace/public/pm/http.js +1 -1
- package/workspace/public/pm/ini-view.css +55 -0
- package/workspace/public/pm/ini-view.js +5 -2
- package/workspace/public/pm/premium-board.js +1 -0
- package/workspace/public/pm/premium-insights.js +1 -0
- package/workspace/public/pm/premium-report-read.js +25 -6
- package/workspace/public/pm/premium-report-tab.js +69 -14
- package/workspace/public/pm/report-flow.js +93 -10
- package/workspace/public/pm/view-notes.js +8 -8
- package/workspace/replaced-tests.json +14 -0
- package/workspace/server.js +24 -3
- package/workspace/skills/report-template.skill +8 -0
- package/workspace/test-lists/page-open-speed.json +5 -0
- package/workspace/test-lists/report-pyramid.json +9 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "PM-only acts: what you and your agents can do"
|
|
4
4
|
description: "The acts that were only the PM's, how the workspace checks that a press comes from your page, your terminal or an agent session, what to do when a press is refused, and how every agent act is logged under the agent's name (D98)."
|
|
5
|
-
timestamp: 2026-
|
|
5
|
+
timestamp: 2026-11-02
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# PM-only acts: what you and your agents can do
|
|
@@ -18,7 +18,7 @@ Some acts decide what the work is and when it is done. Since [D98](/okf/products
|
|
|
18
18
|
| Approve a contract | Not on the page yet. In your own terminal, run `node scripts/log-run.js` with `PM_approved: true` in the contract. |
|
|
19
19
|
| Record a D60 disposition of a prototype | Not on the page yet. A later run adds it. |
|
|
20
20
|
| Hold, close, cancel or reopen an initiative | The initiative's lifecycle menu |
|
|
21
|
-
|
|
|
21
|
+
| Adopt an open proposal (Move to Now was retired with the horizons, D105) | Initiatives (arrives with the Initiatives screen) |
|
|
22
22
|
| Change the anchor (`parent_kr`) of an initiative | The document editor, or the confirm step of Add a repository |
|
|
23
23
|
| Bind a session to an initiative | The session's initiative menu, or + session on an initiative |
|
|
24
24
|
| Issue a report | Reports (arrives in Run 5) |
|
|
@@ -61,15 +61,15 @@ Inside an agent session (the session has a `PMOS_SESSION` value) the command doe
|
|
|
61
61
|
|
|
62
62
|
You can change the lifecycle of up to 20 initiatives in one press. The press makes one grant for the change, and each lifecycle line names that grant. Until the grant writer is available, the workspace refuses the press and writes nothing.
|
|
63
63
|
|
|
64
|
-
You cannot
|
|
64
|
+
You cannot change an anchor in one press for many initiatives. Do it one at a time.
|
|
65
65
|
|
|
66
66
|
## What an agent can write
|
|
67
67
|
|
|
68
68
|
An agent can do every act in the table above, and it can:
|
|
69
69
|
|
|
70
70
|
- add items, which are live at once, and change, move, block and withdraw any item, yours included;
|
|
71
|
-
- create an initiative (it lands
|
|
72
|
-
-
|
|
71
|
+
- create an initiative (it lands at the end of the Roadmap), write report text, and record a measurement with a source;
|
|
72
|
+
- rank an initiative on the Roadmap; the move applies at once.
|
|
73
73
|
|
|
74
74
|
Every line it writes names the agent. Some things stay yours:
|
|
75
75
|
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "PM-only lines: how the workspace checks your acts"
|
|
4
4
|
description: "Which acts only you can do, how each one is recorded, what the Today card 'A PM-only line is not attested' means, what to do about it, and the grants for a bulk lifecycle change and a Release."
|
|
5
|
-
timestamp: 2026-
|
|
5
|
+
timestamp: 2026-11-02
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# PM-only lines: how the workspace checks your acts
|
|
9
9
|
|
|
10
10
|
Some acts are yours only. An agent can propose them, but it cannot do them. These acts are PM-only:
|
|
11
11
|
|
|
12
|
-
- Move to Now
|
|
12
|
+
- Adopt an agent's proposal. (Move to Now was retired with the horizons, D105.)
|
|
13
13
|
- Issue a report.
|
|
14
14
|
- Accept a run, approve or return a review, approve a document or a contract, and record a D60 disposition.
|
|
15
15
|
- Change the lifecycle of an initiative.
|
|
@@ -55,7 +55,7 @@ The gate does not use the dates of a commit, because the person or program that
|
|
|
55
55
|
|
|
56
56
|
Some presses mint a grant: your permission for one action, used once, for 120 minutes.
|
|
57
57
|
|
|
58
|
-
- **A bulk lifecycle change.** In the Initiatives list, select up to 20 initiatives and change their lifecycle. The press mints one `lifecycle-bulk` grant that names the state and each initiative. Each lifecycle line cites that grant.
|
|
58
|
+
- **A bulk lifecycle change.** In the Initiatives list, select up to 20 initiatives and change their lifecycle. The press mints one `lifecycle-bulk` grant that names the state and each initiative. Each lifecycle line cites that grant. An anchor change is never a bulk act.
|
|
59
59
|
- **A Release.** A Release of a factory batch mints one `release` grant for that batch.
|
|
60
60
|
|
|
61
61
|
To mint a grant at a terminal in a cockpit session, type `/pmos-grant release:<initiative>:<batch-id>` or `/pmos-grant lifecycle-bulk:<state>:<id>,<id>`. The state is one of `active`, `closed`, `on-hold` and `cancelled`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Report slides: present and print a report"
|
|
4
4
|
description: "How the Reports page shows a report as the PM-OS biweekly slides, how to present and print them, and how your notes become the words on the slides."
|
|
5
|
-
timestamp: 2026-
|
|
5
|
+
timestamp: 2026-11-02
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Report slides
|
|
@@ -27,4 +27,17 @@ The type is Launch, Improvement, Fix, Security, Deprecation or Beta. To give an
|
|
|
27
27
|
|
|
28
28
|
A draft from before the slides has no slides block. Press **Redraft** to add it. Your notes stay as you wrote them.
|
|
29
29
|
|
|
30
|
+
## The finished slides in the report viewer
|
|
31
|
+
|
|
32
|
+
When you open a drafted report in the viewer, the **Slides** view shows the finished deck. The answer comes first, and the title of each slide is a finding. Read only the titles and you have the story:
|
|
33
|
+
|
|
34
|
+
1. **Title**: the answer. This is your `report.headline` note when you wrote one. If not, PMOS writes a sentence that says which initiatives are off plan.
|
|
35
|
+
2. **The answer**: one sentence with up to three supports, off-plan initiatives first. Your ask is beside them.
|
|
36
|
+
3. **Scorecard**: each initiative's stage, its status (a shape and a colour), done of total with the change since the last report, and the KR value against its target. The gap is the value minus the target. Only a row that is off plan (at risk or off track) has a comment. A row that is on track has none.
|
|
37
|
+
4. **Timeline**: the dated work, the due dates and any overdue item. The title compares two due dates.
|
|
38
|
+
5. **Needs your call**: only when the report has an audience and the `report.asks` note has words. Write each option on its own line that starts with "- ". Write "by" and a date in the note to show a deadline. PMOS adds nothing that you did not write.
|
|
39
|
+
6. **Sources**: the sources that PMOS read, and "What we don't know yet" for each source that it could not read, with the reason.
|
|
40
|
+
|
|
41
|
+
Each slide names its source and shows its page number. **Download › PDF** prints the same slides, one on each page. **Download › PPTX** gives the same slides as a PowerPoint file. The slides use the report's saved look (its font and main colour). If the report has no saved look, they use the standard PMOS look. PMOS does not draw KR trend lines, last-quarter bars or forecast ranges, because the draft does not have that data yet.
|
|
42
|
+
|
|
30
43
|
A report that you set up can have its own design, as a deck or an interactive document, with a presenter view, speaker notes and notes on the slide. See [Design how a report looks](report-design.md).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Reports: draft and issue a cadence report"
|
|
4
4
|
description: "How pmos report drafts a cadence report with every number, how the notes are kept when you draft again, and how you issue and freeze a report."
|
|
5
|
-
timestamp: 2026-
|
|
5
|
+
timestamp: 2026-11-02
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Reports: draft and issue a cadence report
|
|
@@ -17,7 +17,7 @@ The draft has these sections, in this order:
|
|
|
17
17
|
|
|
18
18
|
1. **Headline.** A count of the initiatives that moved, are off track or are at risk.
|
|
19
19
|
2. **Timeline.** The dated items of each initiative, as they were when the numbers were read.
|
|
20
|
-
3. **One block for each initiative.** Only work initiatives that were active in the window get a block. Off track and at risk come first. A block shows the stage, the health and its reason, and the progress, for example "7 of 12 (+4)": 7 of 12 items are done, and 4 of them were done in this window. **Last cycle** lists the items done, the gates passed, the moves
|
|
20
|
+
3. **One block for each initiative.** Only work initiatives that were active in the window get a block. Off track and at risk come first. A block shows the stage, the health and its reason, and the progress, for example "7 of 12 (+4)": 7 of 12 items are done, and 4 of them were done in this window. **Last cycle** lists the items done, the gates passed, the moves on the Roadmap (for example "#2 to #1"), and the overdue items. **Coming cycle** lists the items that start or are due in the next window. If there are none, it lists the next 3 items in order.
|
|
21
21
|
4. **New since last report.** The initiatives that were added in the window.
|
|
22
22
|
5. **Decided this cycle.** The decisions you made in the window. A decision that waits for you is not in the report. It comes to you on the Cycle review card, and it does not stop you from issuing.
|
|
23
23
|
6. **Needs your call.** The asks to the audience that the definition names, and to no one else.
|
|
@@ -47,6 +47,8 @@ The Reports page shows a report as slides. [Report slides](report-slides.md) tel
|
|
|
47
47
|
|
|
48
48
|
When you draft a slot again, every note stays as you wrote it, next to its initiative. The order of the blocks can change. A note for an initiative that is no longer in the window moves to "Notes kept from an earlier draft".
|
|
49
49
|
|
|
50
|
+
When you ask Claude in a chat to change a report, the change goes to the latest draft of that report, in its own file. The report's session rewrites the notes that the change is about, even when they have text, and then drafts the same slot again. It does not draft a new slot for today. A change to a number, a date, a section or a slide is not made in the draft: the session tells you which setting to change in the template or the studio. If the latest cycle is issued, it is frozen, and the change is not passed on.
|
|
51
|
+
|
|
50
52
|
## The commands
|
|
51
53
|
|
|
52
54
|
`pmos report draft <cadence> [<slot>]` writes the draft to `planning/reports/<cadence>/<slot>.md`. The slot is a date, YYYY-MM-DD. If you do not give a slot, the slot is today. If a draft for the slot exists, the command stops and writes nothing. To draft the slot again and keep every note, add `--redraft`. To fix the clock, add `--now <time>`: two drafts with the same inputs and the same `--now` are the same, byte for byte.
|
package/workspace/guide/today.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Today: what needs you"
|
|
4
4
|
description: "The Agenda month and the calendar it remembers, the meeting notes of a meeting, the two-column day (your jobs and the agent's jobs), the eight kinds of card on Today, the one button on each card, the count, the empty state, and the pmos today command."
|
|
5
|
-
timestamp: 2026-
|
|
5
|
+
timestamp: 2026-11-02
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Today: what needs you
|
|
@@ -157,7 +157,7 @@ Today puts the cards in this order. Within a kind, the cards keep a fixed order,
|
|
|
157
157
|
| 4. Work to check | An item is in Review, or an item is Done with no evidence. | Open |
|
|
158
158
|
| 5. Keep an agent breakdown | Retired by D98: an agent's items are live at once, so this card no longer shows. | — |
|
|
159
159
|
| 6. A triaged capture | A capture was triaged and waits for you to add it or dismiss it. | Open |
|
|
160
|
-
| 7. Cycle review | The cycle review is due
|
|
160
|
+
| 7. Cycle review | The cycle review is due: an agent proposal to keep or drop, or a check-by date that passed. | Open |
|
|
161
161
|
| 8. Needs repair | A schedule left no output, a line from the PM has no attestation, or a record has no anchor. Today shows the card until it is fixed. | Open |
|
|
162
162
|
|
|
163
163
|
A stalled initiative is not a card. It shows as a health reason on the initiative, in the list and in its detail.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Your impact"
|
|
4
4
|
description: "What Your impact is, what counts and what never counts, the weekly check in Home's chat, the switch in Settings, and the pmos impact commands."
|
|
5
|
-
timestamp: 2026-
|
|
5
|
+
timestamp: 2026-11-02
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Your impact
|
|
@@ -19,15 +19,14 @@ There are no numbers. You see no points, scores, counts, streaks, levels or rank
|
|
|
19
19
|
|
|
20
20
|
## The weekly check
|
|
21
21
|
|
|
22
|
-
Once a day, Claude reads your sources and files what it found. After the week ends, Claude
|
|
22
|
+
Once a day, Claude reads your sources and files what it found. After the week ends, Claude shows that week's items in Home's chat as thank-you notes: the words in bold, who and what under them, and the source link. They already count. You do not have to do anything.
|
|
23
23
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
- ✓✓ keeps every item that is not checked yet.
|
|
24
|
+
- If an item is not right, press ⋯ on its row, then **Not right, drop it**. A dropped item does not count, and Claude does not file it again.
|
|
25
|
+
- **Undo** brings a dropped item back.
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
You can drop items until the next week ends. After that, every item you did not drop counts as real.
|
|
29
28
|
|
|
30
|
-
Adler's sprout and your impact log stay hidden until two weekly checks show that at least 9 of 10 items are real. Then Adler's sprout grows a leaf for each week's
|
|
29
|
+
Adler's sprout and your impact log stay hidden until two weekly checks show that at least 9 of 10 items are real. A week counts toward this only if Claude showed you its check. Then Adler's sprout grows a leaf for each week's items, and the log in the Viewer shows your weeks, newest first. A quiet week says "A quiet week". Nothing wilts and nothing resets.
|
|
31
30
|
|
|
32
31
|
## Where you see it
|
|
33
32
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* The SAME fold the Board page reads (lib/board-fold.js, the one behind GET /api/board), so a terminal line and a card
|
|
7
7
|
* cannot disagree about an item. No server is needed: the command reads the ledgers of the repository. With no flag it
|
|
8
|
-
* prints the Active filter (an item with an event in the last stall_days, an open item under an initiative
|
|
8
|
+
* prints the Active filter (an item with an event in the last stall_days, an open item under an initiative ranked on the Roadmap, and
|
|
9
9
|
* your own items). `--mine` prints your own items. `--init <initiative>` prints one initiative. `--json` prints the same
|
|
10
10
|
* answer as GET /api/board for that filter, without the workspace id. The command only reads: it writes no line.
|
|
11
11
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* lib/plan-tree.js layout() builds each initiative's columns (R19, the same 14-day Done window).
|
|
15
15
|
*
|
|
16
16
|
* FILTERS (R9). `active` is the default: an item with an event in the last stall_days (planning/plan-rules.json), an open
|
|
17
|
-
* item under an initiative
|
|
17
|
+
* item under an initiative a line ranked on the Roadmap (D105), and the PM's own items (owner `you`). `mine` is the PM's own items. `init:<id>`
|
|
18
18
|
* is one initiative. Done shows the last 14 days under Active and under an initiative, however old the item's last event is
|
|
19
19
|
* (the layout's own window, lib/plan-tree.js DONE_WINDOW_MS); older Done items are counted, never listed. Under Mine, Done
|
|
20
20
|
* shows the PM's own items by the same window.
|
|
@@ -44,7 +44,6 @@ const planRules = require('./plan-rules.js');
|
|
|
44
44
|
const actor = require('./actor.js');
|
|
45
45
|
|
|
46
46
|
const DAY = 86400000;
|
|
47
|
-
const HORIZON_RANK = { now: 0, next: 1, later: 2 };
|
|
48
47
|
const STATES = ['todo', 'doing', 'review', 'done'];
|
|
49
48
|
const NOT_MERGED = planTree.NOT_MERGED_LABEL || 'Done · your call · not merged';
|
|
50
49
|
const TOKEN_TEXT_RE = /\b(sess-\d+)\.[0-9a-f]{8}\b/g;
|
|
@@ -203,15 +202,16 @@ function boardRead(w, { filter, now = Date.now() } = {}) {
|
|
|
203
202
|
|
|
204
203
|
const rows = inits.map((i) => {
|
|
205
204
|
const p = place.byInit && place.byInit[i.id];
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
// D105: one Roadmap rank. `ranked` = a line put it on the Roadmap (Prioritize's output), not day one's guess
|
|
206
|
+
return { ...i, rank: p && Number.isFinite(p.rank) ? p.rank : 0, ranked: !!(p && p.confirmed) };
|
|
207
|
+
}).sort((a, b) => (a.rank - b.rank) || a.id.localeCompare(b.id));
|
|
208
208
|
|
|
209
209
|
const wanted = (it, row) => {
|
|
210
210
|
if (f.kind === 'init') return it.initiative === f.init;
|
|
211
211
|
if (it.owner === 'you') return true;
|
|
212
212
|
if (f.kind === 'mine') return false;
|
|
213
213
|
if (it.state === 'done') return true; // plan-tree's 14-day window lists the recent ones; the rest are counted
|
|
214
|
-
if (row.
|
|
214
|
+
if (row.ranked) return true; // every item of a ranked initiative (was: of a Now initiative; D105)
|
|
215
215
|
return Date.parse(it.updatedAt) >= now - stallMs;
|
|
216
216
|
};
|
|
217
217
|
|
|
@@ -232,7 +232,7 @@ function boardRead(w, { filter, now = Date.now() } = {}) {
|
|
|
232
232
|
const doneAll = [...keep].filter((id) => lay.items[id].state === 'done').length;
|
|
233
233
|
board.doneOlder += doneAll - lay.board.done.filter((id) => keep.has(id)).length;
|
|
234
234
|
initiatives.push({
|
|
235
|
-
id: row.id, title: row.title, lane: row.lane, laneLabel: row.laneLabel,
|
|
235
|
+
id: row.id, title: row.title, lane: row.lane, laneLabel: row.laneLabel, rank: row.rank,
|
|
236
236
|
stages: lay.stages.map((s) => ({ id: s.id, label: s.label })), batches: pageBatches(lay.batches), shown: listed,
|
|
237
237
|
});
|
|
238
238
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* facts come from the routes of lib/routes-boards.js and lib/routes-core-docs.js:
|
|
8
8
|
* board GET /api/boards/board → .board { ws, id, name, workflow: [{ name, cat }], … }
|
|
9
9
|
* counts the same answer's counts { total, open, byStage, byStatus }
|
|
10
|
-
* rows GET /api/boards/backlog → rows [{ id, title, lane, stage, cat, owner, anchor,
|
|
10
|
+
* rows GET /api/boards/backlog → rows [{ id, title, lane, stage, cat, owner, anchor, rank, status, start, end, progress, warnings, updated, stageSource, dupOf,
|
|
11
11
|
* wf, wfStage, wfStages, ended }] (the workflow fields: workflows-per-initiative; a row without `wf` is on Product feature)
|
|
12
12
|
* columns GET /api/boards/columns → [{ stage, cat, count, rows }]
|
|
13
13
|
* sprints GET /api/boards/sprints → { source: 'jira'|'none', readAt, sprints: [{ name, state, start, end, counts: { todo, doing, done } }] }
|
|
@@ -257,7 +257,7 @@ function rowOf(r, wf, today) {
|
|
|
257
257
|
const names = (wf || []).map((s) => s.name), cur = names.indexOf(r.stage);
|
|
258
258
|
const bad = r.status === 'late' || r.status === 'at risk';
|
|
259
259
|
const facts = [
|
|
260
|
-
['Lane', r.lane], ['Stage', r.stage ? r.stage + (r.stageSource ? ' (' + r.stageSource + ')' : '') : ''], ['Anchor', r.anchor], ['
|
|
260
|
+
['Lane', r.lane], ['Stage', r.stage ? r.stage + (r.stageSource ? ' (' + r.stageSource + ')' : '') : ''], ['Anchor', r.anchor], ['Rank', Number.isInteger(r.rank) ? '#' + (r.rank + 1) + ' on the Roadmap' : ''],
|
|
261
261
|
['Status', STATUS_LABEL[r.status] || (r.status ? r.status.charAt(0).toUpperCase() + r.status.slice(1) : '')], ['Owner', r.owner],
|
|
262
262
|
['Progress', pctOf(r.progress) != null ? pctOf(r.progress) + '%' : ''], ['Starts', r.start ? shortDate(r.start) : ''], ['Ends', r.end ? shortDate(r.end) : ''],
|
|
263
263
|
['Last changed', r.updated ? shortDate(String(r.updated).slice(0, 10)) : ''], ['Possible duplicate of', r.dupOf], ['Warnings', (r.warnings || []).map((w) => (typeof w === 'string' ? w : w && (w.text || w.message || w.id)) || '').filter(Boolean).join('; ')],
|
|
@@ -296,7 +296,7 @@ function build(f) {
|
|
|
296
296
|
const rows = (f.rows || []).slice(0, MAX_LIST).map((r) => rowOf(r, wf, todayIso));
|
|
297
297
|
// the on-hold rows follow the open ones; the cancelled and archived rows sit under the list's fold (initiative premium-board-actions)
|
|
298
298
|
for (const r of (f.held || [])) if (rows.length < MAX_LIST + 50 && !rows.some((x) => x.id === r.id)) rows.push(rowOf(r, wf, todayIso));
|
|
299
|
-
// an initiative a program holds stays on the list whatever its
|
|
299
|
+
// an initiative a program holds stays on the list whatever its state: the list reads the open and `risk` views, and a member the
|
|
300
300
|
// program page cannot find here shows as "not read" and its program as "No open initiatives"
|
|
301
301
|
for (const r of (f.members || [])) if (rows.length < MAX_LIST + 100 && !rows.some((x) => x.id === r.id)) rows.push(rowOf(r, wf, todayIso));
|
|
302
302
|
const gone ={ cancelled: (f.cancelled || []).slice(0, MAX_LIST).map((r) => rowOf(r, wf, todayIso)), archived: (f.archived || []).slice(0, MAX_LIST).map((r) => rowOf(r, wf, todayIso)) };
|
|
@@ -74,6 +74,28 @@ const pathOf = (v) => (typeof v === 'string' && /^[\w./-]+\.md$/.test(v.trim())
|
|
|
74
74
|
|
|
75
75
|
/** The default io: the files of `root`, its git history (one `git log` per HEAD), the Jira draft and reading, the OKR anchors. */
|
|
76
76
|
const gitCache = new Map();
|
|
77
|
+
/** The size and time of HEAD and its reflog in the git directory that holds `root` (a linked worktree's own one too), or null when they
|
|
78
|
+
* cannot be read: then the caller asks git, as before. */
|
|
79
|
+
function headStamp(root) {
|
|
80
|
+
let dir = path.resolve(root);
|
|
81
|
+
for (let i = 0; i < 40; i++) {
|
|
82
|
+
const dot = path.join(dir, '.git');
|
|
83
|
+
let gitDir = null;
|
|
84
|
+
try {
|
|
85
|
+
const st = fs.statSync(dot);
|
|
86
|
+
if (st.isDirectory()) gitDir = dot;
|
|
87
|
+
else { const m = /^gitdir:\s*(.+)$/m.exec(fs.readFileSync(dot, 'utf8')); if (m) gitDir = path.resolve(dir, m[1].trim()); }
|
|
88
|
+
} catch { /* not here: look one level up */ }
|
|
89
|
+
if (gitDir) {
|
|
90
|
+
try {
|
|
91
|
+
const a = fs.statSync(path.join(gitDir, 'HEAD')), b = fs.statSync(path.join(gitDir, 'logs', 'HEAD'));
|
|
92
|
+
return gitDir + '|' + a.size + ':' + a.mtimeMs + '|' + b.size + ':' + b.mtimeMs;
|
|
93
|
+
} catch { return null; }
|
|
94
|
+
}
|
|
95
|
+
const up = path.dirname(dir); if (up === dir) return null; dir = up;
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
77
99
|
function defaultIo(root) {
|
|
78
100
|
const read = (rel) => { try { return fs.readFileSync(path.join(root, rel), 'utf8'); } catch { return null; } };
|
|
79
101
|
return {
|
|
@@ -81,16 +103,21 @@ function defaultIo(root) {
|
|
|
81
103
|
list: (dir) => { try { return fs.readdirSync(path.join(root, dir)); } catch { return []; } },
|
|
82
104
|
records: () => { try { return fs.readdirSync(path.join(root, 'planning', 'initiatives')).filter((f) => f.endsWith('.md') && f !== 'README.md' && f !== 'index.md').map((f) => 'planning/initiatives/' + f); } catch { return []; } },
|
|
83
105
|
firstSeen: () => {
|
|
106
|
+
// page-open-speed: HEAD's reflog moves on every commit, checkout and reset, so while it is unchanged the cached map stands and
|
|
107
|
+
// no `git` runs at all (the trail asked `git rev-parse` on every Board open, ~30 ms on the thread every answer waits for).
|
|
108
|
+
const hit = gitCache.get(root);
|
|
109
|
+
const stamp = headStamp(root);
|
|
110
|
+
if (hit && stamp && hit.stamp === stamp) return hit.map;
|
|
84
111
|
let head = '';
|
|
85
112
|
try { head = execFileSync('git', ['-C', root, 'rev-parse', 'HEAD'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim(); } catch { return new Map(); }
|
|
86
|
-
|
|
113
|
+
if (hit && hit.head === head) { hit.stamp = stamp; return hit.map; }
|
|
87
114
|
const map = new Map();
|
|
88
115
|
try {
|
|
89
116
|
const out = execFileSync('git', ['-C', root, 'log', '--diff-filter=A', '--name-only', '--format=@@%at', '--', 'planning'], { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, stdio: ['ignore', 'pipe', 'ignore'] });
|
|
90
117
|
let at = 0;
|
|
91
118
|
for (const line of out.split('\n')) { if (line.startsWith('@@')) at = Number(line.slice(2)) * 1000; else if (line.trim()) map.set(line.trim(), at); } // newest first: the last write is the first appearance
|
|
92
119
|
} catch { /* not a git checkout: no dates */ }
|
|
93
|
-
gitCache.set(root, { head, map });
|
|
120
|
+
gitCache.set(root, { head, map, stamp });
|
|
94
121
|
return map;
|
|
95
122
|
},
|
|
96
123
|
jira: (id) => {
|
|
@@ -258,4 +285,4 @@ function trail({ root, ids, rows = [], moves = [], now = Date.now(), io } = {})
|
|
|
258
285
|
return { ok: true, at: new Date(now).toISOString(), usual, usualBy, themes: out, items };
|
|
259
286
|
}
|
|
260
287
|
|
|
261
|
-
module.exports = { trail, frontmatter, partsOf, ladderDates, median, STAGES, MIN_SAMPLES, TONES };
|
|
288
|
+
module.exports = { trail, defaultIo, frontmatter, partsOf, ladderDates, median, STAGES, MIN_SAMPLES, TONES };
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* INPUT (plain data that routes-calendar-views.js already holds):
|
|
10
10
|
* range = { start, end } 'YYYY-MM-DD'
|
|
11
11
|
* events = imported events ({ id, at, end, title, initiative, prep, prep_done, steps }); all of them, this filters
|
|
12
|
-
* inis = the initiative facts ({ id, title, done, status, promised, stopped:{state}
|
|
12
|
+
* inis = the initiative facts ({ id, title, done, status, promised, stopped:{state} }; an old `horizon` word, such as a parked bet's, is still read)
|
|
13
13
|
* gantt = model.ganttRows rows ({ id, status, promised })
|
|
14
14
|
* planItems = [{ id, initiative, title, due, milestone, state }]
|
|
15
15
|
*
|
|
@@ -63,7 +63,7 @@ const SETS = Object.freeze({
|
|
|
63
63
|
]),
|
|
64
64
|
board: Object.freeze([
|
|
65
65
|
e('board', { key: 'charter', title: 'Board charter', ic: 'flag', for: 'Why this board exists: purpose, owner, the key results it serves, scope in and out, how work flows.', reader: 'Owner, team, new joiners', cadence: 'When the board changes', by: 'drafts', kind: 'doc', isNew: true }),
|
|
66
|
-
e('board', { key: 'backlog', title: 'Roadmap and backlog', ic: 'todo', for: 'Initiatives by
|
|
66
|
+
e('board', { key: 'backlog', title: 'Roadmap and backlog', ic: 'todo', for: 'Initiatives by rank, stage and owner.', reader: 'Team, stakeholders', cadence: 'Live', by: 'live', kind: 'live' }),
|
|
67
67
|
e('board', { key: 'intake', title: 'Intake log', ic: 'inbox', for: 'Asks received, accepted or declined, and why.', reader: 'Owner, requesters', cadence: 'Live', by: 'live', kind: 'live' }),
|
|
68
68
|
e('board', { key: 'bstatus', title: 'Board status report', ic: 'report', for: 'Progress, slips, asks and what needs a decision, for the owner\'s manager.', reader: 'Stakeholders', cadence: 'Every two weeks', by: 'drafts', kind: 'report' }),
|
|
69
69
|
e('board', { key: 'capacity', title: 'Capacity plan', ic: 'user', for: 'Who works on the board, their points a week, and whether the plan fits.', reader: 'Owner, eng lead', cadence: 'Each sprint', by: 'drafts', kind: 'doc', days: 14, isNew: true }),
|
|
@@ -708,7 +708,7 @@ const S = '<state>'; // the state folder, named in the prompt as the run sees
|
|
|
708
708
|
const GUIDE = Object.freeze({
|
|
709
709
|
strategy: { sources: ['The issued product strategy, if any, under <state>/core-docs/portfolio/strategy/', 'planning/okrs/ (the key results and health budgets)', 'The board charters under <state>/core-docs/board-*/charter/', 'The boards and their initiatives with their anchors (`pmos board`, `pmos initiative list`)', 'The Horizon scan reports and the research under planning/radar/ and planning/research/, if any'],
|
|
710
710
|
sections: ['A short line: this is a proposal for the PM to change, keep or drop; the PM issues the strategy', 'Where we are going', 'Where we play (one line per pillar, with its boards)', 'What we will not do', 'How we will know (a table: Pillar, Key results, Boards)'] },
|
|
711
|
-
roadmap: { sources: ['`pmos initiative list` (every initiative with its
|
|
711
|
+
roadmap: { sources: ['`pmos initiative list` (every initiative with its Roadmap rank, lifecycle stage and anchor)', 'planning/okrs/ (the key results the bets serve)', 'The issued portfolio roadmap before this one, if any'],
|
|
712
712
|
sections: ['Now (each bet, its board and the key result it serves)', 'Next', 'Later', 'What changed since the last roadmap'] },
|
|
713
713
|
invest: { sources: ['`pmos initiative list` (anchors: key result or health budget)', 'The plan items and their points on every board (`pmos board`)', 'The people and their points a week (`pmos people list`)', 'The Jira snapshots under the state folder, if any (read-only)'],
|
|
714
714
|
sections: ['Headline (two sentences: where the effort goes and the one thing to look at)', 'By board (a share of the effort per board)', 'Feature work against upkeep (key results against health budgets)', 'By pillar, when a product strategy is issued', 'Worth a look (key results with no effort, effort with no key result)'] },
|
|
@@ -555,18 +555,18 @@ function applyWorkflowEdit(board, stages, moveRemoved, rowsByStage) {
|
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
// ── backlog ─────────────────────────────────────────────────────────────────────────────────────────
|
|
558
|
-
const
|
|
559
|
-
const SORTS = ['rank', 'id', 'title', 'stage', 'status', 'owner', 'horizon', 'end', 'start', 'updated', 'progress'];
|
|
558
|
+
const SORTS = ['rank', 'id', 'title', 'stage', 'status', 'owner', 'end', 'start', 'updated', 'progress'];
|
|
560
559
|
const listParam = (v) => (v == null || v === '' ? null : String(v).split(',').map((x) => x.trim()).filter(Boolean));
|
|
561
560
|
const lc = (v) => String(v == null ? '' : v).toLowerCase();
|
|
562
561
|
|
|
563
|
-
/* A view's own status rule (active only; at risk or late) gives way to a status filter the PM picks, so
|
|
564
|
-
* Status: On hold lists the paused initiatives
|
|
562
|
+
/* A view's own status rule (active only; at risk or late) gives way to a status filter the PM picks, so the open view with
|
|
563
|
+
* Status: On hold lists the paused initiatives (c3-initiative-lifecycle). The `now` view keeps its name for old links; since
|
|
564
|
+
* D105 retired Now / Next / Later it is every open initiative, in Roadmap rank, on no horizon. */
|
|
565
565
|
function viewFilter(view, me, statusGiven) {
|
|
566
566
|
const mine = new Set([lc(me), lc(me ? `pm:${me}` : '')].filter(Boolean));
|
|
567
567
|
const act = (r) => statusGiven || isActive(r);
|
|
568
568
|
switch (view) {
|
|
569
|
-
case 'now': return (r) =>
|
|
569
|
+
case 'now': return (r) => act(r);
|
|
570
570
|
case 'mine': return (r) => !!r.owner && mine.has(lc(r.owner)) && act(r);
|
|
571
571
|
case 'risk': return (r) => statusGiven || r.status === 'at risk' || r.status === 'late';
|
|
572
572
|
case 'noowner': return (r) => !r.owner && act(r);
|
|
@@ -582,11 +582,12 @@ function facetOf(rows, field) {
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
/**
|
|
585
|
-
* query = { q, stage, status, owner,
|
|
585
|
+
* query = { q, stage, status, owner, anchor (each a comma list), view, sort ('-' prefix = descending), offset,
|
|
586
586
|
* limit, me, stages (the workflow's stage names, for the stage sort), archived ('1' = the archive only) }. Facets count the rows
|
|
587
|
-
* after the view and the search, before the stage/status/owner/
|
|
587
|
+
* after the view and the search, before the stage/status/owner/anchor filters, so each filter shows what choosing it
|
|
588
588
|
* would give. An archived row (`r.archived`) is in no list but the archive. A cancelled row is in no view unless the status
|
|
589
589
|
* filter names `cancelled`; `cancelledHidden` counts the board's cancelled rows while they are hidden (0 once asked for).
|
|
590
|
+
* D105: there is no horizon filter, facet or sort; a `horizon` in the query is read past, and sort=horizon reads as rank.
|
|
590
591
|
*/
|
|
591
592
|
function filterRows(rows, query = {}) {
|
|
592
593
|
const archive = query.archived === '1' || query.archived === true;
|
|
@@ -595,13 +596,13 @@ function filterRows(rows, query = {}) {
|
|
|
595
596
|
const wantStatus = listParam(query.status);
|
|
596
597
|
let base = (rows || []).filter((r) => !!r.archived === archive).filter(viewFilter(view, query.me, !!wantStatus));
|
|
597
598
|
if (q) base = base.filter((r) => lc(r.title).includes(q) || lc(r.id).includes(q) || lc(r.anchor).includes(q) || lc(r.owner).includes(q));
|
|
598
|
-
const facets = { stage: facetOf(base, 'stage'), status: facetOf(base, 'status'), owner: facetOf(base, 'owner'),
|
|
599
|
+
const facets = { stage: facetOf(base, 'stage'), status: facetOf(base, 'status'), owner: facetOf(base, 'owner'), anchor: facetOf(base, 'anchor'), cat: facetOf(base, 'cat') };
|
|
599
600
|
const askCancelled = archive || !!(wantStatus && wantStatus.map(lc).includes('cancelled'));
|
|
600
601
|
let out = askCancelled ? base : base.filter((r) => r.status !== 'cancelled');
|
|
601
602
|
// How many cancelled initiatives the list leaves out: every one on the board, whatever the view, since the link that shows them
|
|
602
603
|
// opens All with Status: Cancelled.
|
|
603
604
|
const cancelledHidden = askCancelled ? 0 : (rows || []).filter((r) => !r.archived && r.status === 'cancelled').length;
|
|
604
|
-
for (const f of ['stage', 'status', 'owner', '
|
|
605
|
+
for (const f of ['stage', 'status', 'owner', 'anchor', 'cat']) {
|
|
605
606
|
const want = listParam(query[f]);
|
|
606
607
|
if (!want) continue;
|
|
607
608
|
const set = new Set(want.map(lc));
|
|
@@ -615,10 +616,9 @@ function filterRows(rows, query = {}) {
|
|
|
615
616
|
const statusIdx = new Map(STATUSES.map((s, i) => [s, i]));
|
|
616
617
|
const nul = (v) => (v == null ? '' : v);
|
|
617
618
|
const cmpBy = {
|
|
618
|
-
rank: (a, b) => ((
|
|
619
|
+
rank: (a, b) => ((a.rank ?? 1e9) - (b.rank ?? 1e9)) || a.id.localeCompare(b.id),
|
|
619
620
|
id: (a, b) => a.id.localeCompare(b.id, undefined, { numeric: true }),
|
|
620
621
|
owner: (a, b) => String(nul(a.owner)).localeCompare(String(nul(b.owner))) || a.id.localeCompare(b.id),
|
|
621
|
-
horizon: (a, b) => ((HZ[a.horizon] ?? 3) - (HZ[b.horizon] ?? 3)) || a.id.localeCompare(b.id),
|
|
622
622
|
title: (a, b) => String(a.title).localeCompare(String(b.title)) || a.id.localeCompare(b.id),
|
|
623
623
|
stage: (a, b) => ((stageIdx.get(a.stage) ?? 1e9) - (stageIdx.get(b.stage) ?? 1e9)) || a.id.localeCompare(b.id),
|
|
624
624
|
status: (a, b) => ((statusIdx.get(a.status) ?? 9) - (statusIdx.get(b.status) ?? 9)) || a.id.localeCompare(b.id),
|
|
@@ -235,25 +235,25 @@ reg('discover', 'ideate.concentration', (f) => {
|
|
|
235
235
|
reg('prioritize', 'strategize.kr-deviation', (f) => REG.find((d) => d.id === 'cal.kr-deviation').fn(f).map((x) => ({ ...x, page: 'prioritize' })));
|
|
236
236
|
reg('prioritize', 'strategize.unanchored', (f) => f.inis.filter((i) => !i.done && !i.parent_kr).map((i) => s({
|
|
237
237
|
id: 'strategize.unanchored:' + i.id, page: 'prioritize', key: 'anchor:' + i.id, entity: i.id, magnitude: 0.5, deadlineDays: 14, policyCritical: true, shape: 'rows',
|
|
238
|
-
title: `${i.title} has no KR or health budget`, facts: ['
|
|
238
|
+
title: `${i.title} has no KR or health budget`, facts: ['stage ' + (i.stage || 'none')],
|
|
239
239
|
})));
|
|
240
240
|
reg('prioritize', 'strategize.single-bet', (f) => {
|
|
241
|
-
const now = f.inis.filter((i) => i.
|
|
242
|
-
return now.length === 1 && f.inis.length >= 3 ? [s({ id: 'strategize.single-bet', page: 'prioritize', key: 'bets', entity: 'portfolio', magnitude: 0.4, deadlineDays: 30, strategic: true, title: `Everything
|
|
241
|
+
const now = f.inis.filter((i) => i.underway);
|
|
242
|
+
return now.length === 1 && f.inis.length >= 3 ? [s({ id: 'strategize.single-bet', page: 'prioritize', key: 'bets', entity: 'portfolio', magnitude: 0.4, deadlineDays: 30, strategic: true, title: `Everything under way rides on one bet (${now[0].title}); ${f.inis.length - 1} others are not under way`, facts: [] })] : [];
|
|
243
243
|
});
|
|
244
244
|
reg('prioritize', 'prioritize.capacity-free', (f) => {
|
|
245
|
-
const inflight = f.inis.filter((i) => i.
|
|
245
|
+
const inflight = f.inis.filter((i) => i.underway).length, CAP = 4;
|
|
246
246
|
return inflight < CAP && f.ideas.length ? [s({
|
|
247
247
|
id: 'prioritize.capacity', page: 'prioritize', key: 'capacity', entity: 'portfolio', magnitude: Math.min(1, (CAP - inflight) / CAP), deadlineDays: 14, shape: 'ring',
|
|
248
|
-
title: `${inflight} of ${CAP} bets
|
|
248
|
+
title: `${inflight} of ${CAP} bets under way; the top idea is ${f.ideas[0].title} (score ${f.ideas[0].score})`, facts: f.ideas.slice(0, 3).map((i) => i.title + ' ' + i.score),
|
|
249
249
|
})] : [];
|
|
250
250
|
});
|
|
251
251
|
reg('prioritize', 'prioritize.score-vs-roadmap', (f) => {
|
|
252
252
|
const onRoad = new Set(f.inis.map((i) => String(i.id).split('/').pop()));
|
|
253
253
|
const top = f.ideas.filter((i) => !onRoad.has(i.slug));
|
|
254
|
-
return top.length && f.inis.some((i) => i.
|
|
254
|
+
return top.length && f.inis.some((i) => !i.done && !i.underway && !i.hasPlan) ? [s({
|
|
255
255
|
id: 'prioritize.rank', page: 'prioritize', key: 'capacity', entity: 'portfolio', magnitude: 0.4, deadlineDays: 14, child: true,
|
|
256
|
-
title: `${top[0].title} (score ${top[0].score}) outranks work
|
|
256
|
+
title: `${top[0].title} (score ${top[0].score}) outranks work on the Roadmap that is not under way and has no plan`, facts: [],
|
|
257
257
|
})] : [];
|
|
258
258
|
});
|
|
259
259
|
reg('plan', 'plan.critical-density', (f) => {
|
|
@@ -265,9 +265,9 @@ reg('plan', 'plan.long-ticket', (f) => {
|
|
|
265
265
|
const L = f.tickets.filter((t) => t.dur > 10 && t.status !== 'done');
|
|
266
266
|
return L.length ? [s({ id: 'plan.long', page: 'plan', key: 'split', entity: 'plan', magnitude: Math.min(1, Math.max(...L.map((t) => t.dur)) / 30), deadlineDays: 7, shape: 'bars', title: `${L.length} open tickets run over 10 days (${L.map((t) => t.key + ' ' + t.dur + 'd').join(', ')}); long tickets hide slips, so split them`, facts: L.map((t) => t.key + ' owner ' + t.owner) })] : [];
|
|
267
267
|
});
|
|
268
|
-
reg('plan', 'plan.unplanned', (f) => f.inis.filter((i) => !i.hasPlan &&
|
|
268
|
+
reg('plan', 'plan.unplanned', (f) => f.inis.filter((i) => !i.hasPlan && i.underway).map((i) => s({
|
|
269
269
|
id: 'plan.unplanned:' + i.id, page: 'plan', key: 'plan:' + i.id, entity: i.id, magnitude: 0.5, deadlineDays: i.promised ? i.daysToPromise : 60,
|
|
270
|
-
title: `${i.title} is
|
|
270
|
+
title: `${i.title} is under way with no work breakdown`, facts: ['promised ' + (i.promised || 'none')],
|
|
271
271
|
})));
|
|
272
272
|
reg('monitor', 'monitor.slip', (f) => f.inis.filter((i) => i.slip > 0).map((i) => s({
|
|
273
273
|
id: 'monitor.slip:' + i.id, page: 'monitor', key: 'slip:' + i.id, entity: i.id, magnitude: slipMag(i.slip, i.tolerance), promiseMissed: i.slip > i.tolerance && i.holders.length > 0,
|
|
@@ -299,12 +299,12 @@ reg('evaluate', 'evaluate.retro-missing', (f) => f.inis.filter((i) => i.retroMis
|
|
|
299
299
|
|
|
300
300
|
// ---------- INITIATIVES: views ----------
|
|
301
301
|
reg('roadmap', 'roadmap.overcommit', (f) => {
|
|
302
|
-
const n = f.inis.filter((i) => i.
|
|
303
|
-
return n > 4 ? [s({ id: 'roadmap.overcommit', page: 'roadmap', key: 'cap', entity: 'portfolio', magnitude: Math.min(1, (n - 4) / 4), deadlineDays: 7, title: `${n}
|
|
302
|
+
const n = f.inis.filter((i) => i.underway).length;
|
|
303
|
+
return n > 4 ? [s({ id: 'roadmap.overcommit', page: 'roadmap', key: 'cap', entity: 'portfolio', magnitude: Math.min(1, (n - 4) / 4), deadlineDays: 7, title: `${n} initiatives under way against a capacity of 4`, facts: [] })] : [];
|
|
304
304
|
});
|
|
305
305
|
reg('roadmap', 'roadmap.unanchored', (f) => REG.find((d) => d.id === 'strategize.unanchored').fn(f).map((x) => ({ ...x, page: 'roadmap' })));
|
|
306
|
-
reg('roadmap', 'roadmap.no-forecast', (f) => f.inis.filter((i) =>
|
|
307
|
-
id: 'roadmap.no-forecast:' + i.id, page: 'roadmap', key: 'plan:' + i.id, entity: i.id, magnitude: 0.4, deadlineDays: 30, title: `${i.title}
|
|
306
|
+
reg('roadmap', 'roadmap.no-forecast', (f) => f.inis.filter((i) => i.underway && !i.hasPlan).map((i) => s({
|
|
307
|
+
id: 'roadmap.no-forecast:' + i.id, page: 'roadmap', key: 'plan:' + i.id, entity: i.id, magnitude: 0.4, deadlineDays: 30, title: `${i.title} is under way with no forecast date`, facts: [],
|
|
308
308
|
})));
|
|
309
309
|
const lateTickets = (f) => f.tickets.filter((t) => t.status !== 'done' && t.end && dateMs(t.end) < dateMs(f.nowDate));
|
|
310
310
|
reg('tickets', 'tickets.late', (f) => lateTickets(f).map((t) => s({
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// It is pure. readRepoFacts(root) is the only function that touches the repo, and the tests do not use it.
|
|
6
6
|
//
|
|
7
7
|
// WIRED TO REAL DATA (readRepoFacts): initiative records (id, title, lane, anchor `parent_kr`, stage, accepted,
|
|
8
|
-
//
|
|
8
|
+
// `promised`, `planned_days`, `slip_tolerance_days`) from planning/initiatives/*.md through
|
|
9
9
|
// scripts/workflow-state.js listInitiatives and computeWorkflow, which also supply the gate-order
|
|
10
10
|
// violations (`gate_failures`). Work-item status per item comes from the repo's work-item ledger and its plan items (see layout-paths.js).
|
|
11
11
|
//
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
//
|
|
23
23
|
// Raw facts shape (every key optional):
|
|
24
24
|
// now 'YYYY-MM-DDTHH:MM' | 'YYYY-MM-DD', stance 'hold'|'move', capFocusMin,
|
|
25
|
-
// inis[{id,title,promised,forecast,hasPlan,plannedDays,slip_tolerance_days,parent_kr,
|
|
25
|
+
// inis[{id,title,promised,forecast,hasPlan,plannedDays,slip_tolerance_days,parent_kr,underway,lane,done,
|
|
26
26
|
// holders[{who,told}], meeting{title,at}, slipFromEdits, slipFromAdds, adds, criticalPath[], tripScope,
|
|
27
27
|
// options[{id,label,slipAfter,touches[],promiseChange}], gateViolations[{gate}], retroMissing, accepted}],
|
|
28
28
|
// tickets[{key,status,dur,owner,deps[],end,pts,origin,edits}],
|
|
@@ -97,7 +97,9 @@ function readRepoFacts(root, opts) {
|
|
|
97
97
|
const fm = readFrontmatter(path.join(base, w.record || `planning/initiatives/${id}.md`));
|
|
98
98
|
inis.push({
|
|
99
99
|
id, title: w.title || id, lane: w.lane, parent_kr: w.anchor || fm.parent_kr || null, stage: w.stage,
|
|
100
|
-
done: !!w.accepted,
|
|
100
|
+
done: !!w.accepted, promised: fm.promised || null,
|
|
101
|
+
// D105: no horizon. "Under way" is the engine's contract, build or eval rung, not yet accepted (workspace/lib/lifecycle-stage.js).
|
|
102
|
+
underway: !w.accepted && ['contract', 'build', 'eval'].includes(String(w.stage || '')),
|
|
101
103
|
plannedDays: fm.planned_days != null ? Number(fm.planned_days) : null,
|
|
102
104
|
slip_tolerance_days: fm.slip_tolerance_days != null ? Number(fm.slip_tolerance_days) : undefined,
|
|
103
105
|
gateViolations: (w.gate_failures || []).map((g) => ({ gate: g.rule || g.gate || String(g) })),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* git-shape.js — where a folder sits in git, read from the disk with no `git` run (page-open-speed). */
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
/** A cheap stamp of where `root` sits in git, read from the disk with no `git` run: the nearest `.git` entry above it, whether it is a
|
|
7
|
+
* directory (a main tree) or a file (a linked worktree, with the file's time: it names the tree's git directory).
|
|
8
|
+
* A directory's time is left out: git touches it on every commit, and a main tree stays the main tree. It changes when the folder becomes, or stops being, a repository
|
|
9
|
+
* or a worktree, so an answer about the repository's SHAPE (which tree is the main one) can be kept until it changes instead of asking
|
|
10
|
+
* `git` again on a clock (page-open-speed). 'none' when no `.git` is found up to the file-system root. */
|
|
11
|
+
function shapeStamp(root) {
|
|
12
|
+
if (!root) return 'none';
|
|
13
|
+
let dir = path.resolve(root);
|
|
14
|
+
for (let i = 0; i < 64; i++) {
|
|
15
|
+
try { const st = fs.statSync(path.join(dir, '.git')); return dir + '|' + (st.isDirectory() ? 'd' : 'f|' + st.mtimeMs); } catch { /* look one level up */ }
|
|
16
|
+
const up = path.dirname(dir); if (up === dir) break; dir = up;
|
|
17
|
+
}
|
|
18
|
+
return 'none';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
module.exports = { shapeStamp };
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* deps: { workspaces() → [w], isLead(w), stateDirFor(w), runtimeDir(), rowOf(w, id) → { title, intent, stage, stages } | null,
|
|
13
13
|
* exits(w) → [{ ini, board, stage }] (stages about to end), shapes(w) → [{ ini, board, n, end }] (open tasks, latest due),
|
|
14
|
+
* looks(w) → [{ ini, board, n, end }] (running initiatives with open tasks, for the monthly look),
|
|
14
15
|
* goalInis(w, goalId) → [{ id, endAt, status }] (the initiatives anchored to that goal), checks(w, day) → [{ ini, board, tasks }] (late or at-risk work), turned(dir, sinceIso) → [forecast `turned` line] (lib/forecast.js),
|
|
15
16
|
* api { available(env), run({ prompt, root, env, budget, signal }) → Promise<{ ok, code, costUsd, note?, stopped? }> } (lib/grill-api.js; optional),
|
|
16
17
|
* setting(key) (lib/settings-store.js get), open(now) → bool, headlessOff() → bool, env, promptFor(skillId), spawn(spec), stop(session), warn }
|
|
@@ -27,7 +28,7 @@ const WHY = {
|
|
|
27
28
|
exit: 'The initiative is about to leave its stage. Grill it before it does: what would make the next stage fail?',
|
|
28
29
|
forecast: 'Its forecast just turned. Grill it: why, and what would bring it back?',
|
|
29
30
|
move: 'Its scope or dates moved a lot. Grill it: is the plan still the right plan?',
|
|
30
|
-
monthly: 'The monthly look at running work
|
|
31
|
+
monthly: 'The monthly look at running work (late work first, then the initiatives grilled longest ago). Grill it.',
|
|
31
32
|
ask: 'The PM asked for it in the initiative\'s chat. Grill it now: what would make it fail, and what is the next step?',
|
|
32
33
|
};
|
|
33
34
|
|
|
@@ -50,6 +51,16 @@ function pickFor(inis) {
|
|
|
50
51
|
return run.length ? run[0].id : null;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
/** PURE. The monthly look's order. late: [{ ini, board, tasks }] (late or at-risk work), open: [{ ini, board, n }] (running initiatives with
|
|
55
|
+
* open tasks), lastOf(ini) → ms of its last grill (0: never). → [{ ini, board, last, detail }]: late work first, then never grilled, then the
|
|
56
|
+
* one grilled longest ago; within each, the most open work first. */
|
|
57
|
+
function monthlyOrder(late, open, lastOf) {
|
|
58
|
+
const out = new Map();
|
|
59
|
+
for (const c of late || []) if (c && c.ini && !out.has(c.ini)) out.set(c.ini, { ini: c.ini, board: c.board, last: lastOf(c.ini), late: true, n: (c.tasks || []).length, detail: (c.tasks || []).length + ' late or at-risk tasks' });
|
|
60
|
+
for (const c of open || []) if (c && c.ini && !out.has(c.ini) && Number(c.n) > 0) out.set(c.ini, { ini: c.ini, board: c.board, last: lastOf(c.ini), late: false, n: Number(c.n), detail: c.n + ' open tasks' + (c.end ? ', the latest due ' + c.end : '') });
|
|
61
|
+
return [...out.values()].sort((a, b) => (b.late - a.late) || (a.last - b.last) || (b.n - a.n));
|
|
62
|
+
}
|
|
63
|
+
|
|
53
64
|
function create(deps) {
|
|
54
65
|
const active = new Map(); // run → { session }
|
|
55
66
|
const warn = deps.warn || (() => {});
|
|
@@ -147,10 +158,14 @@ function create(deps) {
|
|
|
147
158
|
const what = G.moved(prev, cur);
|
|
148
159
|
if (what) out.push({ ws: w.id, board: s.board, ini: s.ini, why: 'move', key: `move:${w.id}:${s.ini}:${cur.n}:${cur.end}`, detail: what });
|
|
149
160
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
161
|
+
// the monthly look: every running initiative with open work, at most once in 30 days each (Wawan 2026-11-02: "why only one?").
|
|
162
|
+
// Late work first, then the ones never grilled, then the ones grilled longest ago; the cap decides how far down the list a month goes.
|
|
163
|
+
const late = tryList(() => deps.checks && deps.checks(w, localDay(now))), seen = new Set();
|
|
164
|
+
const looks = monthlyOrder(late, tryList(() => deps.looks && deps.looks(w)), (ini) => Date.parse(F.lastAt.get(w.id + '|' + ini) || '') || 0);
|
|
165
|
+
for (const c of looks) {
|
|
166
|
+
if (seen.has(c.ini)) continue; seen.add(c.ini);
|
|
167
|
+
if (now - c.last < G.MONTHLY_DAYS * 864e5) continue;
|
|
168
|
+
out.push({ ws: w.id, board: c.board, ini: c.ini, why: 'monthly', key: `monthly:${w.id}:${c.ini}:${G.monthOf(now)}`, detail: c.detail });
|
|
154
169
|
}
|
|
155
170
|
return out;
|
|
156
171
|
}
|
|
@@ -182,4 +197,4 @@ function create(deps) {
|
|
|
182
197
|
return { tick, start, stop, dueOf, active: () => [...active.keys()] };
|
|
183
198
|
}
|
|
184
199
|
|
|
185
|
-
module.exports = { create, promptOf, pickFor, WHY, MAX };
|
|
200
|
+
module.exports = { create, promptOf, pickFor, monthlyOrder, WHY, MAX };
|