create-pmos 0.706.0 → 0.707.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 +9 -3
- 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/state/discoveries.md +1 -1
- package/workspace/changelog.json +8 -2
- package/workspace/lib/default-decisions.js +43 -7
- package/workspace/lib/question-batch.js +7 -0
- package/workspace/lib/routes-proposals.js +33 -1
- package/workspace/lib/routes-your-move.js +3 -1
- package/workspace/lib/source-guard.js +18 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/test-lists/tracker-date-moves-wait-for-owner.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.707.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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
36
|
{
|
|
37
|
-
"v": "0.
|
|
38
|
-
"at": "2026-11-22T11:
|
|
37
|
+
"v": "0.707.0",
|
|
38
|
+
"at": "2026-11-22T11:12:27.208Z",
|
|
39
39
|
"f": 4,
|
|
40
40
|
"prs": [
|
|
41
41
|
{
|
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
"t": "Corrections become standing rules (A464)",
|
|
56
56
|
"s": "Corrections become standing rules (A464)",
|
|
57
57
|
"k": "new"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"n": 1533,
|
|
61
|
+
"t": "Date moves only the tracker says wait for the owner, default to the tracker's date (A449)",
|
|
62
|
+
"s": "Date moves only the tracker says wait for the owner, default to the tracker's date (A449)",
|
|
63
|
+
"k": "new"
|
|
58
64
|
}
|
|
59
65
|
]
|
|
60
66
|
},
|
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-22T11:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T11:12:23Z"}
|
|
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-22T11:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T11:12:23Z"}
|
|
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-22T11:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-22T11:12:23Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"v": "0.
|
|
4
|
-
"at": "2026-11-22T11:
|
|
3
|
+
"v": "0.707.0",
|
|
4
|
+
"at": "2026-11-22T11:12:27.208Z",
|
|
5
5
|
"f": 4,
|
|
6
6
|
"prs": [
|
|
7
7
|
{
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"t": "Corrections become standing rules (A464)",
|
|
22
22
|
"s": "Corrections become standing rules (A464)",
|
|
23
23
|
"k": "new"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"n": 1533,
|
|
27
|
+
"t": "Date moves only the tracker says wait for the owner, default to the tracker's date (A449)",
|
|
28
|
+
"s": "Date moves only the tracker says wait for the owner, default to the tracker's date (A449)",
|
|
29
|
+
"k": "new"
|
|
24
30
|
}
|
|
25
31
|
]
|
|
26
32
|
},
|
|
@@ -19,6 +19,12 @@
|
|
|
19
19
|
* writes one drop line per change in proposals.jsonl, marked `default: true` with the batch (by `pmos:default`, so no job learns from it as
|
|
20
20
|
* from the PM's ✕), and one `applied` line for the job `propose:default` in autonomy.jsonl, so "PMOS did" lists it with Undo. The plan
|
|
21
21
|
* itself is not written; nothing is sent.
|
|
22
|
+
* THE TRACKER'S DATE (initiative tracker-date-moves-wait-for-owner, idea A449). A date move of 30 days or less that only the tracker says
|
|
23
|
+
* (lib/source-guard.js trackerMoveOf) has a source: the question asks its owner to confirm it, and the default is `tracker`, PMOS takes the
|
|
24
|
+
* tracker's date. take() applies it through `apply(held)` (lib/routes-proposals.js keepDefault: the board's own writer, one keep line marked
|
|
25
|
+
* `default: true` with the batch and `held: [id]`), records one `applied` line for `propose:default` and logs one [tracker-date-wait] line.
|
|
26
|
+
* A move on a task that is itself a Jira ticket (item `jira`) keeps `leave`: the ticket already has the date. Undo puts the old date back,
|
|
27
|
+
* and the question comes back with no default, like any undone default.
|
|
22
28
|
* NEVER A DEFAULT (NEVER below): a Jira ticket's state, a stage move, a message to a person, a pull request, a merge, a delete, spend, and
|
|
23
29
|
* a refuted outcome's next step. They wait for the PM, however long.
|
|
24
30
|
* UNDO. An undo line for the batch (lib/proposals.js fold then reads its drops as never written) brings the question back. An undone id is
|
|
@@ -56,6 +62,8 @@ const NEVER = [
|
|
|
56
62
|
{ key: 'signoff', test: (p) => p.group === 'ask', waits: 'It needs an answer from someone outside the team.' },
|
|
57
63
|
];
|
|
58
64
|
const LEAVE_GROUPS = new Set(['dates', 'status', 'names', 'found', 'links']);
|
|
65
|
+
const TAKE_SAY = "PMOS takes the tracker's date";
|
|
66
|
+
const TOOK = (due) => `No answer by ${md(due)}, so PMOS took the tracker's date.`;
|
|
59
67
|
|
|
60
68
|
/** The default of one held change. PURE. */
|
|
61
69
|
function defaultOf(p) {
|
|
@@ -63,6 +71,7 @@ function defaultOf(p) {
|
|
|
63
71
|
const never = NEVER.find((n) => { try { return n.test(p); } catch { return false; } });
|
|
64
72
|
if (never) return { choice: null, waits: never.waits, never: never.key };
|
|
65
73
|
if (!LEAVE_GROUPS.has(p.group)) return { choice: null, waits: 'PMOS has no safe default for this kind of change.' };
|
|
74
|
+
if (require('./source-guard.js').trackerMoveOf(p) && !(p.items || []).some((x) => isObj(x) && x.jira)) return { choice: 'tracker', say: TAKE_SAY };
|
|
66
75
|
return { choice: 'leave', say: 'PMOS leaves the plan as it is' };
|
|
67
76
|
}
|
|
68
77
|
|
|
@@ -86,6 +95,12 @@ function defaultedOf(lines) {
|
|
|
86
95
|
batches.get(l.batch).push(l);
|
|
87
96
|
}
|
|
88
97
|
const taken = new Map(), undone = new Set();
|
|
98
|
+
// a tracker's date PMOS took (THE TRACKER'S DATE): one keep line, marked default, naming the held proposal ids
|
|
99
|
+
for (const l of lines || []) {
|
|
100
|
+
if (!isObj(l) || l.kind !== 'keep' || l.default !== true || !str(l.batch) || !Array.isArray(l.held)) continue;
|
|
101
|
+
if (!batches.has(l.batch)) batches.set(l.batch, []);
|
|
102
|
+
for (const id of l.held) batches.get(l.batch).push({ id: String(id), kind: 'keep' });
|
|
103
|
+
}
|
|
89
104
|
for (const [b, ls] of batches) for (const l of ls) { const id = str(l.id); if (!id) continue; if (undoneB.has(b)) undone.add(id); else taken.set(id, b); }
|
|
90
105
|
return { taken, undone, batches, undoneBatches: undoneB };
|
|
91
106
|
}
|
|
@@ -97,7 +112,7 @@ function stateOf(h, first, D, today) {
|
|
|
97
112
|
const since = first.get(id) || '';
|
|
98
113
|
const waiting = since && dn(today) != null ? Math.max(0, dn(today) - dn(since)) : 0;
|
|
99
114
|
if (!d.choice) return { id, d, since, waiting, due: '', open: false };
|
|
100
|
-
if (D.undone.has(id)) return { id, d: { choice: null, waits: 'You undid PMOS\'s default
|
|
115
|
+
if (D.undone.has(id)) return { id, d: { choice: null, waits: 'You undid PMOS\'s default.' }, since, waiting, due: '', open: false };
|
|
101
116
|
const due = since ? addDays(since, DEFAULT_DAYS) : '';
|
|
102
117
|
return { id, d, since, waiting, due, open: !D.taken.has(id) };
|
|
103
118
|
}
|
|
@@ -113,7 +128,13 @@ function annotate(questions, held, { dayLines = [], lines = [], today = '', extr
|
|
|
113
128
|
const yes = st.filter((s) => s.d.choice && s.due), no = st.filter((s) => !s.d.choice);
|
|
114
129
|
const due = yes.map((s) => s.due).sort()[0] || '';
|
|
115
130
|
const part = yes.length && yes.length < st.length ? ` for ${yes.length} of these ${st.length} changes` : '';
|
|
116
|
-
const
|
|
131
|
+
const tr = yes.filter((s) => s.d.choice === 'tracker').length, lv = yes.length - tr;
|
|
132
|
+
const sayOf = () => {
|
|
133
|
+
if (!tr) return `If nobody answers by ${md(due)}, PMOS leaves the plan as it is${part}. You can undo it.`;
|
|
134
|
+
if (!lv) return `If nobody answers by ${md(due)}, ${TAKE_SAY}${part}. You can undo it.`;
|
|
135
|
+
return `If nobody answers by ${md(due)}, ${TAKE_SAY} for ${tr} and leaves the plan as it is for ${lv} of these ${st.length} changes. You can undo it.`;
|
|
136
|
+
};
|
|
137
|
+
const def = yes.length ? { choice: tr && lv ? 'mixed' : tr ? 'tracker' : 'leave', due, n: yes.length, say: sayOf() } : null;
|
|
117
138
|
const reasons = [...new Set(no.map((s) => s.d.waits))];
|
|
118
139
|
const waits = no.length ? (reasons.join(' ') + ' So ' + (no.length === st.length ? 'it waits' : plural(no.length, 'change waits', 'changes wait')) + ' for you.') : null;
|
|
119
140
|
const waiting = Math.max(0, ...st.map((s) => s.waiting));
|
|
@@ -141,12 +162,14 @@ function dueOf(held, { dayLines = [], lines = [], today = '' } = {}) {
|
|
|
141
162
|
return (held || []).filter((h) => {
|
|
142
163
|
if (!isObj(h) || !isObj(h.prop) || !h.prop.id || !h.ini) return false;
|
|
143
164
|
const s = stateOf(h, first, D, today);
|
|
144
|
-
return s.open && s.d.choice === 'leave' && s.due && s.due <= today;
|
|
165
|
+
return s.open && (s.d.choice === 'leave' || s.d.choice === 'tracker') && s.due && s.due <= today;
|
|
145
166
|
});
|
|
146
167
|
}
|
|
147
168
|
|
|
148
|
-
/** Take the defaults due today: one batch per question (owner and initiative)
|
|
149
|
-
|
|
169
|
+
/** Take the defaults due today: one batch per question (owner and initiative) for `leave`, one per change for `tracker`.
|
|
170
|
+
* apply(h) → { batch } | null writes the tracker's date (lib/routes-proposals.js keepDefault); without it a `tracker` default waits.
|
|
171
|
+
* → { taken: [...], why? } */
|
|
172
|
+
function take(dir, held, { dayLines = [], today = '', product = '', pm, now, env = process.env, settingsDir = null, apply = null, log = console.error } = {}) {
|
|
150
173
|
const out = { taken: [] };
|
|
151
174
|
if (!dir || !today) return out;
|
|
152
175
|
const PR = require('./proposals.js');
|
|
@@ -157,7 +180,20 @@ function take(dir, held, { dayLines = [], today = '', product = '', pm, now, env
|
|
|
157
180
|
const dec = A.decide({ stateDir: dir, job: JOB, product, cls: 'B', mode: 'auto', undoable: true, now, env, settingsDir });
|
|
158
181
|
if (!dec.apply) { out.why = dec.why; return out; }
|
|
159
182
|
const first = firstDays(dayLines);
|
|
160
|
-
const
|
|
183
|
+
const isTr = (h) => defaultOf(h.prop).choice === 'tracker';
|
|
184
|
+
for (const h of due.filter(isTr)) {
|
|
185
|
+
if (typeof apply !== 'function') continue;
|
|
186
|
+
const p = h.prop, dueDay = addDays(first.get(String(p.id)), DEFAULT_DAYS), why = TOOK(dueDay);
|
|
187
|
+
let r = null;
|
|
188
|
+
try { r = apply(h, { why }); } catch { r = null; }
|
|
189
|
+
if (!r || !r.batch) continue; // the change is gone or did not land: it stays on the list
|
|
190
|
+
const it = (p.items || []).find(isObj) || {};
|
|
191
|
+
const title = `Took the tracker's date on ${one(h.title || h.ini, 80)}: ${one(it.title || p.title || 'a task', 60)}${it.to && it.to.due ? ' to ' + md(it.to.due) : ''}, nobody answered by ${md(dueDay)}`;
|
|
192
|
+
A.recordApplied(dir, { job: JOB, product, ref: r.batch, title, cls: 'B', ini: h.ini, why, src: [`Tracker, unanswered question due ${dueDay}`] }, { now, settingsDir });
|
|
193
|
+
try { log(`[tracker-date-wait] took the tracker's date on ${product || '*'} ${h.ini} ${p.id}: nobody answered by ${dueDay}`); } catch { /* a log never stops a default */ }
|
|
194
|
+
out.taken.push({ batch: r.batch, ini: h.ini, board: h.board, ids: [String(p.id)], title, tracker: true });
|
|
195
|
+
}
|
|
196
|
+
const groups = require('./question-batch.js').questionsOf(due.filter((h) => !isTr(h)), { pm });
|
|
161
197
|
const byId = new Map(due.map((h) => [String(h.prop.id), h]));
|
|
162
198
|
for (const q of groups) {
|
|
163
199
|
const batch = PR.newBatch();
|
|
@@ -197,4 +233,4 @@ function isDefaultBatch(dir, batch) {
|
|
|
197
233
|
return defaultedOf(PR.readLines(PR.ledgerFile(dir))).batches.has(String(batch || ''));
|
|
198
234
|
}
|
|
199
235
|
|
|
200
|
-
module.exports = { DEFAULT_DAYS, JOB, BY, WHY, NEVER, defaultOf, firstDays, defaultedOf, annotate, costOf, dueOf, take, undo, isDefaultBatch, addDays };
|
|
236
|
+
module.exports = { DEFAULT_DAYS, JOB, BY, WHY, TOOK, TAKE_SAY, NEVER, defaultOf, firstDays, defaultedOf, annotate, costOf, dueOf, take, undo, isDefaultBatch, addDays };
|
|
@@ -41,6 +41,13 @@ function partOf(p, hold) {
|
|
|
41
41
|
const n = items.length;
|
|
42
42
|
return `${plural(n, 'task', 'tasks')} passed ${n === 1 ? 'its' : 'their'} date with no news${name ? ' (for example ' + name + ')' : ''}. Re-plan from today, or new dates?`;
|
|
43
43
|
}
|
|
44
|
+
// tracker-date-moves-wait-for-owner (A449): the tracker moved the date; the owner sees the old and the new date and where it came from
|
|
45
|
+
if (p.group === 'dates' && hold && hold.tracker) {
|
|
46
|
+
const who = kind === 'jira' ? 'Jira' : 'The tracker', from = first.from && first.from.due, to = first.to && first.to.due;
|
|
47
|
+
const span = `${from ? ' from ' + md(from) : ''}${to ? ' to ' + md(to) : ''}`;
|
|
48
|
+
if (items.length > 1) return `${who} moved ${plural(items.length, 'task', 'tasks')} (for example ${name || 'one'}${span}). Take the new dates?`;
|
|
49
|
+
return `${who} moved ${name || 'the work'}${span}. Take the new date?`;
|
|
50
|
+
}
|
|
44
51
|
if (p.group === 'dates') { const to = first.to && first.to.due; return `Move ${name || 'the work'}${to ? ' to ' + md(to) : ''}?${only}`; }
|
|
45
52
|
if (p.group === 'status') return `Is ${name || 'it'} done?${only || ' PMOS found no source.'}`;
|
|
46
53
|
if (p.group === 'names') return `Rename "${one(first.from || first.title || '', 60)}" to "${one(first.to || '', 60)}"?${only || ' PMOS found no source.'}`;
|
|
@@ -141,6 +141,9 @@ function undoCore(ctx, p, g, id) {
|
|
|
141
141
|
// D106: the Undo of a change an agent applied by itself is a setback of its job (lib/autonomy.js), which may demote the job
|
|
142
142
|
const line = PR.readLines(PR.ledgerFile(dir)).find((l) => l.kind === 'keep' && l.batch === id);
|
|
143
143
|
let demoted = null;
|
|
144
|
+
// tracker-date-moves-wait-for-owner: the tracker's date PMOS took when nobody answered is a default; its Undo is a setback of
|
|
145
|
+
// propose:default (lib/default-decisions.js), and the question comes back with no default
|
|
146
|
+
if (line && line.default === true && Array.isArray(line.held)) demoted = require('./autonomy.js').recordSetback(dir, { job: require('./default-decisions.js').JOB, product: p.w.id, ref: id, kind: 'undo' }).demoted;
|
|
144
147
|
if (line && line.auto === true && line.group) {
|
|
145
148
|
const A = require('./autonomy.js');
|
|
146
149
|
demoted = A.recordSetback(dir, { job: `propose:${line.group}`, product: p.w.id, ref: id, kind: 'undo' }).demoted;
|
|
@@ -172,6 +175,7 @@ function autoKeep(ctx, w, { modeOf = () => 'auto', now } = {}) {
|
|
|
172
175
|
for (const x of v.groups.flatMap((gr) => gr.props)) {
|
|
173
176
|
const cls = A.classOfProposal(x);
|
|
174
177
|
const src = SGc.citedOf(x); // no source, no auto (A443), in every group
|
|
178
|
+
if (SGc.trackerMoveOf(x)) logTrackerWait(w.id, ini, x);
|
|
175
179
|
const d = A.decide({ stateDir: dir, job: `propose:${x.group}`, product: w.id, cls, mode: modeOf(board.id), undoable: true, now, settingsDir: ctx.runtimeDir || null, sources: src });
|
|
176
180
|
if (!d.apply && !src.length) A.logHeld(`propose:${x.group}`, w.id, x.id);
|
|
177
181
|
if (!d.apply) { out.held++; continue; }
|
|
@@ -187,6 +191,34 @@ function autoKeep(ctx, w, { modeOf = () => 'auto', now } = {}) {
|
|
|
187
191
|
return out;
|
|
188
192
|
}
|
|
189
193
|
|
|
194
|
+
/** tracker-date-moves-wait-for-owner: one [tracker-date-wait] line per held tracker move per process (its health log). */
|
|
195
|
+
const trackerLogged = new Set();
|
|
196
|
+
function logTrackerWait(product, ini, x, log = console.error) {
|
|
197
|
+
const k = product + '|' + x.id + '|' + x.sig;
|
|
198
|
+
if (trackerLogged.has(k)) return;
|
|
199
|
+
if (trackerLogged.size > 5000) trackerLogged.clear();
|
|
200
|
+
trackerLogged.add(k);
|
|
201
|
+
const owner = ((x.items || []).find((y) => y && y.owner) || {}).owner || (x.ask && x.ask.owner) || 'the PM';
|
|
202
|
+
try { log(`[tracker-date-wait] held ${product} ${ini} ${x.id}: asks ${String(owner).slice(0, 60)} before the tracker's date applies`); } catch { /* a log never stops the apply step */ }
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** tracker-date-moves-wait-for-owner: take the tracker's date for one held change nobody answered by its deadline (lib/default-decisions.js
|
|
206
|
+
* take). It is the same write as a ✓ (keepCore, the board's own writer), on one keep line marked `default: true` with the held id, so
|
|
207
|
+
* Undo puts the old date back and the question returns with no default. → { batch, wrote } | null (the change is gone or did not land). */
|
|
208
|
+
function keepDefault(ctx, w, h, { why = '' } = {}) {
|
|
209
|
+
if (!dirOf(ctx, w) || !h || !h.prop) return null;
|
|
210
|
+
const fr = RB.frameFor(ctx, w), board = (fr.boards || []).find((b) => b.id === h.board);
|
|
211
|
+
if (!board) return null;
|
|
212
|
+
const p = { w, fr, board, file: null };
|
|
213
|
+
const f = TLR.frame(ctx, w, board, { derive: true });
|
|
214
|
+
if (!f) return null;
|
|
215
|
+
const v = view(ctx, p, h.ini, f, { grillAll: true });
|
|
216
|
+
const x = v && v.groups.flatMap((gr) => gr.props).find((y) => y.id === h.prop.id && y.sig === h.prop.sig);
|
|
217
|
+
if (!x || !require('./source-guard.js').trackerMoveOf(x)) return null;
|
|
218
|
+
const r = keepCore(ctx, p, { ok: true, actor: { by: 'agent:auto' } }, f, h.ini, [x], {}, { default: true, held: [String(x.id)], group: x.group, ...(why ? { why } : {}) });
|
|
219
|
+
return r.keptIds.length ? { batch: r.batch, wrote: r.wrote.length } : null;
|
|
220
|
+
}
|
|
221
|
+
|
|
190
222
|
/** act-alone-only-with-a-source: the open proposals of a workspace that PMOS holds for want of a source (lib/source-guard.js), on every
|
|
191
223
|
* board, for the day's question list (lib/question-batch.js). → [{ ini, title, board, prop, hold }] */
|
|
192
224
|
function heldOf(ctx, w) {
|
|
@@ -554,7 +586,7 @@ const WRITES = {
|
|
|
554
586
|
|
|
555
587
|
module.exports = {
|
|
556
588
|
prefixes: ['/api/proposals'],
|
|
557
|
-
viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf,
|
|
589
|
+
viewFor, saidOf, prdRename, keepCore, undoCore, autoKeep, heldOf, keepDefault,
|
|
558
590
|
handle: async (req, res, url, ctx) => {
|
|
559
591
|
const p0 = url.pathname;
|
|
560
592
|
if (req.method === 'GET') {
|
|
@@ -84,7 +84,9 @@ function questions(ctx, w, today, { take = true } = {}) {
|
|
|
84
84
|
// Undo); the question then leaves the list. Every question left says its default or why it waits, and what the wait costs (A27).
|
|
85
85
|
let taken = [];
|
|
86
86
|
if (take) {
|
|
87
|
-
|
|
87
|
+
// tracker-date-moves-wait-for-owner: a tracker's date nobody answered is taken through the board's own writer, with Undo
|
|
88
|
+
const apply = (h, o) => require('./routes-proposals.js').keepDefault(ctx, w, h, o);
|
|
89
|
+
try { taken = DD.take(dir, held, { dayLines: QB.readDays(dir), today, product: w.id, settingsDir: ctx.runtimeDir || null, apply }).taken; } catch { taken = []; }
|
|
88
90
|
if (taken.length) { const gone = new Set(taken.flatMap((t) => t.ids)); held = held.filter((h) => !gone.has(String(h.prop.id))); Q = QB.today(dir, held, { day: today, extra }); }
|
|
89
91
|
}
|
|
90
92
|
const PR = require('./proposals.js');
|
|
@@ -9,13 +9,18 @@
|
|
|
9
9
|
* citedOf(x) → [label] what ANY agent change cites (one-change-record-no-source-no-auto): its sources, its items'
|
|
10
10
|
* sources, its claims' sources, a link's PRD or Jira source, a build's work item. [] = no source
|
|
11
11
|
* noReason(why) → bool a reason that says it has none ("No reason found") or is empty
|
|
12
|
+
* trackerMoveOf(p) → bool a date move of BIG_DAYS days or less that only the tracker says (rule 3 below)
|
|
12
13
|
*
|
|
13
14
|
* THE RULE. It applies to the plan changes on a product: the groups in PLAN (dates, status, names, found, links).
|
|
14
15
|
* 1. No source, or a date proposal that found no reason (`noReason`): held.
|
|
15
16
|
* 2. A close (status done), a rename (names), or a date moved more than BIG_DAYS days needs two different kinds of source. Anyone who can
|
|
16
17
|
* post in a channel PMOS reads can write one line of text (A58), so one kind is not enough for a change that is hard to see afterwards.
|
|
17
18
|
* Two Slack lines are one kind. With one kind: held.
|
|
18
|
-
* 3.
|
|
19
|
+
* 3. A date move of BIG_DAYS days or less whose only kind of source is the tracker (Jira, or another tracker by name) waits for the
|
|
20
|
+
* owner the plan names on the work (initiative tracker-date-moves-wait-for-owner, idea A449: 23 of 35 such moves after an import
|
|
21
|
+
* were applied with nobody told). It joins the day's question list with the old and the new date, and when nobody answers by the
|
|
22
|
+
* deadline PMOS takes the tracker's date (lib/default-decisions.js, choice 'tracker'), with Undo.
|
|
23
|
+
* 4. Anything else keeps its class. A tidy name (group names) that cites only the plan itself ('the tasks') is PMOS's name standard
|
|
19
24
|
* applied to the task's own words, not a rename from outside text: it keeps its class.
|
|
20
25
|
* A held proposal is class C (lib/autonomy.js classOfProposal): the self-apply step (lib/routes-proposals.js autoKeep) leaves it for the
|
|
21
26
|
* owner, and it joins the day's question list (lib/question-batch.js). Other groups (description, outcome, build, the idle lab) carry their
|
|
@@ -26,6 +31,7 @@ const BIG_DAYS = 30;
|
|
|
26
31
|
const KINDS = [
|
|
27
32
|
['plan', /^\s*(the|this|its)\s+(tasks?|plan|board|initiative|stage)\b/i],
|
|
28
33
|
['jira', /\bjira\b|\b[A-Z][A-Z0-9]+-\d+\b/],
|
|
34
|
+
['tracker', /\blinear\b|\basana\b|\bclickup\b|\btrello\b|\byoutrack\b|\bazure boards\b|\bshortcut story\b|\btracker\b/i],
|
|
29
35
|
['slack', /\bslack\b/i],
|
|
30
36
|
['mail', /\bg?mail\b|\be-?mail\b|\binbox\b/i],
|
|
31
37
|
['meeting', /\bmeeting|\bcalendar\b|\bnotes?\b|\bminutes\b|\btranscript|\bwispr\b/i],
|
|
@@ -33,7 +39,7 @@ const KINDS = [
|
|
|
33
39
|
['repo', /\brepo(sitory)?\b|\bgithub\b|\bcommit\b|\bpull request\b|\bPR #?\d+|\.(md|js|ts|json|jsonl|py)(:\d+)?\b/i],
|
|
34
40
|
['chat', /\bchat\b|\bteams\b/i],
|
|
35
41
|
];
|
|
36
|
-
const KIND_NAMES = { plan: 'the plan itself', jira: 'Jira', slack: 'Slack', mail: 'mail', meeting: 'a meeting note', docs: 'a document', repo: 'the repository', chat: 'chat', other: 'one source' };
|
|
42
|
+
const KIND_NAMES = { plan: 'the plan itself', jira: 'Jira', tracker: 'the tracker', slack: 'Slack', mail: 'mail', meeting: 'a meeting note', docs: 'a document', repo: 'the repository', chat: 'chat', other: 'one source' };
|
|
37
43
|
const isObj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
38
44
|
const dn = (iso) => { const m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '')); return m ? Math.round(Date.UTC(+m[1], +m[2] - 1, +m[3]) / 864e5) : null; };
|
|
39
45
|
|
|
@@ -67,6 +73,14 @@ function bigOf(p) {
|
|
|
67
73
|
if (p.group === 'dates' && (p.items || []).some((x) => isObj(x) && Math.abs(shiftOf(x) || 0) > BIG_DAYS)) return 'date';
|
|
68
74
|
return '';
|
|
69
75
|
}
|
|
76
|
+
const TRACKER_KINDS = new Set(['jira', 'tracker']);
|
|
77
|
+
/** A date move of BIG_DAYS days or less that only the tracker says: the owner confirms it, or PMOS takes it after the deadline. PURE. */
|
|
78
|
+
function trackerMoveOf(p) {
|
|
79
|
+
if (!isObj(p) || p.group !== 'dates' || p.noReason === true || bigOf(p)) return false;
|
|
80
|
+
const kinds = kindsOf(p);
|
|
81
|
+
return kinds.length === 1 && TRACKER_KINDS.has(kinds[0]);
|
|
82
|
+
}
|
|
83
|
+
const TRACKER_WHY = (k) => `${k === 'jira' ? 'Jira' : 'The tracker'} moved this date. PMOS asks the owner first, and takes the tracker's date if nobody answers by the deadline.`;
|
|
70
84
|
const BIG_WORDS = { close: 'closes work', rename: 'renames work', date: 'moves a date by more than ' + BIG_DAYS + ' days' };
|
|
71
85
|
|
|
72
86
|
/** null when PMOS may apply the proposal by itself under its class; else { why, kinds }. PURE. */
|
|
@@ -76,6 +90,7 @@ function holdOf(p) {
|
|
|
76
90
|
if (p.noReason === true || !kinds.length) return { why: 'It cites no source, so PMOS asks instead of changing the plan.', kinds };
|
|
77
91
|
const big = bigOf(p);
|
|
78
92
|
if (big && kinds.length < 2) return { why: `It ${BIG_WORDS[big]} on one kind of source (${KIND_NAMES[kinds[0]] || kinds[0]}). PMOS needs two kinds, or the owner's answer.`, kinds };
|
|
93
|
+
if (trackerMoveOf(p)) return { why: TRACKER_WHY(kinds[0]), kinds, tracker: true };
|
|
79
94
|
return null;
|
|
80
95
|
}
|
|
81
96
|
|
|
@@ -101,4 +116,4 @@ function citedOf(x) {
|
|
|
101
116
|
return [...new Set(out)];
|
|
102
117
|
}
|
|
103
118
|
|
|
104
|
-
module.exports = { citedOf, noReason, LINK_SOURCES, holdOf, kindsOf, kindOf, bigOf, shiftOf, PLAN, BIG_DAYS, KIND_NAMES };
|
|
119
|
+
module.exports = { citedOf, noReason, LINK_SOURCES, holdOf, trackerMoveOf, TRACKER_KINDS, kindsOf, kindOf, bigOf, shiftOf, PLAN, BIG_DAYS, KIND_NAMES };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.707.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.707.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Date changes from the tracker wait for the owner (initiative tracker-date-moves-wait-for-owner, done test C1-C7): a date move of 30 days or less that only the tracker says is held, asks the task's owner with the old and new date, and defaults to the tracker's date with Undo. Pure checks plus one scratch server. No connector, model or network.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"tracker-date-wait.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"tracker-date-wait.test.js": 15
|
|
8
|
+
}
|
|
9
|
+
}
|