create-pmos 0.430.0 → 0.432.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 +25 -25
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/board-programs-test.js +10 -4
- package/workspace/briefing-premium-board-test.js +24 -22
- package/workspace/briefing-premium-initiative-test.js +10 -5
- package/workspace/briefing-premium-products-test.js +2 -0
- package/workspace/briefing-premium-sources-test.js +15 -8
- package/workspace/briefing-premium-work-test.js +6 -3
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +40 -33
- package/workspace/guide/briefing-premium.md +1 -1
- package/workspace/guide/data-freshness.md +3 -1
- package/workspace/guide/home.md +27 -18
- package/workspace/guide/initiative-boards.md +6 -6
- package/workspace/guide/programs.md +4 -4
- package/workspace/ini-workflow-test.js +13 -8
- package/workspace/lib/briefing-premium.js +6 -3
- package/workspace/lib/engine/boards.js +13 -2
- package/workspace/lib/ini-deleted.js +58 -0
- package/workspace/lib/initiative-rows.js +4 -1
- package/workspace/lib/routes-boards.js +48 -0
- package/workspace/lib/search-index.js +3 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +50 -32
- package/workspace/premium-briefing-depth-test.js +33 -34
- package/workspace/premium-core-doc-issue-test.js +1 -1
- package/workspace/premium-vw-backlog-test.js +1 -1
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-vw-jira-test.js +1 -1
- package/workspace/program-leave-test.js +20 -19
- package/workspace/public/pm/bd-acts.js +7 -5
- package/workspace/public/pm/bd-ini-panel.js +57 -25
- package/workspace/public/pm/bd-span.js +17 -14
- package/workspace/public/pm/cozy-ev.css +22 -7
- package/workspace/public/pm/cozy-evmodel.js +3 -3
- package/workspace/public/pm/cozy-nav.js +29 -32
- package/workspace/public/pm/cozy-news.js +11 -27
- package/workspace/public/pm/cozy-settings.js +68 -11
- package/workspace/public/pm/cozy-sources.js +5 -89
- package/workspace/public/pm/cozy-today.css +19 -1
- package/workspace/public/pm/hi-pop.css +21 -0
- package/workspace/public/pm/hi-pop.js +5 -5
- package/workspace/public/pm/home-app.js +62 -25
- package/workspace/public/pm/home-day.js +60 -2
- package/workspace/public/pm/home-ini.js +66 -27
- package/workspace/public/pm/home-more.js +9 -50
- package/workspace/public/pm/home-today.js +4 -2
- package/workspace/public/pm/ini-more.js +78 -42
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/ini-view.css +17 -0
- package/workspace/public/pm/ini-view.js +25 -7
- package/workspace/public/pm/premium-board.js +4 -3
- package/workspace/public/pm/prog-move.js +26 -0
- package/workspace/public/pm/stage-line.js +7 -5
- package/workspace/public/premium.html +0 -1
- package/workspace/stage-card-test.js +10 -1
- package/workspace/test-lists/milestone-label.json +5 -0
|
@@ -338,7 +338,7 @@ Board is the fourth place on the rail, after Chat, at `/premium-board.html`. It
|
|
|
338
338
|
- **Opening an initiative.** A click on an initiative opens its page (see "Initiative page"). **Open initiatives** (Page or Popup) in the ⋯ menu changes that: Popup opens the initiative's dialog instead, which shows its record as a grid and the path of its file, with the read-only agent beside it. The choice is kept in this browser. The dialog holds no press.
|
|
339
339
|
- **New asks** sits at the top of the right column on a team board. Each ask shows where it came from and the drafted title, lane and anchor. **Accept** makes it an initiative in the first stage, through the console's accept route; **Decline** asks for a reason first. The card says when nothing is left to triage.
|
|
340
340
|
- **New initiative** (beside the Initiatives heading, team boards only) asks for a title, a lane and an anchor (a KR or a health budget). It writes an ask and accepts it, as the console does. An unanchored initiative is refused on the page.
|
|
341
|
-
-
|
|
341
|
+
- **The stage chip** on an initiative's stage card (and the bar under an initiative page's heading) moves it to the next or another stage, puts it on hold with a reason and a check-back day, marks it Won't do with a reason, or archives it. **⋯** holds the short menu, with **Delete** last (see the Home guide). Each press writes one line through the console's route, says what it recorded, and offers Undo for a few seconds. An on-hold row offers Resume; a cancelled one offers Reopen; an archived one offers Restore. Cancelled and archived initiatives leave the list and sit under a fold below it. On the PMOS board the workflow engine places each initiative, so the moves are not offered and New asks and New initiative are hidden.
|
|
342
342
|
|
|
343
343
|
Not drawn, because PMOS holds no record for them: the mockup's demo measures (Activation, Partner uptime, API p95), targets, and the mockup's demo boards.
|
|
344
344
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Data freshness: how the workspace keeps up to date, and how old each source is"
|
|
4
|
-
timestamp: 2026-10-
|
|
4
|
+
timestamp: 2026-10-27
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Data freshness
|
|
@@ -51,6 +51,8 @@ The Sources list shows them as one row, **Your tools**. Its time is the oldest r
|
|
|
51
51
|
|
|
52
52
|
## Refresh all: the sources first, then the Briefing
|
|
53
53
|
|
|
54
|
+
On Home, the Board and Intelligence, the sources list is in **Settings › Connectors**. There is no Sources card in the place menu. Each source shows when PMOS last read it. A source that is old or failed has an amber dot and ↻: press ↻ to read it again. ↻ in the Connectors header is **Refresh all**. While a source is old, an amber box at the top of Settings names it, and the place menu opens Settings at Connectors.
|
|
55
|
+
|
|
54
56
|
**Refresh all** in Sources is one run, in a fixed order:
|
|
55
57
|
|
|
56
58
|
1. It reads every source that is on in Settings › Data refresh: Calendar, Jira, work assigned to you, tracker files and Your tools. It also rebuilds the repository and initiative facts on this machine.
|
package/workspace/guide/home.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Home (/premium.html) and the designed features"
|
|
4
|
-
description: "Home in the Agreed design: the list grouped by product, the Viewer, the place menu, New for you, Search, and the initiative, meeting, report, Board and Insights features designed after it."
|
|
5
|
-
timestamp: 2026-10-
|
|
4
|
+
description: "Home in the Agreed design: the list grouped by product, the Viewer, the place menu, Your day and its New for you fold, Search, and the initiative, meeting, report, Board and Insights features designed after it."
|
|
5
|
+
timestamp: 2026-10-28
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Home
|
|
@@ -14,8 +14,11 @@ Home, the Board, Insights and the Viewer use one type scale: 11, 12, 14, 16, 20
|
|
|
14
14
|
## The list
|
|
15
15
|
|
|
16
16
|
- The top line has **Good morning**, the product picker, the filter icon (on a desktop) and **New**. The line under it says how many items are yours, for example "4 are yours".
|
|
17
|
-
- Press **Good morning** to open **Your day** in the Viewer. This is the same on a computer and on a phone. To open the calendar, press
|
|
18
|
-
-
|
|
17
|
+
- Press **Good morning** to open **Your day** in the Viewer. This is the same on a computer and on a phone. To open the calendar, press the calendar icon in Your day's header. A program's milestone changes that wait on you are the first line of the program's card.
|
|
18
|
+
- A blue dot after **Good morning** means that something is new for you. It is in the **New for you** fold of Your day.
|
|
19
|
+
- Your day shows the date, the meetings of the day, **Your move** (the items that wait on you, with their count), **New for you**, and **This week** (the Weekly review).
|
|
20
|
+
- **New for you** shows only when something is new: mentions to know about, tasks given to you, and work that finished while you were away. It shows the 3 newest items, then **N more**. Press an item to open it in the Viewer. Press **N more** to see all of them. Press ✓✓ in the fold's header to mark all of them seen. An item leaves when you open it or mark it seen. A mention that asks you something is not here: it is the next step of its initiative.
|
|
21
|
+
- After 17:00, Your day is the end of the day. It shows what moved today, then a **Tomorrow** fold with tomorrow's meetings. When tomorrow has no meetings, there is no Tomorrow fold.
|
|
19
22
|
- 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.
|
|
20
23
|
- 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. 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.
|
|
21
24
|
- 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.
|
|
@@ -51,19 +54,24 @@ Press an initiative's name in the list, or open `?ini=<id>`. The list stays as i
|
|
|
51
54
|
|
|
52
55
|
- The page's header shows the lane and the anchor, the name, **New session** (+), ⋯, Open wide and Close.
|
|
53
56
|
- The stage card shows the stage, **N of M done** for its tasks, the days in the stage (for example "9 of ~7 days", amber when over the usual time) and → for the next stage. → turns blue when every task of the stage is done.
|
|
54
|
-
- Under the header is one line for the whole initiative. Each stage is a part of the line, on its own dates. Done stages are grey, the current stage is blue, later stages are light, and a stage with no dated task is dashed. The ◇ marks are the milestone tasks, with the name above and the date below. The end ◇ is the end date. A thin tick is Today.
|
|
57
|
+
- Under the header is one line for the whole initiative. Each stage is a part of the line, on its own dates. Done stages are grey, the current stage is blue, later stages are light, and a stage with no dated task is dashed. The ◇ marks are the milestone tasks, with the name above and the date below. The end ◇ is the end date. When a milestone task in the last milestone stage stands for the end, the end ◇ sits on that task's own date and shows it. A thin tick is Today.
|
|
55
58
|
- Press a part to show that stage in **Tasks**. Press **N of M done** to do the same. Press a ◇ to open the milestone task in **Tasks**. Milestones a few days apart merge into one ◇ with a count. Press it to list them.
|
|
56
59
|
- The line also shows what the Board's timeline shows: » for a skipped stage, a dotted gap and ⏸ for a hold (press ⏸ to set or change the return date), a hairline for 2 weeks or more with no activity (press it; ahead of Today, + adds a task in the gap), hatching past the end date, a dashed Jira forecast, a thin line under it for a saved plan, and "after <initiative>" when it waits on another initiative.
|
|
57
60
|
- A cancelled, done or archived initiative leaves Home, and so do the next steps that were for it.
|
|
58
61
|
- With no dates at all, the parts are even and dashed. The calendar button opens **Tasks** in the Timeline view to set the dates.
|
|
59
62
|
- On a phone the line shows only the next open milestone's name. Press the line to unfold the stages and milestones as a list under it.
|
|
60
63
|
- Under the card are the 3 most urgent tasks and the documents that need a look. **Show N more** opens all the tasks and **Show all N** opens all the documents. ← goes back to the page. A task or a document that you open from the page also has ← back to the page.
|
|
61
|
-
- ⋯ is the same
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
- ⋯ is a short menu. It is the same on Home and on the Board, in the same order: **Split into a new initiative**, **Merge into**, **Program**, **Open on the Board** (only on Home), **Copy** (**Link** or **Text**), **The record**, a line, then **Delete** in red.
|
|
65
|
+
- **Program** is one list: the open programs (the current one says Now), then **No program** to move out. An initiative that is in no program has **Make it a program** at the end.
|
|
66
|
+
- Every other change is on the thing that it changes:
|
|
67
|
+
- Press the name to rename the initiative.
|
|
68
|
+
- Press the workflow chip to change the workflow.
|
|
69
|
+
- Press the dashed **+** after the people to add a stakeholder.
|
|
70
|
+
- Press the dates chip on the stage card to change the plan dates.
|
|
71
|
+
- Press **↻** beside Jira's last read in **Linked** to read Jira again (only when the board reads Jira).
|
|
72
|
+
- Press the stage name on the stage card to open the stage picker (see below).
|
|
73
|
+
- **The stage picker** lists every stage of the workflow. The current stage is marked. Press an earlier stage to move back, or a later stage to move on. Under the stages are the **Moves on by itself** switch, **Put on hold** (**Resume** when it is on hold), **Won't do** (**Back to Triage** after Won't do) and **Archive**. On a phone the picker is a sheet. **Cancel the initiative** is gone: use **Won't do**, which keeps the record.
|
|
74
|
+
- **Delete** asks nothing. The initiative and its PMOS tasks go at once, and the message says, for example, "Deleted Email OTP and its 67 tasks" with **Undo** for 8 seconds. Undo brings back the initiative and every task. Delete never changes Jira. A deleted initiative leaves Home, the Board, Intelligence, Search and the reports. The board's ledger keeps the delete, so a later restore can bring it back.
|
|
67
75
|
- An item that does not apply does not show. For example, a PMOS-self initiative has no stage moves and no workflow to change. To open the initiative wide, use the expand button in the header.
|
|
68
76
|
- To go back to all work, press the browser's Back, or Menu > **Home**. Neither reloads the page. Close (×) closes the page but keeps the initiative's chat. See [Back and forward](#back-and-forward).
|
|
69
77
|
- If there is no room beside the chat, the Viewer shows on top of the chat. The list stays.
|
|
@@ -112,11 +120,10 @@ Claude names a session after its first real answer. It does not ask. It changes
|
|
|
112
120
|
|
|
113
121
|
Some features are still not designed. Home keeps each one usable as a plain card in the Viewer with the label **Waiting for design**. The label means that the card works, but its look is not final.
|
|
114
122
|
|
|
115
|
-
##
|
|
123
|
+
## Search and Settings
|
|
116
124
|
|
|
117
|
-
- **New for you** replaces the Inbox. It holds only items to know about: mentions, tasks given to you and finished work. An item leaves the list when you have seen it. A mention that asks you something becomes the next step of its initiative.
|
|
118
125
|
- **Search** (Ctrl K or ⌘K, or `/`) finds initiatives, documents, sessions and files in the repository and its worktrees.
|
|
119
|
-
- **
|
|
126
|
+
- **Settings** holds the workspace settings. **General** holds the theme (Light, Dark or Auto). **Connectors** shows when PMOS last read each source. A source that is old or failed has an amber dot and ↻ to read it again. ↻ in the Connectors header reads every source again. While a source is old, an amber box at the top of Settings names it, with ↻.
|
|
120
127
|
|
|
121
128
|
## The other pages
|
|
122
129
|
|
|
@@ -127,10 +134,12 @@ Some features are still not designed. Home keeps each one usable as a plain card
|
|
|
127
134
|
|
|
128
135
|
## The place menu
|
|
129
136
|
|
|
130
|
-
Press the round button at the bottom of the page (bottom left on a desktop, bottom right on a phone). The menu lists **Home**, **Board** and **
|
|
137
|
+
Press the round button at the bottom of the page (bottom left on a desktop, bottom right on a phone). The menu lists **Home**, **Board** and **Intelligence**. Under them are two icons: **Search** (⌘K on a desktop) and **Settings**. The menu holds nothing else.
|
|
131
138
|
|
|
132
|
-
-
|
|
133
|
-
- **
|
|
139
|
+
- The button has a blue dot when something is new for you, and an amber dot when a source is old. The dots show on every page. When the menu is open, the blue dot is on **Home** (New for you is in Your day) and the amber dot is on **Settings**.
|
|
140
|
+
- When a source is old, **Settings** opens at **Connectors**, with the old source first.
|
|
141
|
+
- A screen reader reads both dots in the button's name, for example "Open the menu. 3 new for you. Jira 3 hours old".
|
|
142
|
+
- There is no **More** menu. The end of the day is Your day after 17:00. The calendar is the icon in Your day's header. To record a note, press **+** at the top of the list, then **Recording**.
|
|
134
143
|
|
|
135
144
|
## The list, and what it does not show
|
|
136
145
|
|
|
@@ -146,7 +155,7 @@ There is no My work page. The list on Home is your list:
|
|
|
146
155
|
- **Sessions.** A session row names its agent. The coloured dot beside it is its state: blue waits on you, amber may be blocked, green is running. A session PMOS started itself (a skill or a background job) shows on Home only while it works or asks you something. Once it finishes its prompt, it leaves the list. On an initiative's page, a session that waits on you shows once, under **Needs you**, not again under **Sessions**. **Finished sessions** does not list an old run of a chat that is open again.
|
|
147
156
|
- **One chat box.** Every conversation has the same box: **+** (attach a file, notes, the terminal, and **Link to an initiative** for a loose chat), **/** for commands, **@** inside an initiative, the To or In chip, the mic, and Send. A chat opens at its newest message.
|
|
148
157
|
- **Documents not written yet.** A document that does not exist yet shows **Draft it**, in its stage or ahead of it. The agent writes a draft. Nothing is issued until you read it.
|
|
149
|
-
- **Meeting notes.** A decision, to-do or question that the notes caught is not a fact until you confirm it in the meeting's Replay. Home,
|
|
158
|
+
- **Meeting notes.** A decision, to-do or question that the notes caught is not a fact until you confirm it in the meeting's Replay. Home, Your day and the evening recap do not count unconfirmed points.
|
|
150
159
|
|
|
151
160
|
## The chat
|
|
152
161
|
|
|
@@ -60,13 +60,13 @@ Each initiative has a **stage** and a **status**. The stage is the step in its o
|
|
|
60
60
|
|
|
61
61
|
A cancelled initiative is hidden from every view. The list footer says how many are hidden, for example "1 cancelled hidden". Press it to see them, or pick Cancelled in the Status filter.
|
|
62
62
|
|
|
63
|
-
Press **…** on a row to open its menu:
|
|
63
|
+
Press **…** on a row to open its menu. It is the initiative's short menu: Split, Merge into, Program, Copy, The record and **Delete** (see [Home](home.md#an-initiative)). Press the stage name on the initiative's stage card for the stage picker:
|
|
64
64
|
|
|
65
|
-
- **
|
|
66
|
-
- **Put on hold
|
|
67
|
-
- **
|
|
68
|
-
- **Merge into another
|
|
69
|
-
- **Archive
|
|
65
|
+
- **A stage**: the stages of its own workflow. Press an earlier one to move back, a later one to move on.
|
|
66
|
+
- **Put on hold**: give a reason and pick when to check back (in 2 weeks, in a month, next quarter, or no date). The check-back date shows on the row and on the initiative page. **Resume** makes it active again at the same stage.
|
|
67
|
+
- **Won't do**: pick a reason and add a note if you want. It replaces Cancel. **Back to Triage** makes it active again.
|
|
68
|
+
- **Merge into another…** (in ⋯): for a duplicate. Pick the initiative to keep. The most alike ones are first. Pick what moves: the Jira epic links and the PMOS tasks. The duplicate goes to the Archive as "Merged into" the one you keep. Its documents, asks and notes stay with it. Nothing changes in Jira.
|
|
69
|
+
- **Archive** (in the stage picker): for an initiative that does not belong. It leaves every list, count and timeline of the board. Nothing is deleted. If it belongs on another board, the sheet can move it there instead.
|
|
70
70
|
|
|
71
71
|
When two active initiatives on the same anchor have almost the same title, the less advanced one shows "Looks like a duplicate of" the other. Press it to open Merge. In the merge sheet, press **Not a duplicate** to stop the hint.
|
|
72
72
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "Programs on the Board: All products, groupings and the program panel"
|
|
4
4
|
description: "A program groups initiatives across products. How it shows on the Board (stage track, Kanban, timeline and List), the All products mode, the By product grouping, the program panel and the side panel width."
|
|
5
|
-
timestamp: 2026-10-
|
|
5
|
+
timestamp: 2026-10-28
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Programs on the Board
|
|
@@ -23,11 +23,11 @@ A cancelled or archived initiative leaves its program's views: the band, the pro
|
|
|
23
23
|
- The **timeline** draws a program row that brackets its initiatives' bars, on every span. Program milestones are diamonds. Milestones that are close together merge into one diamond with a count.
|
|
24
24
|
- On the timeline, a **product's head row** also shows milestones. Nothing is added by hand: the row shows every milestone of the product's initiatives, which are each milestone task and each initiative's end diamond (its Deliver or Evaluate date). The diamonds are the same as on the initiative rows: open, filled when done, orange when late. Diamonds that are close together merge into one diamond with a count and the date range under it. Press it to see a list with the milestone, its initiative and the date. Press a line to open that initiative. Hold the pointer on a single diamond to see its milestone and initiative. A thin line goes from the first start to the last end of the product's initiatives. When the product is folded, the row stays the same, so it is a summary of the product. On a phone the diamonds have no dates; tap the row to see all the milestones in date order. A product inside a program has no such row, because the program row shows its milestones.
|
|
25
25
|
- On the timeline, an initiative row shows only its **pinned** milestones. By default that is its last milestone. Press a diamond to see every milestone of the initiative, with how many are on the timeline. Press the pin beside a milestone to show it or to hide it. To see every milestone or none, open **Filter** and pick **Milestones on the timeline: Pinned**, **All** or **None**. The Board keeps your pick. From a terminal: `pmos task set <task> --pin`, `--no-pin`, or `--pin-default` to go back to the default.
|
|
26
|
-
- The label at the end of an initiative row says what lands and when. When a milestone task is in the last milestone stage, or is on the end date, or is in the Deliver stage, the label shows its name and its own date, and the end date of the initiative shows when you hold the pointer on the label. Otherwise the label is **Deliver** (or **Evaluate**) and the end date. Press that end diamond: the card has the same words as the label, then the milestones of the initiative.
|
|
26
|
+
- The label at the end of an initiative row says what lands and when. When a milestone task is in the last milestone stage, or is on the end date, or is in the Deliver stage, or is so close to the end date that its diamond would sit on the end diamond, the label shows its name and its own date, and the end date of the initiative shows when you hold the pointer on the label. Otherwise the label is **Deliver** (or **Evaluate**) and the end date. Press that end diamond: the card has the same words as the label, then the milestones of the initiative.
|
|
27
27
|
- **List** has a Product column and a Program column. Press a column header to sort by it.
|
|
28
28
|
- **New** opens a menu: **New initiative** or **New program**.
|
|
29
29
|
- A new program shows at once, before any initiative joins it. A program with no open initiative shows on its own product's Board and on All products, with "No initiatives yet" or "No open initiatives". Press its name, then **⋯** and **Move an initiative in**. That menu lists open initiatives only, grouped by product, with the program's own product first, wherever you open the program (Home, another product's Board or All products). An initiative joins in its own product.
|
|
30
|
-
- To make an initiative a program, open the initiative, press **⋯**, then **
|
|
30
|
+
- To make an initiative a program, open the initiative, press **⋯**, then **Program** and **Make it a program**. The initiative joins the new program, and the program panel opens. **Make it a program** shows only for an initiative that is in no program. The same **Program** list moves an initiative to another program or out of its program (**No program**).
|
|
31
31
|
- The chat cannot make or change a program. Every program change is a press on the Board. When you ask the chat about a program, it tells you which press to use.
|
|
32
32
|
|
|
33
33
|
## The program panel
|
|
@@ -39,7 +39,7 @@ Press a program's name on the Board to open its panel. Home links to it with `?p
|
|
|
39
39
|
- The goal row shows the KRs of its initiatives for one half year, each with its name and a dot (met, on course or behind). Use the half-year picker to see another half. Earlier halves fold into one chip.
|
|
40
40
|
- The milestone track shows the next 3 milestones. The done cluster and the **N more** cluster open the **Milestones** tab, which lists Done, Next and Later.
|
|
41
41
|
- The rows that wait on you open in Home.
|
|
42
|
-
- After **
|
|
42
|
+
- After **Make it a program**, a card counts the tasks that have no level yet. Press the arrow to ask Claude in Home to suggest a level for each task.
|
|
43
43
|
- The tabs are **Tree**, **Tasks**, **Milestones** and **Documents**. The panel has no chat box: use Home to talk about the program.
|
|
44
44
|
|
|
45
45
|
## Claude suggests milestones
|
|
@@ -92,12 +92,15 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
92
92
|
const V = '#czViewer:not([hidden])';
|
|
93
93
|
const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
|
|
94
94
|
const moreLabels = (p) => p.evaluate(async () => { const b = document.querySelector('#czViewer [data-cz-vw="more"]'); if (!b) return []; b.click(); await new Promise((r) => setTimeout(r, 80)); const m = document.querySelector('#czViewer .cz-vw-menu'); const out = m ? [...m.querySelectorAll('[role="menuitem"] span:first-of-type')].map((x) => x.textContent) : []; b.click(); return out; });
|
|
95
|
+
// batch 16 item 5c (FmI2Stage): Won't do, Back to Triage and Archive sit in the stage chip's picker, not the ⋯
|
|
96
|
+
const stageLabels = (p) => p.evaluate(async (v) => { const b = document.querySelector(v + ' [data-iv-stagepick]'); if (!b) return []; b.click(); await new Promise((r) => setTimeout(r, 80)); const m = document.querySelector('.hi-pop'); const out = m ? [...m.querySelectorAll('[data-sp-life] span')].map((x) => x.textContent) : []; document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape' })); return out; }, V);
|
|
97
|
+
const pickStage = async (p, label) => { await p.click(V + ' [data-iv-stagepick]'); await until(() => p.evaluate(() => !!document.querySelector('.hi-pop [data-sp-life]'))); await p.click(`.hi-pop [data-sp-life]:has(> span:text-is("${label}"))`); };
|
|
95
98
|
const pickMore = async (p, label) => { await p.click('#czViewer [data-cz-vw="more"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await p.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); };
|
|
96
99
|
|
|
97
100
|
const A = await open(), p = A.page;
|
|
98
101
|
ok('W1 the page opens on the initiative with the workflow on its meta line', A.up, await txt(p, V + ' .cz-vw-kind'));
|
|
99
102
|
ok('W1 the kind line names the workflow and the anchor: "Tender · KR 1.1" (Kind becomes Workflow)', /^Tender · KR 1\.1$/.test(await txt(p, V + ' .cz-vw-kind')), await txt(p, V + ' .cz-vw-kind'));
|
|
100
|
-
ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .iv-sch > b')) === 'Triage', await txt(p, V + ' .iv-sch'));
|
|
103
|
+
ok('W1 the card names the stage of that workflow: Triage', (await txt(p, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Triage', await txt(p, V + ' .iv-sch'));
|
|
101
104
|
ok('W1 the line draws the ten stages of Tender, three of them milestones', await p.evaluate((v) => { const t = [...new Map([...document.querySelectorAll(v + ' .iv-tl .iv-tlp')].map((x) => [x.dataset.ivStage, x.title])).values()]; return t.length === 10 && t.filter((x) => /^◆ /.test(x)).length === 3; }, V));
|
|
102
105
|
ok('W1 the next stage is Tender\'s own: the → names Requirements', await p.evaluate((v) => /^Next: Requirements/.test(document.querySelector(v + ' .iv-scgo').getAttribute('aria-label')), V));
|
|
103
106
|
ok('W1 the icon names the workflow for a screen reader', await p.evaluate((v) => /Workflow: Tender/.test(document.querySelector(v + ' [data-iv-wf]').getAttribute('aria-label')), V));
|
|
@@ -120,12 +123,14 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
120
123
|
await p.click('.hi-pop [data-wf-go]');
|
|
121
124
|
ok('W4 Switch sends the workflow and the stage the PM picked', await until(() => A.posts.some((x) => x.path === '/api/boards/ini-wf' && x.body.wf === 'product-feature' && x.body.to === 'discover')), JSON.stringify(A.posts.filter((x) => /ini-wf/.test(x.path))));
|
|
122
125
|
|
|
123
|
-
// W5 the ⋯ menu
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
// W5 the ⋯ menu is short (batch 16 item 5c): the workflow chip changes the workflow, the title renames, the stage chip ends it
|
|
127
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-iv-stagepick]') && !!document.querySelector(v + ' [data-iv-wf]'), V));
|
|
128
|
+
const labels = await moreLabels(p), sl = await stageLabels(p);
|
|
129
|
+
ok('W5 the workflow chip and the title change the workflow and the name; ⋯ holds neither (FmIMap)', !labels.includes('Change workflow') && !labels.includes('Rename') && await p.evaluate((v) => !!document.querySelector(v + ' [data-iv-wf]') && !!document.querySelector('#czViewer [data-cz-vw-rn]'), V), JSON.stringify(labels));
|
|
130
|
+
ok('W5 the stage chip holds Won’t do and Archive (WfAWontDo, FmI2Stage)', ['Won’t do', 'Archive'].every((l) => sl.includes(l)) && sl.indexOf('Won’t do') < sl.indexOf('Archive'), JSON.stringify(sl));
|
|
126
131
|
|
|
127
132
|
// W6 Won't do
|
|
128
|
-
await
|
|
133
|
+
await pickStage(p, 'Won’t do');
|
|
129
134
|
const wd = await until(() => p.evaluate(() => { const el = document.querySelector('.hi-pop[role="dialog"]'); return el && /Won’t do Office network tender\?/.test(el.textContent) ? { chips: [...el.querySelectorAll('[data-wf-why]')].map((c) => c.textContent), off: el.querySelector('[data-wf-go]').disabled } : null; }));
|
|
130
135
|
ok('W6 Won’t do asks a reason: No budget, Out of scope, Done another way, Other; it waits for one', wd && wd.chips.join('|') === 'No budget|Out of scope|Done another way|Other' && wd.off, JSON.stringify(wd));
|
|
131
136
|
await p.click('.hi-pop [data-wf-why="budget"]');
|
|
@@ -140,7 +145,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
140
145
|
await until(() => p.evaluate((v) => !!document.querySelector(v + ' .hi-end'), V), 30000);
|
|
141
146
|
ok('W7 the page of a Won’t do says why, and offers Back to Triage', /Won't do · No budget: Moved to next year’s budget\./.test(await txt(p, V + ' .hi-end')), await txt(p, V + ' .hi-end'));
|
|
142
147
|
ok('W7 its stage does not move: the card has no next stage to move to', !(await p.evaluate((v) => !!document.querySelector(v + ' .iv-sc .iv-scgo, ' + v + ' [data-iv-next]'), V)), await txt(p, V + ' .iv-sc'));
|
|
143
|
-
ok('W7
|
|
148
|
+
ok('W7 the stage chip has Back to Triage in place of Won’t do', await stageLabels(p).then((l) => l.includes('Back to Triage') && !l.includes('Won’t do')));
|
|
144
149
|
await shot(p, 'wontdo-page-1440');
|
|
145
150
|
await p.click(V + ' .hi-end [data-wf-back]');
|
|
146
151
|
ok('W7 Back to Triage brings it back', await until(() => A.posts.some((x) => x.path === '/api/boards/wontdo' && x.body.back === true)));
|
|
@@ -149,7 +154,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
149
154
|
|
|
150
155
|
// W8 the phone, and dark
|
|
151
156
|
const P = await open({ w: 390, h: 844, fresh: false, B: board('requirements') });
|
|
152
|
-
ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .iv-sch > b')) === 'Requirements' && await P.page.evaluate((v) => { const t = [...new Map([...document.querySelectorAll(v + ' .iv-tl .iv-tlp')].map((x) => [x.dataset.ivStage, x.title])).values()]; return t.length === 10 && / · now$/.test(t[1]); }, V));
|
|
157
|
+
ok('W8 the phone opens the page with the workflow at Requirements, the second of its ten bars', P.up && (await txt(P.page, V + ' .iv-sch > b, .iv-sch .iv-stc b')) === 'Requirements' && await P.page.evaluate((v) => { const t = [...new Map([...document.querySelectorAll(v + ' .iv-tl .iv-tlp')].map((x) => [x.dataset.ivStage, x.title])).values()]; return t.length === 10 && / · now$/.test(t[1]); }, V));
|
|
153
158
|
ok('W8 the toast shows once only: seen before, not again', !(await P.page.evaluate(() => { const t = document.getElementById('hiToast'); return !!t && !t.hidden; })));
|
|
154
159
|
await shot(P.page, 'page-390');
|
|
155
160
|
await P.page.click(V + ' [data-iv-wf]');
|
|
@@ -160,7 +165,7 @@ const BRIEF = BRP.build(BRF.facts());
|
|
|
160
165
|
ok('W8 the sheet fits the phone: no side scroll', await P.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1));
|
|
161
166
|
await shot(P.page, 'switch-390');
|
|
162
167
|
await P.page.click('.hi-pop [data-wf-x]');
|
|
163
|
-
await
|
|
168
|
+
await pickStage(P.page, 'Won’t do');
|
|
164
169
|
await until(() => P.page.evaluate(() => !!document.querySelector('.hi-pop.sheet [data-wf-why]')));
|
|
165
170
|
await shot(P.page, 'wontdo-390');
|
|
166
171
|
ok('W8 no page error on the phone', !P.errors.length, P.errors.join(' | '));
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
const fs = require('fs');
|
|
21
21
|
const path = require('path');
|
|
22
|
+
const deleted = require('./ini-deleted.js'); // an initiative the PM deleted leaves Your day too (batch 16 item 5d)
|
|
22
23
|
const { execFile } = require('child_process');
|
|
23
24
|
const W = require('./briefing-premium-writes.js');
|
|
24
25
|
const Src = require('./briefing-premium-sources.js');
|
|
@@ -584,7 +585,7 @@ async function refresh({ root, engine, runtimeDir }) {
|
|
|
584
585
|
inits = await readInitiatives({ root, engine });
|
|
585
586
|
}
|
|
586
587
|
if (!inits) f.missing.push('workflow');
|
|
587
|
-
kept = { at: Date.now(), root, key, ok: !!inits, initiatives: inits || [], model: hooks.build(Object.assign({}, f, { initiatives: inits || [] })) };
|
|
588
|
+
kept = { at: Date.now(), root, key, ok: !!inits, initiatives: inits || [], model: hooks.build(Object.assign({}, f, { initiatives: deleted.drop(root, inits || []) })) };
|
|
588
589
|
partial = null; lastError = null; lastErrorAt = 0;
|
|
589
590
|
if (runtimeDir) saveCache(runtimeDir, kept);
|
|
590
591
|
}
|
|
@@ -622,13 +623,15 @@ async function rebuild({ root, runtimeDir }) {
|
|
|
622
623
|
if (!kept || kept.root !== root) return false;
|
|
623
624
|
const f = await readFast({ root, now: Date.now(), runtimeDir });
|
|
624
625
|
if (!kept.ok) f.missing.push('workflow');
|
|
625
|
-
kept = Object.assign({}, kept, { model: hooks.build(Object.assign({}, f, { initiatives: kept.initiatives })) });
|
|
626
|
+
kept = Object.assign({}, kept, { model: hooks.build(Object.assign({}, f, { initiatives: deleted.drop(root, kept.initiatives) })) });
|
|
626
627
|
if (runtimeDir) saveCache(runtimeDir, kept);
|
|
627
628
|
return true;
|
|
628
629
|
}
|
|
629
630
|
/** The model the route holds for this root, for the agent to find a row in. null before the first read. */
|
|
630
631
|
const peekModel = (root) => (kept && kept.root === root ? kept.model : partial && partial.root === root ? partial.model : null);
|
|
631
632
|
const settle = () => inflight || Promise.resolve();
|
|
633
|
+
/** After the PM deletes an initiative or brings one back (lib/ini-deleted.js): the next request builds the answer again. */
|
|
634
|
+
const stale = () => { if (kept) kept.at = 0; };
|
|
632
635
|
const forget = () => { kept = null; partial = null; inflight = null; lastError = null; startedAt = 0; };
|
|
633
636
|
|
|
634
|
-
module.exports = { build, buildMany, allRowsOf, readMeetings, hooks, refresh, readSources, readFast, readInitiatives, repoKey, readFm, readTripwires, modelOf, refreshNow, settle, forget, rebuild, peekModel, rowsOf, heroOf, todayOf, failedReviews, num };
|
|
637
|
+
module.exports = { build, buildMany, allRowsOf, readMeetings, hooks, refresh, readSources, readFast, readInitiatives, repoKey, readFm, readTripwires, modelOf, refreshNow, settle, stale, forget, rebuild, peekModel, rowsOf, heroOf, todayOf, failedReviews, num };
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
* `task` is a Board task, a breakdown item or a Jira key; the last line wins.
|
|
49
49
|
* ticket-dates { ref, start, due } the PM's own start and due days for a Jira ticket (feedback batch 11
|
|
50
50
|
* item 23): kept in PMOS only, never written to Jira; '' clears one. They win over Jira's dates on the timeline; the last line wins.
|
|
51
|
+
* ini-delete { id, title, tasks, items } the PM's Delete of an initiative (feedback batch 16 item 5d): it
|
|
52
|
+
* leaves every list with the tasks and breakdown items it names (their own task-remove lines and withdrawals). Jira is never written.
|
|
53
|
+
* ini-restore { id } its Undo, or a later restore: the initiative comes back
|
|
51
54
|
* Nothing is deleted. A line that is not an object with a known kind is skipped.
|
|
52
55
|
*
|
|
53
56
|
* STAGE OF AN INITIATIVE on a team board: the last move recorded for it on that board (a workflow edit's `moved` and an
|
|
@@ -170,7 +173,9 @@ function foundOf(f) {
|
|
|
170
173
|
}
|
|
171
174
|
const KINDS = new Set(['board', 'workflow', 'move', 'assign', 'ask', 'ask-accept', 'ask-decline', 'ask-more', 'ini-workflow', 'task', 'task-update', 'task-remove', 'task-restore', 'ticket-note', 'ini-epics', 'ini-archive', 'ini-notdup', 'ini-wf', 'ini-end', 'stage-judge', 'ini-auto', 'task-section', 'task-milestone', 'task-pin', 'ticket-dates',
|
|
172
175
|
// split or merge initiatives (feedback batch 11 item 14): a Jira ticket moved to another initiative, the split and merge records with their Undo, Claude's suggestion dismissed
|
|
173
|
-
'ticket-move', 'ini-split', 'ini-merge', 'ini-sm-undo', 'ini-suggest'
|
|
176
|
+
'ticket-move', 'ini-split', 'ini-merge', 'ini-sm-undo', 'ini-suggest',
|
|
177
|
+
// Delete an initiative with its tasks, and its Undo (feedback batch 16 item 5d)
|
|
178
|
+
'ini-delete', 'ini-restore']);
|
|
174
179
|
// A task's state is its only stage (Wawan, 2026-10-25): the same five every workflow ends in. An old 'In review' reads as In progress (taskState).
|
|
175
180
|
const TASK_STATES = Object.freeze(['To do', 'In progress', 'Done', "Won't do", 'Archived']);
|
|
176
181
|
const taskState = (s) => (s === 'In review' ? 'In progress' : TASK_STATES.includes(s) ? s : null);
|
|
@@ -207,6 +212,7 @@ function fold(events) {
|
|
|
207
212
|
const ticketDates = new Map(); // key(board, Jira key) → { start, due } the PM keeps in PMOS for that ticket (the last ticket-dates line wins)
|
|
208
213
|
const epics = new Map(); // initiative id → the Jira epic keys the PM linked to it (the last ini-epics line wins)
|
|
209
214
|
const archives = new Map(); // initiative id → { at, by, reason, into, moved } while archived (an `archived: false` line restores it)
|
|
215
|
+
const deleted = new Map(); // initiative id → { at, by, board, title, tasks, items } while deleted (an ini-restore line brings it back)
|
|
210
216
|
const notDup = new Map(); // initiative id → Set of initiative ids the PM said it is not a duplicate of
|
|
211
217
|
// D99 workflows per initiative: the workflow each initiative runs, Won't do, the agent's readings of Only-when stages, Moves on by itself
|
|
212
218
|
const iniWf = new Map(); // key(board, id) → { wf, at, by, why, from } (the last ini-wf line)
|
|
@@ -315,6 +321,11 @@ function fold(events) {
|
|
|
315
321
|
if (e.archived === false) archives.delete(e.id);
|
|
316
322
|
else archives.set(e.id, { at: e.at || null, by: e.by || null, board: b, reason: typeof e.reason === 'string' ? e.reason : '', into: typeof e.into === 'string' && e.into ? e.into : null,
|
|
317
323
|
moved: isObj(e.moved) ? { epics: Array.isArray(e.moved.epics) ? e.moved.epics.filter((k) => typeof k === 'string') : [], tasks: Array.isArray(e.moved.tasks) ? e.moved.tasks.filter((k) => typeof k === 'string') : [] } : { epics: [], tasks: [] } });
|
|
324
|
+
} else if (e.kind === 'ini-delete' && typeof e.id === 'string' && e.id) {
|
|
325
|
+
const ids = (v) => (Array.isArray(v) ? v.filter((x) => typeof x === 'string') : []);
|
|
326
|
+
deleted.set(e.id, { at: e.at || null, by: e.by || null, board: b, title: typeof e.title === 'string' ? e.title : '', tasks: ids(e.tasks), items: ids(e.items) });
|
|
327
|
+
} else if (e.kind === 'ini-restore' && typeof e.id === 'string') {
|
|
328
|
+
deleted.delete(e.id);
|
|
318
329
|
} else if (e.kind === 'ini-notdup' && typeof e.id === 'string' && typeof e.of === 'string') {
|
|
319
330
|
if (!notDup.has(e.id)) notDup.set(e.id, new Set());
|
|
320
331
|
notDup.get(e.id).add(e.of);
|
|
@@ -355,7 +366,7 @@ function fold(events) {
|
|
|
355
366
|
suggestNo.set(e.id, { kind: e.of === 'merge' ? 'merge' : 'split', fp: e.fp, at: e.at || null });
|
|
356
367
|
}
|
|
357
368
|
}
|
|
358
|
-
return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, sections, milestones, pins, ticketNotes, ticketDates, epics, archives, notDup, iniWf, ends, judged, autoOver, ticketMoves, smOps, smUndone, suggestNo, events: list };
|
|
369
|
+
return { boards, moves, assigns, asks, stages, iniWorkflows, tasks, sections, milestones, pins, ticketNotes, ticketDates, epics, archives, deleted, notDup, iniWf, ends, judged, autoOver, ticketMoves, smOps, smUndone, suggestNo, events: list };
|
|
359
370
|
}
|
|
360
371
|
|
|
361
372
|
/** The stages an initiative runs on a board: its own workflow when one is recorded, else the board's. */
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* ini-deleted.js — the initiatives the PM deleted (feedback batch 16 item 5d): an ini-delete line in the board ledger (boards.jsonl,
|
|
3
|
+
* scripts/boards.js) takes an initiative out of every list; an ini-restore line (Undo, or a later restore) brings it back.
|
|
4
|
+
*
|
|
5
|
+
* ids(root) → Set of the deleted initiative ids of that repository (read from its board ledger, cached by size and mtime)
|
|
6
|
+
* sig(root) → a short string that changes whenever that set can change, for the caches that key on the records
|
|
7
|
+
* drop(root, rows) → rows without the deleted ones (each row's `id`)
|
|
8
|
+
* forget() → drops the cache (the tests)
|
|
9
|
+
*
|
|
10
|
+
* The ledger lives where server.js stateDirFor puts it: the first of pmos/state, state or .pmos, else (PMOS itself) workspace/state.
|
|
11
|
+
* The record file is never touched, so a restore loses nothing. */
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
const LEDGER = 'boards.jsonl';
|
|
16
|
+
const cache = new Map(); // root → { key, ids }
|
|
17
|
+
|
|
18
|
+
function ledgerOf(root) {
|
|
19
|
+
for (const rel of [['pmos', 'state'], ['state'], ['.pmos']]) {
|
|
20
|
+
const d = path.join(root, ...rel);
|
|
21
|
+
try { if (fs.statSync(d).isDirectory()) return path.join(d, LEDGER); } catch { /* next */ }
|
|
22
|
+
}
|
|
23
|
+
const self = path.join(root, 'workspace', 'state');
|
|
24
|
+
try { if (fs.statSync(path.join(root, 'workspace', 'server.js')).isFile()) return path.join(self, LEDGER); } catch { /* not PMOS itself */ }
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
function statKey(file) {
|
|
28
|
+
try { const st = fs.statSync(file); return st.size + ':' + st.mtimeMs; } catch { return 'none'; }
|
|
29
|
+
}
|
|
30
|
+
function ids(root) {
|
|
31
|
+
if (!root) return new Set();
|
|
32
|
+
const file = ledgerOf(root);
|
|
33
|
+
if (!file) return new Set();
|
|
34
|
+
const key = statKey(file), hit = cache.get(root);
|
|
35
|
+
if (hit && hit.key === key) return hit.ids;
|
|
36
|
+
const out = new Set();
|
|
37
|
+
let text = '';
|
|
38
|
+
try { text = fs.readFileSync(file, 'utf8'); } catch { text = ''; }
|
|
39
|
+
// only the two kinds matter here: a cheap test first, then the parse
|
|
40
|
+
for (const line of text.split('\n')) {
|
|
41
|
+
if (!line || line.indexOf('"ini-') < 0) continue;
|
|
42
|
+
let e; try { e = JSON.parse(line); } catch { continue; }
|
|
43
|
+
if (!e || typeof e.id !== 'string') continue;
|
|
44
|
+
if (e.kind === 'ini-delete') out.add(e.id);
|
|
45
|
+
else if (e.kind === 'ini-restore') out.delete(e.id);
|
|
46
|
+
}
|
|
47
|
+
cache.set(root, { key, ids: out });
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
const sig = (root) => { const f = root ? ledgerOf(root) : null; return f ? 'del:' + [...ids(root)].sort().join(',') : 'del:'; };
|
|
51
|
+
function drop(root, rows) {
|
|
52
|
+
if (!Array.isArray(rows)) return rows;
|
|
53
|
+
const gone = ids(root);
|
|
54
|
+
return gone.size ? rows.filter((r) => !(r && gone.has(r.id))) : rows;
|
|
55
|
+
}
|
|
56
|
+
const forget = () => cache.clear();
|
|
57
|
+
|
|
58
|
+
module.exports = { ids, sig, drop, forget, ledgerOf };
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* deriveSync(root) → { ok, rows } | { ok: false, error } every record, derived now (the CLI, the tests)
|
|
6
6
|
* rowsFor(root) → { pending: true } | { ok, rows, sig, as_of, stale } | { ok: false, error }
|
|
7
|
+
* an initiative the PM deleted is left out (lib/ini-deleted.js; deriveSync keeps every record)
|
|
7
8
|
* the request path: never derives in the server process (see below)
|
|
8
9
|
* peek(root) → the same answer from the cache alone; it never starts a derivation. The needs provider
|
|
9
10
|
* reads this, so the Today poll never pays for a derivation: only a read of the
|
|
@@ -30,6 +31,7 @@ const crypto = require('crypto');
|
|
|
30
31
|
const { spawn, execFileSync } = require('child_process');
|
|
31
32
|
const consoleState = require('./console-state');
|
|
32
33
|
const boardCache = require('./board-cache');
|
|
34
|
+
const deleted = require('./ini-deleted.js');
|
|
33
35
|
|
|
34
36
|
const MAX_AGE_MS = 10 * 60 * 1000;
|
|
35
37
|
const TIMEOUT_MS = 180000;
|
|
@@ -147,7 +149,8 @@ function read(root, derive) {
|
|
|
147
149
|
if (!fresh && derive && background) refresh(root, sig);
|
|
148
150
|
if (!hit) return { pending: true };
|
|
149
151
|
if (hit.error) return { ok: false, error: hit.error };
|
|
150
|
-
|
|
152
|
+
// an initiative the PM deleted (feedback batch 16 item 5d) leaves every reader of these rows; the sig changes with it, so caches keyed on it redraw
|
|
153
|
+
return { ok: true, rows: deleted.drop(root, hit.value), sig: hit.sig + '|' + deleted.sig(root), as_of: new Date(hit.at).toISOString(), stale: !fresh };
|
|
151
154
|
}
|
|
152
155
|
/** The records part of a GET's `sig`, from the answer actually used: a stale answer reads differently from the fresh
|
|
153
156
|
* one that replaces it, so a poll sees the derivation land even when the records did not change again. */
|
|
@@ -37,6 +37,9 @@
|
|
|
37
37
|
* POST /api/boards/tickets/note { ws, board, ref, notes } → { ok, from, notes } the PM's notes on a Jira ticket
|
|
38
38
|
* POST /api/boards/archive { ws, board, id, archived, reason? } → { ok, row } archive (hidden everywhere, kept whole) or restore;
|
|
39
39
|
* restoring a merged initiative moves its epics and tasks back
|
|
40
|
+
* POST /api/boards/ini-delete { ws, board, id } → { ok, id, title, tasks } Delete an initiative with its PMOS
|
|
41
|
+
* tasks and breakdown items (batch 16 item 5d): gone from every list (lib/ini-deleted.js), never Jira
|
|
42
|
+
* POST /api/boards/ini-restore { ws, board, id } → { ok, id, title, tasks } its Undo, or a later restore
|
|
40
43
|
* POST /api/boards/merge { ws, board, id, into, epics?, tasks? } → { ok, row, into } moves the picked Jira epic links and PMOS
|
|
41
44
|
* tasks of `id` to `into`, then archives `id` as "Merged into <into>"
|
|
42
45
|
* POST /api/boards/notdup { ws, board, id, of } → { ok } the PM says `id` is not a duplicate of `of`
|
|
@@ -749,6 +752,10 @@ function postFrame(ctx, res, body, { needBoard = true } = {}) {
|
|
|
749
752
|
}
|
|
750
753
|
return { w, fr, board, file: ledgerFile(ctx, w) };
|
|
751
754
|
}
|
|
755
|
+
/** After a Delete or its Undo: Home's kept briefing reads the initiatives again on its next request (lib/briefing-premium.js stale). */
|
|
756
|
+
function staleAfterDelete() {
|
|
757
|
+
try { require('./briefing-premium.js').stale(); } catch { /* no briefing in this install */ }
|
|
758
|
+
}
|
|
752
759
|
function needRows(ctx, res, w) {
|
|
753
760
|
const b = baseRows(w);
|
|
754
761
|
if (b.pending) { ctx.json(res, { ok: false, pending: true, ws: w.id, error: PENDING }, 202); return null; }
|
|
@@ -1388,6 +1395,47 @@ const WRITES = {
|
|
|
1388
1395
|
const row = boardRow(p.board, b0, foldOf(ctx, p.w));
|
|
1389
1396
|
ctx.json(res, { ok: true, row });
|
|
1390
1397
|
},
|
|
1398
|
+
'/api/boards/ini-delete': (ctx, res, body, g) => {
|
|
1399
|
+
// Delete an initiative with its tasks (feedback batch 16 item 5d): no confirm, Undo in the toast for 8 s (ini-restore). Its PMOS tasks get
|
|
1400
|
+
// their own task-remove lines and its breakdown items a withdrawal, so each comes back with it; Jira is never written. The record file stays.
|
|
1401
|
+
const p = postFrame(ctx, res, body);
|
|
1402
|
+
if (!p) return;
|
|
1403
|
+
if (typeof body.id !== 'string' || !body.id) return fail(ctx, res, 400, 'id is required');
|
|
1404
|
+
if (!p.file) return fail(ctx, res, 409, NO_STATE);
|
|
1405
|
+
const F = p.fr.folded;
|
|
1406
|
+
if (F.deleted && F.deleted.has(body.id)) return fail(ctx, res, 409, `${body.id} is deleted already`);
|
|
1407
|
+
const base = needRows(ctx, res, p.w);
|
|
1408
|
+
if (!base) return;
|
|
1409
|
+
const b0 = base.find((r) => r.id === body.id);
|
|
1410
|
+
if (!b0 || boardIdOf(b0, p.fr.boards, F, p.w) !== p.board.id) return fail(ctx, res, 404, `no initiative ${body.id} on this board`);
|
|
1411
|
+
const tasks = [...F.tasks.values()].filter((t) => t.initiative === body.id).map((t) => t.id);
|
|
1412
|
+
const items = TI.rowsOf(p.w.root, new Set([body.id]), p.board.id).map((x) => x.uid);
|
|
1413
|
+
for (const t of tasks) append(p.file, g.actor, { kind: 'task-remove', board: F.tasks.get(t).board || p.board.id, task: t, why: 'initiative deleted' });
|
|
1414
|
+
const gone = [];
|
|
1415
|
+
for (const uid of items) {
|
|
1416
|
+
const it = TI.itemOf(p.w.root, uid);
|
|
1417
|
+
if (!it) continue;
|
|
1418
|
+
const w = TI.write(p.w.root, TI.deleteEvents(it, 'initiative deleted').events, g.actor, g.cli || null);
|
|
1419
|
+
if (w.ok) gone.push(uid);
|
|
1420
|
+
}
|
|
1421
|
+
append(p.file, g.actor, { kind: 'ini-delete', board: p.board.id, id: body.id, title: b0.title || body.id, tasks, items: gone });
|
|
1422
|
+
staleAfterDelete(ctx);
|
|
1423
|
+
ctx.json(res, { ok: true, id: body.id, title: b0.title || body.id, tasks: tasks.length + gone.length });
|
|
1424
|
+
},
|
|
1425
|
+
'/api/boards/ini-restore': (ctx, res, body, g) => {
|
|
1426
|
+
// the Undo of a Delete, or a later restore: the initiative, then each task and breakdown item the Delete took with it
|
|
1427
|
+
const p = postFrame(ctx, res, body);
|
|
1428
|
+
if (!p) return;
|
|
1429
|
+
if (typeof body.id !== 'string' || !body.id) return fail(ctx, res, 400, 'id is required');
|
|
1430
|
+
if (!p.file) return fail(ctx, res, 409, NO_STATE);
|
|
1431
|
+
const F = p.fr.folded, d = F.deleted && F.deleted.get(body.id);
|
|
1432
|
+
if (!d || (d.board && d.board !== p.board.id)) return fail(ctx, res, 404, `no deleted initiative ${body.id} on this board`);
|
|
1433
|
+
append(p.file, g.actor, { kind: 'ini-restore', board: p.board.id, id: body.id });
|
|
1434
|
+
for (const t of d.tasks) if (!B.taskOf(F, t)) append(p.file, g.actor, { kind: 'task-restore', board: p.board.id, task: t });
|
|
1435
|
+
for (const uid of d.items) if (!TI.itemOf(p.w.root, uid) && TI.goneOf(p.w.root, uid)) TI.write(p.w.root, TI.restoreEvents(uid).events, g.actor, g.cli || null);
|
|
1436
|
+
staleAfterDelete(ctx);
|
|
1437
|
+
ctx.json(res, { ok: true, id: body.id, title: d.title || body.id, tasks: d.tasks.length + d.items.length });
|
|
1438
|
+
},
|
|
1391
1439
|
'/api/boards/merge': (ctx, res, body, g) => {
|
|
1392
1440
|
const p = postFrame(ctx, res, body);
|
|
1393
1441
|
if (!p) return;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
const fs = require('fs');
|
|
16
16
|
const path = require('path');
|
|
17
17
|
const { execFileSync } = require('child_process');
|
|
18
|
+
const { ids: deletedIds } = require('./ini-deleted.js'); // an initiative the PM deleted is not found (batch 16 item 5d)
|
|
18
19
|
|
|
19
20
|
const KINDS = ['initiative', 'document', 'slides', 'report', 'artifact', 'meeting'];
|
|
20
21
|
const MAX_FILES = 40000;
|
|
@@ -123,6 +124,7 @@ function search({ root, q, only = null, notes = [], now = Date.now() } = {}) {
|
|
|
123
124
|
const low = query.toLowerCase();
|
|
124
125
|
const results = [];
|
|
125
126
|
const errors = [];
|
|
127
|
+
const gone = deletedIds(root);
|
|
126
128
|
const day = new Date(now).toDateString();
|
|
127
129
|
for (const wt of pick) {
|
|
128
130
|
let files;
|
|
@@ -140,7 +142,7 @@ function search({ root, q, only = null, notes = [], now = Date.now() } = {}) {
|
|
|
140
142
|
const named = f.toLowerCase().includes(low) || title.toLowerCase().includes(low);
|
|
141
143
|
const r = { kind, group: groupOf(kind), title, path: f, dir: path.posix.dirname(f), wt: wt.id, branch: wt.branch || '', main: wt.main, why: named ? 'name' : 'text' };
|
|
142
144
|
if (!named) r.line = lineOf(text, query);
|
|
143
|
-
if (kind === 'initiative') { r.id = path.posix.basename(f, '.md'); r.lane = fmField(text, 'lane'); }
|
|
145
|
+
if (kind === 'initiative') { r.id = path.posix.basename(f, '.md'); r.lane = fmField(text, 'lane'); if (gone.has(r.id)) continue; } // deleted: not found (batch 16 item 5d)
|
|
144
146
|
if (!wt.main) r.draft = true;
|
|
145
147
|
if (mtime && new Date(mtime).toDateString() === day) r.today = true;
|
|
146
148
|
results.push(r);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.432.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.432.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED