create-pmos 0.753.0 → 0.755.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.753.0",
3
+ "version": "0.755.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": {
@@ -33,6 +33,32 @@
33
33
  "audit"
34
34
  ],
35
35
  "pmosChanges": [
36
+ {
37
+ "v": "0.755.0",
38
+ "at": "2026-11-24T00:55:56.769Z",
39
+ "f": 4,
40
+ "prs": [
41
+ {
42
+ "n": 1699,
43
+ "t": "A new product passes a Setup station before PMOS plans its work",
44
+ "s": "A new product passes a Setup station before PMOS plans its work",
45
+ "k": "new"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "v": "0.754.0",
51
+ "at": "2026-11-24T00:39:51.827Z",
52
+ "f": 4,
53
+ "prs": [
54
+ {
55
+ "n": 1705,
56
+ "t": "The Driver follows the line: works missing exit items, quote-checked stage moves, sprint dates",
57
+ "s": "The Driver follows the line: works missing exit items, quote-checked stage moves, sprint dates",
58
+ "k": "new"
59
+ }
60
+ ]
61
+ },
36
62
  {
37
63
  "v": "0.753.0",
38
64
  "at": "2026-11-24T00:26:15.065Z",
@@ -520,83 +546,6 @@
520
546
  }
521
547
  }
522
548
  ]
523
- },
524
- {
525
- "v": "0.732.0",
526
- "at": "2026-11-23T06:02:19.112Z",
527
- "f": 4,
528
- "prs": [
529
- {
530
- "n": 1632,
531
- "t": "Work always opens in the full popup; remove \"Open work beside the page\"",
532
- "s": "Work always opens in the full popup; remove \"Open work beside the page\"",
533
- "k": "fix",
534
- "try": {
535
- "steps": [
536
- "Open any work item.",
537
- "Check the chat's ⋯ menu."
538
- ],
539
- "see": "The full popup every time; Open work beside the page is gone."
540
- }
541
- },
542
- {
543
- "n": 1628,
544
- "t": "Customer signal count on each roadmap item (A157)",
545
- "s": "Customer signal count on each roadmap item (A157)",
546
- "k": "new",
547
- "try": {
548
- "steps": [
549
- "Open Work in List view."
550
- ],
551
- "see": "Items with customer signals show a count in the Next cell; pressing it lists them.",
552
- "open": "/premium-board.html"
553
- }
554
- },
555
- {
556
- "n": 1630,
557
- "t": "Draft positioning and key messages from the strategy, each citing its line (A328)",
558
- "s": "Draft positioning and key messages from the strategy, each citing its line (A328)",
559
- "k": "new",
560
- "try": {
561
- "steps": [
562
- "On a product with a five-line strategy, ask the chat to draft positioning and key messages."
563
- ],
564
- "see": "Each line of the draft cites the strategy line it came from."
565
- }
566
- }
567
- ]
568
- },
569
- {
570
- "v": "0.731.0",
571
- "at": "2026-11-23T05:49:52.192Z",
572
- "f": 4,
573
- "prs": [
574
- {
575
- "n": 1631,
576
- "t": "One icon per action, and a check for icons that drift (A414)",
577
- "s": "One icon per action, and a check for icons that drift (A414)",
578
- "k": "new",
579
- "try": {
580
- "steps": [
581
- "Look at close, approve, add, undo and back buttons on a few pages."
582
- ],
583
- "see": "Each action draws the same icon everywhere."
584
- }
585
- },
586
- {
587
- "n": 1629,
588
- "t": "PMOS drafts a product's principles from its past decisions, each citing them (job #1613)",
589
- "s": "PMOS drafts a product's principles from its past decisions, each citing them (job #1613)",
590
- "k": "new",
591
- "try": {
592
- "steps": [
593
- "Open Work for one product that has 3 or more decisions."
594
- ],
595
- "see": "A Principles block under the strategy with 4 to 6 drafts, each citing decisions; keep or drop each.",
596
- "open": "/premium-board.html"
597
- }
598
- }
599
- ]
600
549
  }
601
550
  ]
602
551
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@cb307f57
1
+ kernel-source: pmos@64ab80f6
2
2
  assembled: 2026-11-24
3
3
  mode: vendor
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Eval calibration log"
4
4
  description: "Append-only record of every PM override of an evaluator verdict."
5
- generated: {by: process:create-pmos, at: "2026-11-24T00:26:11Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T00:55:53Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Health budgets"
4
4
  description: "Closed registry of health-budget anchors (D59), edited only by the PM."
5
- generated: {by: process:create-pmos, at: "2026-11-24T00:26:11Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T00:55:53Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  type: Reference
3
3
  title: "Discoveries and friction log"
4
4
  description: "Append-only record of what runs discovered and where the process rubbed."
5
- generated: {by: process:create-pmos, at: "2026-11-24T00:26:11Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-24T00:55:53Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.755.0",
4
+ "at": "2026-11-24T00:55:56.769Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1699,
9
+ "t": "A new product passes a Setup station before PMOS plans its work",
10
+ "s": "A new product passes a Setup station before PMOS plans its work",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.754.0",
17
+ "at": "2026-11-24T00:39:51.827Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1705,
22
+ "t": "The Driver follows the line: works missing exit items, quote-checked stage moves, sprint dates",
23
+ "s": "The Driver follows the line: works missing exit items, quote-checked stage moves, sprint dates",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.753.0",
4
30
  "at": "2026-11-24T00:26:15.065Z",
@@ -51,6 +51,15 @@ Some computers have no global git name and email, so each repository keeps its o
51
51
 
52
52
  Type `pmos git-identity` in the repository to see the identity it commits as and the GitHub login it pushes with. When one is missing, the result lists the ones your other repositories use. To save your choice for this repository only, type `pmos git-identity set --name "Your Name" --email you@example.com --login your-github-login`. To save only the login, type `pmos git-identity set --login your-github-login`. After that, `git push` in the repository uses that login, whichever login `gh` has active. Your global git settings do not change.
53
53
 
54
+ ### pmos setup: the Setup station of a new product
55
+
56
+ A new product passes Setup when three things are recorded: its tracker was read, at least one goal is agreed, and it has an owner. Until then, PMOS runs only Triage and the documents part of Discovery on it. A product with work already past Discovery is not held.
57
+
58
+ - `pmos setup` (or `pmos setup check`) shows the three items, each with the record it rests on, and the next proposal. The number of items met is on the last line.
59
+ - `pmos setup agree goal` keeps the goal PMOS drafted. The goal loses its PROPOSED mark.
60
+ - `pmos setup owner "<name>"` writes the owner in project-context.md.
61
+ - `pmos setup undo` takes the last of these two back. It does nothing when the file was changed since.
62
+
54
63
  ## Your day
55
64
 
56
65
  ### pmos today
@@ -620,7 +629,13 @@ An initiative with no plan end is "can't tell". PMOS never guesses its date.
620
629
 
621
630
  ### pmos driver: the Initiative Driver
622
631
 
623
- The agent uses `pmos driver propose` to file a proposal and `pmos driver status` to read what exists. In Auto mode, `pmos driver propose` says whether it applied the proposal or left it for you, and why. The other commands are yours, at an interactive terminal:
632
+ The agent uses `pmos driver propose` to file a proposal and `pmos driver status` to read what exists. In Auto mode, `pmos driver propose` says whether it applied the proposal or left it for you, and why.
633
+
634
+ The agent uses `pmos driver exits <initiative>` to read its work from the line: the station, the To finish lines that are still missing, the next move, and who holds each Jira ticket in which sprint. It does not work an initiative that the line marks as waiting or can't tell.
635
+
636
+ A stage move that the Driver proposes names the stage it leaves and quotes a record line for each To finish line of that stage. The Checker looks for each quote, word for word, in the file or Jira ticket that it names. When every quote is found, the move applies by itself and you can undo it for 14 days. When a quote is not found, the move waits for you. PMOS refuses the move when the line cannot place the initiative, or when you or Jira moved it after the proposal. Your own moves are never checked.
637
+
638
+ The other commands are yours, at an interactive terminal:
624
639
 
625
640
  - `pmos driver keep <proposal>` asks you to type the proposal id. A kept move is pressed on the page.
626
641
  - `pmos driver return <proposal> --note "<what to change>"` sends it back.
@@ -4,6 +4,8 @@
4
4
  * pmos driver propose <initiative|work> <id> --what <what> (--file <json|md> | --data "<text>") --why "<one line>"
5
5
  * [--source label=ref …] [--ws <id>] an agent session files a proposal (anyone may; the PM seldom does)
6
6
  * pmos driver status <initiative|work> <id> proposals, pause, mode and the day's runs (read)
7
+ * pmos driver exits <initiative> the work `pmos line` gives this initiative: station, missing exit items,
8
+ * next move, and who holds its Jira tickets in which sprint (read)
7
9
  * pmos driver keep <proposal> PM only: type the proposal id to confirm
8
10
  * pmos driver return <proposal> --note "<what to change>" PM only: send back; the note wakes a run
9
11
  * pmos driver drop <proposal> [--note "<why>"] PM only
@@ -14,7 +16,11 @@
14
16
  *
15
17
  * Who wrote a line is the call path (lib/actor.js), never an argument. `keep` goes through lib/pm-guard.js requirePmCli, which
16
18
  * refuses an agent session without asking; `return`, `drop`, `pause`, `resume` and `mode` refuse any actor that is not the PM
17
- * at an interactive terminal. The agent-facing verbs are `propose` and `status` only. Keep writes through the existing writers
19
+ * at an interactive terminal. The agent-facing verbs are `propose`, `status` and `exits` only.
20
+ * THE CHECKER'S GATE (product line slice 3, lib/line-driver.js moveGate). A proposed stage move names the station it leaves (`from`) and
21
+ * quotes a record line for every exit item of it (`exits`). A move on an initiative the line cannot place, or that you or Jira moved
22
+ * since, is refused. A move whose quotes all check out writes a `pass` line to checker.jsonl and applies by itself with Undo; one that
23
+ * does not writes a `flag` line and waits for the PM. Keep writes through the existing writers
18
24
  * (lib/driver-decide.js); a kept move is pressed on the workspace page, where the board move route runs.
19
25
  * Exit codes: 0 done, 1 refused, 2 usage.
20
26
  */
@@ -27,13 +33,16 @@ const D = require('./driver.js');
27
33
  const decideLib = require('./driver-decide.js');
28
34
  const stageTools = require('./stage-tools.js');
29
35
  const stateRoot = require('./state-root.js');
36
+ const setupLib = require('./setup-station.js');
30
37
 
31
- const COMMANDS = { driver: ['propose', 'status', 'keep', 'return', 'drop', 'undo', 'pause', 'resume', 'mode'] };
38
+ const COMMANDS = { driver: ['propose', 'status', 'exits', 'keep', 'return', 'drop', 'undo', 'pause', 'resume', 'mode'] };
32
39
  const USAGE = [
33
- 'usage: pmos driver propose|status|keep|return|drop|undo|pause|resume|mode — the Initiative Driver',
40
+ 'usage: pmos driver propose|status|exits|keep|return|drop|undo|pause|resume|mode — the Initiative Driver',
34
41
  ' pmos driver propose <initiative|work> <id> --what <what> (--file <json|md> | --data "<text>") --why "<one line>" [--source label=ref …] [--confidence 0..1] [--recommended "<what you suggest>"] [--reversible true|false] [--effort S|M|L]',
35
42
  ' what: problem, evidence, sizing, assumption, stakeholders, move, note, doc, overlap, artefact (initiative) · next-step, follow-up, note (Work task)',
36
43
  ' pmos driver status <initiative|work> <id>',
44
+ ' pmos driver exits <initiative> the station, its missing exit items and the tracker\'s owners and sprints',
45
+ ' a move: --what move with data {"to": "<stage>", "from": "<the stage it leaves>", "exits": [{"item": "<To finish line>", "quote": "<copied word for word>", "ref": "<file path or Jira key>"}]}',
37
46
  ' pmos driver keep <proposal> PM only',
38
47
  ' pmos driver return <proposal> --note "<what to change>" PM only',
39
48
  ' pmos driver drop <proposal> [--note "<why>"] PM only',
@@ -41,7 +50,7 @@ const USAGE = [
41
50
  ' pmos driver pause|resume <initiative|work> <id> PM only',
42
51
  ' pmos driver mode <off|shadow|approve|auto> [--board <id>] PM only (auto, the default: class A and B apply at once with Undo)',
43
52
  ' every command: [--json] [--root <dir>]',
44
- 'Every claim in a proposal carries a pointer (--source label=ref). The driver sends nothing. In auto mode (D106) a class A or B proposal is applied at once, with Undo; a class C one (a stage move, a follow-up) waits for the PM.',
53
+ 'Every claim in a proposal carries a pointer (--source label=ref). The driver sends nothing. In auto mode (D106) a class A or B proposal is applied at once, with Undo; a class C one (a follow-up, a stage move the quote check did not pass) waits for the PM.',
45
54
  ];
46
55
  const BOOL = new Set(['json', 'help']);
47
56
  const VALUE = new Set(['what', 'file', 'data', 'why', 'source', 'ws', 'note', 'board', 'root', 'confidence', 'recommended', 'reversible', 'effort']);
@@ -139,6 +148,12 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
139
148
  if (flags.effort !== undefined) asked.effort = String(flags.effort).toUpperCase();
140
149
  const c = D.checkProposal({ ...target(), what: flags.what, data: d.data, why: flags.why, sources: s.sources, ...asked });
141
150
  if (!c.ok) return fail(c.error);
151
+ // setup-station: until a new product passes Setup, only Triage and the documents part of Discovery run (lib/setup-station.js gate)
152
+ if (c.proposal.target.kind === 'initiative' && !setupLib.DOC_WHATS.includes(c.proposal.what)) {
153
+ const sr = setupLib.check(setupLib.read(root, { runtimeDir: stateRoot.defaultRoot() }));
154
+ const g = setupLib.gate(sr, sr.passed ? [] : setupLib.stepsOf(root), { what: c.proposal.what, data: c.proposal.data });
155
+ if (!g.ok) { console.error(`[setup] held ${c.proposal.what} on ${c.proposal.target.id}: missing ${sr.missing.join(', ')}`); return fail(g.error); }
156
+ }
142
157
  const actor = actorLib.fromCli(who);
143
158
  const state = D.fold(D.readLines(file));
144
159
  const same = JSON.stringify(c.proposal.data);
@@ -158,15 +173,53 @@ async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), isT
158
173
  }
159
174
  const dup = [...state.proposals.values()].find((p) => D.targetKey(p.target) === D.targetKey(c.proposal.target) && p.what === c.proposal.what && JSON.stringify(p.data) === same);
160
175
  if (dup) return done({ filed: false, duplicate: dup.id, state: dup.state }, `${dup.id} holds this already (${dup.state}); nothing new was filed`);
176
+ // product line slice 3: the Checker's quote check before PMOS moves a stage (lib/line-driver.js moveGate)
177
+ let gate = null;
178
+ if (c.proposal.what === 'move' && c.proposal.target.kind === 'initiative') {
179
+ const LD = require('./line-driver.js');
180
+ const id0 = c.proposal.target.id;
181
+ let row = null, b = null;
182
+ try { const l = require('./line.js').lineOf(root, { only: id0, now: now == null ? Date.now() : now }); row = l.ok ? l.rows[0] : null; } catch { row = null; }
183
+ try { b = LD.boardRowOf(root, id0); } catch { b = null; }
184
+ gate = LD.moveGate({ row, boardRow: b && b.ok ? b.row : null, exits: c.proposal.data.exits || [], from: c.proposal.data.from || null, readText: LD.readerOf(root, id0) });
185
+ // can't tell, or moved since by you or Jira: the move is not filed at all (plan rules 1 and 2)
186
+ // a line that cannot read the initiative at all leaves the move to the PM (flagged); a row the line reads as can't tell, or one you or
187
+ // Jira moved since, is not filed
188
+ if (!gate.ok && row && row.live && (row.flag === 'cant-tell' || /no longer applies/.test(gate.why))) return fail(`the stage move is refused: ${gate.why}`);
189
+ if (!c.proposal.data.from && row && row.station) c.proposal.data.from = row.station.key;
190
+ // each quoted record is a source of the move (no source, no auto)
191
+ const have = new Set(c.proposal.sources.map((x) => x.ref));
192
+ for (const x of c.proposal.data.exits || []) if (!have.has(x.ref) && c.proposal.sources.length < 20) { c.proposal.sources.push({ label: x.item.slice(0, 80), ref: x.ref }); have.add(x.ref); }
193
+ }
161
194
  const token = actorLib.isAgent(actor) && actor.by !== 'agent:unknown' ? actor.by.slice('agent:'.length) : null;
162
195
  const id = D.newId('p');
163
196
  const line = D.append(file, { ev: 'proposal', id, ...c.proposal, run: D.runOfSession(state, token), by: actor.by }, { now });
197
+ if (gate) {
198
+ const LD = require('./line-driver.js');
199
+ try { require('./orchestrator-checker.js').append(stateDir, { run: line.run || null, proposal: id, verdict: gate.ok ? 'pass' : 'flag', reason: `${LD.CHECKER_REASON}: ${gate.why}`.slice(0, 300) }); } catch { /* no check line: the move waits for the PM */ }
200
+ console.error(`[driver-follows-line] move ${id} on ${c.proposal.target.id}: quote check ${gate.ok ? 'pass' : 'flag'}`);
201
+ }
164
202
  // D106: in auto mode a class A or B proposal is applied at once, through the same Keep, with Undo; anything else waits for the PM
165
203
  const a = await decideLib.autoApply({ file, proposal: id, actor, ctx: ctxOf(), now, stateDir, product: ws });
166
204
  if (a.applied) return done({ filed: true, applied: true, id, class: a.cls, proposal: { ...line, by: actorLib.pageName(line.by) } }, `✓ applied ${id}: ${c.proposal.what} for ${c.proposal.target.kind} ${c.proposal.target.id} (class ${a.cls}). Undo: pmos driver undo ${id}`);
167
205
  return done({ filed: true, applied: false, why: a.why, id, proposal: { ...line, by: actorLib.pageName(line.by) } }, `✓ filed ${id}: ${c.proposal.what} for ${c.proposal.target.kind} ${c.proposal.target.id}. It waits for the PM (${a.why}).`);
168
206
  }
169
207
 
208
+ if (verb === 'exits') {
209
+ const id0 = pos[0] === 'initiative' ? pos[1] : pos[0];
210
+ if (!id0) { say('usage: pmos driver exits <initiative>'); return 2; }
211
+ const LD = require('./line-driver.js');
212
+ let l;
213
+ try { l = require('./line.js').lineOf(root, { only: id0, now: now == null ? Date.now() : now }); } catch (e) { return fail(String((e && e.message) || e).slice(0, 200)); }
214
+ if (!l.ok) return fail(l.error);
215
+ const row = l.rows[0];
216
+ const tracker = LD.trackerOf(root, id0);
217
+ const lines = LD.linesFor(row, tracker);
218
+ if (json) { say(JSON.stringify({ ok: true, initiative: id0, work: LD.workOf(row), tracker, lines })); return 0; }
219
+ for (const x of lines) say(x);
220
+ return 0;
221
+ }
222
+
170
223
  if (verb === 'status') {
171
224
  if (!needTarget()) return 2;
172
225
  if (!file) return noState();
@@ -52,10 +52,17 @@ async function writeRecord(p, actor, ctx, now) {
52
52
  return { ok: true, wrote: 'problem', undo: { op: 'problem', from: before ? before.data : null, to: c.data } };
53
53
  }
54
54
  if (p.what === 'move') {
55
- if (typeof ctx.move !== 'function') return refuse(409, 'a move is kept from the workspace page');
56
- const r = await ctx.move(p);
55
+ // product line slice 3: with no page (an automatic keep from `pmos driver propose`), the board move route's own function runs from
56
+ // the repository (lib/line-driver.js boardMove). The station it left is kept for Undo.
57
+ const LD = require('./line-driver.js');
58
+ let before = null; try { before = ctx.root ? LD.stationNow(ctx.root, p.target.id) : null; } catch { before = null; }
59
+ let r;
60
+ if (typeof ctx.move === 'function') r = await ctx.move(p);
61
+ else if (ctx.root) r = LD.boardMove(ctx.root, { id: p.target.id, to: p.data.to, why: p.why }, actor);
62
+ else return refuse(409, 'a move is kept from the workspace page');
57
63
  if (!r || !r.body || r.body.ok !== true) return refuse((r && r.status) || 500, (r && r.body && r.body.error) || 'the move was refused');
58
- return { ok: true, wrote: 'move', warnings: r.body.warnings || [] };
64
+ const from = before ? before.key : (p.data && p.data.from) || null;
65
+ return { ok: true, wrote: 'move', warnings: r.body.warnings || [], ...(from ? { undo: { op: 'move', from, to: p.data.to } } : {}) };
59
66
  }
60
67
  if (p.what === 'doc') {
61
68
  if (!ctx.root) return refuse(409, 'this repository has no folder for the core documents');
@@ -96,8 +103,18 @@ async function writeRecord(p, actor, ctx, now) {
96
103
  }
97
104
 
98
105
  /* D106 "no Undo, no auto": the kinds whose Keep has an Undo. A decision-only kind (evidence, sizing, …) is undone in the ledger alone.
99
- * `doc` issues a document and `move` moves a stage: neither has an Undo writer, so neither is applied by itself. */
106
+ * `doc` issues a document: it has no Undo writer, so it is never applied by itself. `move` is not in the list either: a stage move
107
+ * applies by itself only when the Checker's quote check passed it (product line slice 3, Wawan 2026-11-23: "Yes, apply with Undo";
108
+ * quoteChecked below), and its Undo moves it back while nobody moved it since. */
100
109
  const UNDOABLE = new Set(['problem', 'next-step', 'evidence', 'sizing', 'assumption', 'stakeholders', 'note', 'overlap', 'artefact']);
110
+ /** A move the Checker passed: its quote-check line in checker.jsonl, beside the ledger, says pass (lib/line-driver.js moveGate). */
111
+ function quoteChecked(file, p) {
112
+ if (!p || p.what !== 'move' || !file) return false;
113
+ try {
114
+ const c = require('./orchestrator-checker.js').readChecks(path.dirname(file)).get(p.id);
115
+ return !!c && c.verdict === 'pass' && String(c.reason || '').startsWith(require('./line-driver.js').CHECKER_REASON);
116
+ } catch { return false; }
117
+ }
101
118
 
102
119
  async function decide(verb, { file, proposal, note, actor, ctx = {}, now, auto = false } = {}) {
103
120
  if (!['keep', 'return', 'drop'].includes(verb)) return refuse(500, `driver: ${JSON.stringify(verb)} is not a decision`);
@@ -157,9 +174,11 @@ async function autoApply({ file, proposal, actor, ctx = {}, now, stateDir, produ
157
174
  if (!p || p.state !== 'open') return { applied: false, why: 'not open' };
158
175
  const m = mode || D.modeOf(state, p.target.kind === 'work' ? 'work' : null);
159
176
  // no source, no auto (A443): a Driver change that cites nothing is class C and waits for the PM
160
- const cls = A.classOfDriverProposal(p);
177
+ // product line slice 3: a stage move the Checker's quote check passed is reversible and sourced (class B, with Undo); any other move stays C
178
+ const checkedMove = quoteChecked(file, p);
179
+ const cls = checkedMove ? 'B' : A.classOfDriverProposal(p);
161
180
  const src = require('./source-guard.js').citedOf(p);
162
- const d = A.decide({ stateDir, job: jobOf(p), product, cls, mode: m, undoable: UNDOABLE.has(p.what), now, settingsDir: ctx.settingsDir || null, sources: src });
181
+ const d = A.decide({ stateDir, job: jobOf(p), product, cls, mode: m, undoable: UNDOABLE.has(p.what) || checkedMove, now, settingsDir: ctx.settingsDir || null, sources: src });
163
182
  if (!d.apply && !src.length) A.logHeld(jobOf(p), product, p.id);
164
183
  if (!d.apply) return { applied: false, why: d.why, cls };
165
184
  // board AwI: Intent is the PM's; Claude's change to it is a ✦ proposal on the product page and never applies by itself
@@ -196,7 +215,7 @@ async function undo({ file, proposal, actor, ctx = {}, now, stateDir, product =
196
215
  }
197
216
  if (p.state !== 'kept') return refuse(409, `the proposal is ${p.state}, so there is nothing to undo`);
198
217
  if (p.decided_at && t - Date.parse(p.decided_at) > require('./autonomy.js').UNDO_DAYS * D.DAY) return refuse(409, 'Undo is open for 14 days after a change; this one is older');
199
- if (!UNDOABLE.has(p.what)) return refuse(409, `a kept ${p.what} has no Undo`);
218
+ if (!UNDOABLE.has(p.what) && !(p.what === 'move' && p.undo && p.undo.op === 'move')) return refuse(409, `a kept ${p.what} has no Undo`);
200
219
  let back = true;
201
220
  const u = p.undo || {};
202
221
  if (p.what === 'problem' && u.op === 'problem' && ctx.stageFile) {
@@ -209,6 +228,16 @@ async function undo({ file, proposal, actor, ctx = {}, now, stateDir, product =
209
228
  const r = A.undo(A.file(A.dirOf(ctx.root)), { ref: u.ref }, actor, { now: t });
210
229
  if (!r.ok) back = false;
211
230
  else require('./artefact-mirror.js').after(ctx.root, r.line, A.file(A.dirOf(ctx.root)));
231
+ } else if (p.what === 'move' && u.op === 'move') {
232
+ // product line slice 3: back to the station it left, only while it still stands where PMOS moved it (a later move by you or Jira wins)
233
+ const LD = require('./line-driver.js');
234
+ let cur = null; try { cur = ctx.root ? LD.stationNow(ctx.root, p.target.id) : null; } catch { cur = null; }
235
+ if (!cur || !LD.sameStage(cur, u.to) || !u.from) back = false;
236
+ else {
237
+ const r = typeof ctx.move === 'function' ? await ctx.move({ ...p, data: { ...(p.data || {}), to: u.from }, why: 'Undo: PMOS moved it' })
238
+ : LD.boardMove(ctx.root, { id: p.target.id, to: u.from, why: 'Undo: PMOS moved it' }, actor);
239
+ if (!r || !r.body || r.body.ok !== true) back = false;
240
+ }
212
241
  } else if (p.what === 'next-step' && u.op === 'next-step' && ctx.itemsDir) {
213
242
  const paths = itemsPaths(ctx.itemsDir);
214
243
  pmItems.appendEvent(paths.steps, { event: 'step_removed', id: u.step }, new Date(t));
@@ -14,6 +14,9 @@
14
14
  * initiative's tickets (null when none: the Do rule then stays quiet instead of guessing). `has_evidence` counts kept driver
15
15
  * evidence only. `has_done_criteria` is a PRD that names done-criteria, acceptance criteria or a rubric, or a rubric file.
16
16
  * `docs_due` and `docs_stale` (core-documents) are the current stage's core documents that are due or stale (lib/core-docs.js driverLists).
17
+ * `exit` (product line slice 3) is the initiative's place on the line (lib/line.js, read from the rows the server already holds) as
18
+ * lib/line-driver.js exitFact gives it: station, missing exit items, next move, flag, and whether the Driver may act on them. A line that
19
+ * cannot be read gives no `exit`: the exit rule then stays quiet. The line is read at most once per LINE_MS per repository.
17
20
  */
18
21
  const fs = require('fs');
19
22
  const path = require('path');
@@ -23,6 +26,17 @@ const pmItems = require('./pm-items.js');
23
26
  const itemSteps = require('./item-steps.js');
24
27
 
25
28
  const ms = (iso) => { const t = Date.parse(iso); return Number.isFinite(t) ? t : null; };
29
+ const LINE_MS = 10 * 60 * 1000;
30
+ const lineMemo = new Map(); // root → { at, rows: Map id → line row }
31
+ /** The line rows of a repository (lib/line.js), from the rows already derived. An empty Map when it cannot be read. */
32
+ function lineRows(root, now) {
33
+ const c = lineMemo.get(root);
34
+ if (c && now - c.at < LINE_MS && now >= c.at) return c.rows;
35
+ let rows = new Map();
36
+ try { const r = require('./line.js').lineOf(root, { now, derive: false }); if (r && r.ok) rows = new Map(r.rows.map((x) => [x.id, x])); else if (r && r.pending) return rows; } catch { rows = new Map(); }
37
+ lineMemo.set(root, { at: now, rows });
38
+ return rows;
39
+ }
26
40
 
27
41
  function fmOf(root, rel) {
28
42
  if (!rel) return {};
@@ -66,6 +80,7 @@ function initiativeFacts(w, ctx, { driverState, stateDir, now = Date.now() }) {
66
80
  return { problem: has('experiment', 'why'), evidence: has('experiment', 'evidence'), doneTest: has('done-test', 'check') };
67
81
  };
68
82
  const out = [];
83
+ const line = lineRows(w.root, now);
69
84
  // core-documents: each active initiative's core set with its state, read once for the sweep (lib/core-docs.js). A set that cannot be
70
85
  // read gives empty lists: the doc rules then stay quiet instead of guessing.
71
86
  let docSets = new Map();
@@ -93,6 +108,7 @@ function initiativeFacts(w, ctx, { driverState, stateDir, now = Date.now() }) {
93
108
  outcome_checked: outcomeChecked(stateDir, base.id),
94
109
  kill_tripped: !!(rec.kill && rec.kill.data && (rec.kill.data.items || []).some((i) => i.status === 'tripped')),
95
110
  ...(() => { const set = docSets.get(base.id); if (!set) return { docs_due: [], docs_stale: [] }; const l = require('./core-docs.js').driverLists(set); return { docs_due: l.due, docs_stale: l.stale }; })(),
111
+ ...(line.has(base.id) ? { exit: require('./line-driver.js').exitFact(line.get(base.id)) } : {}),
96
112
  });
97
113
  }
98
114
  return { ok: true, list: out };
@@ -125,4 +141,4 @@ function gather(w, ctx, { now = Date.now(), includeWork = false, runtimeDir, dri
125
141
  return { ok: true, facts };
126
142
  }
127
143
 
128
- module.exports = { gather, initiativeFacts, workFacts };
144
+ module.exports = { gather, initiativeFacts, workFacts, lineRows };
@@ -182,7 +182,10 @@ function checkProposal(input) {
182
182
  data = { text: c.data.text };
183
183
  } else if (i.what === 'move') {
184
184
  if (!oneLine(data.to, 120)) return { ok: false, error: 'a move needs data.to: the name of the stage' };
185
- data = { to: data.to.trim(), ...(oneLine(data.board, 120) ? { board: data.board.trim() } : {}) };
185
+ // product line slice 3: the station it leaves (`from`) and one quote per exit item (`exits`), for the Checker's gate (lib/line-driver.js)
186
+ const ex = require('./line-driver.js').checkExits(data);
187
+ if (!ex.ok) return { ok: false, error: ex.error };
188
+ data = { to: data.to.trim(), ...(oneLine(data.board, 120) ? { board: data.board.trim() } : {}), ...(oneLine(data.from, 120) ? { from: data.from.trim() } : {}), ...(ex.exits.length ? { exits: ex.exits } : {}) };
186
189
  } else if (i.what === 'doc') {
187
190
  // core-documents: a draft the run wrote with `pmos coredoc write`. Keep issues it (lib/driver-decide.js).
188
191
  const CD = require('./core-docs.js');
@@ -429,6 +432,8 @@ function detect(facts, state, { now, stalledDays } = {}) {
429
432
  if (Array.isArray(i.docs_due) && i.docs_due.length) { b('doc-due', 'agent', i.cat || null, `Documents due at this stage: ${i.docs_due.join(', ')}`); out[out.length - 1].docs = i.docs_due.slice(); }
430
433
  if (Array.isArray(i.docs_stale) && i.docs_stale.length) b('doc-stale', 'agent', i.cat || null, `Stale since the stage move: ${i.docs_stale.join(', ')}`);
431
434
  if (i.last_activity != null && t - i.last_activity >= stall) b('stalled', 'agent', null, `Nothing changed for ${Math.floor((t - i.last_activity) / DAY)} days`);
435
+ // product line slice 3 (lib/line-driver.js): the station's missing exit items, as `pmos line` reads them, wake the Driver to work them
436
+ { const x = require('./line-driver.js').blockerOf(i.exit, state, { now: t }); if (x) { add(target, i.board || null, title, x.code, 'agent', i.cat || null, x.text, iniKey(i, x.key)); out[out.length - 1].exit = x.items; } }
432
437
  }
433
438
  for (const w of facts.work || []) {
434
439
  if (!w || w.done) continue;
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ /* line-driver-count.js — the health number of initiative driver-follows-line.
4
+ * node workspace/lib/line-driver-count.js [<checkout>]
5
+ * Prints the Checker's quote checks of the last 14 days, pass and flag, and on its last line the number that passed: the stage moves PMOS
6
+ * could make by itself. It reads <state folder>/checker.jsonl and writes nothing. */
7
+ const path = require('path');
8
+ const root = path.resolve(process.argv[2] || process.cwd());
9
+ const dir = require('./driver.js').stateDirOf(root) || root;
10
+ const c = require('./line-driver.js').countChecks(dir);
11
+ console.log(`[driver-follows-line] quote checks in the last 14 days: ${c.pass} passed, ${c.flag} flagged`);
12
+ console.log(String(c.pass));