create-pmos 0.767.0 → 0.768.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 +20 -14
- package/payload/AGENTS.md +3 -1
- 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/kind-sync.js +112 -0
- package/payload/scripts/workflow-state.js +20 -2
- package/payload/scripts/workflows.js +374 -0
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +19 -0
- package/workspace/guide/breakdown.md +5 -3
- package/workspace/lib/engine/workflow-state.js +20 -2
- package/workspace/lib/engine/workflows.js +27 -3
- package/workspace/lib/initiative-writer.js +12 -1
- package/workspace/lib/routes-boards.js +19 -2
- package/workspace/lib/vendor/scripts/workflow-state.js +20 -2
- package/workspace/lib/vendor/scripts/workflows.js +374 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-pop-work.css +7 -0
- package/workspace/public/pm/cozy-pop-work.js +27 -12
- package/workspace/public/pm/work-select.js +27 -5
- package/workspace/test-lists/gantt-drag-nest.json +9 -0
|
@@ -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-24T07:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-24T07:49:33Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.768.0",
|
|
4
|
+
"at": "2026-11-24T07:49:37.442Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1731,
|
|
9
|
+
"t": "The workflow decides the kind of work, not a legacy type: feature",
|
|
10
|
+
"s": "The workflow decides the kind of work, not a legacy type: feature",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"n": 1730,
|
|
15
|
+
"t": "Drag to nest, take out and reorder in the Gantt, like the List",
|
|
16
|
+
"s": "Drag to nest, take out and reorder in the Gantt, like the List",
|
|
17
|
+
"k": "new"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
2
21
|
{
|
|
3
22
|
"v": "0.767.0",
|
|
4
23
|
"at": "2026-11-24T07:34:38.820Z",
|
|
@@ -17,14 +17,16 @@ If the save fails, the change goes back and a message tells you why, for example
|
|
|
17
17
|
|
|
18
18
|
## Subtasks
|
|
19
19
|
|
|
20
|
-
A task can sit under another task, at any depth. To add a subtask, type `under <parent>: <title>` in the add box of the Work breakdown, for example `under Batch 2: TM web`. To move a task, open its **More** menu and select **Make subtask of…** or **Move out of …**. With a mouse you can also drag a task in the List:
|
|
20
|
+
A task can sit under another task, at any depth. To add a subtask, type `under <parent>: <title>` in the add box of the Work breakdown, for example `under Batch 2: TM web`. To move a task, open its **More** menu and select **Make subtask of…** or **Move out of …**. With a mouse you can also drag a task, in the List or in the Gantt (hold its name):
|
|
21
21
|
|
|
22
22
|
- Drop it on another task to put it under that task.
|
|
23
|
-
- Drop it on the top or bottom edge of a row to put it
|
|
23
|
+
- Drop it on the top or bottom edge of a row to put it just before or after that row, under the same parent and in the same stage. This is also how you change the order of tasks in a stage.
|
|
24
24
|
- Drop it on a stage heading to move it to that stage, at the top level.
|
|
25
25
|
- Drag it to the left to move it out of its parent, one level up.
|
|
26
26
|
|
|
27
|
-
If you drag a selected task, all the selected tasks move. One **Undo** puts them back.
|
|
27
|
+
If you drag a selected task, all the selected tasks move. One **Undo** puts them back, and their order too.
|
|
28
|
+
|
|
29
|
+
In **Make subtask of…**, the tasks of the same stage come first. When the list is long, type in **Find a task** to narrow it.
|
|
28
30
|
|
|
29
31
|
When a stage has 8 or more tasks and several of them share a go-live date, PMOS suggests groups, for example "Group the 12 tasks of Build into 3 batches?". Select ✓ to make one parent for each date and put the tasks under it. One **Undo** removes the parents again. PMOS does not group tasks without your ✓.
|
|
30
32
|
|
|
@@ -640,6 +640,24 @@ function workflowOf(root, id) {
|
|
|
640
640
|
}
|
|
641
641
|
return m.wf.get(id) || '';
|
|
642
642
|
}
|
|
643
|
+
/*
|
|
644
|
+
* workKindOf(root, id, fm) — the kind of work that sets the gate: the record's `kind:` line when it has one, else the kind of the workflow
|
|
645
|
+
* the initiative runs (scripts/workflows.js kindOf). Bug 2026-11-24: a Migration initiative kept the `type: feature` its record was born
|
|
646
|
+
* with before workflows existed, and the gate asked it for a PRD and a rubric. The workflow is the later, more specific choice, so it
|
|
647
|
+
* decides. No workflow (PMOS itself, a repository without boards) or Product feature keeps 'product', the lane rules.
|
|
648
|
+
*/
|
|
649
|
+
function workKindOf(root, id, fm) {
|
|
650
|
+
const k = String((fm && fm.kind) || '').trim().replace(/^["']|["']$/g, '');
|
|
651
|
+
if (k === 'sdlc' || k === 'project' || k === 'product') return k;
|
|
652
|
+
try {
|
|
653
|
+
const wfId = workflowOf(root, id);
|
|
654
|
+
if (wfId === null) return 'product';
|
|
655
|
+
const WF = require('./workflows');
|
|
656
|
+
const f = [['pmos', 'state'], ['state'], ['.pmos']].map((rel) => path.join(root, ...rel, 'workflows.jsonl')).find((x) => fs.existsSync(x));
|
|
657
|
+
const lib = WF.fold(f ? jsonl.readJsonl(f).rows : []);
|
|
658
|
+
return WF.kindOf(wfId ? WF.resolve(lib, wfId) : WF.defaultOf(lib));
|
|
659
|
+
} catch { return 'product'; }
|
|
660
|
+
}
|
|
643
661
|
/** The lanes a repository's initiatives may declare — what the lane picker offers and the lane write accepts. */
|
|
644
662
|
function laneNames(profile) { return laneDefs.laneNames(profile === 'pm-artifacts' ? 'pm-artifacts' : 'product-code'); }
|
|
645
663
|
function lanesFor(root) {
|
|
@@ -1019,7 +1037,7 @@ function computeWorkflowDerived(id, opts) {
|
|
|
1019
1037
|
// W5 (boards WfA/WfB/WfC, agreed 2026-11-12): the kind of work sets the gate. Full SDLC: a done test and a kill condition before the first
|
|
1020
1038
|
// pull request. Project: a dated plan (plan_path), never a PRD. Product management (and a record with no kind:) keeps the rules below. A
|
|
1021
1039
|
// PRD already on the record still satisfies the spec rung after a kind change: a gate already passed stays passed.
|
|
1022
|
-
const workKind = (
|
|
1040
|
+
const workKind = workKindOf(root, id, fm);
|
|
1023
1041
|
const planPath = String(fm.plan_path || '').trim();
|
|
1024
1042
|
const agentMode = agentEvalSet.isAgent(fm);
|
|
1025
1043
|
if (agentMode && !doneTest) {
|
|
@@ -1667,7 +1685,7 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
|
|
|
1667
1685
|
// W6 (launch simulation rerun, 2026-11-15): the kind of work sets this ladder too, as it sets the product-code gate (W5) and the kit gate.
|
|
1668
1686
|
// Full SDLC: a done test and a kill condition, never a brief. Project: a dated plan (plan_path), never a brief. A brief already on the
|
|
1669
1687
|
// record still passes (a gate passed stays passed). Their deliverable is not a document: the pull requests, or the plan's milestones.
|
|
1670
|
-
const workKind = (
|
|
1688
|
+
const workKind = workKindOf(root, id, fm);
|
|
1671
1689
|
const planPath = String(fm.plan_path || '').trim();
|
|
1672
1690
|
const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
|
|
1673
1691
|
const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* workspace/lib/routes-workflows.js does the I/O (<state dir>/workflows.jsonl) and lib/routes-boards.js reads an initiative's workflow.
|
|
4
4
|
*
|
|
5
5
|
* CATS · ENDS · OUTPUT_KINDS · WHEN_MODES · DECIDE · ICONS · PRODUCT_FEATURE_ID · PRODUCT_FEATURE
|
|
6
|
+
* kindOf(wf) → 'product' | 'sdlc' | 'project' the kind of work the workflow runs; it sets the gate (see below)
|
|
6
7
|
* check(wf, { existing }) → { ok, workflow } | { ok:false, status, error } validate and normalise one workflow
|
|
7
8
|
* PROJECT · FULL_SDLC · BUILTIN · KIND_WF the two workflows the kind of work starts on (W5, boards WfA/WfB/WfC), built in like Product feature
|
|
8
9
|
* forKind(folded, kind) · isKindDefault(folded, kind, wfId) the workflow a kind starts on; whether an initiative still runs it
|
|
@@ -180,7 +181,30 @@ function check(wf) {
|
|
|
180
181
|
}
|
|
181
182
|
if (Object.keys(map).length && slug(br.from) !== id) bridge = { from: slug(br.from), map };
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
if (wf.kind != null && wf.kind !== '' && !WORK_KINDS.includes(wf.kind)) return bad(`the kind of work is one of ${WORK_KINDS.join(', ')}`);
|
|
185
|
+
const kind = WORK_KINDS.includes(wf.kind) ? wf.kind : null;
|
|
186
|
+
return { ok: true, workflow: { id, name, icon, decide, ...(kind ? { kind } : {}), stages, ...(bridge ? { bridge } : {}) } };
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/*
|
|
190
|
+
* kindOf(wf) — the kind of work a workflow runs: 'product' | 'sdlc' | 'project' (lib/work-kind.js KINDS).
|
|
191
|
+
*
|
|
192
|
+
* WHY (bug 2026-11-24, "Migration from Okta to Descope"): the gate read what an initiative must write from the record's old `type:`
|
|
193
|
+
* line, which the first records got as `feature` before workflows existed. Picking a Migration workflow later changed nothing, so the
|
|
194
|
+
* gate still asked a migration for a PRD and a rubric. The workflow is the PM's later and more specific choice, so the kind follows it.
|
|
195
|
+
* The built-ins say their kind. A saved workflow can say its own (`kind`). Else the name and the stage names decide, with the words
|
|
196
|
+
* lib/work-kind.js uses for a new initiative's name: a delivery word (migrate, cutover, decommission, rollout, tender, ...) reads as a
|
|
197
|
+
* Project; nothing reads as Product management, which keeps the lane rules, the old behaviour.
|
|
198
|
+
*/
|
|
199
|
+
const WORK_KINDS = Object.freeze(['product', 'sdlc', 'project']);
|
|
200
|
+
const PROJECT_CUES = ['migrate', 'migration', 'tender', 'rollout', 'roll out', 'vendor', 'procurement', 'rfp', 'cutover', 'decommission', 'switch off', 'hypercare', 'renewal', 'go-live', 'go live'];
|
|
201
|
+
const cueIn = (text) => PROJECT_CUES.find((w) => new RegExp('\\b' + w.replace(/[ -]/g, '[\\s-]+') + '\\b', 'i').test(text)) || '';
|
|
202
|
+
function kindOf(wf) {
|
|
203
|
+
if (!wf || typeof wf !== 'object') return 'product';
|
|
204
|
+
if (WORK_KINDS.includes(wf.kind)) return wf.kind;
|
|
205
|
+
if (wf.id === PRODUCT_FEATURE_ID) return 'product';
|
|
206
|
+
const words = [wf.name].concat((wf.stages || []).map((s) => s && s.name)).filter(Boolean).join(' · ');
|
|
207
|
+
return cueIn(words) ? 'project' : 'product';
|
|
184
208
|
}
|
|
185
209
|
|
|
186
210
|
/** Fold workflows.jsonl (objects or JSON strings), oldest first. */
|
|
@@ -324,7 +348,7 @@ function copyOf(wf, name, taken) {
|
|
|
324
348
|
const n = oneLine(name, NAME_MAX) ? name.trim() : 'Copy of ' + wf.name;
|
|
325
349
|
let id = slug(n) || 'workflow', k = 2;
|
|
326
350
|
while ((taken && taken.has(id)) || isBuiltin(id)) id = slug(n) + '-' + k++;
|
|
327
|
-
return { id, name: n, icon: wf.icon, decide: wf.decide || 'pmos', stages: wf.stages.map((s) => ({ ...s, output: { ...s.output }, finish: [...s.finish], when: { ...s.when }, unless: s.unless.map((u) => ({ ...u })) })) };
|
|
351
|
+
return { id, name: n, icon: wf.icon, decide: wf.decide || 'pmos', ...(WORK_KINDS.includes(wf.kind) ? { kind: wf.kind } : {}), stages: wf.stages.map((s) => ({ ...s, output: { ...s.output }, finish: [...s.finish], when: { ...s.when }, unless: s.unless.map((u) => ({ ...u })) })) };
|
|
328
352
|
}
|
|
329
353
|
|
|
330
354
|
/** The workflow a kind of work starts on: Project and Full SDLC their own; Product management the workspace's default (defaultOf). */
|
|
@@ -346,5 +370,5 @@ const milestonesOf = (wf) => (wf || PRODUCT_FEATURE).stages.filter((s) => s.mile
|
|
|
346
370
|
module.exports = {
|
|
347
371
|
CATS, CAT_LABEL, ENDS, OUTPUT_KINDS, WHEN_MODES, DECIDE, ICONS, PRODUCT_FEATURE_ID, PRODUCT_FEATURE,
|
|
348
372
|
PROJECT_ID, PROJECT, FULL_SDLC_ID, FULL_SDLC, BUILTIN, KIND_WF, KIND_GATE, MEANING, isBuiltin, forKind, isKindDefault,
|
|
349
|
-
slug, check, fold, list, defaultOf, resolve, stageByRef, switchTarget, proposeBridge, mapOf, removedInUse, stagesOf, copyOf, milestonesOf,
|
|
373
|
+
WORK_KINDS, kindOf, slug, check, fold, list, defaultOf, resolve, stageByRef, switchTarget, proposeBridge, mapOf, removedInUse, stagesOf, copyOf, milestonesOf,
|
|
350
374
|
};
|
|
@@ -395,6 +395,17 @@ function setKind(root, id, kind, { actor } = {}) {
|
|
|
395
395
|
return { ok: true, id, from, kind };
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
+
/** The record's own `kind:` line, read: { ok, kind, has } (has false when the record has no line; kind then reads as Product management). */
|
|
399
|
+
function readKind(root, id) {
|
|
400
|
+
const f = recordFile(root, id);
|
|
401
|
+
if (!f.ok) return f;
|
|
402
|
+
let text = '';
|
|
403
|
+
try { text = fs.readFileSync(f.file, 'utf8'); } catch { return refuse(500, 'the record could not be read'); }
|
|
404
|
+
const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text);
|
|
405
|
+
const line = m ? m[1].split(/\r?\n/).find((l) => /^kind:/.test(l)) : null;
|
|
406
|
+
return { ok: true, kind: WK.kindOf(line ? line.slice(5) : ''), has: !!line };
|
|
407
|
+
}
|
|
408
|
+
|
|
398
409
|
function withdrawSplit(root, id, want, { actor } = {}) {
|
|
399
410
|
if (!actorLib.valid(actor)) return refuse(500, 'initiative-writer: the caller must pass the actor from pm-guard.js or actor.js');
|
|
400
411
|
const f = recordFile(root, id);
|
|
@@ -406,4 +417,4 @@ function withdrawSplit(root, id, want, { actor } = {}) {
|
|
|
406
417
|
return { ok: true, removed: true };
|
|
407
418
|
}
|
|
408
419
|
|
|
409
|
-
module.exports = { setKind, setRaisedBy, setDescription, restoreDescription, DESC_MAX, setOutcome, restoreOutcome, createInitiative, renameInitiative, setAnchor, restoreAnchor, withdrawSplit, recordSha, slugOf, ID_RE, INPUT_KEYS };
|
|
420
|
+
module.exports = { setKind, readKind, setRaisedBy, setDescription, restoreDescription, DESC_MAX, setOutcome, restoreOutcome, createInitiative, renameInitiative, setAnchor, restoreAnchor, withdrawSplit, recordSha, slugOf, ID_RE, INPUT_KEYS };
|
|
@@ -295,6 +295,7 @@ function startOnDefault(ctx, w, iniId, actor, { boardId = null, recordPath = nul
|
|
|
295
295
|
if (!board || board.self) return null;
|
|
296
296
|
if (from && !WS.library(dir).byId.has(def.id)) { const a = WS.adopt(dir, def, actor, from.id); if (!a.ok) return null; }
|
|
297
297
|
append(file, actor, { kind: 'ini-wf', board: board.id, id: iniId, wf: def.id, why: 'the default workflow for new initiatives', start: true });
|
|
298
|
+
kindFollowsWorkflow(w, iniId, def, actor); // a workspace whose default is a Project-like workflow starts its initiatives as Projects
|
|
298
299
|
return def.id;
|
|
299
300
|
} catch { return null; }
|
|
300
301
|
}
|
|
@@ -310,6 +311,21 @@ function recordKind(root, recordPath) {
|
|
|
310
311
|
} catch { return 'product'; }
|
|
311
312
|
}
|
|
312
313
|
|
|
314
|
+
/** The workflow decides the kind of work (bug 2026-11-24, "Migration from Okta to Descope"): when an initiative starts on or switches to a
|
|
315
|
+
* workflow, its record's `kind:` follows that workflow (scripts/workflows.js kindOf), so the Initiative Gate, which reads the record,
|
|
316
|
+
* asks for what this workflow produces (a dated plan for a Project, a done test for Full SDLC) and not what an old `type: feature` line
|
|
317
|
+
* asked for. Switching back (Undo) puts the old workflow's kind back the same way. A record with no `kind:` line that lands on a Product
|
|
318
|
+
* management workflow is left alone (it already reads as Product). Never throws. → { from, kind } when the line changed, else null. */
|
|
319
|
+
function kindFollowsWorkflow(w, id, wf, actor) {
|
|
320
|
+
try {
|
|
321
|
+
const k = WF.kindOf(wf);
|
|
322
|
+
const cur = writer.readKind(w.root, id);
|
|
323
|
+
if (!cur.ok || cur.kind === k) return null;
|
|
324
|
+
const r = writer.setKind(w.root, id, k, { actor });
|
|
325
|
+
return r.ok && !r.same ? { from: r.from, kind: r.kind } : null;
|
|
326
|
+
} catch { return null; }
|
|
327
|
+
}
|
|
328
|
+
|
|
313
329
|
/** A kind change (POST /api/initiatives/kind, `pmos initiative set … --kind`): an initiative that runs its OLD kind's default workflow moves to
|
|
314
330
|
* the new kind's, its stage mapped by meaning (scripts/workflows.js MEANING: Plan to Plan, Build to Execute, Release to Close). The switch line
|
|
315
331
|
* says what changed in one sentence. A workflow the PM picked by hand is left alone. Never throws. → { switched, wf?, line } */
|
|
@@ -1439,9 +1455,10 @@ const WRITES = {
|
|
|
1439
1455
|
if (found.ws) { const a = WS.adopt(ctx.stateDirFor(p.w), to, g.actor, found.ws.id); if (!a.ok) return fail(ctx, res, a.status || 400, a.error); }
|
|
1440
1456
|
append(p.file, g.actor, { kind: 'ini-wf', board: p.board.id, id: body.id, wf: to.id, from: from.id, moved, map, why: body.why ? body.why.trim() : '', ...(body.pmos === true ? { pmos: true } : {}),
|
|
1441
1457
|
...(body.batch ? { batch: body.batch } : {}), ...(body.undo === true ? { undo: true } : {}) });
|
|
1458
|
+
const kindChange = kindFollowsWorkflow(p.w, body.id, to, g.actor);
|
|
1442
1459
|
const f1 = foldOf(ctx, p.w), row = boardRow(p.board, b0, f1);
|
|
1443
1460
|
const made = stageTasks(p.file, f1, p.board, row, g.actor.by);
|
|
1444
|
-
ctx.json(res, { ok: true, row, moved, ...(made ? { tasksMade: made } : {}) });
|
|
1461
|
+
ctx.json(res, { ok: true, row, moved, ...(made ? { tasksMade: made } : {}), ...(kindChange ? { kind: kindChange } : {}) });
|
|
1445
1462
|
},
|
|
1446
1463
|
'/api/boards/wontdo': (ctx, res, body, g) => {
|
|
1447
1464
|
const p = postFrame(ctx, res, body);
|
|
@@ -2315,4 +2332,4 @@ function meetingBoards(ctx) {
|
|
|
2315
2332
|
return { list, detail };
|
|
2316
2333
|
}
|
|
2317
2334
|
|
|
2318
|
-
module.exports = { prefixes: ['/api/boards'], handle, tasksOfIni, postFrame, needRows, itemsOf, readLedger, foldOf, epicsOf, rowsOfBoard, invalidateRows: (w) => { rowsLib.invalidate(w.root); rowCache.delete(w.root); }, move, switchWorkflow, taskState, taskAdd, taskEdit, describeDraft, writeAs, taskDelete, taskRestore, initiativeWorkflow, seedInitiative, stageTasks, boardIndex, appendScanAsk, scanDeclineSignal, createAndPlace, startOnDefault, kindSwitch, recordKind, ledgerFile, append, frameFor, boardIdOf, meetingBoards, boardsOf, baseRows, boardRow, taskSpanOf, workflowRowOf, closedOf, foldOf, portfolio, SELF_REFUSAL, NO_STATE };
|
|
2335
|
+
module.exports = { prefixes: ['/api/boards'], handle, tasksOfIni, postFrame, needRows, itemsOf, readLedger, foldOf, epicsOf, rowsOfBoard, invalidateRows: (w) => { rowsLib.invalidate(w.root); rowCache.delete(w.root); }, move, switchWorkflow, taskState, taskAdd, taskEdit, describeDraft, writeAs, taskDelete, taskRestore, initiativeWorkflow, seedInitiative, stageTasks, boardIndex, appendScanAsk, scanDeclineSignal, createAndPlace, startOnDefault, kindSwitch, kindFollowsWorkflow, recordKind, ledgerFile, append, frameFor, boardIdOf, meetingBoards, boardsOf, baseRows, boardRow, taskSpanOf, workflowRowOf, closedOf, foldOf, portfolio, SELF_REFUSAL, NO_STATE };
|
|
@@ -640,6 +640,24 @@ function workflowOf(root, id) {
|
|
|
640
640
|
}
|
|
641
641
|
return m.wf.get(id) || '';
|
|
642
642
|
}
|
|
643
|
+
/*
|
|
644
|
+
* workKindOf(root, id, fm) — the kind of work that sets the gate: the record's `kind:` line when it has one, else the kind of the workflow
|
|
645
|
+
* the initiative runs (scripts/workflows.js kindOf). Bug 2026-11-24: a Migration initiative kept the `type: feature` its record was born
|
|
646
|
+
* with before workflows existed, and the gate asked it for a PRD and a rubric. The workflow is the later, more specific choice, so it
|
|
647
|
+
* decides. No workflow (PMOS itself, a repository without boards) or Product feature keeps 'product', the lane rules.
|
|
648
|
+
*/
|
|
649
|
+
function workKindOf(root, id, fm) {
|
|
650
|
+
const k = String((fm && fm.kind) || '').trim().replace(/^["']|["']$/g, '');
|
|
651
|
+
if (k === 'sdlc' || k === 'project' || k === 'product') return k;
|
|
652
|
+
try {
|
|
653
|
+
const wfId = workflowOf(root, id);
|
|
654
|
+
if (wfId === null) return 'product';
|
|
655
|
+
const WF = require('./workflows');
|
|
656
|
+
const f = [['pmos', 'state'], ['state'], ['.pmos']].map((rel) => path.join(root, ...rel, 'workflows.jsonl')).find((x) => fs.existsSync(x));
|
|
657
|
+
const lib = WF.fold(f ? jsonl.readJsonl(f).rows : []);
|
|
658
|
+
return WF.kindOf(wfId ? WF.resolve(lib, wfId) : WF.defaultOf(lib));
|
|
659
|
+
} catch { return 'product'; }
|
|
660
|
+
}
|
|
643
661
|
/** The lanes a repository's initiatives may declare — what the lane picker offers and the lane write accepts. */
|
|
644
662
|
function laneNames(profile) { return laneDefs.laneNames(profile === 'pm-artifacts' ? 'pm-artifacts' : 'product-code'); }
|
|
645
663
|
function lanesFor(root) {
|
|
@@ -1019,7 +1037,7 @@ function computeWorkflowDerived(id, opts) {
|
|
|
1019
1037
|
// W5 (boards WfA/WfB/WfC, agreed 2026-11-12): the kind of work sets the gate. Full SDLC: a done test and a kill condition before the first
|
|
1020
1038
|
// pull request. Project: a dated plan (plan_path), never a PRD. Product management (and a record with no kind:) keeps the rules below. A
|
|
1021
1039
|
// PRD already on the record still satisfies the spec rung after a kind change: a gate already passed stays passed.
|
|
1022
|
-
const workKind = (
|
|
1040
|
+
const workKind = workKindOf(root, id, fm);
|
|
1023
1041
|
const planPath = String(fm.plan_path || '').trim();
|
|
1024
1042
|
const agentMode = agentEvalSet.isAgent(fm);
|
|
1025
1043
|
if (agentMode && !doneTest) {
|
|
@@ -1667,7 +1685,7 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
|
|
|
1667
1685
|
// W6 (launch simulation rerun, 2026-11-15): the kind of work sets this ladder too, as it sets the product-code gate (W5) and the kit gate.
|
|
1668
1686
|
// Full SDLC: a done test and a kill condition, never a brief. Project: a dated plan (plan_path), never a brief. A brief already on the
|
|
1669
1687
|
// record still passes (a gate passed stays passed). Their deliverable is not a document: the pull requests, or the plan's milestones.
|
|
1670
|
-
const workKind = (
|
|
1688
|
+
const workKind = workKindOf(root, id, fm);
|
|
1671
1689
|
const planPath = String(fm.plan_path || '').trim();
|
|
1672
1690
|
const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
|
|
1673
1691
|
const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;
|