create-pmos 0.571.0 → 0.572.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 +14 -14
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/gate-initiative.sh +12 -2
- package/payload/scripts/workflow-state.js +60 -5
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +13 -0
- package/workspace/lib/engine/workflow-state.js +60 -5
- package/workspace/lib/vendor/scripts/workflow-state.js +60 -5
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.572.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,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.572.0",
|
|
38
|
+
"at": "2026-11-16T04:39:30.480Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1305,
|
|
43
|
+
"t": "A Project's dated tasks with a ◇ milestone are its dated plan",
|
|
44
|
+
"s": "A Project's dated tasks with a ◇ milestone are its dated plan",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.571.0",
|
|
38
51
|
"at": "2026-11-16T04:26:43.356Z",
|
|
@@ -297,19 +310,6 @@
|
|
|
297
310
|
"k": "new"
|
|
298
311
|
}
|
|
299
312
|
]
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"v": "0.552.0",
|
|
303
|
-
"at": "2026-11-10T22:15:08.780Z",
|
|
304
|
-
"f": 4,
|
|
305
|
-
"prs": [
|
|
306
|
-
{
|
|
307
|
-
"n": 1280,
|
|
308
|
-
"t": "Phone menu button clears the chat box; the PM can clear an Intent line",
|
|
309
|
-
"s": "Phone menu button clears the chat box; the PM can clear an Intent line",
|
|
310
|
-
"k": "fix"
|
|
311
|
-
}
|
|
312
|
-
]
|
|
313
313
|
}
|
|
314
314
|
]
|
|
315
315
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -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-16T04:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-16T04:39:26Z"}
|
|
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-16T04:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-16T04:39:26Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -90,7 +90,7 @@ anchor="$(frontval parent_kr)"
|
|
|
90
90
|
# In both profiles, as .github/scripts/initiative-gate.sh does for PMOS itself: a record that names its done test and kill condition is
|
|
91
91
|
# an experiment and passes in any lane (the done test is the spec, D13 as amended by D107). The kind of work sets the gate (W5): Full
|
|
92
92
|
# SDLC needs a done test and a kill condition, never a PRD or a brief; a Project needs a dated plan (plan_path: milestones with dates
|
|
93
|
-
# and owners), never a PRD or a brief. A PRD or brief already on the record still passes: a gate passed stays passed. `pmos artefacts
|
|
93
|
+
# and owners, or dated tasks with a ◇ milestone in the task store), never a PRD or a brief. A PRD or brief already on the record still passes: a gate passed stays passed. `pmos artefacts
|
|
94
94
|
# set experiment:<id> done-test …` writes done_test_path and kill: for you (lib/artefact-mirror.js).
|
|
95
95
|
done_test="$(frontval done_test_path)"
|
|
96
96
|
kill_cond="$(frontval kill)"
|
|
@@ -108,7 +108,17 @@ fi
|
|
|
108
108
|
if [ "$kind" = project ]; then
|
|
109
109
|
plan="$(frontval plan_path)"
|
|
110
110
|
if [ -n "$plan" ] || [ -z "$had_spec" ]; then
|
|
111
|
-
[ -
|
|
111
|
+
if [ -z "$plan" ]; then
|
|
112
|
+
# Dated tasks with a dated ◇ milestone in the task store ARE the dated plan (pmos task add --due … / pmos task set --milestone): the
|
|
113
|
+
# reader is workflow-state.js --task-plan, shipped next to this script (scripts/ in the PMOS repository itself).
|
|
114
|
+
here="$(cd "$(dirname "$0")" && pwd)"; ws=""; tp=""
|
|
115
|
+
for c in "$here/workflow-state.js" "$here/../../scripts/workflow-state.js"; do [ -f "$c" ] && { ws="$c"; break; }; done
|
|
116
|
+
if [ -n "$ws" ] && command -v node >/dev/null 2>&1 && tp="$(node "$ws" --task-plan "$id" --root . 2>/dev/null)"; then
|
|
117
|
+
echo "✅ initiative gate PASSED — '$id' (Project): $init_file exists and the dated plan is in the task store ($tp)."
|
|
118
|
+
exit 0
|
|
119
|
+
fi
|
|
120
|
+
fail "initiative '$id' is a Project: it needs a dated plan, never a PRD or a brief. Add dated tasks with at least one dated ◇ milestone (pmos task add --due …, pmos task set <task> --milestone), or set plan_path in $init_file to the plan (milestones with dates and owners), or give it a done test.${tp:+ The task store has $tp.}"
|
|
121
|
+
fi
|
|
112
122
|
[ -f "$plan" ] || fail "plan_path '$plan' (from $init_file) does not exist in the repo."
|
|
113
123
|
echo "✅ initiative gate PASSED — '$id' (Project): $init_file exists and the dated plan ($plan) is present."
|
|
114
124
|
exit 0
|
|
@@ -231,6 +231,48 @@ function layout(root) {
|
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
// ── A Project's dated plan in the task store (launch simulation W6 follow-up) ─────────────────────
|
|
235
|
+
// `pmos task add/link/set --milestone` writes a Project's plan as task lines in <runsDir>/initiative-tasks.jsonl (lib/task-store.js; lines
|
|
236
|
+
// not yet moved there still sit in boards.jsonl). Dated tasks with at least one dated ◇ milestone ARE the dated plan, so plan_path is not
|
|
237
|
+
// needed: the gate (kit/scripts/gate-initiative.sh, through --task-plan) and both ladders read them here. The fold is the task part of
|
|
238
|
+
// scripts/boards.js fold: the first task line makes the task, task-update moves or re-dates it, task-remove and task-restore take it out and
|
|
239
|
+
// back, and the last task-milestone line wins. → { ok, dated, milestones, file, evidence }
|
|
240
|
+
const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
241
|
+
function taskPlanOf(root, id) {
|
|
242
|
+
const L = layout(root);
|
|
243
|
+
const files = ['boards.jsonl', 'initiative-tasks.jsonl'].map((f) => path.join(L.runsDir, f));
|
|
244
|
+
const tasks = new Map(); const removed = new Map(); const milestones = new Map();
|
|
245
|
+
for (const file of files) {
|
|
246
|
+
let text = '';
|
|
247
|
+
try { text = fs.readFileSync(file, 'utf8'); } catch { continue; }
|
|
248
|
+
for (const raw of text.split('\n')) {
|
|
249
|
+
const t = raw.trim();
|
|
250
|
+
if (!t || t[0] !== '{' || !t.includes('"task')) continue;
|
|
251
|
+
let e; try { e = JSON.parse(t); } catch { continue; }
|
|
252
|
+
if (!e || typeof e.task !== 'string' || !e.task) continue;
|
|
253
|
+
if (e.kind === 'task' && typeof e.initiative === 'string' && !tasks.has(e.task) && !removed.has(e.task)) {
|
|
254
|
+
tasks.set(e.task, { initiative: e.initiative, due: typeof e.due === 'string' ? e.due : '' });
|
|
255
|
+
} else if (e.kind === 'task-update' && tasks.has(e.task)) {
|
|
256
|
+
const x = tasks.get(e.task);
|
|
257
|
+
if (typeof e.initiative === 'string' && e.initiative) x.initiative = e.initiative;
|
|
258
|
+
if (typeof e.due === 'string') x.due = e.due;
|
|
259
|
+
} else if (e.kind === 'task-milestone' && typeof e.milestone === 'boolean') milestones.set(e.task, e.milestone);
|
|
260
|
+
else if (e.kind === 'task-remove' && tasks.has(e.task)) { removed.set(e.task, tasks.get(e.task)); tasks.delete(e.task); }
|
|
261
|
+
else if (e.kind === 'task-restore' && removed.has(e.task) && !tasks.has(e.task)) { tasks.set(e.task, removed.get(e.task)); removed.delete(e.task); }
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
let dated = 0; let ms = 0;
|
|
265
|
+
for (const [tid, x] of tasks) {
|
|
266
|
+
if (x.initiative !== id || !DAY_RE.test(x.due)) continue;
|
|
267
|
+
dated++;
|
|
268
|
+
if (milestones.get(tid) === true) ms++;
|
|
269
|
+
}
|
|
270
|
+
const file = path.relative(root, path.join(L.runsDir, 'initiative-tasks.jsonl')).split(path.sep).join('/');
|
|
271
|
+
const ok = ms > 0;
|
|
272
|
+
const evidence = `${dated} dated task${dated === 1 ? '' : 's'}, ${ms} dated milestone${ms === 1 ? '' : 's'} in ${file}`;
|
|
273
|
+
return { ok, dated, milestones: ms, file, evidence };
|
|
274
|
+
}
|
|
275
|
+
|
|
234
276
|
// ── Git ────────────────────────────────────────────────────────────────────────────────────────
|
|
235
277
|
function git(root, args) {
|
|
236
278
|
try {
|
|
@@ -973,9 +1015,12 @@ function computeWorkflowDerived(id, opts) {
|
|
|
973
1015
|
`write the done test (okf/core/templates/done-test-template.md), set done_test_path and kill: in ${recRel}`, { blocking: true, rule: 'R2' }));
|
|
974
1016
|
} else if (!doneTest && workKind === 'project' && (planPath || !prd)) {
|
|
975
1017
|
const planIdx = planPath ? firstAppearance(root, range, planPath) : null;
|
|
976
|
-
|
|
1018
|
+
const taskPlan = planPath ? null : taskPlanOf(root, id);
|
|
1019
|
+
if (taskPlan && taskPlan.ok) {
|
|
1020
|
+
steps.push(step('spec', 'spec', 'done', `dated plan in the task store: ${taskPlan.evidence}`));
|
|
1021
|
+
} else if (!planPath) {
|
|
977
1022
|
steps.push(step('spec', 'spec', 'blocked', 'Project needs a dated plan before Execute — never a PRD',
|
|
978
|
-
`write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or a done test`, { blocking: true, rule: 'R2' }));
|
|
1023
|
+
`write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or add dated tasks with a ◇ milestone (pmos task add --due … / pmos task set --milestone), or a done test`, { blocking: true, rule: 'R2' }));
|
|
979
1024
|
} else if (planIdx === null) {
|
|
980
1025
|
steps.push(step('spec', 'spec', 'blocked', `plan_path '${planPath}' does not exist in the repo`,
|
|
981
1026
|
'create the plan the record points at, or correct plan_path', { blocking: true, rule: 'R2' }));
|
|
@@ -1605,14 +1650,16 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
|
|
|
1605
1650
|
const workKind = (() => { const k = String(fm.kind || '').trim().replace(/^["']|["']$/g, ''); return k === 'sdlc' || k === 'project' ? k : 'product'; })();
|
|
1606
1651
|
const planPath = String(fm.plan_path || '').trim();
|
|
1607
1652
|
const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
|
|
1653
|
+
const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;
|
|
1608
1654
|
if (doneTest && dtPresent && killCond) steps.push(step('brief', def.brief_label, 'done', `done test ${doneTest} + kill condition (D107)`));
|
|
1609
1655
|
else if (kindSpec && workKind === 'sdlc') steps.push(step('brief', 'done test', legacy ? 'pending' : 'blocked',
|
|
1610
1656
|
'Full SDLC needs a done test and a kill condition before the first pull request — never a brief or a PRD',
|
|
1611
1657
|
`write the done test, set done_test_path and kill: in ${recRel} (pmos artefacts set experiment:${id} done-test check --text "…" writes both)`, { blocking: !legacy, rule: 'R2' }));
|
|
1612
1658
|
else if (kindSpec && exists(planPath)) steps.push(step('brief', 'dated plan', 'done', `plan ${planPath} present`));
|
|
1659
|
+
else if (kindSpec && !planPath && tasksPlan && tasksPlan.ok) steps.push(step('brief', 'dated plan', 'done', `dated plan in the task store: ${tasksPlan.evidence}`));
|
|
1613
1660
|
else if (kindSpec) steps.push(step('brief', 'dated plan', legacy ? 'pending' : 'blocked',
|
|
1614
1661
|
planPath ? `plan_path '${planPath}' does not exist in the repo` : 'Project needs a dated plan before Execute — never a brief or a PRD',
|
|
1615
|
-
planPath ? 'create the plan the record points at, or correct plan_path' : `write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or a done test`,
|
|
1662
|
+
planPath ? 'create the plan the record points at, or correct plan_path' : `write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or add dated tasks with a ◇ milestone (pmos task add --due … / pmos task set --milestone), or a done test`,
|
|
1616
1663
|
{ blocking: !legacy, rule: 'R2' }));
|
|
1617
1664
|
else if (doneTest && dtPresent) steps.push(step('brief', def.brief_label, 'blocked', 'no kill condition — an experiment states what would stop it (D107)',
|
|
1618
1665
|
`write kill: "<the result that would make us stop>" in ${recRel}`, { blocking: !legacy, rule: 'R2' }));
|
|
@@ -1896,7 +1943,7 @@ function listInitiatives(root) {
|
|
|
1896
1943
|
// ── CLI ────────────────────────────────────────────────────────────────────────────────────────
|
|
1897
1944
|
function main(argv) {
|
|
1898
1945
|
const args = argv.slice(2);
|
|
1899
|
-
let root = process.cwd(); let json = false; let gate = false; let all = false; let lanes = false;
|
|
1946
|
+
let root = process.cwd(); let json = false; let gate = false; let all = false; let lanes = false; let taskPlan = null;
|
|
1900
1947
|
const rest = [];
|
|
1901
1948
|
for (let i = 0; i < args.length; i++) {
|
|
1902
1949
|
const a = args[i];
|
|
@@ -1905,6 +1952,7 @@ function main(argv) {
|
|
|
1905
1952
|
if (a === '--gate') { gate = true; continue; }
|
|
1906
1953
|
if (a === '--all') { all = true; continue; }
|
|
1907
1954
|
if (a === '--lanes') { lanes = true; continue; }
|
|
1955
|
+
if (a === '--task-plan') { taskPlan = args[++i] || ''; continue; }
|
|
1908
1956
|
if (a === '--open') { continue; } // the board is in-flight-only by default now
|
|
1909
1957
|
if (a === '--help' || a === '-h') {
|
|
1910
1958
|
process.stdout.write([
|
|
@@ -1914,12 +1962,19 @@ function main(argv) {
|
|
|
1914
1962
|
' --gate <id> CI mode — exit 1 on a blocking order violation, with the next action',
|
|
1915
1963
|
' --all the board without the 12-row cap',
|
|
1916
1964
|
' --lanes every lane this repository offers: when to use it, input, output, done',
|
|
1965
|
+
' --task-plan <id> exit 0 when the task store holds a Project\'s dated plan (dated tasks with a ◇ milestone)',
|
|
1917
1966
|
' --json machine-readable (what an agent reads at session start)', '',
|
|
1918
1967
|
].join('\n') + '\n');
|
|
1919
1968
|
return 0;
|
|
1920
1969
|
}
|
|
1921
1970
|
rest.push(a);
|
|
1922
1971
|
}
|
|
1972
|
+
if (taskPlan !== null) {
|
|
1973
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(taskPlan)) { process.stdout.write('--task-plan needs an initiative id\n'); return 2; }
|
|
1974
|
+
const tp = taskPlanOf(root, taskPlan);
|
|
1975
|
+
process.stdout.write(json ? JSON.stringify(tp) + '\n' : tp.evidence + '\n');
|
|
1976
|
+
return tp.ok ? 0 : 1;
|
|
1977
|
+
}
|
|
1923
1978
|
if (lanes) {
|
|
1924
1979
|
const info = lanesFor(root);
|
|
1925
1980
|
if (json) { process.stdout.write(JSON.stringify(info, null, 2) + '\n'); return 0; }
|
|
@@ -1987,7 +2042,7 @@ function main(argv) {
|
|
|
1987
2042
|
}
|
|
1988
2043
|
|
|
1989
2044
|
module.exports = {
|
|
1990
|
-
computeWorkflow, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
|
|
2045
|
+
computeWorkflow, taskPlanOf, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
|
|
1991
2046
|
parseLeadingFrontmatter, specimenRoute, surfaceRoute, priorsCitation, isBuildPath, commitRange,
|
|
1992
2047
|
// the board's trunk range, exported so the suite can assert the split: the same record is legacy
|
|
1993
2048
|
// 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-11-16T04:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-16T04:39:26Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.572.0",
|
|
4
|
+
"at": "2026-11-16T04:39:30.480Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1305,
|
|
9
|
+
"t": "A Project's dated tasks with a ◇ milestone are its dated plan",
|
|
10
|
+
"s": "A Project's dated tasks with a ◇ milestone are its dated plan",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.571.0",
|
|
4
17
|
"at": "2026-11-16T04:26:43.356Z",
|
|
@@ -231,6 +231,48 @@ function layout(root) {
|
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
// ── A Project's dated plan in the task store (launch simulation W6 follow-up) ─────────────────────
|
|
235
|
+
// `pmos task add/link/set --milestone` writes a Project's plan as task lines in <runsDir>/initiative-tasks.jsonl (lib/task-store.js; lines
|
|
236
|
+
// not yet moved there still sit in boards.jsonl). Dated tasks with at least one dated ◇ milestone ARE the dated plan, so plan_path is not
|
|
237
|
+
// needed: the gate (kit/scripts/gate-initiative.sh, through --task-plan) and both ladders read them here. The fold is the task part of
|
|
238
|
+
// scripts/boards.js fold: the first task line makes the task, task-update moves or re-dates it, task-remove and task-restore take it out and
|
|
239
|
+
// back, and the last task-milestone line wins. → { ok, dated, milestones, file, evidence }
|
|
240
|
+
const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
241
|
+
function taskPlanOf(root, id) {
|
|
242
|
+
const L = layout(root);
|
|
243
|
+
const files = ['boards.jsonl', 'initiative-tasks.jsonl'].map((f) => path.join(L.runsDir, f));
|
|
244
|
+
const tasks = new Map(); const removed = new Map(); const milestones = new Map();
|
|
245
|
+
for (const file of files) {
|
|
246
|
+
let text = '';
|
|
247
|
+
try { text = fs.readFileSync(file, 'utf8'); } catch { continue; }
|
|
248
|
+
for (const raw of text.split('\n')) {
|
|
249
|
+
const t = raw.trim();
|
|
250
|
+
if (!t || t[0] !== '{' || !t.includes('"task')) continue;
|
|
251
|
+
let e; try { e = JSON.parse(t); } catch { continue; }
|
|
252
|
+
if (!e || typeof e.task !== 'string' || !e.task) continue;
|
|
253
|
+
if (e.kind === 'task' && typeof e.initiative === 'string' && !tasks.has(e.task) && !removed.has(e.task)) {
|
|
254
|
+
tasks.set(e.task, { initiative: e.initiative, due: typeof e.due === 'string' ? e.due : '' });
|
|
255
|
+
} else if (e.kind === 'task-update' && tasks.has(e.task)) {
|
|
256
|
+
const x = tasks.get(e.task);
|
|
257
|
+
if (typeof e.initiative === 'string' && e.initiative) x.initiative = e.initiative;
|
|
258
|
+
if (typeof e.due === 'string') x.due = e.due;
|
|
259
|
+
} else if (e.kind === 'task-milestone' && typeof e.milestone === 'boolean') milestones.set(e.task, e.milestone);
|
|
260
|
+
else if (e.kind === 'task-remove' && tasks.has(e.task)) { removed.set(e.task, tasks.get(e.task)); tasks.delete(e.task); }
|
|
261
|
+
else if (e.kind === 'task-restore' && removed.has(e.task) && !tasks.has(e.task)) { tasks.set(e.task, removed.get(e.task)); removed.delete(e.task); }
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
let dated = 0; let ms = 0;
|
|
265
|
+
for (const [tid, x] of tasks) {
|
|
266
|
+
if (x.initiative !== id || !DAY_RE.test(x.due)) continue;
|
|
267
|
+
dated++;
|
|
268
|
+
if (milestones.get(tid) === true) ms++;
|
|
269
|
+
}
|
|
270
|
+
const file = path.relative(root, path.join(L.runsDir, 'initiative-tasks.jsonl')).split(path.sep).join('/');
|
|
271
|
+
const ok = ms > 0;
|
|
272
|
+
const evidence = `${dated} dated task${dated === 1 ? '' : 's'}, ${ms} dated milestone${ms === 1 ? '' : 's'} in ${file}`;
|
|
273
|
+
return { ok, dated, milestones: ms, file, evidence };
|
|
274
|
+
}
|
|
275
|
+
|
|
234
276
|
// ── Git ────────────────────────────────────────────────────────────────────────────────────────
|
|
235
277
|
function git(root, args) {
|
|
236
278
|
try {
|
|
@@ -973,9 +1015,12 @@ function computeWorkflowDerived(id, opts) {
|
|
|
973
1015
|
`write the done test (okf/core/templates/done-test-template.md), set done_test_path and kill: in ${recRel}`, { blocking: true, rule: 'R2' }));
|
|
974
1016
|
} else if (!doneTest && workKind === 'project' && (planPath || !prd)) {
|
|
975
1017
|
const planIdx = planPath ? firstAppearance(root, range, planPath) : null;
|
|
976
|
-
|
|
1018
|
+
const taskPlan = planPath ? null : taskPlanOf(root, id);
|
|
1019
|
+
if (taskPlan && taskPlan.ok) {
|
|
1020
|
+
steps.push(step('spec', 'spec', 'done', `dated plan in the task store: ${taskPlan.evidence}`));
|
|
1021
|
+
} else if (!planPath) {
|
|
977
1022
|
steps.push(step('spec', 'spec', 'blocked', 'Project needs a dated plan before Execute — never a PRD',
|
|
978
|
-
`write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or a done test`, { blocking: true, rule: 'R2' }));
|
|
1023
|
+
`write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or add dated tasks with a ◇ milestone (pmos task add --due … / pmos task set --milestone), or a done test`, { blocking: true, rule: 'R2' }));
|
|
979
1024
|
} else if (planIdx === null) {
|
|
980
1025
|
steps.push(step('spec', 'spec', 'blocked', `plan_path '${planPath}' does not exist in the repo`,
|
|
981
1026
|
'create the plan the record points at, or correct plan_path', { blocking: true, rule: 'R2' }));
|
|
@@ -1605,14 +1650,16 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
|
|
|
1605
1650
|
const workKind = (() => { const k = String(fm.kind || '').trim().replace(/^["']|["']$/g, ''); return k === 'sdlc' || k === 'project' ? k : 'product'; })();
|
|
1606
1651
|
const planPath = String(fm.plan_path || '').trim();
|
|
1607
1652
|
const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
|
|
1653
|
+
const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;
|
|
1608
1654
|
if (doneTest && dtPresent && killCond) steps.push(step('brief', def.brief_label, 'done', `done test ${doneTest} + kill condition (D107)`));
|
|
1609
1655
|
else if (kindSpec && workKind === 'sdlc') steps.push(step('brief', 'done test', legacy ? 'pending' : 'blocked',
|
|
1610
1656
|
'Full SDLC needs a done test and a kill condition before the first pull request — never a brief or a PRD',
|
|
1611
1657
|
`write the done test, set done_test_path and kill: in ${recRel} (pmos artefacts set experiment:${id} done-test check --text "…" writes both)`, { blocking: !legacy, rule: 'R2' }));
|
|
1612
1658
|
else if (kindSpec && exists(planPath)) steps.push(step('brief', 'dated plan', 'done', `plan ${planPath} present`));
|
|
1659
|
+
else if (kindSpec && !planPath && tasksPlan && tasksPlan.ok) steps.push(step('brief', 'dated plan', 'done', `dated plan in the task store: ${tasksPlan.evidence}`));
|
|
1613
1660
|
else if (kindSpec) steps.push(step('brief', 'dated plan', legacy ? 'pending' : 'blocked',
|
|
1614
1661
|
planPath ? `plan_path '${planPath}' does not exist in the repo` : 'Project needs a dated plan before Execute — never a brief or a PRD',
|
|
1615
|
-
planPath ? 'create the plan the record points at, or correct plan_path' : `write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or a done test`,
|
|
1662
|
+
planPath ? 'create the plan the record points at, or correct plan_path' : `write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or add dated tasks with a ◇ milestone (pmos task add --due … / pmos task set --milestone), or a done test`,
|
|
1616
1663
|
{ blocking: !legacy, rule: 'R2' }));
|
|
1617
1664
|
else if (doneTest && dtPresent) steps.push(step('brief', def.brief_label, 'blocked', 'no kill condition — an experiment states what would stop it (D107)',
|
|
1618
1665
|
`write kill: "<the result that would make us stop>" in ${recRel}`, { blocking: !legacy, rule: 'R2' }));
|
|
@@ -1896,7 +1943,7 @@ function listInitiatives(root) {
|
|
|
1896
1943
|
// ── CLI ────────────────────────────────────────────────────────────────────────────────────────
|
|
1897
1944
|
function main(argv) {
|
|
1898
1945
|
const args = argv.slice(2);
|
|
1899
|
-
let root = process.cwd(); let json = false; let gate = false; let all = false; let lanes = false;
|
|
1946
|
+
let root = process.cwd(); let json = false; let gate = false; let all = false; let lanes = false; let taskPlan = null;
|
|
1900
1947
|
const rest = [];
|
|
1901
1948
|
for (let i = 0; i < args.length; i++) {
|
|
1902
1949
|
const a = args[i];
|
|
@@ -1905,6 +1952,7 @@ function main(argv) {
|
|
|
1905
1952
|
if (a === '--gate') { gate = true; continue; }
|
|
1906
1953
|
if (a === '--all') { all = true; continue; }
|
|
1907
1954
|
if (a === '--lanes') { lanes = true; continue; }
|
|
1955
|
+
if (a === '--task-plan') { taskPlan = args[++i] || ''; continue; }
|
|
1908
1956
|
if (a === '--open') { continue; } // the board is in-flight-only by default now
|
|
1909
1957
|
if (a === '--help' || a === '-h') {
|
|
1910
1958
|
process.stdout.write([
|
|
@@ -1914,12 +1962,19 @@ function main(argv) {
|
|
|
1914
1962
|
' --gate <id> CI mode — exit 1 on a blocking order violation, with the next action',
|
|
1915
1963
|
' --all the board without the 12-row cap',
|
|
1916
1964
|
' --lanes every lane this repository offers: when to use it, input, output, done',
|
|
1965
|
+
' --task-plan <id> exit 0 when the task store holds a Project\'s dated plan (dated tasks with a ◇ milestone)',
|
|
1917
1966
|
' --json machine-readable (what an agent reads at session start)', '',
|
|
1918
1967
|
].join('\n') + '\n');
|
|
1919
1968
|
return 0;
|
|
1920
1969
|
}
|
|
1921
1970
|
rest.push(a);
|
|
1922
1971
|
}
|
|
1972
|
+
if (taskPlan !== null) {
|
|
1973
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(taskPlan)) { process.stdout.write('--task-plan needs an initiative id\n'); return 2; }
|
|
1974
|
+
const tp = taskPlanOf(root, taskPlan);
|
|
1975
|
+
process.stdout.write(json ? JSON.stringify(tp) + '\n' : tp.evidence + '\n');
|
|
1976
|
+
return tp.ok ? 0 : 1;
|
|
1977
|
+
}
|
|
1923
1978
|
if (lanes) {
|
|
1924
1979
|
const info = lanesFor(root);
|
|
1925
1980
|
if (json) { process.stdout.write(JSON.stringify(info, null, 2) + '\n'); return 0; }
|
|
@@ -1987,7 +2042,7 @@ function main(argv) {
|
|
|
1987
2042
|
}
|
|
1988
2043
|
|
|
1989
2044
|
module.exports = {
|
|
1990
|
-
computeWorkflow, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
|
|
2045
|
+
computeWorkflow, taskPlanOf, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
|
|
1991
2046
|
parseLeadingFrontmatter, specimenRoute, surfaceRoute, priorsCitation, isBuildPath, commitRange,
|
|
1992
2047
|
// the board's trunk range, exported so the suite can assert the split: the same record is legacy
|
|
1993
2048
|
// under BOTH ranges, and `in this change` is false under the trunk one.
|
|
@@ -231,6 +231,48 @@ function layout(root) {
|
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
// ── A Project's dated plan in the task store (launch simulation W6 follow-up) ─────────────────────
|
|
235
|
+
// `pmos task add/link/set --milestone` writes a Project's plan as task lines in <runsDir>/initiative-tasks.jsonl (lib/task-store.js; lines
|
|
236
|
+
// not yet moved there still sit in boards.jsonl). Dated tasks with at least one dated ◇ milestone ARE the dated plan, so plan_path is not
|
|
237
|
+
// needed: the gate (kit/scripts/gate-initiative.sh, through --task-plan) and both ladders read them here. The fold is the task part of
|
|
238
|
+
// scripts/boards.js fold: the first task line makes the task, task-update moves or re-dates it, task-remove and task-restore take it out and
|
|
239
|
+
// back, and the last task-milestone line wins. → { ok, dated, milestones, file, evidence }
|
|
240
|
+
const DAY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
241
|
+
function taskPlanOf(root, id) {
|
|
242
|
+
const L = layout(root);
|
|
243
|
+
const files = ['boards.jsonl', 'initiative-tasks.jsonl'].map((f) => path.join(L.runsDir, f));
|
|
244
|
+
const tasks = new Map(); const removed = new Map(); const milestones = new Map();
|
|
245
|
+
for (const file of files) {
|
|
246
|
+
let text = '';
|
|
247
|
+
try { text = fs.readFileSync(file, 'utf8'); } catch { continue; }
|
|
248
|
+
for (const raw of text.split('\n')) {
|
|
249
|
+
const t = raw.trim();
|
|
250
|
+
if (!t || t[0] !== '{' || !t.includes('"task')) continue;
|
|
251
|
+
let e; try { e = JSON.parse(t); } catch { continue; }
|
|
252
|
+
if (!e || typeof e.task !== 'string' || !e.task) continue;
|
|
253
|
+
if (e.kind === 'task' && typeof e.initiative === 'string' && !tasks.has(e.task) && !removed.has(e.task)) {
|
|
254
|
+
tasks.set(e.task, { initiative: e.initiative, due: typeof e.due === 'string' ? e.due : '' });
|
|
255
|
+
} else if (e.kind === 'task-update' && tasks.has(e.task)) {
|
|
256
|
+
const x = tasks.get(e.task);
|
|
257
|
+
if (typeof e.initiative === 'string' && e.initiative) x.initiative = e.initiative;
|
|
258
|
+
if (typeof e.due === 'string') x.due = e.due;
|
|
259
|
+
} else if (e.kind === 'task-milestone' && typeof e.milestone === 'boolean') milestones.set(e.task, e.milestone);
|
|
260
|
+
else if (e.kind === 'task-remove' && tasks.has(e.task)) { removed.set(e.task, tasks.get(e.task)); tasks.delete(e.task); }
|
|
261
|
+
else if (e.kind === 'task-restore' && removed.has(e.task) && !tasks.has(e.task)) { tasks.set(e.task, removed.get(e.task)); removed.delete(e.task); }
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
let dated = 0; let ms = 0;
|
|
265
|
+
for (const [tid, x] of tasks) {
|
|
266
|
+
if (x.initiative !== id || !DAY_RE.test(x.due)) continue;
|
|
267
|
+
dated++;
|
|
268
|
+
if (milestones.get(tid) === true) ms++;
|
|
269
|
+
}
|
|
270
|
+
const file = path.relative(root, path.join(L.runsDir, 'initiative-tasks.jsonl')).split(path.sep).join('/');
|
|
271
|
+
const ok = ms > 0;
|
|
272
|
+
const evidence = `${dated} dated task${dated === 1 ? '' : 's'}, ${ms} dated milestone${ms === 1 ? '' : 's'} in ${file}`;
|
|
273
|
+
return { ok, dated, milestones: ms, file, evidence };
|
|
274
|
+
}
|
|
275
|
+
|
|
234
276
|
// ── Git ────────────────────────────────────────────────────────────────────────────────────────
|
|
235
277
|
function git(root, args) {
|
|
236
278
|
try {
|
|
@@ -973,9 +1015,12 @@ function computeWorkflowDerived(id, opts) {
|
|
|
973
1015
|
`write the done test (okf/core/templates/done-test-template.md), set done_test_path and kill: in ${recRel}`, { blocking: true, rule: 'R2' }));
|
|
974
1016
|
} else if (!doneTest && workKind === 'project' && (planPath || !prd)) {
|
|
975
1017
|
const planIdx = planPath ? firstAppearance(root, range, planPath) : null;
|
|
976
|
-
|
|
1018
|
+
const taskPlan = planPath ? null : taskPlanOf(root, id);
|
|
1019
|
+
if (taskPlan && taskPlan.ok) {
|
|
1020
|
+
steps.push(step('spec', 'spec', 'done', `dated plan in the task store: ${taskPlan.evidence}`));
|
|
1021
|
+
} else if (!planPath) {
|
|
977
1022
|
steps.push(step('spec', 'spec', 'blocked', 'Project needs a dated plan before Execute — never a PRD',
|
|
978
|
-
`write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or a done test`, { blocking: true, rule: 'R2' }));
|
|
1023
|
+
`write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or add dated tasks with a ◇ milestone (pmos task add --due … / pmos task set --milestone), or a done test`, { blocking: true, rule: 'R2' }));
|
|
979
1024
|
} else if (planIdx === null) {
|
|
980
1025
|
steps.push(step('spec', 'spec', 'blocked', `plan_path '${planPath}' does not exist in the repo`,
|
|
981
1026
|
'create the plan the record points at, or correct plan_path', { blocking: true, rule: 'R2' }));
|
|
@@ -1605,14 +1650,16 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
|
|
|
1605
1650
|
const workKind = (() => { const k = String(fm.kind || '').trim().replace(/^["']|["']$/g, ''); return k === 'sdlc' || k === 'project' ? k : 'product'; })();
|
|
1606
1651
|
const planPath = String(fm.plan_path || '').trim();
|
|
1607
1652
|
const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
|
|
1653
|
+
const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;
|
|
1608
1654
|
if (doneTest && dtPresent && killCond) steps.push(step('brief', def.brief_label, 'done', `done test ${doneTest} + kill condition (D107)`));
|
|
1609
1655
|
else if (kindSpec && workKind === 'sdlc') steps.push(step('brief', 'done test', legacy ? 'pending' : 'blocked',
|
|
1610
1656
|
'Full SDLC needs a done test and a kill condition before the first pull request — never a brief or a PRD',
|
|
1611
1657
|
`write the done test, set done_test_path and kill: in ${recRel} (pmos artefacts set experiment:${id} done-test check --text "…" writes both)`, { blocking: !legacy, rule: 'R2' }));
|
|
1612
1658
|
else if (kindSpec && exists(planPath)) steps.push(step('brief', 'dated plan', 'done', `plan ${planPath} present`));
|
|
1659
|
+
else if (kindSpec && !planPath && tasksPlan && tasksPlan.ok) steps.push(step('brief', 'dated plan', 'done', `dated plan in the task store: ${tasksPlan.evidence}`));
|
|
1613
1660
|
else if (kindSpec) steps.push(step('brief', 'dated plan', legacy ? 'pending' : 'blocked',
|
|
1614
1661
|
planPath ? `plan_path '${planPath}' does not exist in the repo` : 'Project needs a dated plan before Execute — never a brief or a PRD',
|
|
1615
|
-
planPath ? 'create the plan the record points at, or correct plan_path' : `write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or a done test`,
|
|
1662
|
+
planPath ? 'create the plan the record points at, or correct plan_path' : `write the plan (milestones with dates and owners, go-live matching the KR date) and set plan_path in ${recRel}, or add dated tasks with a ◇ milestone (pmos task add --due … / pmos task set --milestone), or a done test`,
|
|
1616
1663
|
{ blocking: !legacy, rule: 'R2' }));
|
|
1617
1664
|
else if (doneTest && dtPresent) steps.push(step('brief', def.brief_label, 'blocked', 'no kill condition — an experiment states what would stop it (D107)',
|
|
1618
1665
|
`write kill: "<the result that would make us stop>" in ${recRel}`, { blocking: !legacy, rule: 'R2' }));
|
|
@@ -1896,7 +1943,7 @@ function listInitiatives(root) {
|
|
|
1896
1943
|
// ── CLI ────────────────────────────────────────────────────────────────────────────────────────
|
|
1897
1944
|
function main(argv) {
|
|
1898
1945
|
const args = argv.slice(2);
|
|
1899
|
-
let root = process.cwd(); let json = false; let gate = false; let all = false; let lanes = false;
|
|
1946
|
+
let root = process.cwd(); let json = false; let gate = false; let all = false; let lanes = false; let taskPlan = null;
|
|
1900
1947
|
const rest = [];
|
|
1901
1948
|
for (let i = 0; i < args.length; i++) {
|
|
1902
1949
|
const a = args[i];
|
|
@@ -1905,6 +1952,7 @@ function main(argv) {
|
|
|
1905
1952
|
if (a === '--gate') { gate = true; continue; }
|
|
1906
1953
|
if (a === '--all') { all = true; continue; }
|
|
1907
1954
|
if (a === '--lanes') { lanes = true; continue; }
|
|
1955
|
+
if (a === '--task-plan') { taskPlan = args[++i] || ''; continue; }
|
|
1908
1956
|
if (a === '--open') { continue; } // the board is in-flight-only by default now
|
|
1909
1957
|
if (a === '--help' || a === '-h') {
|
|
1910
1958
|
process.stdout.write([
|
|
@@ -1914,12 +1962,19 @@ function main(argv) {
|
|
|
1914
1962
|
' --gate <id> CI mode — exit 1 on a blocking order violation, with the next action',
|
|
1915
1963
|
' --all the board without the 12-row cap',
|
|
1916
1964
|
' --lanes every lane this repository offers: when to use it, input, output, done',
|
|
1965
|
+
' --task-plan <id> exit 0 when the task store holds a Project\'s dated plan (dated tasks with a ◇ milestone)',
|
|
1917
1966
|
' --json machine-readable (what an agent reads at session start)', '',
|
|
1918
1967
|
].join('\n') + '\n');
|
|
1919
1968
|
return 0;
|
|
1920
1969
|
}
|
|
1921
1970
|
rest.push(a);
|
|
1922
1971
|
}
|
|
1972
|
+
if (taskPlan !== null) {
|
|
1973
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(taskPlan)) { process.stdout.write('--task-plan needs an initiative id\n'); return 2; }
|
|
1974
|
+
const tp = taskPlanOf(root, taskPlan);
|
|
1975
|
+
process.stdout.write(json ? JSON.stringify(tp) + '\n' : tp.evidence + '\n');
|
|
1976
|
+
return tp.ok ? 0 : 1;
|
|
1977
|
+
}
|
|
1923
1978
|
if (lanes) {
|
|
1924
1979
|
const info = lanesFor(root);
|
|
1925
1980
|
if (json) { process.stdout.write(JSON.stringify(info, null, 2) + '\n'); return 0; }
|
|
@@ -1987,7 +2042,7 @@ function main(argv) {
|
|
|
1987
2042
|
}
|
|
1988
2043
|
|
|
1989
2044
|
module.exports = {
|
|
1990
|
-
computeWorkflow, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
|
|
2045
|
+
computeWorkflow, taskPlanOf, declaredLane: laneDefs.declaredLane, readLifecycle, STOPPED_STATES, renderLadder, renderBoard, listInitiatives, layout, inFlight, BOARD_CAP,
|
|
1991
2046
|
parseLeadingFrontmatter, specimenRoute, surfaceRoute, priorsCitation, isBuildPath, commitRange,
|
|
1992
2047
|
// the board's trunk range, exported so the suite can assert the split: the same record is legacy
|
|
1993
2048
|
// under BOTH ranges, and `in this change` is false under the trunk one.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.572.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.572.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED