create-pmos 0.136.0 → 0.137.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.136.0",
3
+ "version": "0.137.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": {
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@2bbc680
1
+ kernel-source: pmos@6693e56
2
2
  assembled: 2026-10-12
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-12T00:52:51Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-12T00:57:28Z"}
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-12T00:52:51Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-12T00:57:28Z"}
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-12T00:52:51Z"}
5
+ generated: {by: process:create-pmos, at: "2026-10-12T00:57:28Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  type: Guide
3
3
  title: "Data freshness: how the workspace keeps up to date, and how old each source is"
4
- timestamp: 2026-10-11
4
+ timestamp: 2026-10-12
5
5
  ---
6
6
 
7
7
  # Data freshness
@@ -37,4 +37,12 @@ The events are kept in your own runtime folder on this machine, never in a repos
37
37
 
38
38
  ## Where you see it
39
39
 
40
- Each page shows a short **as of** line for the sources it reads. The line turns amber when a source is older than its limit, and says **never read** when nothing was read yet. Settings › Data freshness shows every source in one table: when it was read, its state, its schedule, and **Refresh**.
40
+ Each page shows a short line under its title that says when each source was last read, for example **Initiatives read 08:02 · Calendar read 07:15 · Jira status read 06:31**. The line never says that the data is up to date, because the agents read these sources on a schedule and not live.
41
+
42
+ - A source older than its limit is amber.
43
+ - A source that was never read says **not read yet**, in amber.
44
+ - A source whose last read failed is red and says when it was last read.
45
+ - A watched repository is not named, because the workspace checks it every few seconds.
46
+ - When a source is old, failed or never read, a **Refresh** button for the first of them follows the line.
47
+
48
+ Settings › Data freshness shows every source in one table: when it was read, its state, its schedule, and **Refresh**.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.136.0",
3
+ "version": "0.137.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pmos-workspace",
9
- "version": "0.136.0",
9
+ "version": "0.137.0",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@xterm/addon-fit": "^0.11.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmos-workspace",
3
- "version": "0.136.0",
3
+ "version": "0.137.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",
@@ -117,7 +117,7 @@ function header() {
117
117
  S.tools.append(S.gearBtn);
118
118
  S.moreBtn = ibtn('More', 'more', { 'aria-haspopup': 'menu', 'aria-expanded': 'false', 'data-c3pg': 'more', onclick: toggleMore });
119
119
  S.tools.append(el('span', { class: 'c3pg-menuwrap' }, S.moreBtn));
120
- /* workspace-data-freshness R9: how old the sources are, quiet when they are up to date (freshness-line.js) */
120
+ /* workspace-data-freshness R9: when each source was last read, never "up to date" (freshness-line.js) */
121
121
  S.fresh = S.demo ? null : freshnessLine(S.ws);
122
122
  return el('div', { class: 'c3top' }, el('div', null, S.ttl, S.sub, S.fresh), S.tools);
123
123
  }
@@ -3511,9 +3511,10 @@
3511
3511
  .fr-fresh__state--fresh { color: var(--foreground); }
3512
3512
  .fr-fresh__state--stale { color: var(--warning); }
3513
3513
  .fr-fresh__state--failed { color: var(--destructive); }
3514
- .fr-fresh__state--never,
3514
+ .fr-fresh__state--never { color: var(--warning); }
3515
3515
  .fr-fresh__state--building,
3516
3516
  .fr-fresh__state--off { color: var(--muted-foreground); }
3517
+ .fr-fresh__sep { color: var(--muted-foreground); }
3517
3518
  .fr-fresh-table__grid {
3518
3519
  width: 100%;
3519
3520
  border-collapse: collapse;
@@ -1,7 +1,9 @@
1
1
  /* pm/freshness-line.js — how old each source of the workspace is (workspace-data-freshness R9).
2
2
  *
3
- * freshnessLine(ws) → element the console header's short line: the sources that are old or never read, else
4
- * "Up to date"; a Refresh button for the oldest one. Updates itself every 15 s.
3
+ * freshnessLine(ws) → element the console header's short line: when each source was last read ("Calendar read
4
+ * 07:15 · Jira status read 08:02"), the old, failed and never-read ones flagged, and
5
+ * a Refresh button for the first of those. It never says "up to date": the sources
6
+ * are read on a schedule, not live (pm/freshness-words.js). Updates itself every 15 s.
5
7
  * freshnessTable(ws) → element Settings › Data freshness: every source, when it was read, its state, its schedule,
6
8
  * Refresh, and the repository's Watch for changes switch.
7
9
  *
@@ -13,6 +15,7 @@
13
15
  import { el, setChildren } from './dom.js';
14
16
  import { pmGet, pmPost } from './http.js';
15
17
  import { button, SEL } from './primitives.js';
18
+ import { lineItems, behindOf } from './freshness-words.js';
16
19
 
17
20
  const POLL_MS = 15000;
18
21
  const live = new Map(); // kind|ws -> { node, timer, version }
@@ -26,7 +29,7 @@ function ago(iso) {
26
29
  if (ms < 24 * 3600000) return 'today ' + hhmm(iso);
27
30
  return Math.round(ms / (24 * 3600000)) + ' d ago';
28
31
  }
29
- const STATE_WORD = { fresh: 'Up to date', stale: 'Old', never: 'Never read', building: 'Reading…', failed: 'Failed', off: 'Off' };
32
+ const STATE_WORD = { fresh: 'Recent', stale: 'Old', never: 'Never read', building: 'Reading…', failed: 'Failed', off: 'Off' };
30
33
  // the colour of a state: a class in components.css (.fr-fresh__state--<state>), coloured from the tokens
31
34
  const tone = (state) => 'fr-fresh__state fr-fresh__state--' + (STATE_WORD[state] ? state : 'never');
32
35
  const label = (b, t) => { const l = b.querySelector(SEL.btnLabel); (l || b).textContent = t; };
@@ -64,20 +67,22 @@ function poll(key, ws, draw) {
64
67
  return cur.node;
65
68
  }
66
69
 
67
- /** The header line: quiet when everything is fresh, amber names when a source is old or never read. */
70
+ /** The header line: when each source was last read, old, failed and never-read ones flagged. It never claims "up to date". */
68
71
  export function freshnessLine(ws) {
69
72
  return poll('line|' + ws, ws, (node, d) => {
70
73
  const n = node || el('div', { class: 'fr-fresh', 'data-c3pg': 'freshness' });
71
- if (!d) { if (!node) n.textContent = ''; return n; }
72
- const watched = d.sources.filter((s) => s.state !== 'off');
73
- const behind = watched.filter((s) => s.state === 'stale' || s.state === 'failed' || (s.state === 'never' && s.schedule));
74
- const building = watched.find((s) => s.state === 'building');
74
+ if (!d) { if (node) setChildren(n, [el('span', { class: tone('never') }, 'Could not read when the sources were read')]); else n.textContent = ''; return n; }
75
+ const items = lineItems(d.sources);
76
+ const behind = behindOf(items);
75
77
  const kids = [];
76
- if (!behind.length) kids.push(el('span', { class: tone('fresh') }, building ? 'Reading the repository…' : 'Data up to date'));
77
- for (const s of behind.slice(0, 3)) kids.push(el('span', { class: tone(s.state), title: STATE_WORD[s.state] }, s.label + ' ' + ago(s.as_of)));
78
+ items.forEach((it, i) => {
79
+ if (i) kids.push(el('span', { class: 'fr-fresh__sep', 'aria-hidden': 'true' }, '·'));
80
+ kids.push(el('span', { class: tone(it.state), title: it.title, 'data-fr-line': it.id }, it.text));
81
+ });
78
82
  if (behind.length) {
79
83
  const first = behind[0];
80
- const btn = button({ label: 'Refresh ' + first.label, size: 'sm', attrs: { 'data-c3pg': 'freshness-refresh' },
84
+ const src = d.sources.find((s) => s.id === first.id);
85
+ const btn = button({ label: 'Refresh ' + (src ? src.label : first.id), size: 'sm', attrs: { 'data-c3pg': 'freshness-refresh' },
81
86
  onClick: () => refresh(d.ws, first.id, btn) });
82
87
  kids.push(btn);
83
88
  }
@@ -0,0 +1,46 @@
1
+ /* pm/freshness-words.js — the words of the header's freshness line (pm/freshness-line.js). No DOM, so a suite can import it.
2
+ *
3
+ * lineItems(sources, now?) → [{ id, state, text, title }] one honest phrase per source: when it was last read, or
4
+ * that it was never read, failed or is reading now
5
+ * behindOf(items) → [item] the sources to flag: old, failed or never read
6
+ * whenRead(iso, now?) → '07:15' | 'yesterday 18:02' | '3 d ago'
7
+ *
8
+ * The line never says "up to date". Calendar, Jira, My work and tracker items are read by an agent on a schedule, not
9
+ * live, so the line says when each was read and lets the PM judge. A watched repository is checked every few seconds,
10
+ * so it is named only when it is not watched as it should be.
11
+ */
12
+ const H = 3600000;
13
+ const two = (n) => String(n).padStart(2, '0');
14
+ const hhmm = (d) => two(d.getHours()) + ':' + two(d.getMinutes());
15
+ const dayStart = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
16
+
17
+ export function whenRead(iso, now = Date.now()) {
18
+ const t = Date.parse(iso);
19
+ if (!iso || Number.isNaN(t)) return '';
20
+ const d = new Date(t);
21
+ const today = dayStart(new Date(now));
22
+ if (t >= today) return hhmm(d);
23
+ if (t >= today - 24 * H) return 'yesterday ' + hhmm(d);
24
+ return Math.max(2, Math.round((today - dayStart(d)) / (24 * H))) + ' d ago';
25
+ }
26
+
27
+ const limitWord = (ms) => (ms >= 48 * H ? Math.round(ms / (24 * H)) + ' days' : Math.round(ms / H) + ' hours');
28
+
29
+ export function lineItems(sources, now = Date.now()) {
30
+ const out = [];
31
+ for (const s of sources || []) {
32
+ if (!s || s.state === 'off') continue;
33
+ if (s.id === 'repository' && s.state === 'fresh') continue; // watched: checked every few seconds
34
+ const at = whenRead(s.as_of, now);
35
+ let text; let title;
36
+ if (s.state === 'building') { text = s.label + ' reading…'; title = 'Being read now'; }
37
+ else if (s.state === 'never') { text = s.label + ' not read yet'; title = 'Never read on this machine'; }
38
+ else if (s.state === 'failed') { text = s.label + ' failed' + (at ? ', last read ' + at : ''); title = 'The last read failed'; }
39
+ else if (s.state === 'stale') { text = s.label + ' read ' + at; title = s.stale_after_ms ? 'Older than ' + limitWord(s.stale_after_ms) : 'Changed since it was read'; }
40
+ else { text = s.label + ' read ' + at; title = 'Last read ' + (s.as_of ? new Date(Date.parse(s.as_of)).toLocaleString() : ''); }
41
+ out.push({ id: s.id, state: s.state, text, title });
42
+ }
43
+ return out;
44
+ }
45
+
46
+ export const behindOf = (items) => items.filter((i) => i.state === 'stale' || i.state === 'failed' || i.state === 'never');