create-pmos 0.467.0 → 0.469.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.467.0",
3
+ "version": "0.469.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": {
@@ -32,6 +32,32 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.469.0",
37
+ "at": "2026-10-31T10:43:44.457Z",
38
+ "f": 3,
39
+ "prs": [
40
+ {
41
+ "n": 1122,
42
+ "t": "Build and upload the Board's code for the host (board-publish slice 3, H6)",
43
+ "s": "Build and upload the Board's code for the host (board-publish slice 3, H6)",
44
+ "k": "new"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "v": "0.468.0",
50
+ "at": "2026-10-31T09:41:17.517Z",
51
+ "f": 3,
52
+ "prs": [
53
+ {
54
+ "n": 1121,
55
+ "t": "Slice 2 backend and the central host Worker (boards.pm-os.app)",
56
+ "s": "Slice 2 backend and the central host Worker (boards.pm-os.app)",
57
+ "k": "new"
58
+ }
59
+ ]
60
+ },
35
61
  {
36
62
  "v": "0.467.0",
37
63
  "at": "2026-10-31T08:49:40.991Z",
@@ -271,32 +297,6 @@
271
297
  "k": "new"
272
298
  }
273
299
  ]
274
- },
275
- {
276
- "v": "0.449.0",
277
- "at": "2026-10-29T08:24:22.196Z",
278
- "f": 3,
279
- "prs": [
280
- {
281
- "n": 1095,
282
- "t": "The blue Adler — replace the drawn SVG Adler with the 103-PNG set",
283
- "s": "The blue Adler — replace the drawn SVG Adler with the 103-PNG set",
284
- "k": "new"
285
- }
286
- ]
287
- },
288
- {
289
- "v": "0.448.0",
290
- "at": "2026-10-29T07:52:37.467Z",
291
- "f": 3,
292
- "prs": [
293
- {
294
- "n": 1094,
295
- "t": "Forecast range bar on Intelligence goal rows",
296
- "s": "Forecast range bar on Intelligence goal rows",
297
- "k": "new"
298
- }
299
- ]
300
300
  }
301
301
  ]
302
302
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@3de20095
1
+ kernel-source: pmos@b46a27ee
2
2
  assembled: 2026-10-31
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-10-31T08:49:37Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-31T10:43:41Z"}
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-10-31T08:49:37Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-31T10:43:41Z"}
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-10-31T08:49:37Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-31T10:43:41Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.469.0",
4
+ "at": "2026-10-31T10:43:44.457Z",
5
+ "f": 3,
6
+ "prs": [
7
+ {
8
+ "n": 1122,
9
+ "t": "Build and upload the Board's code for the host (board-publish slice 3, H6)",
10
+ "s": "Build and upload the Board's code for the host (board-publish slice 3, H6)",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.468.0",
17
+ "at": "2026-10-31T09:41:17.517Z",
18
+ "f": 3,
19
+ "prs": [
20
+ {
21
+ "n": 1121,
22
+ "t": "Slice 2 backend and the central host Worker (boards.pm-os.app)",
23
+ "s": "Slice 2 backend and the central host Worker (boards.pm-os.app)",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.467.0",
4
30
  "at": "2026-10-31T08:49:40.991Z",
@@ -0,0 +1,137 @@
1
+ 'use strict';
2
+ /* boards-host.js — the workspace's side of publishing a board to the central host (initiative board-publish, slice 2; D103; PRD P4, P5).
3
+ *
4
+ * THE CONTRACT with the host (slice 3 builds the other side; the tests here use a stand-in that follows it):
5
+ * POST <host>/api/publish Authorization: Bearer <publish key> { team, name, kind, by, days, password, pack } -> { ok, id, url, ends }
6
+ * POST <host>/api/republish Authorization: Bearer <publish key> { id, pack } -> { ok, ends }
7
+ * DELETE <host>/api/links/<id> Authorization: Bearer <publish key> -> { ok }
8
+ * The host answers a refusal as { ok: false, error } with a plain sentence. It makes the link id; the workspace never does.
9
+ *
10
+ * THE PUBLISH KEY. Made here, once, on the first publish: 32 random bytes. It is kept in <runtime state>/board-publish/state.json (mode 0600)
11
+ * and sent only to the host as the bearer. It is never returned to the browser, never logged, never written to a record (D08).
12
+ * The host holds the key's hash; a key can publish and remove its own links only.
13
+ *
14
+ * THE LINKS. state.json also keeps, for each open link: { id, url, team, name, kind, selection, ws, board, by, made, ends, views }. The link's
15
+ * password is NOT kept: it is shown once at publish. Republish keeps the same link and password (the host owns it).
16
+ *
17
+ * THE HOST ADDRESS comes from PMOS_BOARDS_HOST (an https origin; plain http only for 127.0.0.1 and localhost, for tests). Unset, nothing is sent.
18
+ *
19
+ * hostOrigin(env) -> string | null
20
+ * readState(dir) · links(dir) -> the state | the links newest first (ended ones dropped)
21
+ * publish(dir, o, { fetch, env, now }) o = { pack, team, name, kind, by, days, password, selection, ws, board } -> { ok, id, url, ends } | { ok: false, error, status }
22
+ * republish(dir, id, pack, { fetch, env, now }) -> { ok, ends } | { ok: false, error }
23
+ * turnOff(dir, id, { fetch, env }) -> { ok } | { ok: false, error }
24
+ */
25
+ const fs = require('fs');
26
+ const path = require('path');
27
+ const crypto = require('crypto');
28
+
29
+ const DAYS = [1, 7, 30];
30
+ const ID_RX = /^[A-Za-z0-9_-]{8,64}$/;
31
+ const TEAM_RX = /^[A-Za-z0-9][A-Za-z0-9 ._-]{0,39}$/;
32
+ const MAX_PACK = 2 * 1024 * 1024;
33
+ const TIMEOUT_MS = 20000;
34
+
35
+ const fileOf = (dir) => path.join(dir, 'board-publish', 'state.json');
36
+
37
+ function hostOrigin(env = process.env) {
38
+ const raw = String((env && env.PMOS_BOARDS_HOST) || '').trim().replace(/\/+$/, '');
39
+ if (!raw) return null;
40
+ let u; try { u = new URL(raw); } catch { return null; }
41
+ const local = u.hostname === '127.0.0.1' || u.hostname === 'localhost';
42
+ if (u.protocol !== 'https:' && !(u.protocol === 'http:' && local)) return null;
43
+ if (u.username || u.password || (u.pathname && u.pathname !== '/') || u.search || u.hash) return null;
44
+ return u.origin;
45
+ }
46
+
47
+ function readState(dir) {
48
+ try { const s = JSON.parse(fs.readFileSync(fileOf(dir), 'utf8')); return { key: typeof s.key === 'string' ? s.key : null, links: Array.isArray(s.links) ? s.links : [] }; }
49
+ catch { return { key: null, links: [] }; }
50
+ }
51
+ function writeState(dir, st) {
52
+ const f = fileOf(dir);
53
+ fs.mkdirSync(path.dirname(f), { recursive: true, mode: 0o700 });
54
+ const tmp = f + '.' + process.pid + '.' + crypto.randomBytes(4).toString('hex') + '.tmp';
55
+ fs.writeFileSync(tmp, JSON.stringify(st), { mode: 0o600 });
56
+ fs.renameSync(tmp, f);
57
+ }
58
+ function links(dir, now = Date.now()) {
59
+ return readState(dir).links.filter((l) => !l.ends || Date.parse(l.ends) > now).sort((a, b) => String(b.made).localeCompare(String(a.made)));
60
+ }
61
+
62
+ /** One request to the host. Never throws; the answer is { ok, status, body } or { ok: false, error }. */
63
+ async function call(origin, method, p, key, body, fetchFn) {
64
+ const f = fetchFn || (typeof fetch === 'function' ? fetch : null);
65
+ if (!f) return { ok: false, error: 'This computer cannot reach the host (no network client).' };
66
+ const ctl = typeof AbortController === 'function' ? new AbortController() : null;
67
+ const timer = ctl ? setTimeout(() => ctl.abort(), TIMEOUT_MS) : null;
68
+ try {
69
+ const res = await f(origin + p, {
70
+ method, redirect: 'error', signal: ctl ? ctl.signal : undefined,
71
+ headers: Object.assign({ Authorization: 'Bearer ' + key, Accept: 'application/json' }, body ? { 'Content-Type': 'application/json' } : {}),
72
+ body: body ? JSON.stringify(body) : undefined,
73
+ });
74
+ let j = null; try { j = await res.json(); } catch { /* not JSON */ }
75
+ if (!res.ok || !j || j.ok === false) return { ok: false, status: res.status, error: (j && typeof j.error === 'string' && j.error.slice(0, 240)) || 'The host refused the request (' + res.status + ').' };
76
+ return { ok: true, status: res.status, body: j };
77
+ } catch (e) {
78
+ return { ok: false, error: e && e.name === 'AbortError' ? 'The host did not answer in time. Try again.' : 'The host could not be reached. Check the connection and try again.' };
79
+ } finally { if (timer) clearTimeout(timer); }
80
+ }
81
+
82
+ const noHost = { ok: false, status: 409, error: 'Publishing needs the central host. Set PMOS_BOARDS_HOST to its address, then try again.' };
83
+
84
+ async function publish(dir, o, opts = {}) {
85
+ const origin = hostOrigin(opts.env);
86
+ if (!origin) return noHost;
87
+ const days = Number(o.days);
88
+ if (!DAYS.includes(days)) return { ok: false, status: 400, error: 'Ends in 1, 7 or 30 days.' };
89
+ const team = String(o.team || '').trim();
90
+ if (team && !TEAM_RX.test(team)) return { ok: false, status: 400, error: 'A team name is letters, numbers, spaces, dots, dashes and underscores, up to 40.' };
91
+ const pw = o.password == null ? '' : String(o.password);
92
+ if (pw && (pw.length < 6 || pw.length > 100)) return { ok: false, status: 400, error: 'A password is 6 to 100 characters.' };
93
+ if (!o.pack || typeof o.pack !== 'object') return { ok: false, status: 400, error: 'There is nothing to publish.' };
94
+ if (Buffer.byteLength(JSON.stringify(o.pack)) > MAX_PACK) return { ok: false, status: 400, error: 'This selection is over 2 MB. Pick fewer items.' };
95
+ const st = readState(dir);
96
+ if (!st.key) { st.key = crypto.randomBytes(32).toString('base64url'); writeState(dir, st); }
97
+ const r = await call(origin, 'POST', '/api/publish', st.key, { team, name: String(o.name || '').slice(0, 120), kind: o.kind, by: String(o.by || '').slice(0, 60), days, password: pw, pack: o.pack }, opts.fetch);
98
+ if (!r.ok) return r;
99
+ const b = r.body;
100
+ if (!b.id || !ID_RX.test(String(b.id)) || typeof b.url !== 'string' || !b.url.startsWith(origin + '/')) return { ok: false, status: 502, error: 'The host sent an answer this workspace does not accept.' };
101
+ const now = new Date(opts.now || Date.now()).toISOString();
102
+ const cur = readState(dir);
103
+ cur.key = st.key;
104
+ cur.links = cur.links.filter((l) => l.id !== b.id).concat([{ id: b.id, url: b.url, team, name: String(o.name || ''), kind: o.kind, selection: o.selection || [], ws: o.ws || '', board: o.board || '', by: String(o.by || ''), made: now, ends: b.ends || null, views: 0 }]);
105
+ writeState(dir, cur);
106
+ return { ok: true, id: b.id, url: b.url, ends: b.ends || null };
107
+ }
108
+
109
+ async function republish(dir, id, pack, opts = {}) {
110
+ const origin = hostOrigin(opts.env);
111
+ if (!origin) return noHost;
112
+ const st = readState(dir);
113
+ const l = st.links.find((x) => x.id === id);
114
+ if (!st.key || !l) return { ok: false, status: 404, error: 'This link is not one of yours.' };
115
+ if (!pack || typeof pack !== 'object') return { ok: false, status: 400, error: 'There is nothing to publish.' };
116
+ if (Buffer.byteLength(JSON.stringify(pack)) > MAX_PACK) return { ok: false, status: 400, error: 'This selection is over 2 MB. Pick fewer items.' };
117
+ const r = await call(origin, 'POST', '/api/republish', st.key, { id, pack }, opts.fetch);
118
+ if (!r.ok) return r;
119
+ l.made = new Date(opts.now || Date.now()).toISOString(); if (r.body.ends) l.ends = r.body.ends;
120
+ writeState(dir, st);
121
+ return { ok: true, ends: l.ends || null };
122
+ }
123
+
124
+ async function turnOff(dir, id, opts = {}) {
125
+ const origin = hostOrigin(opts.env);
126
+ if (!origin) return noHost;
127
+ const st = readState(dir);
128
+ const l = st.links.find((x) => x.id === id);
129
+ if (!st.key || !l) return { ok: false, status: 404, error: 'This link is not one of yours.' };
130
+ const r = await call(origin, 'DELETE', '/api/links/' + encodeURIComponent(id), st.key, null, opts.fetch);
131
+ // a copy the host no longer has is gone either way: forget it here too
132
+ if (!r.ok && r.status !== 404) return r;
133
+ st.links = st.links.filter((x) => x.id !== id); writeState(dir, st);
134
+ return { ok: true };
135
+ }
136
+
137
+ module.exports = { DAYS, TEAM_RX, MAX_PACK, hostOrigin, readState, links, publish, republish, turnOff };
@@ -58,6 +58,7 @@ const MODULES = Object.freeze([
58
58
  'routes-home-review', // premium-uncovered-features (Home): the weekly review's four steps and the untouched work looked at (page press; file mode)
59
59
  'routes-initiative-premium', // briefing-premium-initiative: the premium initiative page's model from the Initiatives sheet's own routes (read-only)
60
60
  'routes-initiative-layout', // premium-uncovered-features (Initiative): Moves on by itself, held stages, task groups and saved group sets (page press; file mode)
61
+ 'routes-board-publish', // board-publish slice 2 (D103): publish a board to the central host, republish, turn off (page press; the host is never given a way in)
61
62
  'routes-programs', // program-hierarchy: programs above initiatives across products, their members, tasks and milestones (page press; file mode)
62
63
  'routes-brief-page', // console3 Briefing as the brief: Today agenda, Needs you and Mentions (read-only; writes go through routes-pm-items)
63
64
  'routes-mentions', // console3 Briefing Mentions: the PM's read marks (page press only)
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+ /* routes-board-publish.js — publish a board to the central host from the workspace (initiative board-publish, slice 2; D103; PRD P1 to P5).
3
+ *
4
+ * GET /api/board-publish -> { ok, host, days, links } a read: whether a host is set, the choices, the open links (never the key)
5
+ * POST /api/board-publish { ws, board, select, team, password, days, shared_by } -> { ok, id, url, ends }
6
+ * POST /api/board-publish/republish { id } -> { ok, ends } the same selection, as the board is now; same link, same password
7
+ * POST /api/board-publish/off { id } -> { ok } the host deletes the copy at once
8
+ *
9
+ * EVERY POST IS A PAGE PRESS (pm-guard requirePagePress): only a press on the page publishes, not a request an agent session makes (PRD P2, D97 S3).
10
+ * THE SECRET SCAN runs on the finished pack before anything leaves (P3): a hit blocks the publish and the answer names the rule, never the text (D08).
11
+ * THE PACK is made by lib/board-pack-route.js from the Board's own answers, then sent by lib/boards-host.js. The workspace adds no write route that
12
+ * the host can call: the host never reaches this server. */
13
+ const crypto = require('crypto');
14
+ const fs = require('fs');
15
+ const path = require('path');
16
+ const guard = require('./pm-guard.js');
17
+ const Host = require('./boards-host.js');
18
+ const shareStore = require('./share-store.js');
19
+ const secretScan = require('./secret-scan.js');
20
+
21
+ const PUBLIC = path.join(__dirname, '..', 'public');
22
+ let versionMemo = null;
23
+ /** The Board's version for a pack: the host serves the Board's code under it (PRD H6, immutable for a year), so it must change when ANY file the Board loads
24
+ * changes. It is a hash of the page and every file under public/pm, public/vendor and public/icons. Computed once per server run. */
25
+ function viewerVersion() {
26
+ if (versionMemo) return versionMemo;
27
+ try {
28
+ const h = crypto.createHash('sha256');
29
+ const walk = (d, rel) => fs.readdirSync(d, { withFileTypes: true }).sort((a, b) => (a.name < b.name ? -1 : 1)).forEach((e) => {
30
+ const r = rel + '/' + e.name; if (e.isDirectory()) return walk(path.join(d, e.name), r);
31
+ if (e.isFile()) { h.update(r + '\0'); h.update(fs.readFileSync(path.join(d, e.name))); }
32
+ });
33
+ h.update('premium-board.html\0'); h.update(fs.readFileSync(path.join(PUBLIC, 'premium-board.html')));
34
+ for (const dir of ['pm', 'vendor', 'icons']) { try { walk(path.join(PUBLIC, dir), '/' + dir); } catch { /* a folder this checkout does not have */ } }
35
+ versionMemo = 'v' + h.digest('hex').slice(0, 12);
36
+ } catch { versionMemo = 'v0'; }
37
+ return versionMemo;
38
+ }
39
+
40
+ /** The data pack of a selection, from the Board's own route. { ok, pack } | { ok: false, status, error } */
41
+ async function makePack(req, ctx, q) {
42
+ let out = { status: 500, body: null };
43
+ const c = Object.assign({}, ctx, { json: (res, obj, code) => { out = { status: code || 200, body: obj }; } });
44
+ const u = new URL('http://local/api/board-pack');
45
+ for (const [k, v] of Object.entries(q)) if (v != null && v !== '') u.searchParams.set(k, String(v));
46
+ await require('./board-pack-route.js').handle({ method: 'GET', headers: (req && req.headers) || {} }, {}, u, c);
47
+ if (out.status === 202) return { ok: false, status: 202, error: 'The board is still being read. Try again in a moment.' };
48
+ if (!out.body || out.body.ok === false || !out.body.pack) return { ok: false, status: out.status === 200 ? 502 : out.status, error: (out.body && out.body.error) || 'The board could not be read.' };
49
+ return { ok: true, pack: out.body.pack };
50
+ }
51
+
52
+ const kindOf = (pack) => (pack && pack.scope && pack.scope.kind) || 'multi';
53
+ const stateDir = (ctx) => ctx.runtimeDir;
54
+
55
+ module.exports = {
56
+ viewerVersion,
57
+ prefixes: ['/api/board-publish'],
58
+ handle: async (req, res, url, ctx) => {
59
+ const p = url.pathname;
60
+ if (p !== '/api/board-publish' && p !== '/api/board-publish/republish' && p !== '/api/board-publish/off') return false;
61
+ const send = (obj, code) => { ctx.json(res, obj, code); return true; };
62
+ const dir = stateDir(ctx);
63
+ if (!dir) return send({ ok: false, error: 'No state folder.' }, 500);
64
+
65
+ if (req.method === 'GET' && p === '/api/board-publish') {
66
+ const origin = Host.hostOrigin();
67
+ return send({ ok: true, host: origin ? new URL(origin).host : null, days: Host.DAYS, password: shareStore.newPassword(), links: Host.links(dir).map((l) => ({ id: l.id, url: l.url, team: l.team, name: l.name, kind: l.kind, by: l.by, made: l.made, ends: l.ends, views: l.views })) });
68
+ }
69
+ if (req.method !== 'POST') return send({ ok: false, error: 'GET or POST only' }, 405);
70
+
71
+ let body = {};
72
+ try { body = JSON.parse((await ctx.readBody(req)) || '{}'); } catch { return send({ ok: false, error: 'invalid JSON body' }, 400); }
73
+ const g = guard.requirePagePress(req, body);
74
+ if (!g.ok) return send({ ok: false, error: g.error }, g.status);
75
+ // D103 point 6 and PRD P2: a copy leaves this computer only on a press by the person. D98 lets an agent session take PM-only acts; this one it does not.
76
+ if (g.actor && /^agent/.test(String(g.actor.by || ''))) return send({ ok: false, error: 'Publishing is a press on the page. An agent session cannot publish, republish or turn off a board.' }, 403);
77
+
78
+ if (p === '/api/board-publish/off') {
79
+ const r = await Host.turnOff(dir, String(body.id || ''));
80
+ return send(r.ok ? { ok: true } : { ok: false, error: r.error }, r.ok ? 200 : (r.status || 502));
81
+ }
82
+
83
+ // publish and republish both make a pack, scan it, then send it
84
+ const now = Date.now();
85
+ let sel; let meta;
86
+ if (p === '/api/board-publish/republish') {
87
+ const l = Host.readState(dir).links.find((x) => x.id === String(body.id || ''));
88
+ if (!l) return send({ ok: false, error: 'This link is not one of yours.' }, 404);
89
+ sel = { ws: l.ws, board: l.board, select: (l.selection || []).map((s) => s.kind + ':' + s.id).join(','), by: l.by, ends: l.ends };
90
+ meta = l;
91
+ } else {
92
+ const days = Number(body.days);
93
+ if (!Host.DAYS.includes(days)) return send({ ok: false, error: 'Ends in 1, 7 or 30 days.' }, 400);
94
+ sel = { ws: body.ws, board: body.board || body.ws, select: Array.isArray(body.select) ? body.select.map((s) => s.kind + ':' + s.id).join(',') : String(body.select || ''), by: String(body.shared_by || '').slice(0, 60), ends: new Date(now + days * 86400000).toISOString() };
95
+ }
96
+ const pk = await makePack(req, ctx, Object.assign({}, sel, { at: new Date(now).toISOString(), viewer: viewerVersion() }));
97
+ if (!pk.ok) return send({ ok: false, error: pk.error }, pk.status || 502);
98
+ const hits = secretScan.scan(JSON.stringify(pk.pack));
99
+ if (hits.length) return send({ ok: false, error: 'This board holds what looks like a secret (' + hits.join(', ') + '). Remove it, then publish again.', secrets: hits }, 422);
100
+
101
+ if (p === '/api/board-publish/republish') {
102
+ const r = await Host.republish(dir, meta.id, pk.pack);
103
+ return send(r.ok ? { ok: true, ends: r.ends } : { ok: false, error: r.error }, r.ok ? 200 : (r.status || 502));
104
+ }
105
+ const selection = Array.isArray(body.select) ? body.select.map((s) => ({ kind: String(s.kind), id: String(s.id) })) : String(body.select || '').split(',').filter(Boolean).map((s) => ({ kind: s.slice(0, s.indexOf(':')), id: s.slice(s.indexOf(':') + 1) }));
106
+ const r = await Host.publish(dir, { pack: pk.pack, team: body.team, name: pk.pack.scope.label, kind: kindOf(pk.pack), by: sel.by, days: Number(body.days), password: body.password == null ? '' : body.password, selection, ws: sel.ws, board: sel.board });
107
+ return send(r.ok ? { ok: true, id: r.id, url: r.url, ends: r.ends } : { ok: false, error: r.error }, r.ok ? 200 : (r.status || 502));
108
+ },
109
+ };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.467.0",
3
+ "version": "0.469.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.467.0",
9
+ "version": "0.469.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.467.0",
3
+ "version": "0.469.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",
@@ -168,6 +168,7 @@ const WIDE = new Set([
168
168
  * functions that use it. Anything else (top-level setup, middleware between route blocks, a page route, a name used
169
169
  * outside any function or route block) reaches every suite.
170
170
  * - lib/routes-<x>.js (a route module that lib/route-modules.js loads): every '/api/…' route the file names.
171
+ * - lib/route-modules.js, when the diff only adds module names to its list: what each added lib/routes-<x>.js reaches. Any other change to it is the rule below.
171
172
  * - Any other file: the files that name it (a require, an import or a path string), followed the same way: server.js
172
173
  * through the names it binds the module to, a lib/ file through its own users, a suite directly. A lib/ file that no
173
174
  * file names reaches every suite.
@@ -456,6 +457,10 @@ function traceChanges(changes, ctx) {
456
457
  if (picked.size === before) why = `no suite names ${f}, which this change removes`;
457
458
  } else if (f === 'server.js') why = lines ? serverLines(lines) : 'the diff of server.js could not be read';
458
459
  else if (/^lib\/routes-/.test(f)) why = routeModule(f);
460
+ else if (f === 'lib/route-modules.js' && lines && lines.length && lines.every((n) => /^\s*'routes-[\w-]+',?\s*(\/\/.*)?$/.test((get(f).split('\n')[n - 1]) || ''))) {
461
+ // only module names were added to the list: each reaches what its own file reaches, as if that file had changed
462
+ for (const n of lines) { const m = /'(routes-[\w-]+)'/.exec(get(f).split('\n')[n - 1]); if (m && !why) why = routeModule(`lib/${m[1]}.js`); }
463
+ }
459
464
  else if (f.startsWith('public/')) viaPublic(f);
460
465
  else {
461
466
  why = users(f);
@@ -488,8 +493,8 @@ function changedSuites(list, ref, { exact = false } = {}) {
488
493
  if (!files.length) return { files, suites: [], why: `nothing under workspace/ differs from ${ref}` };
489
494
  const all = (git('ls-files', '--full-name', DIR) || '').split('\n').filter((f) => f.startsWith(prefix)).map((f) => f.slice(prefix.length));
490
495
  const changes = files.map((file) => {
491
- if (file !== 'server.js') return { file };
492
- const d = git('diff', '-U0', base, '--', path.join(DIR, 'server.js'));
496
+ if (file !== 'server.js' && file !== 'lib/route-modules.js') return { file };
497
+ const d = git('diff', '-U0', base, '--', path.join(DIR, file));
493
498
  return { file, lines: d == null ? null : diffLines(d) };
494
499
  });
495
500
  const read = (f) => { try { return fs.readFileSync(path.join(DIR, f), 'utf8'); } catch { return null; } };
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Initiative board-publish, slice 2 (planning/prd/board-publish-prd.md P1 to P5; D103): the workspace's side of publishing to the central host (lib/boards-host.js, lib/routes-board-publish.js), run against a stand-in host that follows the contract.",
3
+ "modules": [
4
+ "board-publish-host.test.js"
5
+ ],
6
+ "seconds": {
7
+ "board-publish-host.test.js": 3
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_comment": "Initiative board-publish, slice 3 (planning/prd/board-publish-prd.md H1 to H7; D103): the central host (board-host/src/core.js) run on an in-memory store.",
3
+ "modules": [
4
+ "board-host.test.js"
5
+ ],
6
+ "seconds": {
7
+ "board-host.test.js": 8
8
+ }
9
+ }