create-pmos 0.544.0 → 0.546.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.544.0",
3
+ "version": "0.546.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.546.0",
37
+ "at": "2026-11-09T15:25:03.150Z",
38
+ "f": 4,
39
+ "prs": [
40
+ {
41
+ "n": 1274,
42
+ "t": "D107 ratified — experiments pass the gate on a done test and a kill condition",
43
+ "s": "D107 ratified — experiments pass the gate on a done test and a kill condition",
44
+ "k": "new"
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "v": "0.545.0",
50
+ "at": "2026-11-09T10:45:44.000Z",
51
+ "f": 4,
52
+ "prs": [
53
+ {
54
+ "n": 1273,
55
+ "t": "Seven artefacts — model, map, lossless carry, and proposed D107",
56
+ "s": "Seven artefacts — model, map, lossless carry, and proposed D107",
57
+ "k": "new"
58
+ }
59
+ ]
60
+ },
35
61
  {
36
62
  "v": "0.544.0",
37
63
  "at": "2026-11-08T14:45:01.680Z",
@@ -367,62 +393,6 @@
367
393
  "k": "fix"
368
394
  }
369
395
  ]
370
- },
371
- {
372
- "v": "0.526.0",
373
- "at": "2026-11-04T10:37:51.951Z",
374
- "f": 4,
375
- "prs": [
376
- {
377
- "n": 1226,
378
- "t": "Your move is one ranked list of every open ✦, with ages (workspace grill W3)",
379
- "s": "Your move is one ranked list of every open ✦, with ages (workspace grill W3)",
380
- "k": "new"
381
- },
382
- {
383
- "n": 1225,
384
- "t": "Status says what it knows — On track only from a read (workspace grill W2)",
385
- "s": "Status says what it knows — On track only from a read (workspace grill W2)",
386
- "k": "new"
387
- },
388
- {
389
- "n": 1236,
390
- "t": "Idle lab engine — prototypes and scans while the PM is away (idle lab build E)",
391
- "s": "Idle lab engine — prototypes and scans while the PM is away (idle lab build E)",
392
- "k": "new"
393
- },
394
- {
395
- "n": 1230,
396
- "t": "One true stage per initiative, read from the real workflow (workspace grill W1)",
397
- "s": "One true stage per initiative, read from the real workflow (workspace grill W1)",
398
- "k": "new"
399
- },
400
- {
401
- "n": 1235,
402
- "t": "Good morning is one page — the quarter first, then today, then time",
403
- "s": "Good morning is one page — the quarter first, then today, then time",
404
- "k": "new"
405
- }
406
- ]
407
- },
408
- {
409
- "v": "0.525.0",
410
- "at": "2026-11-04T09:08:28.453Z",
411
- "f": 4,
412
- "prs": [
413
- {
414
- "n": 1231,
415
- "t": "Smart refresh steps 1 and 2: measure each read, ask first, share one session",
416
- "s": "Smart refresh steps 1 and 2: measure each read, ask first, share one session",
417
- "k": "new"
418
- },
419
- {
420
- "n": 1233,
421
- "t": "Two programs in one link keep both, each tab on its own product",
422
- "s": "Two programs in one link keep both, each tab on its own product",
423
- "k": "fix"
424
- }
425
- ]
426
396
  }
427
397
  ]
428
398
  }
@@ -1,3 +1,3 @@
1
- kernel-source: pmos@83e8d786
2
- assembled: 2026-11-08
1
+ kernel-source: pmos@e6b2ed40
2
+ assembled: 2026-11-09
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-08T14:44:58Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-09T15:25:00Z"}
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-08T14:44:58Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-09T15:25:00Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -667,6 +667,10 @@ function computeWorkflowDerived(id, opts) {
667
667
  }
668
668
  const fm = readFrontmatter(recAbs) || {};
669
669
  const profile = profileOf(root);
670
+ // D107 (seven artefacts): an experiment record names its Done test (done_test_path) and its kill condition (kill:). It needs no PRD
671
+ // and no lane: the done test is the spec, written before the build (D13 as amended). A record with no done_test_path keeps its lane rules.
672
+ const doneTest = String(fm.done_test_path || '').trim();
673
+ const killCond = String(fm.kill || '').trim();
670
674
  const pmProfile = profile === 'pm-artifacts';
671
675
  const lane = laneDefs.declaredLane(profile, fm) || (pmProfile ? 'prd' : 'feature');
672
676
  const knownLane = pmProfile ? laneNames('pm-artifacts').includes(lane)
@@ -770,6 +774,9 @@ function computeWorkflowDerived(id, opts) {
770
774
  // Batch 25 item 6: an initiative on a workflow is routed. The workflow's stages say what comes first, and PMOS proposes a
771
775
  // switch when the BRD says another workflow fits, so the two intake questions are not asked of it again.
772
776
  steps.push(step('route', 'route', 'done', `${onWf ? `runs the ${onWf} workflow` : 'runs its board\'s workflow'} — the workflow routes it`));
777
+ } else if (doneTest) {
778
+ // D107: an experiment's specimens and done test route it; the two intake questions are not asked of it.
779
+ steps.push(step('route', 'route', 'done', 'experiment — its done test and specimens route it (D107)'));
773
780
  } else if (effLane !== 'feature') {
774
781
  // The routing questions are asked of feature work only.
775
782
  steps.push(step('route', 'route', 'done', `${lane} lane — routing questions are for features only (${CUT_NOTE})`));
@@ -932,7 +939,29 @@ function computeWorkflowDerived(id, opts) {
932
939
  // A feature PRD's done-criteria section can serve as its rubric (sdlc-step-cuts), so a separate
933
940
  // rubric file is optional in every lane. One that is declared must still exist.
934
941
  const needsRubric = false;
935
- {
942
+ // D107: an experiment's spec is its Done test, in any lane or none, with its kill condition stated. Same order rule (O1).
943
+ const orderOf = (names, specIdx, rule) => {
944
+ if (specIdx === undefined) return step('spec', 'spec', 'unknown', `${names} present — order vs the build undecidable (${range.reason || 'no usable history'})`);
945
+ if (build.unknown) return step('spec', 'spec', 'unknown', `${names} present — order vs the build undecidable (${range.reason})`);
946
+ if (build.first === null) return step('spec', 'spec', 'done', `${names} present — no implementation commits in this range, so nothing can precede them`);
947
+ if (specIdx <= build.first) return step('spec', 'spec', 'done', `${names} — first-appeared at or before the first build commit`);
948
+ return step('spec', 'spec', legacy ? 'unknown' : 'blocked',
949
+ `ORDER VIOLATION — implementation (${build.sample}) was committed BEFORE ${names} first appeared`,
950
+ 'the done test is the spec (D13 as amended by D107). Land it in an earlier commit than the build, or split this PR so it lands first',
951
+ { blocking: !legacy, rule });
952
+ };
953
+ if (doneTest) {
954
+ const dtIdx = firstAppearance(root, range, doneTest);
955
+ if (dtIdx === null) {
956
+ steps.push(step('spec', 'spec', 'blocked', `done_test_path '${doneTest}' does not exist in the repo`,
957
+ 'create the done test the record points at, or correct done_test_path', { blocking: true, rule: 'R2' }));
958
+ } else if (!killCond) {
959
+ steps.push(step('spec', 'spec', 'blocked', 'no kill condition — an experiment states what would stop it (D107)',
960
+ `write kill: "<the result that would make us stop>" in ${recRel}`, { blocking: true, rule: 'R2' }));
961
+ } else {
962
+ steps.push(orderOf(`done test ${doneTest}`, dtIdx, 'O1'));
963
+ }
964
+ } else {
936
965
  const wants = {
937
966
  feature: 'a PRD', discovery: 'a spike brief', incident: 'an incident record',
938
967
  content: 'a content brief', prototype: 'a quick prototype brief',
@@ -1001,7 +1030,9 @@ function computeWorkflowDerived(id, opts) {
1001
1030
  // blocked: the PM's approval of the PRD and the acceptance at the end are the sign-offs that count.
1002
1031
  const approved = runs.find((r) => r.pre_run_contract && r.pre_run_contract.PM_approved === true);
1003
1032
  {
1004
- if (approved) {
1033
+ if (doneTest && !approved) {
1034
+ steps.push(step('contract', 'contract', 'na', 'experiment — the done test, written before the build, is the agreement (D107)'));
1035
+ } else if (approved) {
1005
1036
  steps.push(step('contract', 'contract', 'done',
1006
1037
  `PM-approved pre_run_contract on run ${approved.run_id}${approved.pre_run_contract.approved_by ? ` (by ${approved.pre_run_contract.approved_by})` : ''}`));
1007
1038
  } else if (effLane !== 'feature') {
@@ -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-08T14:44:58Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-09T15:25:00Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  Newest first, ISO dates.
4
4
 
5
- ## 2026-11-08
5
+ ## 2026-11-09
6
6
 
7
7
  - Adopted OKF v0.2 (D73).
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.546.0",
4
+ "at": "2026-11-09T15:25:03.150Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1274,
9
+ "t": "D107 ratified — experiments pass the gate on a done test and a kill condition",
10
+ "s": "D107 ratified — experiments pass the gate on a done test and a kill condition",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.545.0",
17
+ "at": "2026-11-09T10:45:44.000Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1273,
22
+ "t": "Seven artefacts — model, map, lossless carry, and proposed D107",
23
+ "s": "Seven artefacts — model, map, lossless carry, and proposed D107",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.544.0",
4
30
  "at": "2026-11-08T14:45:01.680Z",
@@ -377,6 +377,10 @@ When the agent files a proposal, it can also state what it knows, so that the Br
377
377
 
378
378
  The ledger is `driver.jsonl` in the state folder of the repository (`pmos/state`, `state` or `.pmos`). Each action adds one line. Nothing is changed or removed.
379
379
 
380
+ ### pmos artefacts: the seven artefacts
381
+
382
+ `pmos artefacts show [<scope>]` lists the seven artefacts of a scope: Intent, Goal, Narrative, Experiment, Specimens, Done test and Lessons. The scope is `portfolio` (the default), `board:<id>`, `goal:<id>` or `experiment:<id>`. `pmos artefacts map` lists what each older core document, driver proposal kind, report cadence and lane becomes. `pmos artefacts migrate` puts every older record under its artefact as a pointer: issued and draft core documents, kept driver proposals and report drafts. It deletes and moves nothing, and a second run carries nothing new. `pmos artefacts set <scope> <artefact> [<field>] --text "<text>"` writes one field, and `pmos artefacts undo <id>` takes it back. Intent is yours: an agent proposes a change to it and waits for you. Goal is read from the OKRs, health budgets and readings, so you cannot type it.
383
+
380
384
  ### pmos coredoc: core documents
381
385
 
382
386
  `pmos coredoc write --scope <scope> --key <key> --file <path>` writes one draft of a core document. The scope is `portfolio`, `board:<id>` or `initiative:<id>`. With `--file -` the command reads the document from standard input. The command refuses a scope it does not know, a key that is not a document of that level, and a document that PMOS reads from another source. A background run can write only the document it was started for. The command writes a draft and nothing else: you issue it on the page.
@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+ /* artefacts-cli.js — `pmos artefacts`: the seven artefacts (R18, D107, lib/artefacts.js).
3
+ *
4
+ * pmos artefacts show [<scope>] [--json] the seven artefacts of a scope (default portfolio), with what was carried into each
5
+ * pmos artefacts map [--json] what each of the 36 core documents, 9 proposal kinds, 5 cadences and 6 lanes becomes
6
+ * pmos artefacts migrate [--json] carry every older record (core documents, kept driver proposals, report drafts) under
7
+ * its artefact. Idempotent; it deletes and moves nothing
8
+ * pmos artefacts set <scope> <artefact> [<field>] --text "<…>" [--source label=ref]… one field (PM or agent; Intent is the PM's)
9
+ * pmos artefacts undo <a-id> one set line no longer counts
10
+ * every command: [--root <dir>]
11
+ * Exit codes: 0 done, 1 refused, 2 usage. */
12
+ const path = require('path');
13
+ const { execFileSync } = require('child_process');
14
+ const A = require('./artefacts.js');
15
+ const actorLib = require('./actor.js');
16
+
17
+ const COMMANDS = { artefacts: ['show', 'map', 'migrate', 'set', 'undo'] };
18
+ const USAGE = [
19
+ 'usage: pmos artefacts show|map|migrate|set|undo — the seven artefacts: Intent, Goal, Narrative, Experiment, Specimens, Done test, Lessons',
20
+ ' pmos artefacts show [<scope>] [--json] scope: portfolio (default), board:<id>, goal:<id> or experiment:<id>',
21
+ ' pmos artefacts map [--json] what every older document, proposal kind, report cadence and lane becomes',
22
+ ' pmos artefacts migrate [--json] carry the older records under their artefacts (idempotent; nothing is deleted)',
23
+ ' pmos artefacts set <scope> <artefact> [<field>] --text "<text>" [--source label=ref]…',
24
+ ' pmos artefacts undo <a-id>',
25
+ ];
26
+ function parse(args) {
27
+ const pos = []; const flags = { source: [] };
28
+ for (let i = 0; i < args.length; i++) {
29
+ const a = args[i];
30
+ if (!a.startsWith('--')) { pos.push(a); continue; }
31
+ const k = a.slice(2);
32
+ if (k === 'json') { flags.json = true; continue; }
33
+ const v = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
34
+ if (k === 'source') flags.source.push(v); else flags[k] = v;
35
+ }
36
+ return { pos, flags };
37
+ }
38
+ function repoRoot(cwd) { try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; } catch { return cwd; } }
39
+
40
+ function mapRows() {
41
+ const rows = [];
42
+ for (const [k, v] of Object.entries(A.FROM_DOCS)) rows.push({ from: 'document', name: k, ...v });
43
+ for (const [k, v] of Object.entries(A.FROM_WHATS)) rows.push({ from: 'proposal kind', name: k, ...v });
44
+ for (const [k, v] of Object.entries(A.FROM_CADENCES)) rows.push({ from: 'report cadence', name: k, ...v });
45
+ for (const [k, v] of Object.entries(A.FROM_LANES)) rows.push({ from: 'lane', name: k, ...v });
46
+ return rows;
47
+ }
48
+
49
+ function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), env = process.env, isTTY, now, dir: dirIn } = {}) {
50
+ const args = argv[0] === 'artefacts' ? argv.slice(1) : argv.slice();
51
+ const verb = args[0];
52
+ if (!verb || ['help', '--help', '-h'].includes(verb)) { for (const l of USAGE) say(l); return verb ? 0 : 1; }
53
+ if (!COMMANDS.artefacts.includes(verb)) { say(`unknown artefacts command "${verb}" — one of ${COMMANDS.artefacts.join(', ')}`); return 2; }
54
+ const { pos, flags } = parse(args.slice(1));
55
+ if (verb === 'map') {
56
+ const rows = mapRows();
57
+ if (flags.json) { say(JSON.stringify({ ok: true, artefacts: A.KEYS, rows })); return 0; }
58
+ for (const r of rows) say(`${r.from.padEnd(15)} ${r.name.padEnd(22)} → ${r.artefact ? `${r.artefact}${r.field ? '.' + r.field : ''}` : '(not an artefact)'} — ${r.note}`);
59
+ return 0;
60
+ }
61
+ const root = flags.root ? path.resolve(cwd, flags.root) : repoRoot(cwd);
62
+ let dir = dirIn || null;
63
+ if (!dir) { try { dir = A.dirOf(root); } catch (e) { say('✗ ' + String((e && e.message) || e)); return 1; } }
64
+ const f = A.file(dir);
65
+ if (verb === 'show') {
66
+ const scope = pos[0] || 'portfolio';
67
+ const v = A.viewOf(A.fold(A.readLines(f)), scope);
68
+ if (!v) { say('✗ scope must be portfolio, board:<id>, goal:<id> or experiment:<id>'); return 2; }
69
+ if (flags.json) { say(JSON.stringify({ ok: true, ...v })); return 0; }
70
+ say(v.scope);
71
+ for (const a of v.artefacts) {
72
+ say(` ${a.title}${a.empty ? ' — nothing yet' : ''}`);
73
+ for (const [k, val] of Object.entries(a.fields)) {
74
+ const list = Array.isArray(val) ? val : val ? [val] : [];
75
+ for (const x of list) say(` ${a.labels[k]}: ${x.text} (${x.id})`);
76
+ }
77
+ for (const c of a.carried) say(` carried ${c.kind} ${c.ref}${c.path ? ' · ' + c.path : ''}${c.text ? ' — ' + c.text : ''}`);
78
+ }
79
+ return 0;
80
+ }
81
+ if (verb === 'migrate') {
82
+ const r = dirIn ? A.migrate({ dir }, { now }) : A.migrateRepo(root, { now });
83
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
84
+ if (flags.json) { say(JSON.stringify({ ok: true, carried: r.carried, already: r.already })); return 0; }
85
+ say(r.carried ? `✓ carried ${r.carried} older record${r.carried === 1 ? '' : 's'} under the seven artefacts (${r.already} were already)` : `✓ nothing new to carry (${r.already} already carried)`);
86
+ return 0;
87
+ }
88
+ const actor = actorLib.fromCli({ isTTY: isTTY === undefined ? !!(process.stdin.isTTY && process.stdout.isTTY) : isTTY, env });
89
+ if (verb === 'set') {
90
+ if (pos.length < 2 || typeof flags.text !== 'string') { say(USAGE[4]); return 2; }
91
+ const sources = [];
92
+ for (const s of flags.source) { const i = s.indexOf('='); if (i < 1) { say('✗ --source is label=ref'); return 2; } sources.push({ label: s.slice(0, i), ref: s.slice(i + 1) }); }
93
+ const r = A.set(f, { scope: pos[0], artefact: pos[1], field: pos[2], text: flags.text, sources }, actor, { now });
94
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
95
+ say(flags.json ? JSON.stringify({ ok: true, id: r.line.id }) : `✓ ${r.line.artefact}.${r.line.field} on ${r.line.scope} (${r.line.id}; pmos artefacts undo ${r.line.id})`);
96
+ return 0;
97
+ }
98
+ if (!pos[0]) { say(USAGE[5]); return 2; }
99
+ const r = A.undo(f, { ref: pos[0] }, actor, { now });
100
+ if (!r.ok) { say('✗ ' + r.error); return 1; }
101
+ say(`✓ ${pos[0]} undone`);
102
+ return 0;
103
+ }
104
+
105
+ module.exports = { run, COMMANDS, USAGE, mapRows };