create-pmos 0.712.0 → 0.714.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 +99 -51
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/README.md +1 -1
- package/payload/design-system/ui/components/State/README.md +21 -0
- package/payload/design-system/ui/components/State/preview.html +8 -0
- package/payload/design-system/ui/components/bundle.css +12 -0
- package/payload/design-system/ui/interactions.md +10 -0
- 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/bin/back-place-health.js +70 -0
- package/workspace/changelog.json +98 -0
- package/workspace/design-system/ui/README.md +1 -1
- package/workspace/design-system/ui/components/State/README.md +21 -0
- package/workspace/design-system/ui/components/State/preview.html +8 -0
- package/workspace/design-system/ui/components/bundle.css +12 -0
- package/workspace/design-system/ui/interactions.md +10 -0
- package/workspace/guide/breakdown.md +20 -1
- package/workspace/guide/claude-proposes.md +5 -1
- package/workspace/guide/cli.md +10 -1
- package/workspace/guide/home.md +1 -0
- package/workspace/guide/initiatives-and-next-steps.md +13 -0
- package/workspace/guide/layout.md +27 -1
- package/workspace/guide/routine.md +10 -2
- package/workspace/guide/settings-and-switches.md +4 -0
- package/workspace/lib/briefing-premium-products.js +16 -2
- package/workspace/lib/changed-mark.js +34 -0
- package/workspace/lib/launch-cli.js +43 -5
- package/workspace/lib/launch-tiers.js +143 -0
- package/workspace/lib/moments.js +41 -3
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/parked-cli.js +105 -0
- package/workspace/lib/parked-reasons.js +245 -0
- package/workspace/lib/pmos-verbs.js +4 -1
- package/workspace/lib/prefs-sync.js +138 -0
- package/workspace/lib/product-dots.js +60 -0
- package/workspace/lib/route-modules.js +2 -0
- package/workspace/lib/routes-briefing-premium.js +11 -1
- package/workspace/lib/routes-moments.js +1 -1
- package/workspace/lib/routes-prefs.js +56 -0
- package/workspace/lib/routes-strategy-card.js +53 -0
- package/workspace/lib/routes-use-log.js +24 -3
- package/workspace/lib/routine-sentence.js +250 -0
- package/workspace/lib/strategy-card.js +133 -0
- package/workspace/lib/unused-controls.js +178 -0
- package/workspace/lib/use-log.js +27 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-vw-doc-test.js +2 -0
- package/workspace/public/pm/action-keys.js +187 -0
- package/workspace/public/pm/back-place.js +87 -0
- package/workspace/public/pm/bd-pop-ds.css +10 -0
- package/workspace/public/pm/bd-pop-ds.js +27 -3
- package/workspace/public/pm/bd-strategy.js +85 -0
- package/workspace/public/pm/bd-views.js +2 -1
- package/workspace/public/pm/changed-mark.css +7 -0
- package/workspace/public/pm/changed-mark.js +117 -0
- package/workspace/public/pm/cozy-ev.css +7 -0
- package/workspace/public/pm/cozy-nav.js +2 -0
- package/workspace/public/pm/cozy-pick.css +12 -0
- package/workspace/public/pm/cozy-pop-work.css +10 -1
- package/workspace/public/pm/cozy-pop-work.js +201 -17
- package/workspace/public/pm/cozy-routine-job.js +50 -7
- package/workspace/public/pm/cozy-routine.css +2 -0
- package/workspace/public/pm/cozy-settings.js +21 -3
- package/workspace/public/pm/cozy-today-page.css +1 -0
- package/workspace/public/pm/cozy-viewer.css +1 -1
- package/workspace/public/pm/cozy-viewer.js +14 -2
- package/workspace/public/pm/cozy-vw-mtg.css +0 -2
- package/workspace/public/pm/cozy-vw.css +0 -1
- package/workspace/public/pm/home-app.js +21 -1
- package/workspace/public/pm/home-today.js +2 -0
- package/workspace/public/pm/ini-tasks.js +4 -1
- package/workspace/public/pm/komorebi.css +11 -0
- package/workspace/public/pm/page-chat.js +16 -0
- package/workspace/public/pm/prefs-sync.js +111 -0
- package/workspace/public/pm/premium-board.js +20 -2
- package/workspace/public/pm/premium-chart-tab.js +2 -1
- package/workspace/public/pm/premium-insights.js +2 -2
- package/workspace/public/pm/premium-mtg-replay.js +4 -3
- package/workspace/public/pm/premium-report-read.js +5 -4
- package/workspace/public/pm/premium-report-tab.js +4 -3
- package/workspace/public/pm/premium-vw-backlog.css +2 -1
- package/workspace/public/pm/premium-vw-backlog.js +4 -3
- package/workspace/public/pm/premium-vw-cal.css +1 -2
- package/workspace/public/pm/premium-vw-cal.js +14 -13
- package/workspace/public/pm/premium-vw-copies.js +3 -2
- package/workspace/public/pm/premium-vw-copy.css +0 -3
- package/workspace/public/pm/premium-vw-mtg.js +12 -11
- package/workspace/public/pm/product-switcher.js +41 -0
- package/workspace/public/pm/quiet-place.js +15 -2
- package/workspace/public/pm/report-orders-ui.js +2 -1
- package/workspace/public/pm/rp-parts.js +3 -2
- package/workspace/public/pm/state-blocks.js +67 -0
- package/workspace/public/pm/use-log.js +127 -1
- package/workspace/public/pm/work-select.js +92 -2
- package/workspace/public/pm/work-tree.js +70 -0
- package/workspace/public/premium-aud.html +1 -0
- package/workspace/public/premium-board.html +5 -0
- package/workspace/public/premium-buddy.html +1 -0
- package/workspace/public/premium-events.html +1 -0
- package/workspace/public/premium-goals.html +1 -0
- package/workspace/public/premium-intelligence.html +1 -0
- package/workspace/public/premium-library.html +1 -0
- package/workspace/public/premium-present.html +1 -0
- package/workspace/public/premium-rec.html +1 -0
- package/workspace/public/premium-routine.html +1 -0
- package/workspace/public/premium-viewer.html +1 -0
- package/workspace/public/premium-workflows.html +1 -0
- package/workspace/public/today.html +1 -0
- package/workspace/server.js +20 -0
- package/workspace/test-lists/action-keys.json +9 -0
- package/workspace/test-lists/back-place.json +9 -0
- package/workspace/test-lists/changed-mark.json +9 -0
- package/workspace/test-lists/launch-tiers.json +9 -0
- package/workspace/test-lists/parked-reasons.json +9 -0
- package/workspace/test-lists/prefs-follow-person.json +9 -0
- package/workspace/test-lists/product-switcher-dots.json +9 -0
- package/workspace/test-lists/routine-sentence.json +9 -0
- package/workspace/test-lists/shared-empty-states.json +9 -0
- package/workspace/test-lists/strategy-card.json +9 -0
- package/workspace/test-lists/unused-controls.json +9 -0
- package/workspace/test-lists/work-subtasks-followups.json +9 -0
package/workspace/guide/home.md
CHANGED
|
@@ -32,6 +32,7 @@ Home, the Board, Insights and the Viewer use one typeface, Plus Jakarta Sans, wi
|
|
|
32
32
|
- After 17:00, Your day is the end of the day. The quarter shows only when it moved since the morning, and then says how. **Today made possible** lists what moved today. Decisions caught in today's notes count only after you confirm them; until then one line says how many wait, and it opens your notes. **Your call** stays while it is open. **Still yours** lists what is left. The right column shows tomorrow's meetings.
|
|
33
33
|
- A **program** comes first, above the products. Its header shows the program icon, its name, the next milestone (◆ and the date) and how many of its initiatives are ready for that milestone. Inside it, the program's own tasks come first, then its initiatives under a small heading for each product. Each initiative shows once. Press the program's name to open the program in the Viewer. The chat then talks about the program. Press the chevron to close or open the group.
|
|
34
34
|
- The **product picker** is the chip on the top line. It shows the tiles of the ticked products, overlapped, with **+N** after 3, or **All** when every product is ticked. It shows even with one product. A git worktree of a repository is not a product: it does not appear in the list. Its repository stands for it. Hold the pointer on it to read the names. Press it to open the list: **All products**, then each product with its tile, its name and one line (for example "3 initiatives · 1 of 2 goals"), then **Add a product**. Press a product to tick or untick it; the list stays open, and the last ticked product stays ticked. The pick applies when the list closes (Escape, a press outside, or the chip again). On a phone the list is a sheet at the bottom. The pick is one saved setting (`ws.briefing.include`) that Home, the Board and Insights share, so a product that you untick on one page goes from all three. With **All** ticked, a product that you add later is ticked too. The **Product** row in Settings opens the same list.
|
|
35
|
+
- The **product switcher** is the row of product tiles under the top line, shown when there are two or more products. Work shows the same row beside its product picker on a desktop. A tile has one blue dot when that product has something that needs you, from the same rows as the "needs you" count. It shows no number, and no dot when nothing needs you or the product has not been read yet. Hold the pointer on a tile to read its name and how many need you. Press a tile to show only that product on Today, Work and Goals. Press it again to show all products. Products that are not ticked are still read for their dot, at most once every 30 minutes.
|
|
35
36
|
- A program with no open initiative yet still shows, with "No initiatives yet" or "No open initiatives". A program shows only when it holds work of a ticked product. Home reads again when you come back to its tab, so a program made on the Board shows at once.
|
|
36
37
|
- Then the list is grouped by **product**. A product header shows a tile with the product's short name, the product name, one dot for each goal (green on track, amber off track) and a chevron. When the product has chats of its own (the product's chat and its new sessions), the header has the same pill as an initiative row: press it to see them, and **+** starts a new session in the product. These chats are not under **Not in an initiative**. A program header has the same pill for the program's own chats, and **+** starts a new session in the program. The chat then shows the program or the product as its scope, not **Loose**. You set the short name in Settings. Press the product's name to open the product in the Viewer, with its goals and this week's update and metrics review. The chat then talks about the product. This is the same for every product in the list: Home stays on the workspace you opened it on. For another product, the weekly update and the metrics review open that product's own Home in a new tab. An initiative of another product opens from that product's own board, and its chat works in that product's workspace. This is also true for a new initiative that an agent made with `pmos initiative new` and that is not on the board's Now list yet: it opens with its title, stage and tasks.
|
|
37
38
|
- Each row is one line. A dot is a session: blue when it waits on you, a ring while it runs. A check box is a task: amber when it is late. The stage track on the right shows where the initiative is. A session that runs under an initiative shows indented under it. An initiative shows its 3 most urgent tasks, and **N more** shows the rest.
|
|
@@ -95,6 +95,19 @@ An initiative can also have a **check-by** date: the day you want to look at it
|
|
|
95
95
|
|
|
96
96
|
The Roadmap shows work lanes only: feature, discovery, chore, incident, content, prototype and the other lanes of the work group. A document lane (for example strategy) is a file, not a row. It is not on the Roadmap, in the list, in the sheet or in an export.
|
|
97
97
|
|
|
98
|
+
### The strategy in five lines
|
|
99
|
+
|
|
100
|
+
A Board that shows one product has a **Strategy** card above its initiatives. It holds five lines: who the product is for, the problem, the bet, how you win, and what you won't do. Press the pencil to write or change them. Press the tick or Enter to save, or Esc to cancel. A save offers Undo.
|
|
101
|
+
|
|
102
|
+
When all five lines are written, PMOS checks the initiatives that are not built yet (Triage to Prioritize, not chore or incident). An initiative gets a short note when:
|
|
103
|
+
|
|
104
|
+
- its title shares a word with "what we won't do", or
|
|
105
|
+
- its title shares no word with the other four lines, and it changed on or after the day the strategy was written.
|
|
106
|
+
|
|
107
|
+
The notes fold under one line, for example "2 don't fit". Open it to see each initiative and why. A note only informs you. PMOS does not move, hide or block the initiative. When nothing needs a note, the line is not shown.
|
|
108
|
+
|
|
109
|
+
The lines are kept in `strategy-card.jsonl` in the product's records folder. Every save adds a line, so earlier versions are kept. A Board that shows several products at once shows no strategy card.
|
|
110
|
+
|
|
98
111
|
### Now, Next and Later are retired (D105)
|
|
99
112
|
|
|
100
113
|
Earlier versions put each initiative in one of three horizons: Now, Next and Later. They are retired. Nothing you placed is lost:
|
|
@@ -25,6 +25,12 @@ The workspace has one stylesheet for each part: `pm/brand.css`, `pm/charts.css`,
|
|
|
25
25
|
|
|
26
26
|
These pages are on the UI system: the meeting buddy, the recording tab, the audience tab, the extension's capture popup and the Welcome page. On a moved page, `pm/ds-bridge.css` points the old colour names at the system's colours, so the parts that other modules draw there follow the system too. While a screen is shared, the recording tab's stage uses the Dark theme.
|
|
27
27
|
|
|
28
|
+
Every block has three states, and one part of the UI system draws all three (`State` in `ui/components/`). The Viewer uses it for every tab:
|
|
29
|
+
|
|
30
|
+
- **Empty**: one quiet line, and the next step when there is one.
|
|
31
|
+
- **Loading**: soft grey rows where the content goes. Nothing moves. A screen reader says what PMOS is reading, for example "Reading the report.".
|
|
32
|
+
- **Error**: one line that says what failed, with a small red dot. When the page can try again, a Retry button sits at the end of the line.
|
|
33
|
+
|
|
28
34
|
## The navigation
|
|
29
35
|
|
|
30
36
|
On a computer, one thin panel at the left edge of every page holds the places. It is the same on every page. Press a place to go there.
|
|
@@ -112,6 +118,7 @@ The Viewer shows one item: an initiative, a program, a task, a document, a meeti
|
|
|
112
118
|
- On a computer, work opens in the popup over the page, with Ask PMOS beside it. There is no setting for this: the popup is the one way.
|
|
113
119
|
- Drag its edge to change its width. The expand icon opens it wide. Each kind of item keeps the width you gave it.
|
|
114
120
|
- It keeps one trail: a press inside it keeps the item behind, ← goes back, → goes forward, and the browser's Back and Forward move along the same trail. × or Escape closes it.
|
|
121
|
+
- A step along the trail gives the item back as you left it: scrolled to the same place, with the same sections open. If its content arrives a moment later, the place lands when it arrives. Scroll or press first, and PMOS leaves the place to you. A new item opens at the top.
|
|
115
122
|
- An item opened on its own page, with **Open in a new tab**, shows the Viewer card in the colours and type of the PMOS design system. When you close it, one line at the top links to Home.
|
|
116
123
|
- On a page drawn from the PMOS design system (Today, Home, an item on its own page), the parts inside the Viewer card follow the system too: a meeting, the calendar and a report use its corners, its buttons and its switches. A word button has a small corner, a switch looks like tabs, and a chip or a tag stays round.
|
|
117
124
|
- One item shows in one Viewer only. If an item is already open, opening it again (a row, a ⌘-click, Open beside) shows it in the Viewer it is in. It never opens a second copy.
|
|
@@ -263,6 +270,14 @@ The Board shows initiatives by stage, with programs, a timeline and a list. Inte
|
|
|
263
270
|
| ⌘K (Ctrl-K) or / | Open Search from any page. A second press focuses the box. |
|
|
264
271
|
| Esc | Close Search or the menu, then the Viewer. |
|
|
265
272
|
| ↑ ↓ and Enter | Move through Search results and open one. |
|
|
273
|
+
| Y | Say yes to what PMOS proposes on the item you point at. |
|
|
274
|
+
| O | Open the item you point at. |
|
|
275
|
+
| S | Move the item you point at to the next sprint. |
|
|
276
|
+
| P | Park the item you point at (put it on hold). |
|
|
277
|
+
| Z | Undo the last change. |
|
|
278
|
+
| ? | Show these keys, and which of them work on this page. |
|
|
279
|
+
|
|
280
|
+
Y, O, S, P and Z press the item's own button, so they work only where the item has that button. Point at the item, or tab to it, then press the key. Hover a button to see its key, for example **Open (O)**. PMOS counts your key presses in the Use log on this computer.
|
|
266
281
|
|
|
267
282
|
A key that you type in a field, or in a terminal, goes to the field or the terminal.
|
|
268
283
|
|
|
@@ -273,7 +288,7 @@ A phone has its own layout. It is not the computer's page made smaller. There is
|
|
|
273
288
|
- **⋯** is at the top right of every screen. It opens **Waiting on you** with a count (only when something waits), **Live now** (only while something runs), **Today**, **Work**, **Ask PMOS** and **Settings**. A blue dot on ⋯ means that something waits on you. When an item is open, its own menu items are at the top of the same menu.
|
|
274
289
|
- **Today** opens first. **Where it stands** says what leads today and why, and which dates are late. Under it is at most one ✦ proposal. Press it to read what changes and why, then press ✓ or ✕. The log has the **All** filter: Reply, Do, Decide or Send. A row has two lines: the title, then the job, the work and how late it is. A dot is before each row: red when it is late, blue for today, grey for Can wait. When PMOS has a fix for a row, the fix is under it with ✦. Swipe a row to the right to do, accept or send it, and to the left to drop it or put it off. Each swipe shows **Undo**. **Can wait** is one folded line. The box at the bottom logs a task, an event or a note; where the browser can listen, the microphone writes what you say into the box. After a recording, the first line says where PMOS filed it, with **Undo**.
|
|
275
290
|
- **Work** is the list of initiatives: the product, search and filter, the tabs **Initiatives**, **Backlog** with its count (for example **Backlog 14**) and **Sprint**, a short **Where it stands**, and the groups At risk or late, On track and No signal. A row shows its stage, its next milestone and how many milestones are late. A Project also shows its end date.
|
|
276
|
-
- **An initiative** opens full screen: **Where it stands** with one ✦ proposal and the next 3 dates, the **Stages** as one strip with the stage now marked, the **Work breakdown** of the stage now (a red dot when late, blue in progress, an empty ring to do, a tick when done, the Jira key, subtasks under their task), one line that opens the other stages, **The case**, and **Artefacts**. There is no timeline on a phone. Swipe a ✦ line to the right to say yes and to the left to say no; press it to read why. A task, a milestone or an artefact opens full screen with ← back to the initiative, as one page with no boxes. The box at the
|
|
291
|
+
- **An initiative** opens full screen: **Where it stands** with one ✦ proposal and the next 3 dates, the **Stages** as one strip with the stage now marked, the **Work breakdown** of the stage now (a red dot when late, blue in progress, an empty ring to do, a tick when done, the Jira key, subtasks under their task), one line that opens the other stages, **The case**, and **Artefacts**. There is no timeline on a phone. Swipe a ✦ line to the right to say yes and to the left to say no; press it to read why. A task, a milestone or an artefact opens full screen with ← back to the initiative, as one page with no boxes. The box at the end of the page asks PMOS about this work.
|
|
277
292
|
- **Ask PMOS** lists your chats grouped by the work they are about, with its product. "Not in a work yet" is last. A blue dot after the time marks a chat that waits for you. Write in the box at the bottom to start a new chat. In a chat, when PMOS asks before it changes or sends something, the ask is a blue-lined line: swipe it to the right to allow it, and to the left to say no. Press **Why** under it to read why PMOS asks. After you allow a change, a line says **Done** with what changed and **Undo**, until you write again.
|
|
278
293
|
- **Settings** has the theme (Light, Dark or Auto) and the version with **Check update**. Connectors, workspaces and updates are on your computer.
|
|
279
294
|
- **Recording** shows the red dot, the time, the meeting's name and a small red stop at the top. Under it: the shared screen cut to the slide, with the slides (only while a screen is shared); **So far**, newest first, each point with its time; and **PMOS proposes**, the line to tell the call. Swipe it to the right to copy it, and to the left to put it away. When you stop, Today opens.
|
|
@@ -385,6 +400,17 @@ A place opens on a fact PMOS can check in your records. It never opens because a
|
|
|
385
400
|
|
|
386
401
|
Your first initiative is the first moment. The card that sets it up comes right after setup, so this list starts after it.
|
|
387
402
|
|
|
403
|
+
### One next step under the line
|
|
404
|
+
|
|
405
|
+
Under its line, a quiet place shows one ✦ next step that fills it from what PMOS already has. PMOS picks the step in this order:
|
|
406
|
+
|
|
407
|
+
| Place | First choice | Then | Else |
|
|
408
|
+
|---|---|---|---|
|
|
409
|
+
| Board and Reports | "Make initiatives from the Jira epics PMOS read" (PMOS has saved a Jira reading) | "Draft initiatives from the strategy" (the Board's strategy has a written line) | "Paste a list of the work, and PMOS makes initiatives from it" |
|
|
410
|
+
| Intelligence | "Draft a goal from the strategy" | "Draft a goal from your initiatives" (you have one or more) | "Write what you want to reach, and PMOS makes a goal from it" |
|
|
411
|
+
|
|
412
|
+
The arrow writes the request in the chat over the page. It does not send it. Read it, change it if you want, and send it. PMOS shows you the drafts, and keeps nothing until you say yes. The use log counts presses of the arrow (Settings › General › Use log).
|
|
413
|
+
|
|
388
414
|
### One ✦ a day in Home's chat
|
|
389
415
|
|
|
390
416
|
When a place opens, Home's own chat shows one ✦ for it, with a link to its page in this guide (for example "How the Board works").
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Routine: everything that repeats"
|
|
4
|
-
timestamp: 2026-11-
|
|
4
|
+
timestamp: 2026-11-22
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Routine: everything that repeats
|
|
@@ -59,7 +59,15 @@ A report also shows its newest issue. When it is a draft, PMOS asks **Issue this
|
|
|
59
59
|
|
|
60
60
|
## Add a routine
|
|
61
61
|
|
|
62
|
-
Press **+** at the top right. The popup opens with an empty setup
|
|
62
|
+
Press **+** at the top right. The popup opens with an empty setup and a box, **Say it in one sentence**.
|
|
63
|
+
|
|
64
|
+
1. Type what should repeat and when, for example "Every Monday at 9am, sum up the top 3 risks for the team".
|
|
65
|
+
2. Read the setup on the right. PMOS fills in **Repeats**, **First run**, **Does** and **Tells** as you type. When you give no time, PMOS uses 09:00 and says so.
|
|
66
|
+
3. Press ✓, or press Enter. The routine starts on its schedule.
|
|
67
|
+
|
|
68
|
+
PMOS can repeat a routine every hour, every day, on one weekday, every other weekday, on day 1 to 28 of the month, or once. When PMOS cannot read the sentence, it asks one question, for example "Which one: every day, or one weekday such as Monday?". A routine made this way writes a draft. It sends nothing: you send it.
|
|
69
|
+
|
|
70
|
+
For a routine that one sentence cannot say, tell Ask PMOS on the right. It asks **What should repeat?**, fills in the setup and the instruction, and asks you once before it starts.
|
|
63
71
|
|
|
64
72
|
## Settings
|
|
65
73
|
|
|
@@ -75,6 +75,7 @@ At the bottom of **General**, **Extras** has three rows. Press the arrow on a ro
|
|
|
75
75
|
- **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).
|
|
76
76
|
- **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.
|
|
77
77
|
- **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.
|
|
78
|
+
- **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.
|
|
78
79
|
|
|
79
80
|
## Checks: when PMOS grills, and what it may spend
|
|
80
81
|
|
|
@@ -96,6 +97,8 @@ The first three come from the corrections of 18 Nov: **No device or browser fram
|
|
|
96
97
|
|
|
97
98
|
Each setting is saved when you change it. The settings are kept in the PMOS state directory, in `settings.json` for this computer and in `settings-ws/<workspace>.json` for each workspace. Only you can read these files. `GET /api/settings` returns every setting with its value and default. A change goes through `POST /api/settings` and must come from the workspace page. A variable in the environment where PMOS starts, such as `PMOS_GRILL=off`, wins over the page, and the row says so.
|
|
98
99
|
|
|
100
|
+
**View preferences follow you.** Your view choices, such as the theme, the Work and Board views, columns, folds, filters and scopes, are kept in `view-prefs.json` in the PMOS state directory on this computer, as well as in the browser. So when you open PMOS on your phone or in another browser, each page opens the way you left it. The later choice wins. Text you have not sent, panel sizes and what you have already seen stay in each browser. Nothing goes to another computer. Set `PMOS_PREFS_SYNC=off` to keep the choices in each browser only.
|
|
101
|
+
|
|
99
102
|
## Every PMOS_ variable
|
|
100
103
|
|
|
101
104
|
This page lists every `PMOS_` environment variable that the workspace reads. Use Settings first (above). Use a variable only when this page or another guide page tells you to, or when no Settings entry does the same.
|
|
@@ -203,6 +206,7 @@ An "off" switch accepts `off`, `0`, `false` or `no` unless the row says a differ
|
|
|
203
206
|
| `PMOS_UPDATE_SOURCE` | A built create-pmos package on this computer to update from. | the npm registry | — |
|
|
204
207
|
| `PMOS_KIT_PAYLOAD` | The kit folder that project setup copies. | the app's `payload/` | — |
|
|
205
208
|
| `PMOS_INGEST_TIMEOUT_MS` | The longest time a repository clone may take. | 2 minutes | — |
|
|
209
|
+
| `PMOS_PREFS_SYNC` | `off` stops view preferences following you: each browser keeps its own again (see Where the settings are kept). | on | — |
|
|
206
210
|
|
|
207
211
|
### Meeting notes
|
|
208
212
|
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
* modelOfMany({ available, engine, runtimeDir }) → { state, model, as_of, ... } the route's answer, one workspace read and kept at a time.
|
|
7
7
|
* rebuildOne({ root, runtimeDir }) after a write: that workspace's quick facts again, without the slow read.
|
|
8
8
|
* peekModel() the last merged model, for the read-only agent to find a row in.
|
|
9
|
+
* factsOf(p, { engine, runtimeDir, maxAge }) → one product's kept read, or null (the product switcher's dots, lib/product-dots.js).
|
|
9
10
|
*
|
|
10
11
|
* THE SELECTION RULE. With nothing chosen, every registered workspace except the home one (PMOS itself) is read. With a choice (the setting
|
|
11
12
|
* ws.briefing.include, a list of workspace ids), exactly those are read, the home workspace included when it is listed. A workspace that is not
|
|
12
|
-
* selected is not read
|
|
13
|
+
* selected is not read for the Briefing. Its one exception is the product switcher's dot (bet A381): factsOf reads it at most every 30 minutes. An id in the choice that is no longer registered is ignored and returned.
|
|
13
14
|
* The choice ['*'] is every registered workspace, the home one included, so a workspace registered later is read too (the product picker's All,
|
|
14
15
|
* batch 12 item 5). pickFor(available, on) turns the picker's ticks into the setting: every one '*', the default ones null, else the list.
|
|
15
16
|
*
|
|
@@ -120,6 +121,19 @@ async function modelOfMany({ available, engine, runtimeDir, sources, agent, agen
|
|
|
120
121
|
return { state: 'ready', model, as_of: asOf || now, refreshing, pending: model.pending, ...(error ? { error } : {}) };
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
/** One product's kept read for its dot (bet A381, lib/product-dots.js): the same state, cache and one-read-at-a-time rule as modelOfMany.
|
|
125
|
+
* A read older than maxAge starts again in the background. → the read (deleted initiatives left out), or null while none is kept or the
|
|
126
|
+
* initiative state is still pending. A product that is not on Home is read here only for its dot, so the caller gives it a longer maxAge. */
|
|
127
|
+
async function factsOf(p, { engine, runtimeDir, maxAge = STALE_MS } = {}) {
|
|
128
|
+
const s = stateOf(p.root);
|
|
129
|
+
if (!s.kept && runtimeDir) {
|
|
130
|
+
const c = loadCache(runtimeDir, p.root);
|
|
131
|
+
if (c) { const f = await BP.readFast({ root: p.root, now: Date.now(), runtimeDir, calendar: false }); s.kept = { at: c.at, key: c.key, ok: c.ok, initiatives: c.initiatives, f: Object.assign({}, f, { initiatives: c.initiatives }) }; }
|
|
132
|
+
}
|
|
133
|
+
if (!s.kept || Date.now() - s.kept.at > maxAge) start(p, engine, runtimeDir);
|
|
134
|
+
return s.kept ? gone(p.root, s.kept.f) : null;
|
|
135
|
+
}
|
|
136
|
+
|
|
123
137
|
/** The PM's Refresh: read every included workspace again now, without waiting for the 5-minute age. A read already running is not doubled; a failed one is tried again at once. Returns the names it started and the names already being read. */
|
|
124
138
|
function refreshNow({ available, engine, runtimeDir }) {
|
|
125
139
|
const started = [], already = [];
|
|
@@ -147,4 +161,4 @@ const peekModel = () => last;
|
|
|
147
161
|
const settle = () => Promise.all([...states.values()].map((s) => s.inflight).filter(Boolean));
|
|
148
162
|
const forget = () => { states.clear(); last = null; };
|
|
149
163
|
|
|
150
|
-
module.exports = { pickFor, ALL, choose, splitKey, modelOfMany, refreshNow, rebuildOne, peekModel, settle, forget, refreshOne, STALE_MS };
|
|
164
|
+
module.exports = { pickFor, ALL, choose, splitKey, modelOfMany, factsOf, refreshNow, rebuildOne, peekModel, settle, forget, refreshOne, STALE_MS };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* changed-mark.js — the health number of Undo on the changed item (bet A456, initiative undo-on-changed-item; the mark is
|
|
4
|
+
* public/pm/changed-mark.js). It only reads the local use log (lib/use-log.js, A466): nothing is written or sent.
|
|
5
|
+
*
|
|
6
|
+
* undoPresses(lines, now, days = 7) → n PURE: presses of the mark's Undo (control data-changed-undo) in the last `days` days
|
|
7
|
+
* CLI: node lib/changed-mark.js uses [days] → that count on its last line (the health number) */
|
|
8
|
+
const U = require('./use-log.js');
|
|
9
|
+
|
|
10
|
+
const CONTROL = 'data-changed-undo';
|
|
11
|
+
const DAY = 864e5;
|
|
12
|
+
|
|
13
|
+
function undoPresses(lines, now = Date.now(), days = 7) {
|
|
14
|
+
const cut = now - days * DAY;
|
|
15
|
+
let n = 0;
|
|
16
|
+
for (const l of lines || []) {
|
|
17
|
+
if (!l || l.kind !== 'use' || l.control !== CONTROL) continue;
|
|
18
|
+
const t = Date.parse(l.at);
|
|
19
|
+
if (t >= cut && t <= now + DAY) n++;
|
|
20
|
+
}
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = { CONTROL, undoPresses };
|
|
25
|
+
|
|
26
|
+
if (require.main === module) {
|
|
27
|
+
const [cmd, d] = process.argv.slice(2);
|
|
28
|
+
const days = d ? Number(d) : 7;
|
|
29
|
+
if (cmd !== 'uses' || !(days > 0)) { console.error('usage: node lib/changed-mark.js uses [days] (presses of Undo on a changed item, default the last 7 days)'); process.exit(2); }
|
|
30
|
+
const dir = require('./state-root.js').defaultRoot({ env: process.env });
|
|
31
|
+
const n = undoPresses(U.readLines(dir), Date.now(), days);
|
|
32
|
+
console.log('[changed-mark] presses of Undo on a changed item, last ' + days + ' days');
|
|
33
|
+
console.log(String(n));
|
|
34
|
+
}
|
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
/* launch-cli.js — `pmos launch …`: what is not ready before a launch date (initiative launch-readiness-check, lib/launch-readiness.js).
|
|
3
3
|
* pmos launch check <initiative> [--date YYYY-MM-DD] [--json] open tasks, tracker tickets, sign-offs and questions before the launch
|
|
4
4
|
* pmos launch list [--days N] [--json] every initiative with a launch in the next N days (14), with its verdict
|
|
5
|
+
* pmos launch tier [<initiative>] [--json] the launch tier (small, medium, big) and its launch steps (lib/launch-tiers.js,
|
|
6
|
+
* initiative launch-tiers); with no initiative, every initiative's tier
|
|
5
7
|
* The repository is the one this terminal is in (or --root). Read-only: it calls no tracker, sends nothing and writes no record.
|
|
6
8
|
* Exit codes: 0 done, 1 refused (no launch date, no such initiative), 2 usage. */
|
|
7
9
|
const path = require('path');
|
|
8
10
|
const { execFileSync } = require('child_process');
|
|
9
11
|
const LR = require('./launch-readiness.js');
|
|
12
|
+
const LT = require('./launch-tiers.js');
|
|
10
13
|
|
|
11
|
-
const COMMANDS = { launch: ['check', 'list'] };
|
|
14
|
+
const COMMANDS = { launch: ['check', 'list', 'tier'] };
|
|
12
15
|
const USAGE = [
|
|
13
|
-
'usage: pmos launch check|list — what is not ready before a launch date',
|
|
16
|
+
'usage: pmos launch check|list|tier — what is not ready before a launch date, and what the launch needs',
|
|
14
17
|
' pmos launch check <initiative> [--date YYYY-MM-DD] open tasks, tracker tickets, sign-offs with no answer and open questions',
|
|
15
18
|
' The launch date: --date, else a ◇ milestone named launch, go-live, release or ship, else the committed end, else the last ◇ milestone.',
|
|
16
19
|
' pmos launch list [--days N] every initiative with a launch in the next N days (default 14), and its verdict',
|
|
20
|
+
' pmos launch tier [<initiative>] the launch tier (small, medium, big) and the launch steps it sets for 100%',
|
|
21
|
+
' From launch_tier in the initiative record, else from reach (few, some, all) and risk (low, medium, high).',
|
|
17
22
|
' every command: [--json] [--root <repository>]',
|
|
18
23
|
'Read-only: it calls no tracker and sends nothing. Read the tracker first so the tickets are fresh.',
|
|
19
24
|
];
|
|
@@ -60,8 +65,40 @@ function run(argv, { say = console.log, cwd = process.cwd(), now = () => new Dat
|
|
|
60
65
|
if (got.error) return fail(got.error);
|
|
61
66
|
if (!got.launch) return fail(`${id} has no launch date: no ◇ milestone and no committed end. Give one with --date YYYY-MM-DD.`);
|
|
62
67
|
const res = LR.check(got.input, { launch: got.launch.date, launchTask: got.launch.task, today });
|
|
63
|
-
|
|
68
|
+
// the launch tier's steps, when the tier is known; an unknown tier adds nothing here (zero is silence; `pmos launch tier` says why)
|
|
69
|
+
const t = LT.read(root, id, { ctx, w, tasks: got.input.tasks });
|
|
70
|
+
const tier = t.error || !t.tier ? null : { tier: t.tier, from: t.from, why: t.why, steps: t.steps };
|
|
71
|
+
if (tier) LT.log(id, t);
|
|
72
|
+
if (a.json) { say(JSON.stringify({ ok: true, initiative: id, title: got.title, launchFrom: got.launch.from, ...res, ...(tier ? { tier } : {}) })); return 0; }
|
|
64
73
|
say(LR.render(res, { title: got.title, id, launchFrom: LR.FROM_WORDS[got.launch.from] }));
|
|
74
|
+
if (tier) { const lines = LT.render(id, t, { title: got.title }); say(['', 'Launch tier: ' + lines[0].slice(lines[0].indexOf(': ') + 2), ...lines.slice(1)].join('\n')); }
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (sub === 'tier') {
|
|
79
|
+
if (a._.length > 2) { say('usage: pmos launch tier [<initiative>] [--json]'); return 2; }
|
|
80
|
+
const one = a._[1];
|
|
81
|
+
const ids = [];
|
|
82
|
+
if (one) ids.push(one);
|
|
83
|
+
else {
|
|
84
|
+
const d = require('./initiative-rows.js').deriveNow(root);
|
|
85
|
+
if (!d.ok) return fail(d.error || 'the initiative records could not be read');
|
|
86
|
+
for (const row of d.rows || []) if (row && row.ok !== false && !row.stopped && row.id) ids.push(row.id);
|
|
87
|
+
}
|
|
88
|
+
const tiers = [];
|
|
89
|
+
for (const id of ids) {
|
|
90
|
+
const t = LT.read(root, id, { ctx, w });
|
|
91
|
+
if (t.error) { if (one) return fail(t.error); continue; }
|
|
92
|
+
LT.log(id, t);
|
|
93
|
+
tiers.push({ initiative: id, title: t.title, tier: t.tier, from: t.from, why: t.why, ...(t.missing ? { missing: t.missing } : {}), steps: t.steps });
|
|
94
|
+
}
|
|
95
|
+
if (a.json) { say(JSON.stringify(one ? { ok: true, ...tiers[0], tiers } : { ok: true, tiers })); return 0; }
|
|
96
|
+
if (one) { say(LT.render(one, tiers[0], { title: tiers[0].title }).join('\n')); return 0; }
|
|
97
|
+
if (!tiers.length) { say('No initiative in this repository.'); return 0; }
|
|
98
|
+
const known = tiers.filter((x) => x.tier);
|
|
99
|
+
say(`${known.length} of ${tiers.length} initiatives have a launch tier.`);
|
|
100
|
+
for (const x of known) say(` ${x.tier} · ${x.title} · ${x.steps.filter((s) => s.state !== 'done').length} of ${x.steps.length} steps not done · pmos launch tier ${x.initiative}`);
|
|
101
|
+
if (known.length < tiers.length) say('Set reach and risk (or launch_tier) in the other initiative records to give them a tier.');
|
|
65
102
|
return 0;
|
|
66
103
|
}
|
|
67
104
|
|
|
@@ -78,12 +115,13 @@ function run(argv, { say = console.log, cwd = process.cwd(), now = () => new Dat
|
|
|
78
115
|
let got; try { got = LR.read(root, row.id, { ctx, w }); } catch { continue; }
|
|
79
116
|
if (!got || got.error || !got.launch || got.launch.date < today || got.launch.date > until) continue;
|
|
80
117
|
const res = LR.check(got.input, { launch: got.launch.date, launchTask: got.launch.task, today });
|
|
81
|
-
|
|
118
|
+
const t = LT.read(root, row.id, { ctx, w, tasks: got.input.tasks });
|
|
119
|
+
out.push({ initiative: row.id, title: got.title, launch: res.launch, daysLeft: res.daysLeft, launchFrom: got.launch.from, verdict: res.verdict, items: res.items.length, notes: res.notes.length, ...(t.tier ? { tier: t.tier } : {}) });
|
|
82
120
|
}
|
|
83
121
|
out.sort((x, y) => x.launch.localeCompare(y.launch) || x.initiative.localeCompare(y.initiative));
|
|
84
122
|
if (a.json) { say(JSON.stringify({ ok: true, today, until, launches: out })); return 0; }
|
|
85
123
|
if (!out.length) { say(`No launch in the next ${n} days.`); return 0; }
|
|
86
|
-
for (const x of out) say(`${x.launch} (${x.daysLeft === 0 ? 'today' : 'in ' + x.daysLeft + (x.daysLeft === 1 ? ' day' : ' days')}) · ${x.title} · ${x.verdict}${x.items ? ' · ' + x.items + (x.items === 1 ? ' item' : ' items') + ' not ready' : ''} · pmos launch check ${x.initiative}`);
|
|
124
|
+
for (const x of out) say(`${x.launch} (${x.daysLeft === 0 ? 'today' : 'in ' + x.daysLeft + (x.daysLeft === 1 ? ' day' : ' days')}) · ${x.title}${x.tier ? ' · ' + x.tier + ' launch' : ''} · ${x.verdict}${x.items ? ' · ' + x.items + (x.items === 1 ? ' item' : ' items') + ' not ready' : ''} · pmos launch check ${x.initiative}`);
|
|
87
125
|
return 0;
|
|
88
126
|
}
|
|
89
127
|
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* launch-tiers.js — each initiative's launch tier (small, medium, big) and the launch steps it sets for full rollout (initiative
|
|
3
|
+
* launch-tiers, bet A418 in pmos-ideas). Works on any product built with PMOS: it reads only the initiative's own record and tasks.
|
|
4
|
+
*
|
|
5
|
+
* THE RECORD KEYS (frontmatter of the initiative record, all optional):
|
|
6
|
+
* launch_tier: small | medium | big the PM's own choice; it wins
|
|
7
|
+
* reach: few | some | all how many of the product's users meet the change
|
|
8
|
+
* risk: low | medium | high how bad it is if the change goes wrong
|
|
9
|
+
*
|
|
10
|
+
* tierOf(rec) → { tier, from, why, missing? } PURE. from: 'set' | 'reach-risk' | 'unknown'. Reach and risk each score 0 to 2;
|
|
11
|
+
* a sum of 0–1 is small, 2 medium, 3–4 big. With either missing (and no launch_tier)
|
|
12
|
+
* the tier is null and `missing` names the keys to set: nothing is guessed.
|
|
13
|
+
* stepsOf(tier, tasks) → [{ id, what, when, state, task? }] PURE. when: 'before 100%' | 'at 100%' | 'after 100%'.
|
|
14
|
+
* state: done (a Done task names the step) | open (an open task names it) | missing.
|
|
15
|
+
* readRecord(root, id, stateDir) → { launch_tier, reach, risk } | null the record's frontmatter keys
|
|
16
|
+
* read(root, ini, o) → { title, tier, steps } | { error } I/O: the record and `pmos task list` rows. Writes nothing.
|
|
17
|
+
* log(id, t, write) — one `[launch-tier]` line on stderr (the health log; stdout stays clean for --json). */
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
const TIERS = ['small', 'medium', 'big'];
|
|
22
|
+
const REACH = { few: 0, some: 1, all: 2 };
|
|
23
|
+
const RISK = { low: 0, medium: 1, high: 2 };
|
|
24
|
+
const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
25
|
+
const low = (v) => String(v == null ? '' : v).trim().toLowerCase();
|
|
26
|
+
|
|
27
|
+
/* Each step: who it is for, when it is due against the 100% step, and the words a task title uses for it. */
|
|
28
|
+
const STEPS = {
|
|
29
|
+
'support-briefing': { what: 'Brief the support team before users meet the change', when: 'before 100%', re: /support (team )?brief|brief(ing)? (the )?support/i },
|
|
30
|
+
'sales-notes': { what: 'Notes for sales and customer-facing teams', when: 'before 100%', re: /sales (note|brief|one-?pager)|customer[- ]facing note/i },
|
|
31
|
+
'release-note': { what: 'Release note', when: 'at 100%', re: /release note|changelog/i },
|
|
32
|
+
'help-article': { what: 'Help article written or updated', when: 'at 100%', re: /help (article|centre|center|doc)|docs? (update|page)/i },
|
|
33
|
+
'support-note': { what: 'A short note to the support team', when: 'at 100%', re: /support note|note (to|for) (the )?support/i },
|
|
34
|
+
'announcement': { what: 'Announcement post (blog, newsletter or in-product)', when: 'at 100%', re: /announce|blog post|newsletter/i },
|
|
35
|
+
'watch-3': { what: 'Watch the health number for 3 days', when: 'after 100%', re: /watch|monitor/i },
|
|
36
|
+
'watch-14': { what: 'Watch the health number for 14 days', when: 'after 100%', re: /watch|monitor/i },
|
|
37
|
+
};
|
|
38
|
+
const PLAN = {
|
|
39
|
+
small: ['release-note'],
|
|
40
|
+
medium: ['release-note', 'help-article', 'support-note', 'watch-3'],
|
|
41
|
+
big: ['support-briefing', 'sales-notes', 'release-note', 'help-article', 'announcement', 'watch-14'],
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** The launch tier of one initiative record. PURE. */
|
|
45
|
+
function tierOf(rec = {}) {
|
|
46
|
+
const r = isObj(rec) ? rec : {};
|
|
47
|
+
const set = low(r.launch_tier);
|
|
48
|
+
if (set && TIERS.includes(set)) return { tier: set, from: 'set', why: 'set by the PM' };
|
|
49
|
+
const reach = low(r.reach), risk = low(r.risk);
|
|
50
|
+
const bad = [];
|
|
51
|
+
if (set) bad.push(`launch_tier "${set}" is not small, medium or big`);
|
|
52
|
+
if (reach && !(reach in REACH)) bad.push(`reach "${reach}" is not few, some or all`);
|
|
53
|
+
if (risk && !(risk in RISK)) bad.push(`risk "${risk}" is not low, medium or high`);
|
|
54
|
+
const missing = [];
|
|
55
|
+
if (!(reach in REACH)) missing.push('reach');
|
|
56
|
+
if (!(risk in RISK)) missing.push('risk');
|
|
57
|
+
if (missing.length) {
|
|
58
|
+
const why = (bad.length ? bad.join('; ') + '. ' : '') + `Set ${missing.join(' and ')} in the initiative record, or launch_tier.`;
|
|
59
|
+
return { tier: null, from: 'unknown', why, missing };
|
|
60
|
+
}
|
|
61
|
+
const sum = REACH[reach] + RISK[risk];
|
|
62
|
+
const tier = sum <= 1 ? 'small' : sum === 2 ? 'medium' : 'big';
|
|
63
|
+
return { tier, from: 'reach-risk', why: `reach ${reach}, risk ${risk}` + (bad.length ? ` (${bad.join('; ')})` : '') };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** The tier's steps, each with its state from the initiative's tasks. PURE. */
|
|
67
|
+
function stepsOf(tier, tasks = []) {
|
|
68
|
+
if (!TIERS.includes(tier)) return [];
|
|
69
|
+
const ts = (tasks || []).filter((t) => isObj(t) && t.title && t.state !== "Won't do" && t.state !== 'Archived');
|
|
70
|
+
return PLAN[tier].map((id) => {
|
|
71
|
+
const s = STEPS[id];
|
|
72
|
+
const named = ts.filter((t) => s.re.test(String(t.title)));
|
|
73
|
+
const done = named.find((t) => t.state === 'Done');
|
|
74
|
+
const open = named.find((t) => t.state !== 'Done');
|
|
75
|
+
const hit = done || open;
|
|
76
|
+
return { id, what: s.what, when: s.when, state: done ? 'done' : open ? 'open' : 'missing', ...(hit ? { task: String(hit.id || '') } : {}) };
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* The leading frontmatter of a markdown file as { key: value } (one line per key, quotes taken off). */
|
|
81
|
+
function front(text) {
|
|
82
|
+
const L = String(text || '').split('\n'), out = {};
|
|
83
|
+
if (!/^---\s*$/.test(L[0] || '')) return out;
|
|
84
|
+
for (let i = 1; i < L.length && !/^---\s*$/.test(L[i]); i++) {
|
|
85
|
+
const m = /^([A-Za-z_][\w-]*):\s*(.*)$/.exec(L[i]);
|
|
86
|
+
if (m) out[m[1]] = m[2].trim().replace(/^(["'])(.*)\1$/, '$2');
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The record's tier keys, from planning/initiatives/<id>.md or <state>/initiatives/<id>.md. */
|
|
92
|
+
function readRecord(root, id, stateDir) {
|
|
93
|
+
const dirs = [path.join(root, 'planning', 'initiatives')];
|
|
94
|
+
if (stateDir) dirs.push(path.join(stateDir, 'initiatives'));
|
|
95
|
+
for (const d of dirs) {
|
|
96
|
+
const f = path.join(d, `${id}.md`);
|
|
97
|
+
let text;
|
|
98
|
+
try { text = fs.readFileSync(f, 'utf8'); } catch { continue; }
|
|
99
|
+
const fm = front(text);
|
|
100
|
+
return { launch_tier: fm.launch_tier || '', reach: fm.reach || '', risk: fm.risk || '' };
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Read one initiative's tier and steps. Writes nothing. o: { ctx, w } (lib/stage-read.js cliCtx), tasks (when already read). */
|
|
106
|
+
function read(root, ini, o = {}) {
|
|
107
|
+
const SR = require('./stage-read.js');
|
|
108
|
+
const { w, ctx } = o.ctx ? { w: o.w, ctx: o.ctx } : SR.cliCtx(root);
|
|
109
|
+
const rec = readRecord(root, ini, ctx.stateDirFor());
|
|
110
|
+
if (!rec) return { error: `no initiative record for ${ini}` };
|
|
111
|
+
let title = ini;
|
|
112
|
+
try { const r = SR.rowOf(ctx, w, ini); if (r && r.ok && r.row.title) title = r.row.title; } catch { /* the id stands in */ }
|
|
113
|
+
const t = tierOf(rec);
|
|
114
|
+
let tasks = o.tasks;
|
|
115
|
+
if (!tasks && t.tier) { try { tasks = SR.tasksOf(ctx, w, ini); } catch { tasks = []; } }
|
|
116
|
+
return { title, ...t, steps: stepsOf(t.tier, tasks || []) };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** The health log line: one per tier answer, on stderr. */
|
|
120
|
+
function log(id, t, write = (s) => process.stderr.write(s + '\n')) {
|
|
121
|
+
const open = (t.steps || []).filter((s) => s.state !== 'done').length;
|
|
122
|
+
try { write(`[launch-tier] ${id} tier=${t.tier || 'unknown'} from=${t.from}${t.tier ? ` steps_open=${open}` : ''}`); } catch { /* no stderr */ }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const WHEN_ORDER = ['before 100%', 'at 100%', 'after 100%'];
|
|
126
|
+
const MARK = { done: '✓', open: '…', missing: '○' };
|
|
127
|
+
|
|
128
|
+
/** Lines for a terminal or a chat. */
|
|
129
|
+
function render(id, t, { title = '' } = {}) {
|
|
130
|
+
const name = title || id;
|
|
131
|
+
if (!t.tier) return [`${name}: launch tier unknown. ${t.why}`, ' reach: few | some | all · risk: low | medium | high · or launch_tier: small | medium | big'];
|
|
132
|
+
const left = t.steps.filter((s) => s.state !== 'done');
|
|
133
|
+
const out = [`${name}: ${t.tier} launch (${t.why}). ${left.length ? `${left.length} of ${t.steps.length} launch steps not done.` : 'Every launch step is done.'}`];
|
|
134
|
+
for (const w of WHEN_ORDER) {
|
|
135
|
+
const xs = t.steps.filter((s) => s.when === w);
|
|
136
|
+
if (!xs.length) continue;
|
|
137
|
+
out.push(` ${w[0].toUpperCase() + w.slice(1)}:`);
|
|
138
|
+
for (const s of xs) out.push(` ${MARK[s.state]} ${s.what}${s.state === 'open' ? ` (task ${s.task} is open)` : s.state === 'missing' ? ' (no task yet)' : ''}`);
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
module.exports = { TIERS, REACH, RISK, STEPS, PLAN, tierOf, stepsOf, front, readRecord, read, log, render };
|
package/workspace/lib/moments.js
CHANGED
|
@@ -98,7 +98,35 @@ function facts(ctx, w, now = Date.now()) {
|
|
|
98
98
|
let goal = false, goalTitle = '';
|
|
99
99
|
try { const r = require('./okr-goals.js').read(w.root); if (r.ok && r.objectives.length) { goal = true; goalTitle = String(r.objectives[0].title || '').slice(0, 120); } } catch { /* unreadable: no goal */ }
|
|
100
100
|
const week = ids.size > 0 && Number.isFinite(oldest) && oldest <= now - WEEK && newest >= now - WEEK;
|
|
101
|
-
|
|
101
|
+
// what could fill a waiting place (initiative empty-page-next-action): a saved Jira reading, and a written strategy line
|
|
102
|
+
const tracker = stateDirsOf(ctx, w).some((s) => ls(path.join(s, 'tracker', 'jira')).some((n) => n.endsWith('.md')));
|
|
103
|
+
let strategy = false;
|
|
104
|
+
try {
|
|
105
|
+
const dir = require(require('./repo-script.js').repoScript('signals/layout-paths.js')).pathsFor(w.root).recordsDir;
|
|
106
|
+
const c = require('./strategy-card.js').read(dir);
|
|
107
|
+
strategy = ['for', 'problem', 'bet', 'win', 'wont'].some((k) => String((c && c[k]) || '').trim());
|
|
108
|
+
} catch { /* no records folder: no strategy */ }
|
|
109
|
+
return { initiatives: ids.size, dated, goal, goalTitle, week, tracker, strategy };
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The one next step a waiting place offers, from what PMOS already holds (initiative empty-page-next-action, idea A474).
|
|
113
|
+
* PURE. → { id, say, ask } | null. `say` is the line on screen and names the source; `ask` is what a press puts in the chat, unsent:
|
|
114
|
+
* it asks PMOS to show the draft before it keeps anything (the person approves). Order: Board and Reports (both fill from initiatives)
|
|
115
|
+
* tracker → strategy → paste; Intelligence (fills from a goal) strategy → initiatives → paste. */
|
|
116
|
+
const KEEP = ' Show them to me before you keep any.';
|
|
117
|
+
const NEXT = {
|
|
118
|
+
tracker: { id: 'tracker', say: 'Make initiatives from the Jira epics PMOS read', ask: 'Make draft initiatives for this product from the Jira epics PMOS has read.' + KEEP },
|
|
119
|
+
strategy: { id: 'strategy', say: 'Draft initiatives from the strategy', ask: 'Draft three initiatives for this product from its strategy.' + KEEP },
|
|
120
|
+
paste: { id: 'paste', say: 'Paste a list of the work, and PMOS makes initiatives from it', ask: 'Make an initiative from each line of this list.' + KEEP + '\n\n' },
|
|
121
|
+
goalStrategy: { id: 'strategy', say: 'Draft a goal from the strategy', ask: 'Draft one goal for this quarter, with two or three key results, from this product\'s strategy. Show it to me before you keep it.' },
|
|
122
|
+
goalWork: { id: 'initiatives', say: 'Draft a goal from your initiatives', ask: 'Draft one goal for this quarter, with two or three key results, from this product\'s open initiatives. Show it to me before you keep it.' },
|
|
123
|
+
goalPaste: { id: 'paste', say: 'Write what you want to reach, and PMOS makes a goal from it', ask: 'Make one goal with key results from what we want to reach this quarter. Show it to me before you keep it.\n\n' },
|
|
124
|
+
};
|
|
125
|
+
function nextOf(place, F) {
|
|
126
|
+
if (!F) return null;
|
|
127
|
+
if (place === 'insights') return { ...(F.strategy ? NEXT.goalStrategy : F.initiatives > 0 ? NEXT.goalWork : NEXT.goalPaste) };
|
|
128
|
+
if (place === 'board' || place === 'reports') return { ...(F.tracker ? NEXT.tracker : F.strategy ? NEXT.strategy : NEXT.paste) };
|
|
129
|
+
return null;
|
|
102
130
|
}
|
|
103
131
|
|
|
104
132
|
/** Which places the facts open. */
|
|
@@ -113,6 +141,13 @@ function isNew(ctx, w) {
|
|
|
113
141
|
} catch { return false; }
|
|
114
142
|
}
|
|
115
143
|
|
|
144
|
+
const told = new Set();
|
|
145
|
+
/** One [moments] next line per place and step, so a responder sees which step a waiting place offered. */
|
|
146
|
+
function logNext(place, id) {
|
|
147
|
+
const k = place + ':' + id; if (told.has(k)) return; told.add(k);
|
|
148
|
+
try { console.info('[moments] next', place, id); } catch { /* no console */ }
|
|
149
|
+
}
|
|
150
|
+
|
|
116
151
|
const dayOf = (now) => { const d = new Date(now); return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0'); };
|
|
117
152
|
|
|
118
153
|
/** Whether moment m is due for a workspace with facts F and setup record P. */
|
|
@@ -137,7 +172,7 @@ function wordsOf(m, F) {
|
|
|
137
172
|
* The whole view, and the writes it implies. Pure over its inputs: `rows` is one entry per workspace
|
|
138
173
|
* { w, isNew, facts, progress, reveal? }. → { moment, places, writes }
|
|
139
174
|
* moment the day's ✦ or null: { id, ws, product, text, sub, href, guide, guideLabel, go }
|
|
140
|
-
* places { [place]: { quiet, dot, line } }
|
|
175
|
+
* places { [place]: { quiet, dot, line, next? } } next: the one step a quiet place offers (nextOf)
|
|
141
176
|
* writes [{ ws, moments?, places? }] what to save (the first moment recorded, a place that opened)
|
|
142
177
|
*/
|
|
143
178
|
function view(rows, now = Date.now()) {
|
|
@@ -148,6 +183,9 @@ function view(rows, now = Date.now()) {
|
|
|
148
183
|
for (const p of PLACES) {
|
|
149
184
|
const open = rows.some((r) => !r.isNew || openOf(r.facts)[p]);
|
|
150
185
|
places[p] = { quiet: rows.length > 0 && !open, dot: false, line: QUIET[p] };
|
|
186
|
+
// a quiet place offers one next step, from the first new workspace's facts
|
|
187
|
+
const src = places[p].quiet && fresh.find((r) => r.facts);
|
|
188
|
+
if (src) { places[p].next = nextOf(p, src.facts); if (places[p].next) logNext(p, places[p].next.id); }
|
|
151
189
|
}
|
|
152
190
|
let answeredToday = false, current = null;
|
|
153
191
|
for (const r of fresh) {
|
|
@@ -238,4 +276,4 @@ function visit(ctx, place, now = Date.now()) {
|
|
|
238
276
|
return { ok: true };
|
|
239
277
|
}
|
|
240
278
|
|
|
241
|
-
module.exports = { MOMENTS, PLACES, QUIET, facts, openOf, isNew, view, rowsOf, current, answer, visit, dayOf };
|
|
279
|
+
module.exports = { MOMENTS, PLACES, QUIET, facts, nextOf, openOf, isNew, view, rowsOf, current, answer, visit, dayOf };
|
|
@@ -39,6 +39,7 @@ const PROVIDERS = Object.freeze([
|
|
|
39
39
|
'folder-needs', // folder repair: a folder PMOS could not put back on its default branch alone, in one plain sentence (kind 8)
|
|
40
40
|
'factory-needs', // factory-builder-inner-loop: a work item blocked after the Builder's CI-fix rounds, with the reason (kind 8)
|
|
41
41
|
'decision-journal-needs', // decision-journal-outcome-checks: a journal decision whose check date came, with no verdict (kind 1)
|
|
42
|
+
'parked-reasons', // parked-reason-way-back (bet A446): a parked initiative whose way back is met, to bring back (kind 7)
|
|
42
43
|
]);
|
|
43
44
|
/** Kinds that already mean something in the needs queue. A provider may not reuse one. */
|
|
44
45
|
const RESERVED_KINDS = Object.freeze(['question', 'accept', 'outcome', 'keep', 'evidence', 'plan-flag', 'provider-error']);
|