create-pmos 0.419.0 → 0.420.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 (58) hide show
  1. package/package.json +13 -18
  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/scripts/lane-defs.js +14 -1
  6. package/payload/scripts/workflow-state.js +2 -2
  7. package/payload/state/discoveries.md +1 -1
  8. package/workspace/briefing-premium-board-test.js +9 -13
  9. package/workspace/changelog.json +12 -0
  10. package/workspace/fixtures/report-api/draft.json +2 -1
  11. package/workspace/guide/home.md +2 -0
  12. package/workspace/home-other-product-test.js +18 -0
  13. package/workspace/home-rows-test.js +14 -0
  14. package/workspace/lib/board-premium.js +13 -3
  15. package/workspace/lib/brief.js +5 -0
  16. package/workspace/lib/engine/lane-defs.js +14 -1
  17. package/workspace/lib/engine/workflow-state.js +2 -2
  18. package/workspace/lib/hold-spans.js +64 -0
  19. package/workspace/lib/mention-store.js +49 -13
  20. package/workspace/lib/plan-tree.js +1 -1
  21. package/workspace/lib/report-draft.js +6 -0
  22. package/workspace/lib/routes-boards.js +22 -6
  23. package/workspace/lib/source-reads.js +5 -0
  24. package/workspace/lib/vendor/scripts/lane-defs.js +14 -1
  25. package/workspace/lib/vendor/scripts/workflow-state.js +2 -2
  26. package/workspace/package-lock.json +2 -2
  27. package/workspace/package.json +1 -1
  28. package/workspace/public/pm/bd-acts.js +49 -1
  29. package/workspace/public/pm/bd-ini-panel.js +15 -8
  30. package/workspace/public/pm/bd-next.js +119 -0
  31. package/workspace/public/pm/bd-prog.js +1 -1
  32. package/workspace/public/pm/bd-span.js +117 -22
  33. package/workspace/public/pm/bd-views.js +7 -5
  34. package/workspace/public/pm/cozy-board.css +54 -9
  35. package/workspace/public/pm/cozy-today.css +9 -0
  36. package/workspace/public/pm/cozy-viewer.js +7 -3
  37. package/workspace/public/pm/cozy.css +10 -0
  38. package/workspace/public/pm/home-app.js +39 -13
  39. package/workspace/public/pm/home-ini.js +42 -11
  40. package/workspace/public/pm/home-list.js +22 -2
  41. package/workspace/public/pm/home-mentions.js +1 -1
  42. package/workspace/public/pm/home-today.js +13 -2
  43. package/workspace/public/pm/ini-tasks.js +363 -0
  44. package/workspace/public/pm/ini-view-model.js +19 -11
  45. package/workspace/public/pm/ini-view.css +160 -0
  46. package/workspace/public/pm/ini-view.js +39 -8
  47. package/workspace/public/pm/premium-board.js +54 -17
  48. package/workspace/public/pm/premium-vw-mtg.js +2 -0
  49. package/workspace/public/pm/task-card.js +6 -0
  50. package/workspace/skills/day-check.skill +2 -2
  51. package/workspace/skills/morning-brief.skill +1 -1
  52. package/workspace/skills/sources-read.skill +8 -4
  53. package/workspace/task-press-test.js +120 -0
  54. package/workspace/task-views-test.js +245 -0
  55. package/workspace/test-lists/task-press.json +6 -0
  56. package/workspace/test-lists/task-views.json +6 -0
  57. package/workspace/test-lists/timeline-holds.json +6 -0
  58. package/workspace/timeline-holds-test.js +191 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pmos",
3
- "version": "0.419.0",
3
+ "version": "0.420.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,18 @@
32
32
  "audit"
33
33
  ],
34
34
  "pmosChanges": [
35
+ {
36
+ "v": "0.420.0",
37
+ "at": "2026-10-26T05:26:08.144Z",
38
+ "f": 2,
39
+ "prs": [
40
+ {
41
+ "n": 1057,
42
+ "t": "Ninth testing feedback batch",
43
+ "s": "Ninth testing feedback batch"
44
+ }
45
+ ]
46
+ },
35
47
  {
36
48
  "v": "0.419.0",
37
49
  "at": "2026-10-26T03:21:59.105Z",
@@ -259,23 +271,6 @@
259
271
  "s": "Testing fixes round 2 (Home list, one chat box, newest-first chat, Draft it)"
260
272
  }
261
273
  ]
262
- },
263
- {
264
- "v": "0.400.0",
265
- "at": "2026-10-23T13:50:38.397Z",
266
- "f": 2,
267
- "prs": [
268
- {
269
- "n": 1021,
270
- "t": "Remove the classic shell and the console, and run only the tests a change reaches",
271
- "s": "Remove the classic shell and the console, and run only the tests a change reaches"
272
- },
273
- {
274
- "n": 1023,
275
- "t": "Testing fixes from the iPhone run of create-pmos 0.399.0",
276
- "s": "Testing fixes from the iPhone run of create-pmos 0.399.0"
277
- }
278
- ]
279
274
  }
280
275
  ]
281
276
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@711a1902
1
+ kernel-source: pmos@8f1cae13
2
2
  assembled: 2026-10-26
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-26T03:21:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T05:26:05Z"}
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-26T03:21:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T05:26:05Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -219,8 +219,21 @@ function laneNames(profile) {
219
219
  function laneDef(profile, lane) {
220
220
  return defsFor(profile)[lane] || null;
221
221
  }
222
+ // A record that names its lane as `type:` (chore, feature, discovery …) and has no `lane:` still has a lane. `type:` is
223
+ // also the D63 document type ("Initiative"), so only a value that is a lane of the profile counts. In pm-artifacts,
224
+ // `feature` means `new-feature`. A `lane:` always wins.
225
+ const TYPE_ALIAS = { 'pm-artifacts': { feature: 'new-feature' } };
226
+ function declaredLane(profile, fm) {
227
+ const lane = String((fm && fm.lane) || '').trim();
228
+ if (lane) return lane;
229
+ const p = profile === 'pm-artifacts' ? 'pm-artifacts' : 'product-code';
230
+ const t = String((fm && fm.type) || '').trim().toLowerCase();
231
+ if (!t) return '';
232
+ const named = (TYPE_ALIAS[p] || {})[t] || t;
233
+ return defsFor(p)[named] ? named : '';
234
+ }
222
235
  function rungRule(profile, key) {
223
236
  return (RUNG_RULES[profile] || {})[key] || null;
224
237
  }
225
238
 
226
- module.exports = { PM_ARTIFACTS, PRODUCT_CODE, RUNG_RULES, defsFor, laneNames, laneDef, rungRule };
239
+ module.exports = { PM_ARTIFACTS, PRODUCT_CODE, RUNG_RULES, defsFor, laneNames, laneDef, rungRule, declaredLane };
@@ -645,7 +645,7 @@ function computeWorkflowDerived(id, opts) {
645
645
  const fm = readFrontmatter(recAbs) || {};
646
646
  const profile = profileOf(root);
647
647
  const pmProfile = profile === 'pm-artifacts';
648
- const lane = (fm.lane || (pmProfile ? 'prd' : 'feature')).trim() || (pmProfile ? 'prd' : 'feature');
648
+ const lane = laneDefs.declaredLane(profile, fm) || (pmProfile ? 'prd' : 'feature');
649
649
  const knownLane = pmProfile ? laneNames('pm-artifacts').includes(lane)
650
650
  : laneNames('product-code').includes(lane);
651
651
  // unknown lane = the profile's strictest (feature in product-code, a governed prd in pm-artifacts)
@@ -1877,7 +1877,7 @@ function main(argv) {
1877
1877
  }
1878
1878
 
1879
1879
  module.exports = {
1880
- computeWorkflow, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
1880
+ computeWorkflow, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
1881
1881
  parseLeadingFrontmatter, specimenRoute, surfaceRoute, priorsCitation, isBuildPath, commitRange,
1882
1882
  // the board's trunk range, exported so the suite can assert the split: the same record is legacy
1883
1883
  // under BOTH ranges, and `in this change` is false under the trunk one.
@@ -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-26T03:21:55Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-26T05:26:05Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -131,15 +131,15 @@ const IVREAD = () => {
131
131
  /* B1 the stage track (premium-agreed-design): eight columns, two of them milestones, the board's counts, rows by stage.
132
132
  * 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
133
133
  * that shape is present, so the check pins which two columns are milestones. Evaluate 21 is the fixture's own count (+20 done). */
134
- 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')), out: r.querySelector('.bt-dl .t1 b').textContent, prog: r.querySelector('.bt-dl .t1 span').textContent, line: r.querySelector('.bt-dl .t3').textContent, st: r.querySelector('.cs').textContent, days: (r.querySelector('.sc.c small') || {}).textContent, dt: (r.querySelector('.sc.c') || {}).title })), pressed: document.querySelector('#ibTabs [aria-pressed="true"]').dataset.v, n: document.querySelector('.bt-nmh').textContent.replace(/\s+/g, ' ').trim(), lg: document.querySelector('.bt-oh .lg').textContent, tf: document.querySelector('.bt-tf').textContent }));
134
+ 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('#ibTabs [aria-pressed="true"]').dataset.v, 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 }));
135
135
  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)', tr.pressed === 'track' && tr.heads.join('|') === 'Triage0|Discover1|Plan1|Prioritize0|Build2|◆ Deliver1|Monitor1|◆ Evaluate21', JSON.stringify(tr.heads));
136
136
  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)));
137
- ok('B1 the Output column names what finishes the step and the parts or progress a record holds; a part not on record is not counted', tr.rows[0].out === 'PRD' && tr.rows[0].prog === '— of 6 parts' && /Problem · users · evidence · scope · success metric · risks/.test(tr.rows[0].line) && tr.rows[1].out === 'Scope, timeline, work breakdown' && tr.rows[1].prog === '18%' && tr.rows[3].prog === 'No tickets yet' && tr.rows[6].out === 'Keep, iterate or stop', JSON.stringify(tr.rows.map((r) => r.out + ':' + r.prog)));
137
+ 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', 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 === 'Draft the outcome report with Claude', JSON.stringify(tr.rows.map((r) => [r.nx, r.cnt, r.act])));
138
138
  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)));
139
139
  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)));
140
140
  // PgBoard: a committed date (the planned end) shows under the Deliver milestone; at the milestone itself it replaces the days count
141
141
  ok('B1 at the Deliver milestone the committed date replaces the days count', tr.rows.filter((r) => /Deliver/.test(r.dt)).every((r) => r.days === 'Oct 23'), JSON.stringify(tr.rows.map((r) => r.days + ':' + r.dt)));
142
- ok('B1 the legend reads Skipped, Done, Review, Doing, You and Blocked', tr.lg === 'SkippedDoneReviewDoingYouBlocked', tr.lg);
142
+ ok('B1 the Next column has no segment bar and no legend', tr.lg === false, String(tr.lg));
143
143
  ok('B1 Monitor and Evaluate fold after the first of each: "20 more in Monitor and Evaluate", sorted by stage', /^20 more in Monitor and Evaluate/.test(tr.tf) && /Sorted by stage$/.test(tr.tf), tr.tf);
144
144
  await p.click('#fold');
145
145
  ok('B1 the fold opens and says how many are not loaded, and closes again', await p.evaluate(() => document.querySelector('#fold').getAttribute('aria-expanded') === 'true' && /Fold Monitor and Evaluate · 20 more are not loaded/.test(document.querySelector('#fold').textContent)));
@@ -189,9 +189,9 @@ const IVREAD = () => {
189
189
  }
190
190
  {
191
191
  const R = await open({ model: BP.build(FJ.facts()) }), q = R.page;
192
- const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')), segs: [...document.querySelectorAll('.bt-l[data-row="board:self-serve-v2"] .seg5 .bt-tk')].map((b) => b.className.replace('bt-tk ', '')).join(), sso: document.querySelector('.bt-l[data-row="board:sso-partners"] .bt-dl').textContent, st: document.querySelector('.bt-l[data-row="board:sso-partners"] .cs').textContent, ssoCount: document.querySelector('.bt-l[data-row="board:sso-partners"] .t1 span').textContent, ssCount: document.querySelector('.bt-l[data-row="board:self-serve-v2"] .t1 span').textContent }));
192
+ const c = await q.evaluate(() => ({ chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((b) => b.textContent.replace(/\s+/g, ' ').trim() + (b.getAttribute('aria-pressed') === 'true' ? '*' : '')), 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 }));
193
193
  ok('B1 the chips read Jira, the sprint and the release, the new asks, late, at risk and blocked from the records; This sprint is on by default', /^Jira · read /.test(c.chips[0]) && c.chips[1] === 'Sprint 24 · v2.4 ships Nov 4' && c.chips[2] === '1 new ask' && c.chips.includes('1 late') && c.chips.includes('3 at risk') && c.chips.includes('1 blocked*') === false && c.chips.includes('1 blocked') && c.chips[c.chips.length - 1] === 'Sprint 24 only*', JSON.stringify(c.chips));
194
- ok('B1 Build progress is the Jira tickets in points, one segment each; a blocked ticket shows in red and says why', c.segs === 'dn,dn,rv,ip,td' && c.ssCount === '5 of 13 pts' && c.ssoCount === '1 of 4' && /v2\.4 shipped \+ your sign-off/.test(c.sso) && /SSO-12 blocked · Waiting on PLAT-88/.test(c.sso), JSON.stringify(c));
194
+ 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));
195
195
  ok('B1 a Deliver row whose release has a date says when it ships', c.st === 'Ships Nov 4', c.st);
196
196
  // a metric chip opens its trend (BdPanel); its "Show only" filters
197
197
  await q.click('#bdChipset [data-f="blocked"]');
@@ -226,10 +226,6 @@ const IVREAD = () => {
226
226
  ok('B1 the ticket\'s Back goes to the initiative', await until(async () => (await vwTitle(q)) === 'SSO for partners'));
227
227
  await q.keyboard.press('Escape');
228
228
  ok('B1 Escape closes the Viewer', await vwShut(q));
229
- await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-tk:nth-child(3)');
230
- ok('B1 a deliverable segment on the row opens its Jira ticket', await until(async () => /ONB-34/.test(await vwTitle(q))));
231
- await q.keyboard.press('Escape');
232
- await vwShut(q);
233
229
  const n1 = R.posts.length; await q.click('#chJira');
234
230
  ok('B1 the Jira chip reads Jira again', await until(() => R.posts.slice(n1).some((x) => x.path === '/api/sources/refresh' && x.body.source === 'jira')));
235
231
  /* the chips and tools open their designed popovers (BdAsks, BdSprint, BdFilter) and New initiative its panel (BdNew), with no "Waiting for design" tag */
@@ -293,7 +289,7 @@ const IVREAD = () => {
293
289
  await view(p, 'list');
294
290
  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('#ibTabs [aria-pressed="true"]').dataset.v }));
295
291
  const lv = await listOf();
296
- ok('B4 the List view lists the initiatives with workflow, stage, category, status, owner, next, finish and output, 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|Output|' && /Self-serve onboarding v2.*Product feature.*Build.*In progress.*7 days over.*10 Oct/.test(lv.ss) && /2 more in Monitor and Evaluate/.test(lv.foot) && lv.v === 'list', JSON.stringify(lv));
292
+ 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));
297
293
  await p.click('#ibBody [data-sort="title"]');
298
294
  const lt = await listOf();
299
295
  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));
@@ -438,12 +434,12 @@ const IVREAD = () => {
438
434
  const gone = F.row('old-idea', 'Old idea', { status: 'cancelled', stopped: { reason: 'Not worth it now' } });
439
435
  const R = await open({ model: BP.build(FJ.facts({ cancelled: [gone] })), trail: FT.trail() }), q = R.page;
440
436
  await until(() => q.evaluate(() => /18d/.test(document.querySelector('#ibBody').textContent)));
441
- 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 .t1 span').textContent, line: r.querySelector('.bt-dl .t3').textContent, skip: [...r.querySelectorAll('.bt-cells > div.k')].map((d) => d.title) }; }, id);
437
+ 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);
442
438
  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');
443
439
  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]));
444
440
  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]));
445
- ok('T the output counts its parts from the records and names the next one', ub.prog === '2 of 6 parts' && ub.line === 'Next: Evidence' && pr.prog === '1 of 4 parts' && pr.line === 'Next: Timeline', JSON.stringify([ub, pr]));
446
- ok('T what waits on you comes first, in blue', rf.st === 'Your verdict' && /s-you/.test(rf.stc), JSON.stringify(rf));
441
+ 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]));
442
+ 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));
447
443
  await q.click('.bt-l[data-row="board:self-serve-v2"] .bt-nm');
448
444
  /* re-pointed (the one view): the same records, in the stage card's day clock, the ladder, Linked (a fold of the view) and the Board's own rows */
449
445
  const pk = await until(() => q.evaluate(() => { const v = document.querySelector('#czViewer'); if (!v || v.hidden || !v.querySelector('[data-czs-id="drafted"]') || !v.querySelector('.iv')) return null; const sec = (id) => { const x = v.querySelector(`[data-czs-id="${id}"]`); return x ? { n: (x.querySelector('.czs-n') || {}).textContent || '', body: (x.querySelector('.czs-body') || {}).textContent.replace(/\s+/g, ' ').trim() } : null; }; return { meta: v.querySelector('.iv-meta').textContent, where: (v.querySelector('.iv-sch .iv-r') || {}).textContent, stage: (v.querySelector('.iv-sch b') || {}).textContent, stt: (v.querySelector('.iv-lad i.now') || {}).title, drafted: sec('drafted'), wt: sec('drift') }; }));
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "v": "0.420.0",
4
+ "at": "2026-10-26T05:26:08.144Z",
5
+ "f": 2,
6
+ "prs": [
7
+ {
8
+ "n": 1057,
9
+ "t": "Ninth testing feedback batch",
10
+ "s": "Ninth testing feedback batch"
11
+ }
12
+ ]
13
+ },
2
14
  {
3
15
  "v": "0.419.0",
4
16
  "at": "2026-10-26T03:21:59.105Z",
@@ -28,7 +28,8 @@
28
28
  ],
29
29
  "milestones": [
30
30
  "2026-10-24"
31
- ]
31
+ ],
32
+ "holds": []
32
33
  }
33
34
  ]
34
35
  },
@@ -30,6 +30,8 @@ Home is the page at `/premium.html`. It follows the Agreed design and the "Uncov
30
30
 
31
31
  Press the row to open Mentions in the Viewer (full screen on a phone).
32
32
 
33
+ A mention is not only an @ of your handle. A Slack direct message to you is a mention, and so is a Slack message or a mail that names you (your first name, full name or the name on your Slack profile) without an @. A DM or a name mention that asks you something waits on you. One that only tells you something goes to **Last 7 days**. A message you wrote yourself is never a mention.
34
+
33
35
  - The summary says how many asks wait on you and how old the oldest one is, and who asks what. The round reply button opens the oldest ask.
34
36
  - **Waiting on you** lists every ask you have not answered, whatever its age, oldest first. The age is the only signal: it turns amber after 2 days. The same person asking twice in one thread is one row with a count. With more than 5, the oldest 5 show and **Show all** shows the rest. An ask that waited 30 days or more asks once: "Did you answer this already?" ✓ clears it, × keeps it waiting and asks again in 30 days.
35
37
  - **Last 7 days** lists what does not wait on you, by day: Today, Yesterday with its date, then dated days. An FYI has a blue dot until you open it. A mention to @channel, @here, a team or from a bot is for your information and never counts as an ask. A mention you answered says how: you replied in the thread, or you marked it answered.
@@ -6,6 +6,7 @@
6
6
  * O1 a Microsites initiative is read from the Microsites board (ws=microsites), and its page opens in the Viewer under its own title
7
7
  * O2 the chat is the initiative's own, named by its title (its target carries ws=microsites)
8
8
  * O3 the Microsites heading opens its page in the Viewer and Home stays on IDPF: no navigation, the list keeps the IDPF group
9
+ * O5 its chat's first message starts a session in Microsites, and "A new session" (In: chip, + New) starts a second one beside it
9
10
  * Serves the real page from the real server; the reads are fixtures (fixtures/program-ascent.js through the Board and Home fixtures). */
10
11
  const path = require('path');
11
12
  const { spawn } = require('child_process');
@@ -88,6 +89,23 @@ const model = () => { const m = IP.build(F.facts()); return { ...m, id: ID, key:
88
89
  await sleep(500);
89
90
  ok('O3 Home stays on IDPF: no navigation, and the IDPF group is still in the list', opens.length === navs && new URL(page.url()).searchParams.get('ws') === 'idpf' && await page.evaluate(() => [...document.querySelectorAll('#hmList [data-hm-prodopen]')].some((b) => /IDPF/.test(b.getAttribute('aria-label') || ''))), JSON.stringify(opens.slice(navs)) + ' ' + page.url());
90
91
  ok('O3 the chat is the Microsites product\'s own', await page.evaluate(() => (document.querySelector('#hmChat textarea, textarea') || {}).placeholder === 'Message Claude about Microsites'));
92
+ // O5 a product's chat starts its first session and, like an initiative, a new one beside it (batch 9 item 3, Wawan 2026-10-26: "I can't
93
+ // initiate a new session" on pmos-scarlet). Each send asks with the product's own key in its own workspace; a new session has the next key.
94
+ const asks = [];
95
+ await page.route('**/api/briefing-premium/ask*', (r) => { asks.push({ ws: new URL(r.request().url()).searchParams.get('ws'), ...JSON.parse(r.request().postData() || '{}') }); return json(r, { ok: true, session: 'sess-' + asks.length, started: true }); });
96
+ await page.fill('#hmIn', 'How is Microsites doing?'); await page.keyboard.press('Enter');
97
+ ok('O5 the first message starts the Microsites product chat in its workspace', await until(() => asks.length === 1, 5000) && asks[0].key === 'chat:product:microsites' && asks[0].ws === 'microsites', JSON.stringify(asks));
98
+ await page.click('#hmChat [data-hm-scope]');
99
+ const fresh = await until(() => page.evaluate(() => { const b = [...document.querySelectorAll('#hmMenu [role=menuitem], #hmMenu button')].find((x) => /A new session/.test(x.textContent)); if (!b) return null; const sub = b.textContent; b.click(); return sub; }), 3000);
100
+ ok('O5 its In: chip offers "A new session" in Microsites', !!fresh && /Microsites/.test(fresh), fresh);
101
+ ok('O5 the new session\'s chat is open, empty and still about Microsites', await until(() => page.evaluate(() => { const t = document.querySelector('#hmIn'); return !!t && t.placeholder === 'Message Claude about Microsites' && /A new session in Microsites/.test(document.querySelector('#hmChat').textContent); }), 3000));
102
+ await page.fill('#hmIn', 'A second thread'); await page.keyboard.press('Enter');
103
+ ok('O5 it sends with the next key, so a second session starts beside the first', await until(() => asks.length === 2, 5000) && asks[1].key === 'chat:product:microsites:2' && asks[1].ws === 'microsites', JSON.stringify(asks));
104
+ await page.click('[data-hm-new]');
105
+ const nw = await until(() => page.evaluate(() => [...document.querySelectorAll('#hmMenu [role=menuitem], #hmMenu button')].map((x) => x.textContent).find((x) => /New session in/.test(x)) || null), 3000);
106
+ ok('O5 the + New menu names the product: "New session in Microsites"', !!nw && /New session in Microsites/.test(nw), nw);
107
+ await page.keyboard.press('Escape');
108
+
91
109
  // O4 a phone (Wawan, 2026-10-25): the chat is not beside the page, so the page ends with the way to its own chat
92
110
  const pctx = await browser.newContext({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true });
93
111
  const pp = await pctx.newPage();
@@ -257,6 +257,20 @@ const MENTIONS = (ini) => ({ ok: true, count: 4, gaps: [], as_of: ago(30), waiti
257
257
  ok('R no page error', !R.errors.length, R.errors.join(' | '));
258
258
  await R.close();
259
259
 
260
+ /* W (batch 9 item 6): widening the Viewer folds the list before it narrows the chat */
261
+ const W = await open({ w: 2000, h: 1000 });
262
+ await W.page.click('#hmList [data-hr-mentions]');
263
+ await until(() => vw(W.page));
264
+ const lay = async (px) => { await W.page.evaluate((x) => window.czViewer.setWidth(x, false), px); return W.page.evaluate(() => ({ rail: window.czViewer.railOn(), list: Math.round(document.getElementById('hmList').getBoundingClientRect().width), chat: Math.round(document.getElementById('hmChat').getBoundingClientRect().width) })); };
265
+ const w0 = await lay(600);
266
+ ok('W at a narrow width the list shows', !w0.rail && w0.list > 200, JSON.stringify(w0));
267
+ const w1 = await lay(1000);
268
+ ok('W past the default width the list folds to a rail first, and the chat keeps more than the list had', w1.rail && w1.list < 100 && w1.chat > 700, JSON.stringify(w1));
269
+ const w2 = await lay(600);
270
+ ok('W back under the default the list comes back', !w2.rail && w2.list > 200, JSON.stringify(w2));
271
+ ok('W no page error', !W.errors.length, W.errors.join(' | '));
272
+ await W.close();
273
+
260
274
  /* F */
261
275
  const P = await open({ w: 390, h: 844, rec: note });
262
276
  const ph = await until(() => P.page.evaluate(() => !!document.querySelector('#hmList .hr-rec-card') && !!document.querySelector('#hmList [data-hr-mentions]')), 15000);
@@ -151,7 +151,7 @@ function trackOf(r, tickets, today, release) {
151
151
  line.push({ text: 'Nothing is counted toward it yet' });
152
152
  } else if (own) out = own.output && own.output.name ? own.output.name : '';
153
153
  else line.push({ text: 'Its stage is not one of the eight steps' });
154
- if (!jira && pct != null) { count = pct + '%'; }
154
+ // the record's progress is the whole initiative's breakdown, not this step's output: it never stands as the step's count (batch 9 item 4)
155
155
  // a step the row was moved past (lib/routes-boards.js keeps the move's "Skipped <stage>" warning)
156
156
  const skipped = own ? [] : [...new Set((r.warnings || []).map((w) => (typeof w === 'string' ? /^Skipped (.+)$/.exec(w) : null)).filter(Boolean).map((m) => stepIndex(m[1], null)).filter((i) => i >= 0 && (k < 0 || i < k)))].sort((a, b) => a - b);
157
157
  // what waits on the PM: the sign-off of a release whose tickets are all done (the last part of Deliver is the PM's)
@@ -240,6 +240,13 @@ function wfFields(r) {
240
240
  const ended = r.ended && (r.ended.as === 'wontdo' || r.ended.as === 'archived') ? { as: r.ended.as, reason: r.ended.reason || '', note: clip(r.ended.note || '', 300), at: r.ended.at || null } : null;
241
241
  return { wf, wfStage: stageFields(r.wfStage), wfStages: Array.isArray(r.wfStages) ? r.wfStages.map(stageFields).filter(Boolean).slice(0, 40) : null, ended };
242
242
  }
243
+ /** The holds of a row as the timeline draws them (feedback batch 9 item 8): from, to (null while open), the return date and the reason. */
244
+ const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
245
+ const dayOr = (v) => (typeof v === 'string' && DAY_RE.test(v) ? v : null);
246
+ const holdsOf = (r) => (Array.isArray(r.holds) ? r.holds : []).filter((h) => h && dayOr(h.from)).slice(-12)
247
+ .map((h) => ({ from: h.from, to: dayOr(h.to), back: dayOr(h.back), reason: clip(h.reason || '', 200) }));
248
+ /** The plain gaps of a row: stretches of 4 weeks or more that no dated work covers. */
249
+ const gapsOf = (r) => (Array.isArray(r.gaps) ? r.gaps : []).filter((g) => g && dayOr(g.from) && dayOr(g.to)).slice(0, 12).map((g) => ({ from: g.from, to: g.to }));
243
250
  function rowOf(r, wf, today) {
244
251
  const names = (wf || []).map((s) => s.name), cur = names.indexOf(r.stage);
245
252
  const bad = r.status === 'late' || r.status === 'at risk';
@@ -258,6 +265,7 @@ function rowOf(r, wf, today) {
258
265
  finish: r.end ? shortDate(r.end) : 'Not planned', over: !!over, start: r.start || null, end: r.end || null,
259
266
  owner: r.owner || null, lane: r.lane || null, anchor: r.anchor || null, kr: krShort(r.anchor), rank: Number.isInteger(r.rank) ? r.rank : null, warnings: (r.warnings || []).filter((w) => typeof w === 'string').slice(0, 12), epics: Array.isArray(r.epics) ? r.epics.filter((e) => typeof e === 'string').slice(0, 6) : [], updated: r.updated || null, reading: r.reading || null, overDays: over ? days(r.end, today) : 0,
260
267
  acts: actsOf(r, names),
268
+ holds: holdsOf(r), gaps: gapsOf(r),
261
269
  // D99: the workflow it runs and where it stands in it (lib/routes-boards.js workflowRowOf); Product feature when the server sends none
262
270
  ...wfFields(r),
263
271
  dialog: {
@@ -296,9 +304,11 @@ function build(f) {
296
304
  // each initiative's PMOS tasks (feedback batch 5, one list): its Board tasks, its breakdown items and its stage's To finish tasks, for the panel
297
305
  const taskBy = new Map();
298
306
  for (const w of f.items || []) {
299
- if (!w || w.src !== 'pmos' || w.kind === 'Epic' || !w.ini || !w.uid || w.status === 'Archived') continue;
307
+ // archived tasks come too: the one view leaves them out of every count and shows them only in the List's Archived fold (batch 9 item 5b)
308
+ if (!w || w.src !== 'pmos' || w.kind === 'Epic' || !w.ini || !w.uid) continue;
300
309
  if (!taskBy.has(w.ini)) taskBy.set(w.ini, []);
301
- taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}),
310
+ // the start too: the Tasks Timeline draws a bar from the start to the due day (batch 9 item 5b)
311
+ taskBy.get(w.ini).push({ uid: w.uid, title: clip(w.title || '', 160), status: w.status || 'To do', owner: w.owner || '', start: w.start || '', end: w.end || '', ...(w.from ? { from: { stage: w.from.stage, finish: w.from.finish } } : {}),
302
312
  // one view (feedback batch 6 item 1): its place in the breakdown, and a breakdown item's own stage and order
303
313
  ...(typeof w.section === 'string' ? { section: w.section } : {}), ...(w.itemStage ? { itemStage: w.itemStage } : {}), ...(Number.isFinite(w.order) ? { order: w.order } : {}), ...(w.store === 'item' ? { item: true } : {}) });
304
314
  }
@@ -181,6 +181,11 @@ function itemExtras(x, at) {
181
181
  if (typeof x.reply_needed !== 'boolean') return { error: `${at}: reply_needed must be true or false` };
182
182
  f.reply_needed = x.reply_needed;
183
183
  }
184
+ // how a mention reaches the PM (sources-read): an @handle, a Slack direct message, or the PM's name with no @
185
+ if (x.via !== undefined && x.via !== null) {
186
+ if (!['at', 'dm', 'name'].includes(x.via)) return { error: `${at}: via must be at, dm or name` };
187
+ f.via = x.via;
188
+ }
184
189
  // The kind says who finishes the job. The PM's own item is always `you`: an agent cannot approve or auto-run it.
185
190
  const kind = x.kind === undefined || x.kind === null ? (x.owner === 'pm' ? 'you' : 'approve') : x.kind;
186
191
  if (!KINDS.includes(kind)) return { error: `${at}: kind must be one of ${KINDS.join(', ')}` };
@@ -219,8 +219,21 @@ function laneNames(profile) {
219
219
  function laneDef(profile, lane) {
220
220
  return defsFor(profile)[lane] || null;
221
221
  }
222
+ // A record that names its lane as `type:` (chore, feature, discovery …) and has no `lane:` still has a lane. `type:` is
223
+ // also the D63 document type ("Initiative"), so only a value that is a lane of the profile counts. In pm-artifacts,
224
+ // `feature` means `new-feature`. A `lane:` always wins.
225
+ const TYPE_ALIAS = { 'pm-artifacts': { feature: 'new-feature' } };
226
+ function declaredLane(profile, fm) {
227
+ const lane = String((fm && fm.lane) || '').trim();
228
+ if (lane) return lane;
229
+ const p = profile === 'pm-artifacts' ? 'pm-artifacts' : 'product-code';
230
+ const t = String((fm && fm.type) || '').trim().toLowerCase();
231
+ if (!t) return '';
232
+ const named = (TYPE_ALIAS[p] || {})[t] || t;
233
+ return defsFor(p)[named] ? named : '';
234
+ }
222
235
  function rungRule(profile, key) {
223
236
  return (RUNG_RULES[profile] || {})[key] || null;
224
237
  }
225
238
 
226
- module.exports = { PM_ARTIFACTS, PRODUCT_CODE, RUNG_RULES, defsFor, laneNames, laneDef, rungRule };
239
+ module.exports = { PM_ARTIFACTS, PRODUCT_CODE, RUNG_RULES, defsFor, laneNames, laneDef, rungRule, declaredLane };
@@ -645,7 +645,7 @@ function computeWorkflowDerived(id, opts) {
645
645
  const fm = readFrontmatter(recAbs) || {};
646
646
  const profile = profileOf(root);
647
647
  const pmProfile = profile === 'pm-artifacts';
648
- const lane = (fm.lane || (pmProfile ? 'prd' : 'feature')).trim() || (pmProfile ? 'prd' : 'feature');
648
+ const lane = laneDefs.declaredLane(profile, fm) || (pmProfile ? 'prd' : 'feature');
649
649
  const knownLane = pmProfile ? laneNames('pm-artifacts').includes(lane)
650
650
  : laneNames('product-code').includes(lane);
651
651
  // unknown lane = the profile's strictest (feature in product-code, a governed prd in pm-artifacts)
@@ -1877,7 +1877,7 @@ function main(argv) {
1877
1877
  }
1878
1878
 
1879
1879
  module.exports = {
1880
- computeWorkflow, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
1880
+ computeWorkflow, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
1881
1881
  parseLeadingFrontmatter, specimenRoute, surfaceRoute, priorsCitation, isBuildPath, commitRange,
1882
1882
  // the board's trunk range, exported so the suite can assert the split: the same record is legacy
1883
1883
  // under BOTH ranges, and `in this change` is false under the trunk one.
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+ // hold-spans.js — the idle time of an initiative on the Board timeline (feedback batch 9 item 8; canvas XtiA1Desk, XtiA2Hold, XtiA4Long,
3
+ // XtiA3Phone, XtiAHard, XtiAGrill).
4
+ //
5
+ // holdsOf(lines) → Map id → [{ from, to, back, reason }] every hold of every initiative, oldest first
6
+ // readHolds(file) → the same, read from a lifecycle.jsonl file ({} when it is missing)
7
+ // planGaps(spans, minDays) → [{ from, to }] the stretches of at least minDays (28) that no dated work covers
8
+ //
9
+ // No new record (XtiAGrill 1). A hold is the lifecycle lines PMOS already writes (D70): `on-hold` with `at` and an optional `back`
10
+ // (YYYY-MM-DD), and `active`, `closed` or `cancelled` after it. The latest line still decides the state (scripts/workflow-state.js
11
+ // readLifecycle); this fold reads EVERY line, so a past hold stays a gap on the bar (XtiAGrill 6).
12
+ // - `on-hold` opens a hold on the day of its `at`. A second `on-hold` while one is open changes its return date and reason, and keeps its
13
+ // start ("Change the return date" writes one, XtiAGrill 9).
14
+ // - `active`, `closed` or `cancelled` ends the open hold on the day of its `at`. `to` stays null while the hold is open.
15
+ // - A line with no readable day is left out: a hold cannot be drawn without its start.
16
+ // planGaps reads the dated work-items and tasks as { start, due }: a gap is a stretch inside them that none covers, of minDays or more
17
+ // (XtiAGrill 13). It is "nothing planned", never a hold, so it carries no reason.
18
+ const fs = require('fs');
19
+
20
+ const DATE = /^\d{4}-\d{2}-\d{2}$/;
21
+ const dayOf = (v) => { const s = String(v || '').slice(0, 10); return DATE.test(s) ? s : null; };
22
+ const dayNum = (d) => Math.round(Date.UTC(+d.slice(0, 4), +d.slice(5, 7) - 1, +d.slice(8, 10)) / 86400000);
23
+ const ENDS = new Set(['active', 'closed', 'cancelled']);
24
+
25
+ function holdsOf(lines) {
26
+ const out = new Map();
27
+ for (const r of Array.isArray(lines) ? lines : []) {
28
+ if (!r || typeof r.initiative_id !== 'string') continue;
29
+ const at = dayOf(r.at);
30
+ if (!at) continue;
31
+ const list = out.get(r.initiative_id) || [];
32
+ const open = list.length && list[list.length - 1].to === null ? list[list.length - 1] : null;
33
+ if (r.state === 'on-hold') {
34
+ const back = DATE.test(r.back || '') ? r.back : null;
35
+ if (open) { open.back = back; open.reason = String(r.reason || ''); }
36
+ else list.push({ from: at, to: null, back, reason: String(r.reason || '') });
37
+ } else if (ENDS.has(r.state) && open) open.to = at < open.from ? open.from : at;
38
+ if (list.length) out.set(r.initiative_id, list);
39
+ }
40
+ return out;
41
+ }
42
+
43
+ function readHolds(file) {
44
+ let text = '';
45
+ try { text = fs.readFileSync(file, 'utf8'); } catch { return new Map(); }
46
+ const lines = [];
47
+ for (const l of text.split('\n')) { if (!l.trim()) continue; try { lines.push(JSON.parse(l)); } catch { /* a torn line */ } }
48
+ return holdsOf(lines);
49
+ }
50
+
51
+ function planGaps(spans, minDays) {
52
+ const min = Number.isFinite(minDays) ? minDays : 28;
53
+ const list = (Array.isArray(spans) ? spans : []).map((s) => [dayOf(s && s.start), dayOf(s && (s.due || s.end))])
54
+ .map(([a, b]) => [a || b, b || a]).filter(([a]) => a).sort((x, y) => (x[0] < y[0] ? -1 : x[0] > y[0] ? 1 : 0));
55
+ const out = [];
56
+ let end = null;
57
+ for (const [a, b] of list) {
58
+ if (end && dayNum(a) - dayNum(end) >= min) out.push({ from: end, to: a });
59
+ if (!end || b > end) end = b;
60
+ }
61
+ return out;
62
+ }
63
+
64
+ module.exports = { holdsOf, readHolds, planGaps };