create-pmos 0.842.0 → 0.844.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.
Files changed (32) hide show
  1. package/package.json +37 -3
  2. package/payload/KIT-VERSION +1 -1
  3. package/payload/planning/evals/eval-calibration.md +1 -1
  4. package/payload/planning/okrs/health-budgets.md +1 -1
  5. package/payload/state/discoveries.md +1 -1
  6. package/workspace/board-shared-ui-test.js +1 -0
  7. package/workspace/changelog.json +36 -2
  8. package/workspace/guide/cli.md +13 -1
  9. package/workspace/guide/layout.md +2 -0
  10. package/workspace/guide/settings-and-switches.md +1 -0
  11. package/workspace/lib/build-engine.js +4 -1
  12. package/workspace/lib/factory-traces.js +2 -1
  13. package/workspace/lib/features.json +1 -0
  14. package/workspace/lib/initiative-cost.js +259 -0
  15. package/workspace/lib/pmos-verbs.js +4 -1
  16. package/workspace/lib/routes-factory-metrics.js +54 -1
  17. package/workspace/lib/routes-proposals.js +7 -0
  18. package/workspace/lib/sprint-cli.js +30 -4
  19. package/workspace/lib/sprint-now.js +39 -4
  20. package/workspace/package-lock.json +2 -2
  21. package/workspace/package.json +1 -1
  22. package/workspace/public/pm/bd-backlog-ds.js +24 -4
  23. package/workspace/public/pm/bd-backlog.css +3 -0
  24. package/workspace/public/pm/bd-backlog.js +36 -7
  25. package/workspace/public/pm/bd-sprint-ds.js +117 -23
  26. package/workspace/public/pm/bd-sprint.js +9 -1
  27. package/workspace/public/pm/bd-work-ds.css +29 -0
  28. package/workspace/public/pm/cozy-pop-work.js +14 -1
  29. package/workspace/public/pm/initiative-cost.js +103 -0
  30. package/workspace/task-press-test.js +1 -1
  31. package/workspace/test-lists/initiative-cost.json +9 -0
  32. package/workspace/test-lists/tb-sprint-balanced.json +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.842.0",
3
+ "version": "0.844.0",
4
4
  "description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -34,8 +34,8 @@
34
34
  ],
35
35
  "pmosChanges": [
36
36
  {
37
- "v": "0.842.0",
38
- "at": "2026-11-25T17:28:28.326Z",
37
+ "v": "0.844.0",
38
+ "at": "2026-11-25T17:36:00.349Z",
39
39
  "f": 4,
40
40
  "prs": [
41
41
  {
@@ -71,6 +71,40 @@
71
71
  "open": "/premium-events.html"
72
72
  },
73
73
  "i": "tb-events-bring"
74
+ },
75
+ {
76
+ "n": 1958,
77
+ "t": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
78
+ "s": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
79
+ "k": "new",
80
+ "h": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
81
+ "try": {
82
+ "steps": [
83
+ "Open Work and press the Cost tab: read each initiative's agent hours, spend and result",
84
+ "Open an initiative from Work, press ⋯ and pick Cost: one row per merged pull request with its own cost",
85
+ "Where a row says 0 merged in 7 days, press the pause button on its ✦, then Undo in the toast"
86
+ ],
87
+ "see": "One row per initiative the factory worked on: agent hours, spend in dollars and how many pull requests merged. An initiative that spent for 7 days with no merge shows one ✦ asking to pause its jobs.…",
88
+ "open": "/premium-board.html?work=cost"
89
+ },
90
+ "i": "initiative-cost"
91
+ },
92
+ {
93
+ "n": 2022,
94
+ "t": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
95
+ "s": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
96
+ "k": "new",
97
+ "h": "This sprint, with a Summary that says what is going on",
98
+ "try": {
99
+ "steps": [
100
+ "Open Work and press This sprint",
101
+ "Read the Summary card above Tasks: To do, In progress and Done with one bar, a ✦ sentence under each, and who holds what",
102
+ "In Tasks, press a Ticket or an Epic to open it in Jira"
103
+ ],
104
+ "see": "The Summary card gives the same To do, In progress and Done counts as the Tasks tabs, all work in the sprint's dates, Jira and not. Each count with work has one ✦ sentence written from the tickets,…",
105
+ "open": "/premium-board.html"
106
+ },
107
+ "i": "tb-sprint-balanced"
74
108
  }
75
109
  ]
76
110
  },
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@3499311af
1
+ kernel-source: pmos@a76055a1e
2
2
  assembled: 2026-11-25
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-25T17:28:24Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T17:35:56Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-25T17:28:24Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T17:35:56Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-25T17:28:24Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-25T17:35:56Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -159,6 +159,7 @@ const iso = (ms) => new Date(Date.now() + ms).toISOString();
159
159
  ok('G1 on a phone Shared with me is the last item of the view button (batch 28 item 3, BhA; no Docs chip), and it opens Shared', await (async () => { await s.p.waitForSelector('#bdView'); await s.p.click('#bdView'); const last = await s.p.evaluate(() => { const m = document.querySelector('#bdViewMenu'); const b = [...m.querySelectorAll('button')].pop(); return !document.getElementById('chDocs') && !document.getElementById('chShared') && b && b.hasAttribute('data-vshared') && /Shared with me/.test(b.textContent); }); await s.p.click('#bdViewMenu [data-vshared]'); await s.p.waitForSelector('.bdsh-list .bdsh-card'); return last; })());
160
160
  const g = await s.p.evaluate(() => ({ side: document.documentElement.scrollWidth > innerWidth + 1, cards: document.querySelectorAll('#cShared .bdsh-card').length }));
161
161
  ok('G2 a row is a card that fits the phone, with no sideways scroll', g.cards === 4 && !g.side, JSON.stringify(g));
162
+ await s.p.waitForFunction(() => [...document.styleSheets].some((x) => /bd-shared\.css/.test(x.href || '')), null, { timeout: 10000 }).catch(() => {}); // bd-shared.css loads lazily (css()): measure after it applies
162
163
  const small = await s.p.locator('#cShared button:visible').evaluateAll((els) => els.filter((e) => e.getBoundingClientRect().height < 34).map((e) => e.className + ':' + Math.round(e.getBoundingClientRect().height)));
163
164
  ok('G3 every control on the phone is at least 34 px high', small.length === 0, small.join(' '));
164
165
  ok('G4 no page error in any section', s.errs.length === 0, s.errs.join(' | '));
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
- "v": "0.842.0",
4
- "at": "2026-11-25T17:28:28.326Z",
3
+ "v": "0.844.0",
4
+ "at": "2026-11-25T17:36:00.349Z",
5
5
  "f": 4,
6
6
  "prs": [
7
7
  {
@@ -37,6 +37,40 @@
37
37
  "open": "/premium-events.html"
38
38
  },
39
39
  "i": "tb-events-bring"
40
+ },
41
+ {
42
+ "n": 1958,
43
+ "t": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
44
+ "s": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
45
+ "k": "new",
46
+ "h": "What each initiative and merged pull request cost, and a pause for a stall (job #1906)",
47
+ "try": {
48
+ "steps": [
49
+ "Open Work and press the Cost tab: read each initiative's agent hours, spend and result",
50
+ "Open an initiative from Work, press ⋯ and pick Cost: one row per merged pull request with its own cost",
51
+ "Where a row says 0 merged in 7 days, press the pause button on its ✦, then Undo in the toast"
52
+ ],
53
+ "see": "One row per initiative the factory worked on: agent hours, spend in dollars and how many pull requests merged. An initiative that spent for 7 days with no merge shows one ✦ asking to pause its jobs.…",
54
+ "open": "/premium-board.html?work=cost"
55
+ },
56
+ "i": "initiative-cost"
57
+ },
58
+ {
59
+ "n": 2022,
60
+ "t": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
61
+ "s": "This sprint's Summary card with a ✦ sentence per count, Ticket and Epic columns (job #2018)",
62
+ "k": "new",
63
+ "h": "This sprint, with a Summary that says what is going on",
64
+ "try": {
65
+ "steps": [
66
+ "Open Work and press This sprint",
67
+ "Read the Summary card above Tasks: To do, In progress and Done with one bar, a ✦ sentence under each, and who holds what",
68
+ "In Tasks, press a Ticket or an Epic to open it in Jira"
69
+ ],
70
+ "see": "The Summary card gives the same To do, In progress and Done counts as the Tasks tabs, all work in the sprint's dates, Jira and not. Each count with work has one ✦ sentence written from the tickets,…",
71
+ "open": "/premium-board.html"
72
+ },
73
+ "i": "tb-sprint-balanced"
40
74
  }
41
75
  ]
42
76
  },
@@ -607,10 +607,11 @@ PMOS lists the asks in the product's Jira readings that were closed without bein
607
607
  - `pmos declined draft <KEY>` shows the reply draft for one ask. `--reason "<why>"` gives your own reason instead of the one PMOS reads from the ticket.
608
608
  - `pmos declined record <KEY>` records the ask in `planning/out-of-scope/<key>.md` and in `declined-asks.jsonl` in the product's records folder. `--reason "<why>"` gives your reason. When a later idea repeats the ask, "You decided this before" raises it. Once you edit the file, PMOS does not write over it.
609
609
 
610
- ### pmos sprint: the retro of a closed sprint and one tracked change
610
+ ### pmos sprint: the sprint running now, the retro of a closed sprint and one tracked change
611
611
 
612
612
  The same block as One change in a past sprint on Work › Backlog. PMOS writes the retro from its own close numbers for every sprint it saw open and then closed: done of total, and why work was carried (never started, started, in review, carried two sprints in a row, added after the start). It tracks one change for the next sprint: the biggest reason with 2 or more tickets. At the next sprint's close, the retro says whether that change helped, with the number before and after. Run the commands in the product's repository, or pass `--root <dir>`. Your overrides are in `_sprint-retro.jsonl` beside the kept sprint history. Nothing is sent and Jira is not written.
613
613
 
614
+ - `pmos sprint now` shows the sprint running now, the same as the Summary card on Work › This sprint: how much it holds and when it ends, To do, In progress and Done, and who holds what ("By person: Wawan 4 to do · no one 5"). The counts cover all work in the sprint's dates, Jira and not. `--sprint "<name>"` picks another running sprint, `--ws <id>` another workspace, and `--json` prints the fields. It asks the running PMOS and writes nothing.
614
615
  - `pmos sprint retro` shows the retro of the newest closed sprint PMOS kept. `--sprint "<name>"` shows another one. `--json` prints the fields.
615
616
  - `pmos sprint change --sprint "<name>" --pick <reason>` tracks another change. The reasons are `twice`, `never`, `review`, `started` and `added`.
616
617
  - `pmos sprint change --sprint "<name>" --drop` tracks no change for that sprint. `--undo` goes back to PMOS's pick.
@@ -1147,6 +1148,17 @@ PMOS never pushes to the default branch and never merges. Every command takes `-
1147
1148
 
1148
1149
  The benchmark needs a signed-in agent CLI. It never pushes and never opens a pull request. A role run cannot start it.
1149
1150
 
1151
+ ### pmos cost: what the factory spent per initiative and pull request
1152
+
1153
+ Where PMOS's factory builds a product's work items, each run leaves its tokens, its cost and its time. These commands add them up per initiative and per merged pull request. Work › Cost shows the same rows.
1154
+
1155
+ - `pmos cost` (or `pmos cost show`) prints one line per initiative the factory worked on: its agent hours, its spend in dollars and how many pull requests merged. An initiative that spent in the last 7 days and has had no merge for 7 days says "0 merged in 7 days", with the `pmos cost pause` that would pause it. `--json` prints the rows.
1156
+ - `pmos cost <initiative>` prints one line per merged pull request of that initiative, each with its own agent hours, spend and tokens, and its link when PMOS opened it.
1157
+ - `pmos cost pause <initiative>` pauses the initiative's new factory jobs: the Builder takes no new work item of it. Work a Builder holds now finishes. PMOS also files one ✦ for a stalled initiative, and its ✓ does the same, with Undo.
1158
+ - `pmos cost resume <initiative>` lets the factory take its jobs again.
1159
+
1160
+ Money shows only in these commands, on Work › Cost and in the initiative's ⋯ › Cost. `PMOS_INITIATIVE_COST=off` stops the ✦.
1161
+
1150
1162
  ### pmos jira
1151
1163
 
1152
1164
  [Jira tickets](jira.md) explains each step with its examples.
@@ -117,6 +117,8 @@ On a computer, Work is built from the parts of the PMOS design system. The top l
117
117
  - **Add to the backlog.** Type a line and press Enter. Name the initiative ("for Migration from Okta") or PMOS puts it in the closest one; when none is close, it asks.
118
118
  - **Items.** A table grouped by initiative, each group with "n items · r ready". The tabs show **All**, **Ready**, **Needs detail** or **Untouched 60 days**. Drag a row by its grip to change the rank (with Undo); the number is its place in the one rank. **Last change** shows when the item last changed; an item untouched for 30 days or more has a badge, for example "79 days untouched". **Group** also groups the rows by what PMOS can do, with its ✓ buttons. Tick rows to change them together. The tune icon filters the rows.
119
119
 
120
+ **Cost** shows on a computer when PMOS's factory has built work items for the product. One row per initiative it worked on: **Agent hours**, **Spend** in dollars and **Result**, for example "3 PRs merged". Press a name to open the initiative. An initiative that spent in the last 7 days and has had no merge for 7 days says "0 merged in 7 days" in red, and one ✦ under the table asks to pause its jobs. The pause button stops new jobs: the factory takes no new work item of it, and the work it holds now finishes. The toast has **Undo**. ✕ keeps it going, and PMOS does not ask again until it stalls again. A paused initiative has a play button that starts its jobs again. Money shows only here and in the initiative's ⋯ › **Cost**, which lists each merged pull request with its own cost. `pmos cost` reads the same rows.
121
+
120
122
  **This sprint** shows all work in the sprint's dates, in Jira and outside it. It holds every ticket of the active Jira sprint, done ones too, and every PMOS task whose dates meet the sprint's dates. A task under way with no date is in it too. Early stages often have no tickets, so their work still shows here.
121
123
 
122
124
  - **The sprint card.** The sprint's name, its end date and what it holds, for example "21 Jira tickets and 7 tasks outside Jira". Under it, "11 of 28 done" with a bar. Then four columns: **Sprint goal**, **In progress**, **To do** and **Done**, each with its count and its first tasks. PMOS drafts the goal from the sprint's work. Press the pencil to write your own; it can name work outside Jira, and PMOS does not write over it. When PMOS has a newer draft, ✓ uses it and ✕ keeps yours. Press the sprint's name to open a past sprint. The arrow icon reads Jira again; a red dot on it means the last read is old. Under the columns, PMOS shows one suggestion, for example to place tickets in an initiative, with **Why**, **PMOS will**, **What changes** and **Based on**. The pencil picks another initiative first, ✓ does it (with Undo) and ✕ says not now.
@@ -173,6 +173,7 @@ An "off" switch accepts `off`, `0`, `false` or `no` unless the row says a differ
173
173
  | `PMOS_CORRECTION_MEMORY` | `off` stops your ✕ reasons from becoming memory. By default a reason of 12 characters or more is remembered as one unconfirmed entry for 30 days, at most 6 at once. | on | — |
174
174
  | `PMOS_CORRECTION_RULES` | `off` stops PMOS from recording each ✕ reason with a kind and offering a kind that repeats 3 times in 30 days as a standing rule in the Lab. | on | — |
175
175
  | `PMOS_FACTORY_LESSONS` | `off` stops factory lessons. By default each factory setback (a failed check, a revert or rollback, a pull request the guardrail sent to a person, your Undo of one, a reviewer FAIL) becomes one Lessons line on its initiative and one line in the Builder's notebook. The Builder prompt carries the last 5. The same setback 3 times in 14 days files one proposal, "Change the factory harness", for your ✓. | on | — |
176
+ | `PMOS_INITIATIVE_COST` | `off` stops the pause proposal of the factory's cost. By default, when the factory has spent on an initiative for 7 days with no merge, PMOS files one ✦ to pause its new jobs, for your ✓. Work › Cost and `pmos cost` still show the cost. | on | — |
176
177
  | `PMOS_CLAUDE_HOME` | The one folder where PMOS looks for PMOS transcripts. | the PMOS config folders | — |
177
178
  | `PMOS_HEADLESS_TIMEOUT_MS` | The longest time a background run may take. | 20 minutes | — |
178
179
 
@@ -134,7 +134,9 @@ function itemsOf(root) {
134
134
  }
135
135
  const itemOf = (root, item) => itemsOf(root).find((x) => x.item_id === item) || null;
136
136
  // factory-fleet-scale: an item whose dependencies are not integrated yet is not offered (lib/factory-fleet.js waitingOn)
137
- const next = (root, ini) => { const all = itemsOf(root); return all.filter((x) => x.state === 'declared' && (!ini || x.initiative_id === ini) && !require('./factory-fleet.js').waitingOn(x, all).length); };
137
+ // initiative-cost (A17): a paused initiative's declared items are not offered; an item already claimed is not touched, so running work finishes
138
+ const pausedOf = (root) => { try { return require('./initiative-cost.js').pausedOf(require('./driver.js').stateDirOf(root, { create: false })); } catch { return new Set(); } };
139
+ const next = (root, ini) => { const all = itemsOf(root), off = pausedOf(root); return all.filter((x) => x.state === 'declared' && (!ini || x.initiative_id === ini) && !off.has(x.initiative_id) && !require('./factory-fleet.js').waitingOn(x, all).length); };
138
140
 
139
141
  function claim(root, item, { agent = 'pmos:builder' } = {}) {
140
142
  if (!ITEM_RE.test(String(item || ''))) return { ok: false, error: 'name a work item, <initiative>.<n>' };
@@ -143,6 +145,7 @@ function claim(root, item, { agent = 'pmos:builder' } = {}) {
143
145
  const it = all.find((x) => x.item_id === item) || null;
144
146
  if (!it) return { ok: false, error: `${item} is not a declared work item` };
145
147
  if (it.state !== 'declared') return { ok: false, error: `${item} is ${it.state}, not waiting for a Builder` };
148
+ if (pausedOf(root).has(it.initiative_id)) return { ok: false, error: `${it.initiative_id} is paused, so the factory takes no new job of it. pmos cost resume ${it.initiative_id} starts its jobs again` };
146
149
  const FL = require('./factory-fleet.js');
147
150
  const wait = FL.waitingOn(it, all);
148
151
  if (wait.length) return { ok: false, error: `${item} waits for ${wait.join(', ')}. It can be claimed once ${wait.length === 1 ? 'that item is' : 'those items are'} integrated` };
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * THE TRACE. <product state>/factory-traces.jsonl (pmos/state: runtime, gitignored, never a control-graph record). One line per Builder
13
13
  * or reviewer run that named a work item (`pmos build claim|propose|open|policy|status <item>`):
14
- * { at, kind: 'run', item, role, turns, tools: { Name: count }, files: [rel], model, input, cacheCreate, cacheRead, output, costUsd, ok }
14
+ * { at, kind: 'run', item, role, turns, tools: { Name: count }, files: [rel], model, input, cacheCreate, cacheRead, output, costUsd, ms, ok }
15
15
  * tools are the tool NAMES the run called; files are the paths Write and Edit touched, relative to the item's worktree. The tokens and the
16
16
  * cost come from lib/headless.js parseResult and usageOf, the same reads lib/run-tokens.js keeps. No line holds a prompt, an answer, a
17
17
  * tool input, a command or a key. The server writes the line after the run ends, from the run's own stdout: the Builder's run gains no
@@ -105,6 +105,7 @@ function record(stateDir, { item, role = '', result = null, tracker: t = null, o
105
105
  model: typeof r.model === 'string' ? r.model.slice(0, 80) : null,
106
106
  input: num(tk.input), cacheCreate: num(tk.cacheCreate), cacheRead: num(tk.cacheRead), output: num(tk.output),
107
107
  costUsd: Number.isFinite(r.costUsd) ? Math.round(r.costUsd * 10000) / 10000 : null,
108
+ ms: Number.isFinite(r.durationMs) && r.durationMs >= 0 ? Math.round(r.durationMs) : null, // the run's time: agent hours (lib/initiative-cost.js)
108
109
  ok: ok == null ? null : !!ok,
109
110
  });
110
111
  }
@@ -93,6 +93,7 @@
93
93
  {"id": "source", "audience": "agent", "status": "ga", "group": "Catch up", "name": "Stored tool reads", "say": "An agent session saves its read of a tool for the Briefing.", "cmd": "/source", "verb": "source"},
94
94
  {"id": "refresh", "audience": "agent", "status": "ga", "group": "Catch up", "name": "Read only what changed", "say": "An agent session asks a tool what changed since the last read.", "cmd": "/refresh", "verb": "refresh"},
95
95
  {"id": "lead", "audience": "agent", "status": "ga", "group": "Catch up", "name": "A popup's lead", "say": "PMOS writes a popup's short lead ahead, from stored reads.", "cmd": "/lead", "verb": "lead"},
96
+ {"id": "cost", "audience": "user", "status": "beta", "group": "What PMOS did", "name": "What the factory spent", "say": "Agent hours and spend per initiative and per merged pull request. Pause one that spends with no merge.", "cmd": "/spend", "verb": "cost", "place": "board", "since": "0.825.0"},
96
97
  {"id": "propose", "audience": "agent", "status": "ga", "group": "What PMOS did", "name": "File a suggestion", "say": "A PMOS run files what it found under an initiative's ✦ for you to keep or drop.", "cmd": "/propose", "verb": "propose"},
97
98
  {"id": "lab", "audience": "agent", "status": "ga", "group": "What PMOS did", "name": "The idle lab", "say": "What the idle lab's runs read and filed while you were away.", "cmd": "/lab", "verb": "lab"},
98
99
  {"id": "metrics", "audience": "agent", "status": "ga", "group": "Your product", "name": "Metric drafts", "say": "A metric-draft run files a metric for you to keep or drop.", "cmd": "/metrics", "verb": "metrics"},
@@ -0,0 +1,259 @@
1
+ 'use strict';
2
+ /* initiative-cost.js — what each initiative and each merged pull request cost the factory, and a pause for one that spends without a
3
+ * result (initiative initiative-cost, job #1906, idea A17; board BatchReleaseDS panel 21, agreed 2026-11-25). `pmos cost`.
4
+ *
5
+ * THE SOURCES, all the product's own, read-only here:
6
+ * traces <state>/factory-traces.jsonl (lib/factory-traces.js): one `run` line per Builder or reviewer run on a work item, with its
7
+ * tokens, its cost in dollars and (since this build) its time `ms`. An item `<initiative>.<n>` belongs to <initiative>.
8
+ * ledger <factory>/planning/work-items.jsonl: `integrated` or `shipped` is a merged item; `declared` carries its criterion.
9
+ * prs <state>/proposals.jsonl: a kept build ✦ wrote { op: 'pr', item, url }, the pull request PMOS opened for the item.
10
+ * THE ONE STORE this module writes: <state>/initiative-pause.jsonl, { at, by, ini, kind: 'pause' | 'resume', why }. The last line for an
11
+ * initiative wins. The UI (POST /api/initiative-cost/*), the ✦ (lib/routes-proposals.js group cost) and `pmos cost pause|resume` all write
12
+ * it through pause() and resume(), and lib/build-engine.js reads pausedOf().
13
+ *
14
+ * A PAUSE stops NEW jobs only: build-engine next() offers no declared item of a paused initiative and claim() refuses one. An item a
15
+ * Builder already holds keeps its claim, its worktree and its fix rounds, so running work finishes. Nothing here writes the work-item ledger.
16
+ *
17
+ * A STALL: the initiative's factory spent in the last STALL_DAYS days, and it has had no merge for STALL_DAYS days, counted from its last
18
+ * merge or, with none, from its first run. The proposal pass files ONE ✦ (group cost, type pause, class C: only the PM's ✓ pauses) per
19
+ * stall: its id carries the stall's start, so a ✕ or a ✓ is never asked again for the same stall. A ✦ whose initiative merged, stopped
20
+ * spending or was paused another way is dropped (zero is silence). Money is the Cost tab's alone: the ✦ title and why name no amount.
21
+ *
22
+ * costOf({ traces, ledger, prs, pauses, now }) PURE → { total: { costUsd, tokens, hours, runs }, rows: [row] }
23
+ * row { ini, runs, costUsd, tokens, hours, merged, prs: [{ item, title, costUsd, tokens, hours, url, mergedAt }], firstRunAt,
24
+ * lastRunAt, lastMergeAt, recentUsd (spent in the last STALL_DAYS), sinceUsd (spent since the stall's start), stall: { since } | null,
25
+ * paused }
26
+ * iniOf(item) · pausedOf(sd) → Set · pause(sd, ini, o) · resume(sd, ini, o) · readOf(root, { now }) → costOf over the repository's files
27
+ * proposePass(root, { now, stateDir? }) → { ok, filed: [id], dropped: [id] } never throws
28
+ * lines(C) · prLines(row) · run(argv, o) the CLI
29
+ * Nothing here calls a model or sends anything. */
30
+ const fs = require('fs');
31
+ const path = require('path');
32
+
33
+ const FILE = 'initiative-pause.jsonl';
34
+ const TAG = '[initiative-cost]';
35
+ const BY = 'agent:initiative-cost';
36
+ const DAY = 86400000;
37
+ const STALL_DAYS = 7;
38
+ const ITEM_RE = /^([a-z0-9][a-z0-9_-]*)\.[0-9]+$/;
39
+ const ID_RE = /^[a-z0-9][a-z0-9._-]*$/;
40
+
41
+ const num = (v) => (Number.isFinite(Number(v)) && Number(v) >= 0 ? Number(v) : 0);
42
+ const tOf = (at) => { const t = Date.parse(at); return Number.isFinite(t) ? t : null; };
43
+ const r2 = (n) => Math.round(n * 100) / 100;
44
+ const r1 = (n) => Math.round(n * 10) / 10;
45
+ const one = (s, n) => String(s == null ? '' : s).replace(/\s+/g, ' ').trim().slice(0, n);
46
+ const iniOf = (item) => { const m = ITEM_RE.exec(String(item || '')); return m ? m[1] : null; };
47
+
48
+ function readJsonl(file) {
49
+ let text = '';
50
+ try { text = fs.readFileSync(file, 'utf8'); } catch { return []; }
51
+ const out = [];
52
+ for (const s of text.split('\n')) { if (!s.trim()) continue; try { const o = JSON.parse(s); if (o && typeof o === 'object') out.push(o); } catch { /* a torn line */ } }
53
+ return out;
54
+ }
55
+
56
+ /* ── the pause store ── */
57
+ const pauseFile = (sd) => (sd ? path.join(sd, FILE) : null);
58
+ function pausesOf(sd) { return sd ? readJsonl(pauseFile(sd)) : []; }
59
+ /** PURE over the lines: the initiatives whose last line is a pause. */
60
+ function pausedSet(lines) {
61
+ const last = new Map();
62
+ for (const l of lines || []) if (l && ID_RE.test(String(l.ini || '')) && (l.kind === 'pause' || l.kind === 'resume')) last.set(l.ini, l.kind);
63
+ return new Set([...last].filter(([, k]) => k === 'pause').map(([i]) => i));
64
+ }
65
+ const pausedOf = (sd) => pausedSet(pausesOf(sd));
66
+ function write(sd, ini, kind, { by = 'pm', why = '', now = Date.now() } = {}) {
67
+ if (!sd) return { ok: false, error: 'this product has no state folder' };
68
+ if (!ID_RE.test(String(ini || ''))) return { ok: false, error: 'name an initiative' };
69
+ const on = pausedOf(sd).has(ini);
70
+ if (kind === 'pause' && on) return { ok: true, already: true, ini };
71
+ if (kind === 'resume' && !on) return { ok: true, already: true, ini };
72
+ const line = { at: new Date(now).toISOString(), by: one(by, 60) || 'pm', ini, kind, ...(why ? { why: one(why, 200) } : {}) };
73
+ try { fs.mkdirSync(sd, { recursive: true }); fs.appendFileSync(pauseFile(sd), JSON.stringify(line) + '\n'); } catch (e) { return { ok: false, error: one(e && e.message, 160) }; }
74
+ console.info(`${TAG} ${kind} ${ini}`);
75
+ return { ok: true, ini, line };
76
+ }
77
+ const pause = (sd, ini, o) => write(sd, ini, 'pause', o);
78
+ const resume = (sd, ini, o) => write(sd, ini, 'resume', o);
79
+
80
+ /* ── the fold ── */
81
+ /** PURE. prs: [{ item, url }]; pauses: the pause store's lines. */
82
+ function costOf({ traces = [], ledger = [], prs = [], pauses = [], now = Date.now() } = {}) {
83
+ const from = now - STALL_DAYS * DAY;
84
+ const mergedAt = new Map(), title = new Map(), urlOf = new Map();
85
+ for (const e of ledger || []) {
86
+ if (!e || typeof e.item_id !== 'string') continue;
87
+ if (e.event === 'declared' && e.criterion) title.set(e.item_id, one(e.criterion, 120));
88
+ const t = tOf(e.at);
89
+ if ((e.event === 'integrated' || e.event === 'shipped') && t != null && !mergedAt.has(e.item_id)) mergedAt.set(e.item_id, t);
90
+ }
91
+ for (const p of prs || []) if (p && p.item && p.url) urlOf.set(p.item, String(p.url));
92
+ const paused = pausedSet(pauses);
93
+ const by = new Map(), items = new Map();
94
+ const row = (ini) => { if (!by.has(ini)) by.set(ini, { ini, runs: 0, costUsd: 0, tokens: 0, ms: 0, firstRunAt: null, lastRunAt: null, runAts: [] }); return by.get(ini); };
95
+ for (const l of traces || []) {
96
+ if (!l || l.kind !== 'run') continue;
97
+ const ini = iniOf(l.item), t = tOf(l.at);
98
+ if (!ini || t == null || t > now) continue;
99
+ const x = row(ini), usd = num(l.costUsd), tk = num(l.input) + num(l.cacheCreate) + num(l.cacheRead) + num(l.output), ms = num(l.ms);
100
+ x.runs += 1; x.costUsd += usd; x.tokens += tk; x.ms += ms; x.runAts.push([t, usd]);
101
+ if (x.firstRunAt == null || t < x.firstRunAt) x.firstRunAt = t;
102
+ if (x.lastRunAt == null || t > x.lastRunAt) x.lastRunAt = t;
103
+ if (!items.has(l.item)) items.set(l.item, { item: l.item, costUsd: 0, tokens: 0, ms: 0 });
104
+ const it = items.get(l.item); it.costUsd += usd; it.tokens += tk; it.ms += ms;
105
+ }
106
+ const rows = [...by.values()].map((x) => {
107
+ const mine = [...items.values()].filter((it) => iniOf(it.item) === x.ini && mergedAt.has(it.item));
108
+ const merges = mine.map((it) => mergedAt.get(it.item)).filter((t) => t <= now);
109
+ const lastMergeAt = merges.length ? Math.max(...merges) : null;
110
+ const start = lastMergeAt != null ? lastMergeAt : x.firstRunAt;
111
+ const recentUsd = x.runAts.filter(([t]) => t >= from).reduce((s, [, u]) => s + u, 0);
112
+ const sinceUsd = x.runAts.filter(([t]) => lastMergeAt == null || t > lastMergeAt).reduce((s, [, u]) => s + u, 0);
113
+ const stalled = x.runAts.some(([t]) => t >= from) && start != null && now - start >= STALL_DAYS * DAY && (lastMergeAt == null || x.lastRunAt > lastMergeAt);
114
+ return {
115
+ ini: x.ini, runs: x.runs, costUsd: r2(x.costUsd), tokens: x.tokens, hours: r1(x.ms / 3600000), merged: mine.length,
116
+ prs: mine.sort((a, b) => mergedAt.get(b.item) - mergedAt.get(a.item)).map((it) => ({ item: it.item, title: title.get(it.item) || '', costUsd: r2(it.costUsd), tokens: it.tokens, hours: r1(it.ms / 3600000), url: urlOf.get(it.item) || '', mergedAt: new Date(mergedAt.get(it.item)).toISOString() })),
117
+ firstRunAt: new Date(x.firstRunAt).toISOString(), lastRunAt: new Date(x.lastRunAt).toISOString(), lastMergeAt: lastMergeAt == null ? null : new Date(lastMergeAt).toISOString(),
118
+ recentUsd: r2(recentUsd), sinceUsd: r2(sinceUsd), stall: stalled ? { since: new Date(start).toISOString() } : null, paused: paused.has(x.ini),
119
+ };
120
+ }).sort((a, b) => b.costUsd - a.costUsd || b.runs - a.runs || a.ini.localeCompare(b.ini));
121
+ const total = rows.reduce((s, r) => ({ costUsd: s.costUsd + r.costUsd, tokens: s.tokens + r.tokens, hours: s.hours + r.hours, runs: s.runs + r.runs }), { costUsd: 0, tokens: 0, hours: 0, runs: 0 });
122
+ return { total: { ...total, costUsd: r2(total.costUsd), hours: r1(total.hours) }, rows };
123
+ }
124
+
125
+ /* ── the repository's files ── */
126
+ const stateDirOf = (root, create = false) => { try { return require('./driver.js').stateDirOf(root, { create }); } catch { return null; } };
127
+ function prsOf(sd) {
128
+ const out = [];
129
+ for (const l of sd ? readJsonl(path.join(sd, 'proposals.jsonl')) : []) if (l.kind === 'keep' && Array.isArray(l.wrote)) for (const w of l.wrote) if (w && w.op === 'pr' && w.item && w.url) out.push({ item: w.item, url: w.url });
130
+ return out;
131
+ }
132
+ /** costOf over this repository's own files. An empty answer ({ rows: [] }) when no factory ran here. */
133
+ function readOf(root, { now = Date.now(), stateDir = null } = {}) {
134
+ const sd = stateDir || stateDirOf(root, false);
135
+ let dir = null; try { dir = require('./work-kind.js').factoryDir(root); } catch { dir = null; }
136
+ const ledger = dir ? readJsonl(path.join(dir, 'planning', 'work-items.jsonl')) : [];
137
+ const traces = sd ? readJsonl(path.join(sd, 'factory-traces.jsonl')) : [];
138
+ return costOf({ traces, ledger, prs: prsOf(sd), pauses: pausesOf(sd), now });
139
+ }
140
+
141
+ /* ── the ✦ ── */
142
+ const dayOf = (iso) => String(iso || '').slice(0, 10);
143
+ /** The ✦ for one stalled row. No amount of money in it (Totals only on the Cost tab). */
144
+ function proposalOf(r, now) {
145
+ const PR = require('./proposals.js');
146
+ const days = Math.floor((now - Date.parse(r.stall.since)) / DAY);
147
+ return {
148
+ kind: 'propose', ini: r.ini, board: '', run: 'initiative-cost', id: PR.idOf(r.ini, 'cost', 'pause', dayOf(r.stall.since)), group: 'cost', type: 'pause', section: 'check',
149
+ title: `Pause ${r.ini}'s new jobs?`,
150
+ why: one(`The factory has run agents on ${r.ini} for ${days} days with no merge${r.lastMergeAt ? ` since ${dayOf(r.lastMergeAt)}` : ''}. A pause stops new jobs; the work it holds now finishes, and Undo starts them again.`, 300),
151
+ sources: [{ label: 'Factory run traces', ref: 'factory-traces.jsonl' }, { label: 'Work items', ref: 'planning/work-items.jsonl' }],
152
+ items: [{ id: r.ini, title: 'Pause new jobs' }],
153
+ data: { since: r.stall.since, lastMergeAt: r.lastMergeAt, runs: r.runs },
154
+ at: new Date(now).toISOString(),
155
+ };
156
+ }
157
+ /** The pause ✦ pass, run when Work reads the costs (lib/routes-factory-metrics.js). Never throws. */
158
+ function proposePass(root, { now = Date.now(), stateDir = null, env = process.env } = {}) {
159
+ try {
160
+ if (/^(off|0|false|no)$/i.test(String(env.PMOS_INITIATIVE_COST || ''))) return { ok: true, filed: [], dropped: [], why: 'PMOS_INITIATIVE_COST=off' };
161
+ const sd = stateDir || stateDirOf(root, false);
162
+ if (!sd) return { ok: true, filed: [], dropped: [] };
163
+ const PR = require('./proposals.js');
164
+ const C = readOf(root, { now, stateDir: sd });
165
+ if (!C.rows.length) return { ok: true, filed: [], dropped: [] };
166
+ const F = PR.read(sd), kept = new Set(); for (const k of F.kept) if (!F.undone.has(k.batch)) for (const id of k.ids) kept.add(id);
167
+ const want = new Map(C.rows.filter((r) => r.stall && !r.paused).map((r) => [PR.idOf(r.ini, 'cost', 'pause', dayOf(r.stall.since)), r]));
168
+ const dropped = [], filed = [];
169
+ for (const p of F.props.values()) {
170
+ if (p.group !== 'cost' || p.type !== 'pause' || kept.has(p.id) || F.drops.has(PR.sigOf(p)) || want.has(p.id)) continue;
171
+ PR.append(sd, { by: BY }, { kind: 'drop', ini: p.ini, sig: PR.sigOf(p), id: p.id, group: 'cost', type: 'pause', why: 'it merged, stopped spending or was paused' });
172
+ dropped.push(p.id);
173
+ }
174
+ for (const [id, r] of want) {
175
+ if (F.props.has(id)) continue; // one ✦ per stall: open, kept or dropped, never filed again
176
+ PR.append(sd, { by: BY }, proposalOf(r, now));
177
+ filed.push(id);
178
+ }
179
+ if (filed.length || dropped.length) console.info(`${TAG} proposals filed=${filed.length} dropped=${dropped.length}`);
180
+ return { ok: true, filed, dropped };
181
+ } catch (e) { return { ok: false, filed: [], dropped: [], why: one(e && e.message, 160) }; }
182
+ }
183
+ /** The Cost tab's ✕ "Keep going" and its pause: the stall's open ✦ is answered, so it does not ask again. → the ids dropped */
184
+ function answer(sd, ini, why, { by = 'pm' } = {}) {
185
+ const PR = require('./proposals.js'), F = PR.read(sd), out = [];
186
+ for (const p of F.props.values()) {
187
+ if (p.group !== 'cost' || p.ini !== ini || F.drops.has(PR.sigOf(p))) continue;
188
+ PR.append(sd, { by }, { kind: 'drop', ini, sig: PR.sigOf(p), id: p.id, group: 'cost', type: 'pause', why: one(why, 120) });
189
+ out.push(p.id);
190
+ }
191
+ return out;
192
+ }
193
+
194
+ /* ── the CLI ── */
195
+ const usd = (n) => '$' + (n >= 100 ? Math.round(n) : n.toFixed(2));
196
+ const hrs = (h) => (h > 0 ? `${h} h` : 'no time logged');
197
+ const result = (r) => (r.stall ? `0 merged in ${STALL_DAYS} days` : r.merged ? `${r.merged} PR${r.merged === 1 ? '' : 's'} merged` : 'nothing merged yet');
198
+ /** PURE. */
199
+ function lines(C) {
200
+ if (!C.rows.length) return ['No factory run on any initiative here yet.'];
201
+ const out = [`Factory cost by initiative: ${usd(C.total.costUsd)} in all, ${C.total.runs} run${C.total.runs === 1 ? '' : 's'}.`];
202
+ for (const r of C.rows) out.push(` ${r.ini}: ${hrs(r.hours)} · ${usd(r.costUsd)} · ${result(r)}${r.paused ? ' · paused' : r.stall ? ` · pause it? pmos cost pause ${r.ini}` : ''}`);
203
+ return out;
204
+ }
205
+ /** PURE. One initiative's merged pull requests. */
206
+ function prLines(r) {
207
+ if (!r) return ['No factory run on that initiative.'];
208
+ const out = [`${r.ini}: ${hrs(r.hours)} · ${usd(r.costUsd)} · ${r.tokens} tokens · ${result(r)}${r.paused ? ' · paused' : ''}`];
209
+ for (const p of r.prs) out.push(` ${p.item}${p.title ? ' ' + p.title : ''}: ${hrs(p.hours)} · ${usd(p.costUsd)} · ${p.tokens} tokens${p.url ? ' · ' + p.url : ''}`);
210
+ if (!r.prs.length) out.push(' No pull request merged yet.');
211
+ return out;
212
+ }
213
+
214
+ const COMMANDS = { cost: ['show', 'pause', 'resume'] };
215
+ const USAGE = [
216
+ 'usage: pmos cost [<initiative>] [--json] | pmos cost pause|resume <initiative> — what the factory spent per initiative and merged pull request',
217
+ ' pmos cost [--json] each initiative: agent hours, spend and what merged',
218
+ ' pmos cost <initiative> [--json] its merged pull requests, each with its own cost',
219
+ ' pmos cost pause <initiative> the factory takes no new job of it; work it holds now finishes',
220
+ ' pmos cost resume <initiative> the factory takes its jobs again',
221
+ ];
222
+ function repoOf(cwd) {
223
+ let d = path.resolve(cwd);
224
+ for (;;) { try { if (fs.existsSync(path.join(d, '.git'))) return d; } catch { /* look further up */ } const up = path.dirname(d); if (up === d) return path.resolve(cwd); d = up; }
225
+ }
226
+ function run(argv, o = {}) {
227
+ const say = o.say || ((s) => console.log(s)), now = o.now || Date.now();
228
+ const args = argv[0] === 'cost' ? argv.slice(1) : argv.slice();
229
+ const pos = [], flags = {};
230
+ for (let i = 0; i < args.length; i++) { const a = args[i]; if (a === '--root') flags.root = args[++i]; else if (a === '--json') flags.json = true; else pos.push(a); }
231
+ if (pos[0] === 'help' || pos[0] === '--help') { USAGE.forEach((l) => say(l)); return 0; }
232
+ const root = path.resolve(flags.root || o.root || repoOf(o.cwd || process.cwd()));
233
+ const sd = o.stateDir || stateDirOf(root, pos[0] === 'pause' || pos[0] === 'resume');
234
+ if (pos[0] === 'pause' || pos[0] === 'resume') {
235
+ const ini = pos[1];
236
+ if (!ini || !ID_RE.test(ini)) { say(`✗ name an initiative: pmos cost ${pos[0]} <initiative>`); return 2; }
237
+ const r = (pos[0] === 'pause' ? pause : resume)(sd, ini, { by: 'pm:cli', now, why: pos[0] === 'pause' ? 'pmos cost pause' : '' });
238
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
239
+ if (pos[0] === 'pause') try { answer(sd, ini, 'paused with pmos cost pause', { by: 'pm:cli' }); } catch { /* no ✦ to answer */ }
240
+ if (flags.json) { say(JSON.stringify({ ok: true, ini, paused: pos[0] === 'pause', already: !!r.already })); return 0; }
241
+ say(r.already ? `${ini} was already ${pos[0] === 'pause' ? 'paused' : 'running'}.` : pos[0] === 'pause' ? `✓ Paused ${ini}'s new jobs. Work it holds now finishes. pmos cost resume ${ini} undoes it.` : `✓ ${ini}'s jobs run again.`);
242
+ return 0;
243
+ }
244
+ const C = readOf(root, { now, stateDir: sd });
245
+ try { require('./use-log.js').record(sd || root, [{ kind: 'use', page: 'premium-board', control: 'costCli', device: 'desk' }], now); } catch { /* a count, never a reason to fail */ }
246
+ console.info(`${TAG} rows=${C.rows.length} stalled=${C.rows.filter((r) => r.stall).length}`);
247
+ const ini = pos[0] && pos[0] !== 'show' ? pos[0] : null;
248
+ if (ini) {
249
+ const r = C.rows.find((x) => x.ini === ini) || null;
250
+ if (flags.json) { say(JSON.stringify({ ok: true, row: r })); return 0; }
251
+ prLines(r).forEach((l) => say(l));
252
+ return 0;
253
+ }
254
+ if (flags.json) { say(JSON.stringify({ ok: true, ...C })); return 0; }
255
+ lines(C).forEach((l) => say(l));
256
+ return 0;
257
+ }
258
+
259
+ module.exports = { FILE, TAG, STALL_DAYS, iniOf, costOf, pausedSet, pausedOf, pause, resume, readOf, proposalOf, proposePass, answer, lines, prLines, run, COMMANDS, USAGE };
@@ -167,6 +167,9 @@ const VERBS = Object.freeze({
167
167
  tradeoff: Object.freeze({ module: 'tradeoff-cli.js', run: null, guide: 'cli.md',
168
168
  help: 'pmos tradeoff [list|show|keep|undo|count] — two close items on the Roadmap side by side, and the reason you kept one first (pmos tradeoff help)' }),
169
169
  // Not a pm-os-absorb verb (run: null): initiative next-hire-draft (job #1876, A75) added it through the same table.
170
+ // Not a pm-os-absorb verb (run: null): initiative initiative-cost (job #1906, A17) added it through the same table.
171
+ cost: Object.freeze({ module: 'initiative-cost.js', run: null, guide: 'cli.md',
172
+ help: 'pmos cost [<initiative>] | pmos cost pause|resume <initiative> — what the factory spent per initiative and merged pull request, and its pause (pmos cost help)' }),
170
173
  // Not a pm-os-absorb verb (run: null): initiative starter-goals (job #1916, A84) added it through the same table.
171
174
  goals: Object.freeze({ module: 'goals-cli.js', run: null, guide: 'cli.md',
172
175
  help: 'pmos goals [starter|draft|keep <n>|drop <n>|undo] — starter goals PMOS drafts from your own product, each with its source; keep one and it becomes a goal (pmos goals help)' }),
@@ -223,7 +226,7 @@ const VERBS = Object.freeze({
223
226
  help: 'pmos declined list|draft|record — asks closed without being done, each with a kind reply draft PMOS never sends; record one in the out-of-scope list (pmos declined help)' }),
224
227
  // Not a pm-os-absorb verb (run: null): initiative sprint-retro-one-change (bet A76) added it through the same table.
225
228
  sprint: Object.freeze({ module: 'sprint-cli.js', run: null, guide: 'cli.md',
226
- help: 'pmos sprint retro|change — a closed sprint\'s retro from PMOS\'s own close numbers, and its one tracked change (pmos sprint help)' }),
229
+ help: 'pmos sprint now|retro|change — the sprint running now and who holds what, and a closed sprint\'s retro with its one tracked change (pmos sprint help)' }),
227
230
  // Not a pm-os-absorb verb (run: null): initiative parked-reason-way-back (bet A446) added it through the same table.
228
231
  parked: Object.freeze({ module: 'parked-cli.js', run: null, guide: 'cli.md',
229
232
  help: 'pmos parked list|hold|back|coverage — parked initiatives: why each is parked, what brings it back, and bringing it back (pmos parked help)' }),