create-pmos 0.549.0 → 0.551.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.
@@ -153,10 +153,10 @@ const IVREAD = () => {
153
153
  /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage.
154
154
  * The milestone mark is a drawn diamond (.msh header holding .cz-ms, cozy.css), not a ◆ glyph in the text; the heads read '◆ ' only where
155
155
  * that shape is present, so the check pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
156
- const tr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('.bt-h .bt-cells > div')].map((d) => (d.classList.contains('msh') && d.querySelector('.cz-ms') ? '◆ ' : '') + d.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#ibBody .bt-l')].map((r) => ({ t: r.querySelector('.bt-nm b').textContent, cur: [...r.querySelectorAll('.bt-cells > div')].findIndex((c) => c.classList.contains('c')), nx: ((r.querySelector('.bt-dl .bd-nx .tx') || {}).textContent || ''), cnt: ((r.querySelector('.bt-dl .bd-nx .mu') || {}).textContent || ''), act: ((r.querySelector('.bt-dl .bd-nxa') || { getAttribute: () => '' }).getAttribute('aria-label') || ''), you: !!r.querySelector('.bt-dl .bd-nx .cz-dot.you'), st: r.querySelector('.cs').textContent, days: (r.querySelector('.sc.c small') || {}).textContent, dt: (r.querySelector('.sc.c') || {}).title })), pressed: document.querySelector('#bdViewMenu [aria-pressed="true"]').dataset.pv, n: document.querySelector('.bt-nmh').textContent.replace(/\s+/g, ' ').trim(), oh: document.querySelector('.bt-oh').textContent, lg: !!document.querySelector('.bt-oh .lg, #ibBody .seg5'), tf: document.querySelector('.bt-tf').textContent }));
156
+ const tr = await p.evaluate(() => ({ heads: [...document.querySelectorAll('.bt-h .bt-cells > div')].map((d) => (d.classList.contains('msh') && d.querySelector('.cz-ms') ? '◆ ' : '') + d.textContent.replace(/\s+/g, ' ').trim()), rows: [...document.querySelectorAll('#ibBody .bt-l')].map((r) => ({ t: r.querySelector('.bt-nm b').textContent, cur: [...r.querySelectorAll('.bt-cells > div')].findIndex((c) => c.classList.contains('c')), nx: ((r.querySelector('.bt-dl .bd-nx .tx') || {}).textContent || ''), cnt: ((r.querySelector('.bt-dl .bd-nx .mu') || {}).textContent || ''), act: ((r.querySelector('.bt-dl .bd-nxa') || { getAttribute: () => '' }).getAttribute('aria-label') || ''), you: !!r.querySelector('.bt-dl .bd-nx.y'), st: r.querySelector('.cs').textContent, days: (r.querySelector('.sc.c small') || {}).textContent, dt: (r.querySelector('.sc.c') || {}).title })), pressed: document.querySelector('#bdViewMenu [aria-pressed="true"]').dataset.pv, n: document.querySelector('.bt-nmh').textContent.replace(/\s+/g, ' ').trim(), oh: document.querySelector('.bt-oh').textContent, lg: !!document.querySelector('.bt-oh .lg, #ibBody .seg5'), tf: document.querySelector('.bt-tf').textContent }));
157
157
  ok('B1 the default view is the stage track with six stages and two milestones, each with the board\'s count (old names count for the new ones); a step with none says no 0 (UI grill U2)', tr.pressed === 'track' && tr.heads.join('|') === 'Triage|Discover1|Plan1|Prioritize|Build2|◆ Deliver1|Monitor1|◆ Evaluate21', JSON.stringify(tr.heads));
158
158
  ok('B1 one row per initiative, sorted by stage, with its current step marked; the head counts the open initiatives', tr.rows.length === 7 && tr.rows.map((r) => r.cur).join() === '1,2,4,4,5,6,7' && tr.rows[0].t === 'Usage-based billing' && tr.n === 'Initiative 9', JSON.stringify(tr.rows.map((r) => r.t + ':' + r.cur)));
159
- ok('B1 the Next column says what finishes the step next, with its count; the initiative\'s whole progress is never the step\'s, and a part not on record draws nothing; a draft step has no "with Claude" link (chief-of-staff: Claude drafts it by itself)', tr.oh === 'Next' && tr.rows[0].nx === '' && tr.rows[1].nx === 'Draft the tickets' && tr.rows[1].cnt === '1/2 parts' && tr.rows.every((r) => !/%/.test(r.cnt)) && tr.rows[3].nx === 'Link the Jira epic' && tr.rows[3].act === 'Link the Jira epic' && tr.rows[6].nx === 'Draft the outcome report' && tr.rows[6].act === '', JSON.stringify(tr.rows.map((r) => [r.nx, r.cnt, r.act])));
159
+ ok('B1 the Next column says what Claude does next (board AwH): no document asks and no part counters; the PM\'s calls only read "Your call"; the epic keeps its link icon', tr.oh === 'Next' && tr.rows[1].nx === 'Claude drafts the tickets' && tr.rows[1].cnt === '' && tr.rows.every((r) => !/%|parts|PRD|^Draft |^Write |^Add the /.test(r.cnt + ' ' + r.nx)) && tr.rows[3].nx === 'Claude finds the Jira epic' && tr.rows[3].act === 'Link the Jira epic' && tr.rows[5].nx === 'Claude reads the outcome' && tr.rows[5].act === '' && tr.rows[6].nx === 'Your call · did it work?' && tr.rows[6].act === '', JSON.stringify(tr.rows.map((r) => [r.nx, r.cnt, r.act])));
160
160
  ok('B1 the status line says late in days over and at risk with no owner', tr.rows.some((r) => /^\d+ days over$/.test(r.st)) && tr.rows[0].st === 'At risk · no owner', JSON.stringify(tr.rows.map((r) => r.st)));
161
161
  ok('B1 days in a step are not on record, so the current step shows a dash and says so; nothing is invented', tr.rows.every((r) => (r.days === '—' || /Deliver/.test(r.dt)) && /days in this step are not on record/.test(r.dt)), JSON.stringify(tr.rows.map((r) => r.days + ':' + r.dt)));
162
162
  // PgBoard: a committed date (the planned end) shows under the Deliver milestone; at the milestone itself it replaces the days count
@@ -212,11 +212,11 @@ const IVREAD = () => {
212
212
  }
213
213
  {
214
214
  const R = await open({ model: BP.build(FJ.facts()) }), q = R.page;
215
- const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')), spr: document.querySelector('#bdChipset #chSprint').getAttribute('aria-label'), jiraRow: !!document.querySelector('.bd-hd #bdLgdMenu #chJira') && !document.querySelector('#bdJiraw'), need: document.querySelector('#chNeed').getAttribute('aria-label'), rows: [...document.querySelectorAll('#bdNeedMenu button')].map((b) => b.textContent.trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join('|'), jira: document.querySelector('#chJira').getAttribute('title'), ss: document.querySelector('.bt-l[data-row="board:self-serve-v2"] .bd-nx .tx').textContent, sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .tx').textContent, red: !!document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx em.red'), ssoTitle: document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .tx').title, st: document.querySelector('.bt-l[data-row="board:sso-partners"] .cs').textContent, ssoCount: document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .mu').textContent, ssCount: document.querySelector('.bt-l[data-row="board:self-serve-v2"] .bd-nx .mu').textContent }));
215
+ const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')), spr: document.querySelector('#bdChipset #chSprint').getAttribute('aria-label'), jiraRow: !!document.querySelector('.bd-hd #bdLgdMenu #chJira') && !document.querySelector('#bdJiraw'), need: document.querySelector('#chNeed').getAttribute('aria-label'), rows: [...document.querySelectorAll('#bdNeedMenu button')].map((b) => b.textContent.trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')).join('|'), jira: document.querySelector('#chJira').getAttribute('title'), ss: document.querySelector('.bt-l[data-row="board:self-serve-v2"] .bd-nx .tx').textContent, sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .tx').textContent, red: !!document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .tx .red'), ssoTitle: document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .tx').title, st: document.querySelector('.bt-l[data-row="board:sso-partners"] .cs').textContent, ssoCount: document.querySelector('.bt-l[data-row="board:sso-partners"] .bd-nx .mu').textContent, ssCount: document.querySelector('.bt-l[data-row="board:self-serve-v2"] .bd-nx .mu').textContent }));
216
216
  ok('B1 the one row holds one pill for the new asks, late, at risk and blocked; its (i) holds the sprint and release and the Jira read with its ↻ (batch 24 item 7, UI grill U2)', c.chips.length === 1 && c.spr === 'Sprint 24 · v2.4 ships Nov 4. Sprints and releases' && c.need === '1 new ask, 1 late, 3 at risk, 1 blocked. Show them' && c.rows === 'New ask1|Late1|At risk3|Blocked1' && /^Jira · read .*Read Jira again$/.test(c.jira) && c.jiraRow, JSON.stringify(c));
217
217
  await q.click('#bdFilter'); const fo = await q.evaluate(() => { const b = document.querySelector('#bdPop [data-fsonly]'); return b ? b.textContent + (b.getAttribute('aria-pressed') === 'true' ? '*' : '') : null; }); await q.keyboard.press('Escape');
218
218
  ok('B1 This sprint (on by default) is Filter\'s first sprint chip now that the chip row is gone (batch 28 item 3)', fo === 'Sprint 24 only*', String(fo));
219
- ok('B1 Build and Deliver say the ticket that matters, counted in points or tickets; a blocked ticket comes first, in red', c.ssCount === '5/13 pts' && c.ssoCount === '1/4 tickets' && /^Finish SSO-12/.test(c.sso) && c.red && /blocked/.test(c.ssoTitle) && /^Finish ONB-\d+ · 2 more$/.test(c.ss), JSON.stringify(c));
219
+ ok('B1 Build and Deliver say the ticket that matters, counted in points or tickets; a blocked ticket comes first, in red', c.ssCount === '5/13 pts' && c.ssoCount === '1/4 tickets' && /^Claude chases SSO-12/.test(c.sso) && c.red && /blocked/.test(c.ssoTitle) && /^Claude follows ONB-\d+ · 2 more$/.test(c.ss), JSON.stringify(c));
220
220
  ok('B1 a Deliver row whose release has a date says when it ships', c.st === 'Ships Nov 4', c.st);
221
221
  // a metric chip opens its trend (BdPanel); its "Show only" filters
222
222
  await needOpen(q); await q.click('#bdChipset [data-f="blocked"]');
@@ -318,7 +318,7 @@ const IVREAD = () => {
318
318
  await view(p, 'list');
319
319
  const listOf = () => p.evaluate(() => ({ tag: !!document.querySelector('#ibBody .bd-wtag'), rows: [...document.querySelectorAll('#ibBody .bd-lt[data-row] .bd-ltn b')].map((b) => b.textContent), ss: ((document.querySelector('#ibBody .bd-lt[data-row="board:self-serve-v2"]') || {}).textContent || '').replace(/\s+/g, ' '), head: [...document.querySelectorAll('#ibBody .bd-lt.h [role="columnheader"]')].map((h) => h.textContent).join('|'), foot: (document.querySelector('#ibBody .bd-lt.foot') || {}).textContent || '', v: document.querySelector('#bdViewMenu [aria-pressed="true"]').dataset.pv }));
320
320
  const lv = await listOf();
321
- ok('B4 the List view lists the initiatives with workflow, stage, category, status, owner, next and finish, sorted by need; Monitor and Evaluate fold below', !lv.tag && lv.rows.length === 5 && lv.head === 'Initiative · sorted by need|Workflow|Stage|Category|Status|Owner|Next|Finish|' && /Self-serve onboarding v2.*Product feature.*Build.*In progress.*7 days over.*Link the Jira epic.*10 Oct/.test(lv.ss) && /2 more in Monitor and Evaluate/.test(lv.foot) && lv.v === 'list', JSON.stringify(lv));
321
+ ok('B4 the List view lists the initiatives with workflow, stage, category, status, owner, next and finish, sorted by need; Monitor and Evaluate fold below', !lv.tag && lv.rows.length === 5 && lv.head === 'Initiative · sorted by need|Workflow|Stage|Category|Status|Owner|Next|Finish|' && /Self-serve onboarding v2.*Product feature.*Build.*In progress.*7 days over.*Claude finds the Jira epic.*10 Oct/.test(lv.ss) && /2 more in Monitor and Evaluate/.test(lv.foot) && lv.v === 'list', JSON.stringify(lv));
322
322
  await p.click('#ibBody [data-sort="title"]');
323
323
  const lt = await listOf();
324
324
  ok('B4 a column title sorts the list', lt.rows[0] === 'Docs search' && lt.rows.join() === lt.rows.slice().sort((a, b) => a.localeCompare(b)).join(), JSON.stringify(lt.rows));
@@ -468,12 +468,12 @@ const IVREAD = () => {
468
468
  const gone = F.row('old-idea', 'Old idea', { status: 'cancelled', stopped: { reason: 'Not worth it now' } });
469
469
  const R = await open({ model: BP.build(FJ.facts({ cancelled: [gone] })), trail: FT.trail() }), q = R.page;
470
470
  await until(() => q.evaluate(() => /18d/.test(document.querySelector('#ibBody').textContent)));
471
- const row = (id) => q.evaluate((k) => { const r = document.querySelector(`.bt-l[data-row="board:${k}"]`); if (!r) return null; const c = r.querySelector('.sc.c'); return { days: (c.querySelector('small') || {}).textContent, dt: c.title, st: r.querySelector('.cs').textContent, stc: r.querySelector('.cs').className, prog: ((r.querySelector('.bt-dl .bd-nx .mu') || {}).textContent || ''), line: ((r.querySelector('.bt-dl .bd-nx .tx') || {}).textContent || ''), you: !!r.querySelector('.bt-dl .bd-nx .cz-dot.you'), skip: [...r.querySelectorAll('.bt-cells > div.k')].map((d) => d.title) }; }, id);
471
+ const row = (id) => q.evaluate((k) => { const r = document.querySelector(`.bt-l[data-row="board:${k}"]`); if (!r) return null; const c = r.querySelector('.sc.c'); return { days: (c.querySelector('small') || {}).textContent, dt: c.title, st: r.querySelector('.cs').textContent, stc: r.querySelector('.cs').className, prog: ((r.querySelector('.bt-dl .bd-nx .mu') || {}).textContent || ''), line: ((r.querySelector('.bt-dl .bd-nx .tx') || {}).textContent || ''), you: !!r.querySelector('.bt-dl .bd-nx.y'), skip: [...r.querySelectorAll('.bt-cells > div.k')].map((d) => d.title) }; }, id);
472
472
  const ss = await row('self-serve-v2'), pr = await row('partner-rate-limits'), ub = await row('usage-billing'), rf = await row('refund-reason-codes'), ds = await row('docs-search');
473
473
  ok('T days in the step come from the trail, with "usually N days" only from three samples on', ss.days === '18d' && ss.dt === 'Build · 18 days in this step · usually 14 days' && pr.days === '6d' && pr.dt === 'Plan · 6 days in this step', JSON.stringify([ss, pr]));
474
474
  ok('T a skipped step is a ring that says why: the move\'s reason, or the lane\'s ladder', pr.skip.join() === 'Discover skipped: Moved from Triage to Plan: the PRD came with the ask.' && ds.skip.length === 3 && /The chore lane has no Triage step/.test(ds.skip[0]), JSON.stringify([pr.skip, ds.skip]));
475
- ok('T the Next cell counts the parts from the records and names the next one', ub.prog === 'PRD 2/6' && ub.line === 'Add the evidence' && pr.prog === '1/4 parts' && pr.line === 'Set the timeline', JSON.stringify([ub, pr]));
476
- ok('T what waits on you comes first, in blue', rf.st === 'Your verdict' && /s-you/.test(rf.stc) && rf.you && rf.line === 'Give your verdict', JSON.stringify(rf));
475
+ ok('T the Next cell says what Claude writes next, with no part counter (board AwH)', ub.prog === '' && ub.line === 'Claude writes the experiment' && pr.prog === '' && pr.line === 'Claude writes the done test', JSON.stringify([ub, pr]));
476
+ ok('T what waits on you comes first, in blue', rf.st === 'Your verdict' && /s-you/.test(rf.stc) && rf.you && rf.line === 'Your call · did it work?', JSON.stringify(rf));
477
477
  // UI grill U2 took the Board's bell off: what it listed is the pill's "Waits on you" row, which shows only those initiatives
478
478
  await needOpen(q);
479
479
  const wy = await q.evaluate(() => { const b = document.querySelector('#bdNeedMenu [data-f="you"]'); return b ? b.textContent.trim() : null; });
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.551.0",
4
+ "at": "2026-11-10T11:25:58.991Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1279,
9
+ "t": "Intent card on the product page; the Board by goal, and a Next column that says what Claude does next",
10
+ "s": "Intent card on the product page; the Board by goal, and a Next column that says what Claude does next",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.550.0",
17
+ "at": "2026-11-10T08:31:44.572Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1278,
22
+ "t": "Run PMOS on an always-on cloud server — one paste on the Mac moves it, the Mac stays as the fallback",
23
+ "s": "Run PMOS on an always-on cloud server — one paste on the Mac moves it, the Mac stays as the fallback",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.549.0",
4
30
  "at": "2026-11-10T07:06:56.286Z",
@@ -0,0 +1,100 @@
1
+ ---
2
+ type: Guide
3
+ title: "Run PMOS in the cloud"
4
+ timestamp: 2026-11-10
5
+ ---
6
+
7
+ # Run PMOS in the cloud
8
+
9
+ PMOS can run on a small always-on Linux server instead of a Mac. The server keeps PMOS up, keeps Claude signed in, keeps Remote Control on and answers your Online address (such as `pmos.pm-os.app`). The Mac stays as the fallback: nothing on it is deleted, and one line turns it back on.
10
+
11
+ The server runs the same `pmos` as the Mac. Records still sync through each repository's own git remote. Your Jira and Slack reads come from the claude.ai connectors of the Claude account you sign in with.
12
+
13
+ ## What you do
14
+
15
+ There are four steps. The first and the last need you, because they are accounts and sign-ins. The two pastes do everything else.
16
+
17
+ 1. **Make the server (about 5 minutes).** Use [Hetzner Cloud](https://console.hetzner.cloud). Select **Add server** and set:
18
+ - **Location:** the one nearest to you (Singapore for South-East Asia).
19
+ - **Image:** Ubuntu 24.04.
20
+ - **Type:** shared vCPU, 4 vCPU and 8 GB RAM. Each Claude session uses up to 0.5 GB, and a smaller server slows down when several run.
21
+ - **SSH key:** paste the Mac's public key. To show it, run `cat ~/.ssh/id_ed25519.pub` on the Mac. If the file is missing, run `ssh-keygen -t ed25519` first.
22
+ - **Backups:** on. Hetzner then keeps a copy of the whole server every day.
23
+
24
+ Copy the server's IP address.
25
+
26
+ 2. **On the Mac, paste one line.** Use the IP address from step 1:
27
+
28
+ ```sh
29
+ curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash -s -- move root@<server-ip>
30
+ ```
31
+
32
+ It takes about 10 minutes. It checks that the Mac can reach the server, then stops PMOS on the Mac. It copies PMOS to the server and starts it there.
33
+
34
+ 3. **Sign in once (about 2 minutes).** From the Mac or any computer:
35
+
36
+ ```sh
37
+ ssh -t <your-mac-user>@<server-ip> pmos-cloud signin
38
+ ```
39
+
40
+ Claude shows a link. Open it on any device, sign in with your Claude account and paste the code back. GitHub then shows a code: open its link, enter the code and allow access. Last, Remote Control opens: answer any question it asks, such as trusting the folder, then press Ctrl-B and then D. It keeps running after you leave.
41
+
42
+ 4. **Check it.** Open your Online address on your phone, or run `ssh <your-mac-user>@<server-ip> pmos-cloud status`. Every line shows ✓ when all is ready.
43
+
44
+ When the Mac is off or cannot be reached, skip step 2. Paste this on the server instead, as root:
45
+
46
+ ```sh
47
+ curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash
48
+ ```
49
+
50
+ This starts an empty PMOS for the user `pmos`. After the sign-in, add each product repository with `pmos-cloud add <owner/repo>`, and set up the Online address with `pmos-cloud online pmos.pm-os.app`. Chats, notes and settings that are only on the Mac stay there until you run step 2.
51
+
52
+ ## What the move copies
53
+
54
+ | Item | Where it goes on the server | Why |
55
+ |---|---|---|
56
+ | The PMOS state folder: chats, notes, settings, Online and the product list | `~/.local/state/pmos` | Your PMOS is the same as it was on the Mac. |
57
+ | Every repository PMOS hosts, with its git history (no `node_modules`) | The same path as on the Mac | Paths and product ids do not change. |
58
+ | `~/.cloudflared`: the tunnel's files | The same path | The same tunnel and DNS record answer your Online address. No DNS change is needed. |
59
+ | The name and folder of the Claude profile in Settings › Claude | An alias in `~/.bashrc` | Unattended Claude work runs as that profile, as on the Mac. |
60
+ | `~/.gitconfig` | The same path | Your git name and email. The macOS keychain line is removed, and GitHub is reached over HTTPS. |
61
+
62
+ The server uses the same user name and home folder as the Mac, such as `/Users/<you>`. That is why no path needs to change.
63
+
64
+ The move does not copy Claude or GitHub sign-ins, because the Mac keeps them in its keychain. Step 3 makes new ones on the server.
65
+
66
+ ## What runs on the server
67
+
68
+ - **The minute check.** A systemd timer runs `pmos up --keep` every minute and 20 seconds after a restart, like the Mac's login item. It does nothing when PMOS answers. It starts PMOS when PMOS is down, and replaces PMOS when PMOS is stuck. It waits while an in-page update runs.
69
+ - **Remote Control.** After the sign-in, the same check keeps `claude remote-control` running in the tmux session `pmos-remote-control`, as "PMOS cloud (<server>)". It uses `--permission-mode auto`, because nobody is at the server to answer.
70
+ - **Online.** If Online was on at the Mac, it is on at the server, and the server runs the tunnel. The move turned Online off on the Mac, so only one computer answers.
71
+ - **The firewall.** Only SSH is open. PMOS listens on the server only. Cloudflare reaches it through the tunnel from inside the server.
72
+ - **Backups.** PMOS copies its state folder every night to `~/pmos-backups`, as on the Mac. Hetzner's Backups copies the whole server every day.
73
+
74
+ ## `pmos-cloud` on the server
75
+
76
+ | Command | What it does |
77
+ |---|---|
78
+ | `pmos-cloud status` | Shows the workspace, the Claude sign-in, Remote Control, GitHub and Online, each with ✓ or the next step. |
79
+ | `pmos-cloud signin` | Signs in to Claude and GitHub. It skips a sign-in that is already done. Remote Control then starts. |
80
+ | `pmos-cloud online [host] [tunnel]` | Sets up the Online address on a server that has no tunnel files. It signs in to Cloudflare, uses the tunnel `pmos` (or makes it), and writes `~/.cloudflared/config.yml`. Then turn Online on in Settings › Online. |
81
+ | `pmos-cloud add <owner/repo>…` | Clones a repository to `~/Project` and adds it to PMOS. |
82
+ | `pmos-cloud logs [n]` | Shows the last lines of the minute check's log. |
83
+ | `pmos-cloud stop` · `pmos-cloud start` | Stops PMOS, Remote Control and the tunnel, and keeps the minute check from starting them again. `start` undoes this. |
84
+
85
+ To open PMOS without the Online address, run `ssh -N -L 7433:127.0.0.1:7433 <you>@<server-ip>`. Then open `http://localhost:7433`. Settings › Online can be changed only this way, because PMOS treats the request as one from the server itself.
86
+
87
+ ## Go back to the Mac
88
+
89
+ 1. On the server: `pmos-cloud stop`.
90
+ 2. On the Mac: `curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash -s -- mac-on`. PMOS starts within a minute.
91
+ 3. On the Mac, turn Online on in Settings › Online.
92
+
93
+ Records that both computers push to a git remote stay in step. Chats, notes and settings that changed on the server after the move are only on the server.
94
+
95
+ ## Limits
96
+
97
+ - The server must run Ubuntu or Debian. Other Linux systems need the steps done by hand.
98
+ - A product repository with no git remote is copied once, at the move. After that, the Mac and the server do not sync it.
99
+ - Claude's sign-in on the server lasts as long as a sign-in on any computer. When it expires, `pmos-cloud status` shows ✗ for Claude, and Settings › Claude shows the sign-in prompt. Run `pmos-cloud signin` again.
100
+ - The two pastes download the newest create-pmos release from `unpkg.com`. If unpkg is down, copy `cloud-setup.sh` from the create-pmos package (`npm pack create-pmos`) and run it with `bash cloud-setup.sh move root@<server-ip>`.
@@ -41,6 +41,7 @@ PMOS has three places: **Home**, **Board** and **Intelligence**. The round menu
41
41
 
42
42
  - [What Claude does behind the scenes](agent-capabilities.md): every job Claude runs by itself, when it runs, what it reads, where you see it, how to stop it, and what it fixes by itself; the three classes of change (D106), what is applied at once with Undo, what waits for you, and how a job goes back to propose; long-running goals; the team of role agents; the idle lab; and the PM-only acts, how each is checked and recorded, and how an agent's act is logged under its name (D98).
43
43
  - [Layout and first run](layout.md): the three places, the menu button, the Viewer and its trail, docking panels, the keys and the phone; the first run; why a new PMOS starts quiet and what opens each place; the PMOS app and the login item; and Adler, Claude's face, with Settings › General › Adler.
44
+ - [Run PMOS in the cloud](cloud.md): move PMOS from the Mac to an always-on server with one paste, the one sign-in that is yours, what runs on the server, `pmos-cloud`, and how to go back to the Mac.
44
45
  - [Settings, switches and data freshness](settings-and-switches.md): what each section of Settings holds, every `PMOS_` environment variable with its default and the Settings entry that does the same, and when each source is read again and how old it is.
45
46
 
46
47
  ### Home and your day
@@ -2,7 +2,7 @@
2
2
  type: Guide
3
3
  title: "The Board: programs, views, published boards and core documents"
4
4
  description: "The Board's views and programs, milestones, a read-only published copy of a Board, and the core documents of each level."
5
- timestamp: 2026-11-08
5
+ timestamp: 2026-11-10
6
6
  ---
7
7
 
8
8
  # The Board
@@ -53,6 +53,8 @@ The weekly update in Home follows the same rules. Claude drafts it only when som
53
53
  - A program comes first. Its band shows the stage spread of its initiatives, the next milestone and how many initiatives are ready for it. Under the band, the initiatives sit under a small heading for each product. Then each product has its own group.
54
54
  - A product's group head works like a program's: press the product's tile or name to open its page in Home's Viewer. Press the chevron to fold the group. This works in every view: the stage track, Kanban, the timeline and List. On a shared board, the product's name is plain text.
55
55
  - To group by product only, press the tune button in the top row and choose **By product** under **Group**. A program member then shows a small layers icon and stays under its product in every view, the timeline included.
56
+ - **By goal** is the stage track's first grouping. Each goal row shows the goal's name, its KR id and its reading ("KR-A1 · no reading yet"), the spread of its initiatives over the steps, and in the Next column its target and where the reading comes from. A health budget is a goal too: its cap is the target, and its share of the open initiatives is its reading. The goals come from your OKR file and your health budgets; nothing is typed here. An initiative whose anchor names no goal sits under **No goal yet**. Choose **Programs first** or **By product** under **Group** for the other groupings; Kanban, the timeline and List keep the programs.
57
+ - The **Next** column says what Claude does next, with ✦, for example "Claude writes the experiment" or "Claude reads the outcome". It does not ask you to write a document. Only your calls show in blue with a person icon: **Your call** · did it work?, move it to the next stage, send the drafted tickets to Jira, and the release sign-off. Ticket and task counts stay.
56
58
  - **Kanban** shows programs as swimlanes, then products. Press a column header to fold the column to a strip with its count. An empty column starts folded. The Board remembers each fold.
57
59
  - 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.
58
60
  - On the timeline, **every initiative has a row**, in a program or not, in every grouping. An initiative with no dates says **No dates** beside today; in each group it comes after the dated ones. Under the chart, a line gives how many have no dates, with **Ask to propose dates**.
@@ -83,6 +85,7 @@ The Viewer of a program, and the product page, are one page. There is no Work an
83
85
 
84
86
  - The top shows Claude's ✦ line, then the goal card with its milestones and the forecast bar. Goals show a short title, not the KR's full text.
85
87
  - On the product page, **The story so far** comes under the ✦ line. Claude writes it from the records, and every line shows its source as a chip. This story is your weekly update: the update leads with it, without the sources. The ✦ line then says "Your weekly update is this story." Claude keeps it current when it prepares the weekly report. With no story, there is no card.
88
+ - On the product page, **Intent** comes under the story: what we want, the limits Claude works inside, and what we will not do. It is yours. Press the pencil to edit the three parts, one line each. Claude never changes it; when a record says it should change, Claude adds a ✦ row under the card, for example "Add a limit: …" with its source. ✓ adds it, ✕ declines it.
86
89
  - Each goal row shows the KR as a chip, then a short title, then one grey line on how it reads. The KR id alone is never the title.
87
90
  - When Claude proposes changes, a folded row under the goal card counts them. Only the owner sees this row. Press it to open every proposal, each with Claude's pick: ✕ drops it, ✎ opens it to change, ✓ keeps the pick.
88
91
  - On the product page, the same row also holds **Goals I would change**: a KR whose wording reads badly, with the old words struck through, the new words, one reason and a test read (its source and number). Claude lists a goal only when its test read returned a number.
@@ -18,6 +18,9 @@
18
18
  * storyOf(state, scopes, { now, days }) → { at, lines: [{ text, sources }] } | null "The story so far" (board AwE): the Narrative's
19
19
  * `now` (one paragraph per line) and its `week` lines of the last `days` days; every line carries the sources of its set
20
20
  * lessonsOf(state) → [{ scope, text, sources, at }] every Lessons line of every scope, newest first (Settings › Claude, AwG2)
21
+ * intentOf(state, scopes) → { scope, fields: { want, limits, not } } the Intent card on the product page (board AwI): the first scope
22
+ * that holds an Intent line, else the first scope with every field empty. A field is { id, text, at, by } | null
23
+ * withLine(current, text) → text an Intent proposal that adds one line: the field's text with the line after it (a line already there is kept once)
21
24
  *
22
25
  * THE LINES. Every line is { v: 1, ev, id, scope, at, by }.
23
26
  * set { artefact, field, text, sources: [{ label, ref }] } a value. A `one` field: the newest set wins. A `list` field: every set is a line.
@@ -274,6 +277,22 @@ function lessonsOf(state) {
274
277
  return out.sort((a, b) => String(b.at).localeCompare(String(a.at)));
275
278
  }
276
279
 
280
+ /** The Intent of a product (board AwI): the first of `scopes` that holds an Intent line. Pure. */
281
+ function intentOf(state, scopes) {
282
+ const L = (scopes || []).filter((sc) => parseScope(sc));
283
+ const pick = (sc) => { const v = viewOf(state, sc); return v && v.artefacts.find((a) => a.key === 'intent'); };
284
+ for (const sc of L) {
285
+ const a = pick(sc);
286
+ if (a && !a.empty && ['want', 'limits', 'not'].some((k) => a.fields[k])) return { scope: parseScope(sc).scope, fields: { want: a.fields.want, limits: a.fields.limits, not: a.fields.not } };
287
+ }
288
+ return L.length ? { scope: parseScope(L[0]).scope, fields: { want: null, limits: null, not: null } } : null;
289
+ }
290
+ /** One line added under an Intent field: the lines already there, then this one. A line already there is not added twice. Pure. */
291
+ function withLine(current, text) {
292
+ const have = String(current || '').split(/\n+/).map((x) => x.trim()).filter(Boolean), t = String(text || '').trim();
293
+ return (have.includes(t) || !t ? have : have.concat(t)).join('\n');
294
+ }
295
+
277
296
  // ── writes ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
278
297
  const refuse = (status, error) => ({ ok: false, status, error });
279
298
  const oneLine = (v, max) => typeof v === 'string' && v.trim().length >= 1 && v.trim().length <= max && !/[\r\n\x00-\x08\x0b-\x1f]/.test(v);
@@ -411,7 +430,7 @@ function migrateRepo(root, { now } = {}) {
411
430
  }
412
431
 
413
432
  module.exports = {
414
- pmEdited, storyOf, lessonsOf,
433
+ pmEdited, storyOf, lessonsOf, intentOf, withLine,
415
434
  LEDGER, EVENTS, ARTEFACTS, KEYS, EXECUTORS, FROM_DOCS, FROM_WHATS, FROM_CADENCES, FROM_LANES,
416
435
  parseScope, targetOfDoc, targetOfWhat, fieldOf, file, readLines, append, fold, viewOf, checkSet, set, undo,
417
436
  planMigration, migrate, migrateRepo, reportDrafts, dirOf, proposalText,
@@ -0,0 +1,94 @@
1
+ 'use strict';
2
+ /* board-goals.js — the Board's "By goal" grouping (agent-run workspace board AwH, agreed by the PM 2026-11-10).
3
+ *
4
+ * goalsFor({ src, budgets, anchors, rows }) → { goals: [goal], of: { <anchor>: <goal key> } } PURE
5
+ * readingOf(record) → { text, at, words } | null a KR metric record's newest reading. PURE
6
+ * readBudgets(root) → [{ id, covers, cap }] | null the workspace's health budget registry
7
+ *
8
+ * A goal is the Goal artefact (D107): derived, never typed. It is a key result of the OKR file (lib/goal-source.js source(), the one goal source)
9
+ * or a health budget of planning/okrs/health-budgets.md (D59: a budget is a goal). Each goal row on the Board says three things:
10
+ * meta the key result's id and whether it has a reading ("KR-A1 · no reading yet"), or a budget's "under its cap" / "over its cap"
11
+ * target what it must reach ("60.2% → ≥ 70% by Dec 2026"), from the OKR file's words; a budget's "20% cap a quarter"
12
+ * from where the reading comes from, or what it waits on ("Reads idpf.pm-os.app once connected"); a budget's "2 of 11 initiatives"
13
+ * Nothing is invented: a key result with no reading says so, and an anchor that names no key result or budget is left out of `of` (the Board
14
+ * puts its rows under "No goal yet").
15
+ *
16
+ * src: lib/goal-source.js source() of the workspace
17
+ * budgets: [{ id, covers, cap }] (lib/insights-goals.js parseBudgets)
18
+ * anchors: the anchors the Board's rows carry (parent_kr): "O-A.KR-A1", "KR-A2", "health:tech"
19
+ * rows: the Board's open rows [{ anchor, status }]: a budget's share is counted from them
20
+ */
21
+ const OG = require('./okr-goals.js');
22
+ const MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
23
+ const fin = (v) => typeof v === 'number' && Number.isFinite(v);
24
+ const r2 = (v) => Math.round(v * 100) / 100;
25
+ const day = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? +m[3] + ' ' + MON[+m[2] - 1] : ''; };
26
+ const cap1 = (s) => String(s || '').charAt(0).toUpperCase() + String(s || '').slice(1);
27
+
28
+ /** The newest reading of a record, as words: "61.4% · 2 Nov". null when it has none. */
29
+ function readingOf(rec) {
30
+ const R = (rec && Array.isArray(rec.readings) ? rec.readings : []).filter((x) => x && fin(x.v));
31
+ if (!R.length) return null;
32
+ const last = R.slice().sort((a, b) => String(a.at || '').localeCompare(String(b.at || ''))).pop();
33
+ const u = String(rec.unit || '').trim();
34
+ const v = u === 'done' ? (last.v >= 1 ? 'done' : 'not done') : r2(last.v) + (u ? (/^[A-Za-z]/.test(u) ? ' ' + u : u) : '');
35
+ return { text: v, at: last.at || null, words: [v, day(last.at)].filter(Boolean).join(' · ') };
36
+ }
37
+
38
+ function krGoal(g) {
39
+ const rec = g.record, read = readingOf(rec);
40
+ const conn = rec && rec.recipe && (rec.recipe.connector || rec.recipe.source);
41
+ const need = g.k.need || '';
42
+ return {
43
+ key: g.key, kind: 'kr', token: g.token, title: cap1(g.title), objective: g.objective || '',
44
+ meta: g.token + ' · ' + (read ? read.words : 'no reading yet'),
45
+ reading: read, target: String(g.k.line || '').replace(/\s*\([^)]*\)/g, '').trim(), // "60.2% (Jun 2026 steady-state) → ≥ 70%" reads "60.2% → ≥ 70%"
46
+ from: read ? (conn ? 'Read from ' + conn : '') : g.k.decision ? 'A decision, read from its record' : conn ? 'Reads ' + conn + ' at its next run' : need ? 'Reads ' + need + ' once connected' : '',
47
+ };
48
+ }
49
+ function budgetGoal(b, rows) {
50
+ const open = (rows || []).filter((r) => r && !['done', 'cancelled'].includes(String(r.status || '').toLowerCase()) && !r.archived);
51
+ const n = open.filter((r) => String(r.anchor || '') === 'health:' + b.id).length, total = open.length;
52
+ const over = total && fin(b.cap) ? n / total > b.cap : false;
53
+ const pct = fin(b.cap) ? Math.round(b.cap * 100) + '%' : '';
54
+ return {
55
+ key: 'health:' + b.id, kind: 'budget', token: 'Health', title: cap1(b.id) + ' health', objective: b.covers || '',
56
+ meta: 'Health · ' + (total ? (over ? 'over its cap' : 'under its cap') : 'no reading yet'),
57
+ reading: total ? { text: Math.round((n / total) * 100) + '%', at: null, words: n + ' of ' + total } : null, over,
58
+ target: pct ? pct + ' cap a quarter' : '', from: total ? n + ' of ' + total + ' initiatives' : '',
59
+ };
60
+ }
61
+
62
+ function goalsFor({ src, budgets, anchors, rows } = {}) {
63
+ const okr = src && src.okr && src.okr.ok ? src.okr.objectives : [];
64
+ const G = (src && src.goals) || [];
65
+ const out = new Map(), of = {};
66
+ for (const a of new Set((anchors || []).map((x) => String(x || '').trim()).filter(Boolean))) {
67
+ const h = /^health:([a-z0-9-]+)$/i.exec(a);
68
+ if (h) {
69
+ const b = (budgets || []).find((x) => x.id === h[1].toLowerCase());
70
+ if (!b) continue;
71
+ if (!out.has('health:' + b.id)) out.set('health:' + b.id, budgetGoal(b, rows));
72
+ of[a] = 'health:' + b.id;
73
+ continue;
74
+ }
75
+ const m = OG.matchAnchor(a, okr);
76
+ if (!m) continue;
77
+ const key = m.o.id + '::' + m.k.id, g = G.find((x) => x.key === key);
78
+ if (!g) continue;
79
+ if (!out.has(key)) out.set(key, krGoal(g));
80
+ of[a] = key;
81
+ }
82
+ return { goals: [...out.values()], of };
83
+ }
84
+
85
+ /** The health budget registry of a workspace (D59): planning/okrs/health-budgets.md, or pmos/planning/okrs/ in a product repository. null when neither reads. */
86
+ function readBudgets(root) {
87
+ const path = require('path'), fs = require('fs'), IG = require('./insights-goals.js');
88
+ for (const f of [path.join(root, 'planning', 'okrs', 'health-budgets.md'), path.join(root, 'pmos', 'planning', 'okrs', 'health-budgets.md')]) {
89
+ try { return IG.parseBudgets(fs.readFileSync(f, 'utf8')); } catch { /* the next place */ }
90
+ }
91
+ return null;
92
+ }
93
+
94
+ module.exports = { goalsFor, readingOf, readBudgets };
@@ -65,8 +65,13 @@ async function writeRecord(p, actor, ctx, now) {
65
65
  // R18 (D107): one field of one of the seven artefacts. Intent is the PM's: an agent's Keep of it is refused and it waits.
66
66
  if (!ctx.root) return refuse(409, 'this repository has no folder for the artefacts');
67
67
  const A = require('./artefacts.js');
68
- const d = p.data || {};
69
- const r = A.set(A.file(A.dirOf(ctx.root)), { scope: d.scope, artefact: d.artefact, field: d.field, text: d.text, sources: p.sources }, actor, { now });
68
+ const d = p.data || {}, f = A.file(A.dirOf(ctx.root));
69
+ let text = d.text;
70
+ if (d.op === 'add') { // board AwI: the line goes under the field's lines as they are when the PM keeps it
71
+ const v = A.viewOf(A.fold(A.readLines(f)), d.scope), a = v && v.artefacts.find((x) => x.key === d.artefact), cur = a && a.fields[d.field];
72
+ text = A.withLine(cur && !Array.isArray(cur) ? cur.text : '', d.text);
73
+ }
74
+ const r = A.set(f, { scope: d.scope, artefact: d.artefact, field: d.field, text, sources: p.sources }, actor, { now });
70
75
  if (!r.ok) return refuse(r.status || 409, r.error);
71
76
  return { ok: true, wrote: 'artefact', undo: { op: 'artefact', ref: r.line.id } };
72
77
  }
@@ -137,6 +142,8 @@ async function autoApply({ file, proposal, actor, ctx = {}, now, stateDir, produ
137
142
  const cls = A.classOfDriver(p.what);
138
143
  const d = A.decide({ stateDir, job: jobOf(p), product, cls, mode: m, undoable: UNDOABLE.has(p.what), now, settingsDir: ctx.settingsDir || null });
139
144
  if (!d.apply) return { applied: false, why: d.why, cls };
145
+ // board AwI: Intent is the PM's; Claude's change to it is a ✦ proposal on the product page and never applies by itself
146
+ if (p.what === 'artefact' && p.data && p.data.artefact === 'intent') return { applied: false, why: 'Intent is the PM\'s, so Claude only proposes', cls };
140
147
  // board AwB: a line of an artefact the PM edited is the PM's now; Claude's change to it waits as a proposal
141
148
  if (p.what === 'artefact' && ctx.root) {
142
149
  const AR = require('./artefacts.js');
@@ -189,10 +189,14 @@ function checkProposal(input) {
189
189
  // R18 (D107): one field of one of the seven artefacts (lib/artefacts.js). Keep writes it to artefacts.jsonl, with Undo.
190
190
  // The scope is this experiment unless data.scope names the portfolio or a board (Intent, Narrative, Lessons).
191
191
  const A = require('./artefacts.js');
192
- const scope = typeof data.scope === 'string' && data.scope ? data.scope : `experiment:${t.target.id}`;
192
+ // Intent (board AwI) is the product's: with no scope it lands on board:<ws>, the scope the product page's Intent card reads first
193
+ const scope = typeof data.scope === 'string' && data.scope ? data.scope : data.artefact === 'intent' ? `board:${t.target.ws}` : `experiment:${t.target.id}`;
193
194
  const c = A.checkSet({ scope, artefact: data.artefact, field: data.field, text: data.text }, { by: 'pm:check' });
194
195
  if (!c.ok) return { ok: false, error: `an artefact proposal: ${c.error}` };
195
- data = { scope: c.line.scope, artefact: c.line.artefact, field: c.line.field, text: c.line.text };
196
+ // board AwI: an Intent proposal may add one line to a field (op: add, "Add a limit: …") instead of replacing the field's words
197
+ if (data.op != null && data.op !== 'add') return { ok: false, error: 'an artefact proposal: op is add, or left out to replace the field' };
198
+ if (data.op === 'add' && /[\r\n]/.test(c.line.text)) return { ok: false, error: 'an artefact proposal: an added line is one line' };
199
+ data = { scope: c.line.scope, artefact: c.line.artefact, field: c.line.field, text: c.line.text, ...(data.op === 'add' ? { op: 'add' } : {}) };
196
200
  } else if (i.what === 'next-step') {
197
201
  if (!oneLine(data.text, 500)) return { ok: false, error: 'a next step needs data.text: one line of up to 500 characters' };
198
202
  if (data.due != null && !(typeof data.due === 'string' && DATE_RE.test(data.due))) return { ok: false, error: 'data.due is YYYY-MM-DD' };
@@ -9,6 +9,14 @@
9
9
  * GET /api/artefacts/lessons → { ok, lessons: [{ ws, product, scope, text, at }] } every product's Lessons, newest first, at most 20
10
10
  * (Settings › Claude, board AwG2)
11
11
  * GET /api/artefacts/map → { ok, artefacts, rows: [{ from, name, artefact, field, note }] } what every older shape became
12
+ * GET /api/artefacts/intent?ws → { ok, ws, intent: { scope, fields: { want, limits, not } }, proposals: [{ id, field, op, text, why, sources, at }] }
13
+ * the Intent card on the product page (board AwI): board:<ws>, else the portfolio. The proposals are
14
+ * Claude's open ✦ changes to it (driver proposals of what `artefact`, artefact `intent`); the PM keeps one
15
+ * with POST /api/driver/keep and declines it with /api/driver/drop. Claude never writes the Intent itself.
16
+ * GET /api/artefacts/goals?ws&a=<anchor>… → { ok, ws, goals: [{ key, kind, token, title, meta, reading, target, from }], of: { anchor: key } }
17
+ * the Board's "By goal" grouping (board AwH): the Goal artefact, derived from the OKR file's key results and
18
+ * the health budgets (lib/board-goals.js). `a` names the anchors of the Board's rows; one the file does not
19
+ * name is left out of `of`.
12
20
  * POST /api/artefacts/set { ws, scope, artefact, field, text } → { ok, line } the PM edits one line from the Viewer (board AwB: "You edit
13
21
  * any line"). A page press (pm-guard requirePagePress); the actor is the PM, so Claude asks before it
14
22
  * changes that line again (lib/artefacts.js pmEdited, lib/driver-decide.js autoApply).
@@ -58,6 +66,33 @@ async function handle(req, res, url, ctx) {
58
66
  out.sort((a, b) => String(b.at).localeCompare(String(a.at)));
59
67
  return send(200, { ok: true, lessons: out.slice(0, 20) });
60
68
  }
69
+ if (sub === 'intent') {
70
+ const w = wsOf(ctx, url.searchParams.get('ws'));
71
+ if (!w || !w.root) return send(404, { ok: false, error: 'no such workspace' });
72
+ let dir;
73
+ try { dir = A.dirOf(w.root); } catch (e) { return send(409, { ok: false, error: String((e && e.message) || e) }); }
74
+ const scopes = (A.parseScope('board:' + w.id) ? ['board:' + w.id] : []).concat('portfolio');
75
+ const intent = A.intentOf(A.fold(A.readLines(A.file(dir))), scopes);
76
+ const D = require('./driver.js');
77
+ let open = [];
78
+ try { const f = D.ledgerFile(ctx.stateDirFor ? ctx.stateDirFor(w) : null); open = f ? D.openProposals(D.fold(D.readLines(f))) : []; } catch { open = []; }
79
+ const here = new Set(scopes.map((sc) => A.parseScope(sc).scope));
80
+ const proposals = open.filter((p) => p.what === 'artefact' && p.target.ws === w.id && p.data && p.data.artefact === 'intent' && here.has(p.data.scope))
81
+ .map((p) => ({ id: p.id, field: p.data.field, op: p.data.op === 'add' ? 'add' : 'set', text: p.data.text, why: p.why || '', sources: p.sources || [], at: p.at || null }));
82
+ const fields = intent ? Object.fromEntries(Object.entries(intent.fields).map(([k, v]) => [k, pageBy(v)])) : null;
83
+ return send(200, { ok: true, ws: w.id, intent: intent ? { scope: intent.scope, fields } : null, proposals });
84
+ }
85
+ if (sub === 'goals') {
86
+ const w = wsOf(ctx, url.searchParams.get('ws'));
87
+ if (!w || !w.root) return send(404, { ok: false, error: 'no such workspace' });
88
+ const BG = require('./board-goals.js');
89
+ const anchors = url.searchParams.getAll('a').slice(0, 200);
90
+ let src = null;
91
+ try { src = require('./goal-source.js').source({ root: w.root, recordsDir: require('./records-dir.js').recordsDirFor(ctx, w.id) }); } catch { src = null; }
92
+ const rows = anchors.map((anchor) => ({ anchor })); // a budget's share: of the open rows the Board named
93
+ const r = BG.goalsFor({ src, budgets: BG.readBudgets(w.root) || [], anchors, rows });
94
+ return send(200, { ok: true, ws: w.id, goals: r.goals, of: r.of });
95
+ }
61
96
  if (sub === 'story') {
62
97
  const w = wsOf(ctx, url.searchParams.get('ws'));
63
98
  if (!w || !w.root) return send(404, { ok: false, error: 'no such workspace' });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.549.0",
3
+ "version": "0.551.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.549.0",
9
+ "version": "0.551.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@anthropic-ai/sdk": "^1.3.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.549.0",
3
+ "version": "0.551.0",
4
4
  "private": true,
5
5
  "description": "PMOS Terminal Workspace — local companion hosting real PTYs beside the library and gates (D62)",
6
6
  "license": "MIT",
@@ -193,7 +193,10 @@ function filterHtml() {
193
193
  const chip = (k, v, label) => `<button type="button" class="bd-chip${F[k].has(v) ? ' on' : ''}" data-flt="${k}" data-v="${esc(v)}" aria-pressed="${F[k].has(v)}">${label || esc(v)}</button>`;
194
194
  // the grouping (PgBoard, PgBoardProduct): programs first by default; a desktop has its own Group button, a phone has it here
195
195
  const G = A.grouping ? A.grouping() : null;
196
- const grp = G && G.on ? `<p class="bd-mlbl">Group</p><div class="bd-fg" role="radiogroup" aria-label="Group">${[['program', 'Programs first'], ['product', 'By product']].map(([k, n]) => `<button type="button" class="bd-chip${(k === 'product') === G.byProduct ? ' on' : ''}" role="radio" aria-checked="${(k === 'product') === G.byProduct}" data-fgrp="${k}">${n}</button>`).join('')}</div>` : '';
196
+ // board AwH: By goal groups the Track under each goal its initiatives anchor to; it shows when a goal resolves for a row here
197
+ const gopts = G ? [...(G.on ? [['program', 'Programs first'], ['product', 'By product']] : G.goal ? [['product', 'By product']] : []), ...(G.goal ? [['goal', 'By goal']] : [])] : [];
198
+ const gnow = G ? G.by || (G.byProduct ? 'product' : 'program') : '';
199
+ const grp = gopts.length > 1 ? `<p class="bd-mlbl">Group</p><div class="bd-fg" role="radiogroup" aria-label="Group">${gopts.map(([k, n]) => `<button type="button" class="bd-chip${k === gnow ? ' on' : ''}" role="radio" aria-checked="${k === gnow}" data-fgrp="${k}">${n}</button>`).join('')}</div>` : '';
197
200
  // a phone's tune sheet (batch 28 item 3, canvas BhA): Group, Sort, the filters, then the Jira read. A desktop has Group and Sort as buttons
198
201
  const T = A.tune ? A.tune() : null;
199
202
  const so = A.sprintOnly ? A.sprintOnly() : null;
@@ -372,7 +375,7 @@ document.addEventListener('click', async (e) => {
372
375
  if (!A || !M()) return;
373
376
  const t = e.target;
374
377
  const fl = t.closest('[data-flt]'); if (fl && Pop.isOpen() && Pop.el().contains(fl)) { const S = A.F[fl.dataset.flt], v = fl.dataset.v; if (S.has(v)) S.delete(v); else S.add(v); Pop.redraw(filterHtml()); A.redraw(); return; }
375
- const fg = t.closest('[data-fgrp]'); if (fg && Pop.isOpen() && Pop.el().contains(fg)) { A.setGrouping(fg.dataset.fgrp === 'product'); Pop.redraw(filterHtml()); return; }
378
+ const fg = t.closest('[data-fgrp]'); if (fg && Pop.isOpen() && Pop.el().contains(fg)) { A.setGrouping(fg.dataset.fgrp); Pop.redraw(filterHtml()); return; }
376
379
  if (t.closest('[data-fsonly]') && Pop.isOpen() && Pop.el().contains(t)) { A.toggleSprintOnly(); Pop.redraw(filterHtml()); A.redraw(); return; }
377
380
  const sk = t.closest('[data-so-pick]'); if (sk && Pop.isOpen() && Pop.el().contains(sk)) { await A.sortPick(sk.dataset.soPick); if (Pop.isOpen()) Pop.redraw(filterHtml()); const b = Pop.isOpen() && Pop.el().querySelector(`[data-so-pick="${sk.dataset.soPick}"]`); if (b) b.focus(); return; }
378
381
  if (t.closest('[data-jread]') && Pop.isOpen() && Pop.el().contains(t)) { Pop.close(false); A.refreshJira(); return; }
@@ -0,0 +1,61 @@
1
+ /* pm/bd-goal.js — the Board's "By goal" grouping (agent-run workspace board AwH, agreed by the PM 2026-11-10).
2
+ *
3
+ * readGoals(ws, rows) → Promise<{ goals, of } | null> GET /api/artefacts/goals: the Goal artefact of each anchor the rows carry (D107, derived)
4
+ * goalGroups(rows, R) → [{ key, goal, rows }] | null PURE. The rows under each goal, key results in the file's order, then the health budgets,
5
+ * then "No goal yet". null when no row's anchor names a goal (zero is silence)
6
+ * goalHeadHtml(g, o) → the Track's goal row: the goal icon, its name, "KR-A1 · no reading yet", the spread of its initiatives over the steps,
7
+ * and in the Next column its target and where the reading comes from. o: { steps, plain, open }
8
+ *
9
+ * A goal is never typed here: it is read from the OKR file and the health budgets (lib/board-goals.js). The stages stay derived. */
10
+ import { pmGet } from './http.js';
11
+
12
+ const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
13
+ const SV = (d, n) => `<svg viewBox="0 0 24 24" aria-hidden="true"${n ? ` width="${n}" height="${n}"` : ''}><path d="${d}"/></svg>`;
14
+ const TARGET = 'M12 4a8 8 0 1 0 0 16a8 8 0 0 0 0-16zM12 8.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 0 0 0-7z';
15
+ const CHEV_D = 'M7 10l5 5 5-5', CHEV_R = 'M10 7l5 5-5 5';
16
+ const plural = (n, a, b) => (n === 1 ? a : b);
17
+ const NONE = 'goal:none';
18
+
19
+ const CACHE = new Map(); // ws|anchors → { goals, of }
20
+ /** Each open row's anchor goes once per row, so a budget's share counts the rows. */
21
+ export async function readGoals(ws, rows) {
22
+ const A = (rows || []).filter((r) => r && !r.ended).map((r) => String(r.anchor || ''));
23
+ const key = (ws || '') + '|' + A.join(',');
24
+ if (CACHE.has(key)) return CACHE.get(key);
25
+ const q = new URLSearchParams(); if (ws) q.set('ws', ws); for (const a of A) q.append('a', a);
26
+ const r = await pmGet('/api/artefacts/goals?' + q.toString()).catch(() => null);
27
+ const v = r && r.ok ? { goals: r.goals || [], of: r.of || {} } : null;
28
+ if (v) CACHE.set(key, v);
29
+ return v;
30
+ }
31
+
32
+ export function goalGroups(rows, R) {
33
+ if (!R || !(R.goals || []).length) return null;
34
+ const by = new Map(R.goals.map((g) => [g.key, { key: 'goal:' + g.key, goal: g, rows: [] }]));
35
+ const none = { key: NONE, goal: null, rows: [] };
36
+ for (const r of rows || []) { const k = (R.of || {})[String(r.anchor || '')]; (k && by.has(k) ? by.get(k) : none).rows.push(r); }
37
+ const G = [...by.values()].filter((g) => g.rows.length);
38
+ if (!G.length) return null;
39
+ G.sort((a, b) => (a.goal.kind === 'budget') - (b.goal.kind === 'budget') || String(a.goal.key).localeCompare(String(b.goal.key)));
40
+ return none.rows.length ? G.concat(none) : G;
41
+ }
42
+
43
+ /** The goal's fold, as the program and product heads fold (pm/bd-prog.js fold, data-fold). */
44
+ export function goalHeadHtml(g, o = {}) {
45
+ const x = g.goal, open = o.open !== false, steps = o.steps || [], N = steps.length || 8;
46
+ const pc = (n) => ((n / N) * 100).toFixed(3) + '%';
47
+ const ks = g.rows.map((r) => (r.track && Number.isInteger(r.track.k) ? r.track.k : -1)).filter((k) => k >= 0);
48
+ const lo = ks.length ? Math.min(...ks) : -1, hi = ks.length ? Math.max(...ks) : -1, n = g.rows.length;
49
+ const name = (k) => (steps[k] && (steps[k].label || steps[k].name)) || '';
50
+ const words = n + ' ' + plural(n, 'initiative', 'initiatives') + (lo >= 0 && !o.plain ? ', ' + (lo === hi ? name(lo) : name(lo) + ' to ' + name(hi)) : '');
51
+ const band = lo >= 0 && !o.plain ? `<span class="bd-spb" style="left:calc(${pc(lo)} + 4px);width:calc(${pc(hi - lo + 1)} - 8px)"></span>` : '';
52
+ const lab = `<span class="bd-spl" style="left:calc(${pc(lo >= 0 && !o.plain ? lo : 0)} + 14px)">${esc(words)}</span>`;
53
+ const title = x ? x.title : 'No goal yet';
54
+ const meta = x ? x.meta : 'Claude anchors each one to a goal';
55
+ const dl = x ? `<div class="bd-pm"><b>${esc(x.target || '')}</b></div>${x.from ? `<div class="t3">${esc(x.from)}</div>` : ''}` : '';
56
+ return `<div class="bt-r bt-pg bt-goal${x && x.over ? ' over' : ''}" role="row" data-goal="${esc(g.key)}">`
57
+ + `<div class="bt-pgn" role="rowheader"><span class="bt-pgo bt-gln" title="${esc(x && x.objective ? x.objective : title)}"><span class="bd-pti">${SV(TARGET)}</span><span class="tt"><b>${esc(title)}</b><span class="m">${esc(meta)}</span></span></span>`
58
+ + `<button type="button" class="bd-ib sm bd-fold" data-fold="${esc(g.key)}" aria-expanded="${open}" aria-label="${open ? 'Fold' : 'Show'} ${esc(title)}" title="${open ? 'Fold' : 'Show'}">${SV(open ? CHEV_D : CHEV_R)}</button></div>`
59
+ + `<div class="bt-spread" role="cell">${band}${lab}</div>`
60
+ + `<div class="bt-dl" role="cell">${dl}</div></div>`;
61
+ }