create-pmos 0.783.0 → 0.785.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 +70 -78
- package/payload/AGENTS.md +160 -0
- package/payload/KIT-VERSION +1 -1
- package/payload/design-system/ui/components/Badge/README.md +2 -2
- package/payload/design-system/ui/components/Glyph/README.md +28 -0
- package/payload/design-system/ui/components/bundle.css +3 -0
- 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/bin/card-catalog-gen.js +22 -0
- package/workspace/board-columns-test.js +2 -2
- package/workspace/briefing-premium-insights-test.js +5 -4
- package/workspace/calm-timeline-test.js +4 -3
- package/workspace/changelog.json +69 -10
- package/workspace/design-system/ui/components/Badge/README.md +2 -2
- package/workspace/design-system/ui/components/Glyph/README.md +28 -0
- package/workspace/design-system/ui/components/bundle.css +3 -0
- package/workspace/guide/claude-proposes.md +1 -0
- package/workspace/guide/cli.md +8 -0
- package/workspace/guide/home.md +4 -3
- package/workspace/guide/index.md +2 -2
- package/workspace/guide/layout.md +16 -2
- package/workspace/lib/briefing-premium-agent.js +3 -0
- package/workspace/lib/card-catalog-gen.js +123 -0
- package/workspace/lib/cos-chat.js +1 -0
- package/workspace/lib/declined-asks.js +177 -0
- package/workspace/lib/declined-cli.js +87 -0
- package/workspace/lib/goal-chat.js +1 -0
- package/workspace/lib/initiative-chat.js +1 -0
- package/workspace/lib/jira-status.js +11 -2
- package/workspace/lib/live-events.js +99 -0
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/program-chat.js +1 -0
- package/workspace/lib/proposals.js +13 -2
- package/workspace/lib/report-chat.js +1 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-live-rows.js +30 -0
- package/workspace/lib/routes-proposals.js +31 -3
- package/workspace/lib/routes-slash.js +142 -2
- package/workspace/lib/routes-task-links.js +1 -1
- package/workspace/lib/scope-cuts.js +138 -0
- package/workspace/lib/task-cli.js +5 -3
- package/workspace/lib/workflow-chat.js +1 -0
- package/workspace/okr-goals-ui-test.js +3 -2
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/bd-cols.js +3 -1
- package/workspace/public/pm/bd-span.js +13 -7
- package/workspace/public/pm/bd-views.js +6 -3
- package/workspace/public/pm/bd-work-ds.css +1 -0
- package/workspace/public/pm/bd-work.js +15 -2
- package/workspace/public/pm/cozy-board.css +3 -0
- package/workspace/public/pm/cozy-insights.css +3 -4
- package/workspace/public/pm/ds-bridge.css +12 -0
- package/workspace/public/pm/goal-forecast.js +7 -4
- package/workspace/public/pm/home-app.js +5 -3
- package/workspace/public/pm/ini-props.js +4 -3
- package/workspace/public/pm/komorebi.css +1 -0
- package/workspace/public/pm/live-edit.js +34 -3
- package/workspace/public/pm/live-feed.js +42 -0
- package/workspace/public/pm/okr-list.js +5 -2
- package/workspace/public/pm/premium-board.js +2 -0
- package/workspace/public/pm/premium-insights.js +10 -4
- package/workspace/public/pm/premium-vw-doc.css +5 -0
- package/workspace/public/pm/premium-vw-doc.js +11 -31
- package/workspace/public/pm/premium-vw-file.js +13 -8
- package/workspace/public/pm/premium-vw-guide.css +9 -0
- package/workspace/public/pm/premium-vw-guide.js +20 -17
- package/workspace/public/pm/reading-view.js +44 -0
- package/workspace/public/pm/state-glyph.js +135 -0
- package/workspace/skills/jira-sync.skill +4 -3
- package/workspace/task-milestones-test.js +2 -2
- package/workspace/test-lists/a2ui-chat-rules.json +9 -0
- package/workspace/test-lists/a2ui-live-rows.json +9 -0
- package/workspace/test-lists/declined-asks.json +9 -0
- package/workspace/test-lists/scope-cuts-save-date.json +5 -0
- package/workspace/test-lists/state-glyph.json +5 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* declined-cli.js — `pmos declined`: the asks closed without being done, each with a kind reply draft, and recording one in the product's
|
|
3
|
+
* out-of-scope list (initiative declined-asks-reply, bet A326; lib/declined-asks.js).
|
|
4
|
+
*
|
|
5
|
+
* pmos declined list [--days N] [--json] the asks closed as Won't Do, Declined, Duplicate… in the last N days (90), each with its reply draft
|
|
6
|
+
* pmos declined draft <KEY> [--reason "<why>"] [--json] the reply draft for one ask, with the PM's reason when given
|
|
7
|
+
* pmos declined record <KEY> [--reason "<why>"] [--json] record it: a line in declined-asks.jsonl and planning/out-of-scope/<key>.md
|
|
8
|
+
* every command: [--root <dir>] (default: this repository)
|
|
9
|
+
*
|
|
10
|
+
* PMOS never sends the reply: the PM copies it and sends it where they talk to that person. Exit codes: 0 done, 1 refused, 2 usage. */
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const { execFileSync } = require('child_process');
|
|
13
|
+
const D = require('./declined-asks.js');
|
|
14
|
+
|
|
15
|
+
const COMMANDS = { declined: ['list', 'draft', 'record'] };
|
|
16
|
+
const USAGE = [
|
|
17
|
+
'usage: pmos declined list|draft|record — asks closed without being done, each with a kind reply draft PMOS never sends',
|
|
18
|
+
' pmos declined list [--days 90] [--json] the asks closed as Won\'t Do, Declined, Duplicate and the like, newest first, each with its reply draft',
|
|
19
|
+
' pmos declined draft <KEY> [--reason "<why>"] the reply draft for one ask; your reason replaces the one PMOS reads from the ticket',
|
|
20
|
+
' pmos declined record <KEY> [--reason "<why>"] record it in the product\'s out-of-scope list, so a repeat of the ask is raised later',
|
|
21
|
+
'Run it in the product\'s repository, or pass --root <dir>. The reply is a draft: copy it and send it yourself.',
|
|
22
|
+
];
|
|
23
|
+
const ALLOWED = { list: ['json', 'root', 'days'], draft: ['json', 'root', 'reason'], record: ['json', 'root', 'reason'] };
|
|
24
|
+
const BOOL = new Set(['json']);
|
|
25
|
+
|
|
26
|
+
function parse(args) {
|
|
27
|
+
const pos = [], flags = {};
|
|
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 (BOOL.has(k)) { flags[k] = true; continue; }
|
|
33
|
+
flags[k] = args[i + 1] !== undefined && !String(args[i + 1]).startsWith('--') ? args[++i] : '';
|
|
34
|
+
}
|
|
35
|
+
return { pos, flags };
|
|
36
|
+
}
|
|
37
|
+
function repoRoot(cwd) {
|
|
38
|
+
try { return execFileSync('git', ['rev-parse', '--show-toplevel'], { cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }).trim() || cwd; } catch { return cwd; }
|
|
39
|
+
}
|
|
40
|
+
const who = (a) => (a.reporter ? `asked by ${a.reporter}` : 'who asked is not known');
|
|
41
|
+
|
|
42
|
+
async function run(argv, { say = (s) => console.log(s), cwd = process.cwd(), now = Date.now() } = {}) {
|
|
43
|
+
const args = argv[0] === 'declined' ? argv.slice(1) : argv.slice();
|
|
44
|
+
let sub = args[0];
|
|
45
|
+
if (['help', '--help', '-h'].includes(sub)) { for (const l of USAGE) say(l); return 0; }
|
|
46
|
+
if (!sub || sub.startsWith('--')) { sub = 'list'; args.unshift('list'); }
|
|
47
|
+
if (!COMMANDS.declined.includes(sub)) { say(`unknown declined command "${sub}". Use one of: ${COMMANDS.declined.join(', ')}`); return 2; }
|
|
48
|
+
const { pos, flags } = parse(args.slice(1));
|
|
49
|
+
for (const k of Object.keys(flags)) if (!ALLOWED[sub].includes(k)) { say(`✗ --${k} is not an option of pmos declined ${sub}`); return 2; }
|
|
50
|
+
const root = path.resolve(flags.root || repoRoot(cwd));
|
|
51
|
+
const fail = (error, code = 1) => { say(flags.json ? JSON.stringify({ ok: false, error }) : '✗ ' + error); return code; };
|
|
52
|
+
|
|
53
|
+
if (sub === 'list') {
|
|
54
|
+
if (pos.length) return fail('pmos declined list takes options, not an argument', 2);
|
|
55
|
+
const days = flags.days === undefined ? D.DAYS : Number(flags.days);
|
|
56
|
+
if (!Number.isInteger(days) || days < 1 || days > 3650) return fail('--days is a whole number from 1 to 3650', 2);
|
|
57
|
+
const done = new Set(D.recorded(root).map((o) => o.key));
|
|
58
|
+
const asks = D.collect(root, { now, days }).map((a) => ({ ...a, recorded: done.has(a.key), reply: D.replyFor(a) }));
|
|
59
|
+
if (flags.json) { say(JSON.stringify({ ok: true, days, asks })); return 0; }
|
|
60
|
+
if (!asks.length) { say(`No ask was closed without being done in the last ${days} days in this product's Jira readings.`); return 0; }
|
|
61
|
+
say(`${asks.length} ask${asks.length === 1 ? ' was' : 's were'} closed without being done in the last ${days} days. Each reply is a draft: PMOS does not send it.`);
|
|
62
|
+
for (const a of asks) {
|
|
63
|
+
say('');
|
|
64
|
+
say(`${a.recorded ? '✓' : '•'} ${a.key} ${a.summary} (closed as ${a.resolution || a.status} on ${a.resolved}, ${who(a)})${a.recorded ? ' — recorded' : ''}`);
|
|
65
|
+
say(` Reply: ${a.reply}`);
|
|
66
|
+
}
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
const key = String(pos[0] || '').toUpperCase();
|
|
70
|
+
if (!key || pos.length > 1) return fail(`pmos declined ${sub} takes one ticket key, such as ABC-123`, 2);
|
|
71
|
+
if (sub === 'draft') {
|
|
72
|
+
const a = D.collect(root, { now, days: 3650 }).find((x) => x.key === key);
|
|
73
|
+
if (!a) return fail(`${key} is not a declined ask in this product's Jira readings (pmos declined lists them)`);
|
|
74
|
+
const reply = D.replyFor(a, { reason: flags.reason || undefined });
|
|
75
|
+
say(flags.json ? JSON.stringify({ ok: true, ask: a, reply }) : reply);
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
// record
|
|
79
|
+
const r = D.record(root, key, { reason: flags.reason || undefined, now });
|
|
80
|
+
if (!r.ok) return fail(r.error);
|
|
81
|
+
if (flags.json) { say(JSON.stringify({ ok: true, key, file: r.file, kept: r.kept, reply: r.reply })); return 0; }
|
|
82
|
+
say(`recorded ${key} in ${r.file}${r.kept ? ' (your own edits to that file are kept)' : ''}`);
|
|
83
|
+
say(`Reply (a draft, not sent): ${r.reply}`);
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
module.exports = { run, COMMANDS, USAGE };
|
|
@@ -76,6 +76,7 @@ function startMessage(draft) {
|
|
|
76
76
|
'At the end of each message about this goal, add a fenced pmos-goal block: {"step":"progress","state":"working|done|needs-you","met":["done points met"],"open":["done points still open"]}. Copy each done point word for word. Report done only after you checked every point.',
|
|
77
77
|
// batch 22 item 13 (Wawan, 2026-11-01): "6 of 6 met" while the report the goal asked for was only proposed
|
|
78
78
|
'A done point that names a thing to make (a report, slides, a deck, a document) is met only when that thing exists where the PM reads it, opened and checked by you. A proposal, a plan or a draft waiting for a PM press does not meet it: that point stays open, and you end with needs-you and the one press.',
|
|
79
|
+
/* card-catalog:begin, generated by bin/card-catalog-gen.js: edit lib/card-catalog.json, not this block */"The card buttons run these pmos commands (the card catalog; who acts: you = one press with Undo, agent = PMOS starts a run, waits = only after the PM says yes). Run the one that fits the PM's ask, and tell the PM the Undo line it prints: pmos proactive goals add <text> --initiative <id> (Add, Done, Drop, Reopen; you); pmos measure add <anchor> <value> --source <source> (Add a reading; you); pmos outcomes declare <id> --metric <text> (Declare the metric; you); pmos outcomes test <id> --test <text> (Set the smallest test; you); pmos outcomes record <id> worked|didnt-work|cant-tell --evidence <text> (Record the result; you); pmos forecast baseline (Set baseline; you); pmos forecast baseline-off (Clear baseline; you)."/* card-catalog:end */,
|
|
79
80
|
].join('\n');
|
|
80
81
|
}
|
|
81
82
|
const cancelMessage = () => MARK.cancel + ' The PM cancelled this goal. Do no more work for it and say in one line what you stopped.';
|
|
@@ -62,6 +62,7 @@ function rule(info, id) {
|
|
|
62
62
|
'The Work timeline draws one bar per initiative, from the earliest start to the latest due of its tasks. An initiative with no dated task has no bar. Every stage shows there, Monitor and Evaluate included. Use these rules when the PM asks why an initiative is not on the timeline.',
|
|
63
63
|
`A stage's document fills its card only through \`pmos coredoc write --scope initiative:${ini} --key wf-<stage key> --file <path>\` (the stage keys are in \`pmos workflow of ${ini}\`). It is a draft the PM issues on the page. A file written under planning/ is not linked to a card.`,
|
|
64
64
|
);
|
|
65
|
+
out.push(/* card-catalog:begin, generated by bin/card-catalog-gen.js: edit lib/card-catalog.json, not this block */"The card buttons run these pmos commands (the card catalog; who acts: you = one press with Undo, agent = PMOS starts a run, waits = only after the PM says yes). Run the one that fits the PM's ask, and tell the PM the Undo line it prints: pmos task set <id> --due <date> [--start <date>] [--owner <who>] [--notes <text>] [--milestone] [--pin] [--no-milestone] (Move the date, Set start and due, Change owner, Add a note, Make it a milestone, Pin, Back to a task; you); pmos task state <id> --to <state> --why <text> (Change status, Mark done; you); pmos task comment <id> <text> (Comment; you); pmos task describe <id> (Write the description; agent); pmos task remove <id> --why <text> (Remove; you); pmos task add <initiative> \"<title>\" --parent <task> [--due <date>] [--owner <who>] (Add a subtask, Add a task; you); pmos rehearse move <id> --due <date> [--by <days>] (What slips if it moves, Move a task; you); pmos task link <from> <to> --type fs|ss|ff|sf --lag <days> (Link two tasks; you); pmos task unlink <from> <to> (Unlink; you); pmos item move <item> <todo|doing|review|done> --evidence <ref> (Move on the board; you); pmos item set <item> --due <date> --owner <who> (Change date or owner; you); pmos item withdraw <item> (Withdraw; you); pmos initiative up|down <id> (Move up / down; you); pmos initiative top|bottom <id> (Move to top / bottom; you); pmos initiative after <id> <other> (Rank after another; you); pmos initiative check-by <id> <date> (Set check date; you); pmos initiative kind <id> product|project|sdlc (Change kind; you); pmos workflow switch <id> --to <workflow> --stage <stage> --why <text> (Change workflow; you); pmos workflow move <id> --stage <stage> --why <text> (Move to stage; you); pmos initiative describe <id> (Write the description; agent); pmos parked hold <id> --why <text> (Park it, Change the reason; you); pmos initiative export <id> (Export the breakdown; you); pmos initiative adopt <proposal> (Keep; you); pmos initiative drop <proposal> (Drop; you); pmos parked back <id> (Bring back; you); pmos launch check <initiative> --date <date> (Check what is not ready; you); pmos launch tier <initiative> (Set the launch tier; you); pmos ready check <initiative> (Run the check; you); pmos artefacts set <scope> <artefact> --text <text> (Write it; you); pmos artefacts undo <a-id> (Undo; you); pmos signoff ask <initiative> --who <who> (Ask; waits); pmos signoff answer <id> --answer <text> (Record the answer; you); pmos signoff drop <id> --why <text> (Drop; you); pmos rehearse end <initiative> --to <date> (Move the end; you); pmos rehearse cut <task|initiative> (Cut it; you)."/* card-catalog:end */);
|
|
65
66
|
return out;
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
* reading saved before they were carried has none of them, and the burndown says it cannot be drawn. A ticket the search did not return keeps its last reading, marked
|
|
30
30
|
* stale. Titles and statuses only: never a description or a comment. The one person a reading carries is the assignee's display name, with
|
|
31
31
|
* the time of the last update (`assignee`, `updated`): Waiting on others names who a stale ticket waits on (home-your-move-waiting).
|
|
32
|
+
* It may also carry the reporter's display name and the resolution's name (`reporter`, `resolution`), when the read gave them:
|
|
33
|
+
* lib/declined-asks.js drafts a reply to the person who asked when the ticket was closed without being done (bet A326).
|
|
32
34
|
*
|
|
33
35
|
* A task that names a key follows its reading: lib/task-jira.js trackerLines sets its state in memory when the read is newer (no
|
|
34
36
|
* plan item or ledger line is written, D88 still holds).
|
|
@@ -241,6 +243,13 @@ function whoWhen(a, up) {
|
|
|
241
243
|
const t = Date.parse(isStr(up) ? up : '');
|
|
242
244
|
return { ...(name ? { assignee: name } : {}), ...(Number.isFinite(t) ? { updated: new Date(t).toISOString() } : {}) };
|
|
243
245
|
}
|
|
246
|
+
/** Who asked (the reporter's display name only, never an email) and how the ticket was closed (the resolution's name, e.g. "Won't Do"):
|
|
247
|
+
* lib/declined-asks.js drafts the reply to the person who asked when an ask is closed without being done (bet A326). */
|
|
248
|
+
function askedClosed(rep, res) {
|
|
249
|
+
const nm = (v) => clip(oneLine(typeof v === 'string' ? v : v && typeof v === 'object' ? v.displayName || v.name || '' : ''), 80);
|
|
250
|
+
const reporter = nm(rep), resolution = nm(res);
|
|
251
|
+
return { ...(reporter ? { reporter } : {}), ...(resolution ? { resolution } : {}) };
|
|
252
|
+
}
|
|
244
253
|
/** The official Atlassian MCP connector returns custom fields under `fields.customFields`, keyed by name: { Sprint: { id: 'customfield_10004',
|
|
245
254
|
* value: [...] } }. They are put back at the top level under their id and their name, as the REST shape has them, so the sprint, points
|
|
246
255
|
* and flag rules read them. A field already at the top level wins. */
|
|
@@ -271,7 +280,7 @@ function normalizeIssue(x) {
|
|
|
271
280
|
return { key, summary, status, category: categoryOf(status, st.statusCategory), sprint: sprintIn(f), ...sprintsAll(sprintField(f)), subtasks: subtasksOf(f.subtasks), ...subsOf(f.subtasks), fixVersion: fixVersionsOf(f.fixVersions),
|
|
272
281
|
points: pointsIn(f), resolved: dayOf(f.resolutiondate || f.resolved),
|
|
273
282
|
flagged, reason: flagged ? (flaggedIn(f) ? 'Flagged in Jira' : `Status: ${status}`) : null, url: urlOf(x, key),
|
|
274
|
-
...typeParent(f.issuetype, f.parent), ...whoWhen(f.assignee, f.updated) };
|
|
283
|
+
...typeParent(f.issuetype, f.parent), ...whoWhen(f.assignee, f.updated), ...askedClosed(f.reporter, f.resolution) };
|
|
275
284
|
}
|
|
276
285
|
// The flat shape: what the skill tells the agent to write when it is unsure of the connector's shape.
|
|
277
286
|
const summary = clip(oneLine(x.summary || x.title), 250);
|
|
@@ -281,7 +290,7 @@ function normalizeIssue(x) {
|
|
|
281
290
|
return { key, summary, status, category: categoryOf(status, x.category), sprint: sprintOf(x.sprint), ...sprintsAll(x.sprints != null ? x.sprints : x.sprint), subtasks: subtasksOf(x.subtasks), ...subsOf(x.subtasks), fixVersion: fixVersionsOf(x.fixVersions != null ? x.fixVersions : x.fixVersion),
|
|
282
291
|
points: pointsIn(x), resolved: dayOf(x.resolved || x.resolutiondate),
|
|
283
292
|
flagged, reason: flagged ? clip(oneLine(x.reason || x.flag_reason || (x.flagged === true ? 'Flagged in Jira' : `Status: ${status}`)), 160) : null,
|
|
284
|
-
url: urlOf(x, key), ...typeParent(x.type != null ? x.type : x.issuetype, x.parent), ...whoWhen(x.assignee, x.updated) };
|
|
293
|
+
url: urlOf(x, key), ...typeParent(x.type != null ? x.type : x.issuetype, x.parent), ...whoWhen(x.assignee, x.updated), ...askedClosed(x.reporter, x.resolution) };
|
|
285
294
|
}
|
|
286
295
|
function normalize(raw) {
|
|
287
296
|
const list = issuesList(raw);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* live-events.js — a write made from the chat shows on every open page at once (bet A458, path-level live updates; job #1750).
|
|
3
|
+
*
|
|
4
|
+
* Before: a page drew a chat-made change only when the chat turn ended (cz:chat-turn), and then it read its whole lists again. A
|
|
5
|
+
* change that `pmos task …` made in the PM's terminal reached no open page until that read.
|
|
6
|
+
*
|
|
7
|
+
* Now `pmos task add|set|state|remove` appends one line per changed field to <state dir>/live-events.jsonl:
|
|
8
|
+
* { at, kind: 'task', id, field, value, undo } field is a live-edit field (state, due, start, owner, notes, section, parent,
|
|
9
|
+
* milestone), 'removed' for a deleted task, or 'added' for a new one
|
|
10
|
+
* (value: { initiative, title, status, owner, start, end, section?, parent? })
|
|
11
|
+
* The server streams new lines to every open page (lib/routes-live-rows.js, GET /api/live-rows), and the page puts each one on the rows it holds
|
|
12
|
+
* (public/pm/live-feed.js → live-edit.js remote()): one row changes, no list is read again.
|
|
13
|
+
*
|
|
14
|
+
* emit(stateDir, ev) append one event (several when ev is a list); never throws, a failed append only loses the live draw
|
|
15
|
+
* fieldEvents(id, body) the events of one task edit body ({ due, start, owner, notes, section, parent, milestone })
|
|
16
|
+
* read(file, from) { events, size } the events after byte offset from
|
|
17
|
+
* hub(dirsOf) { on(fn) → off, poll() } one shared watcher over the state dirs dirsOf() names, for every open page
|
|
18
|
+
*
|
|
19
|
+
* The file is local runtime state (pmos/state is not tracked), kept short: past MAX bytes the writer keeps the last KEEP lines that fit in half of MAX. */
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
const path = require('path');
|
|
22
|
+
|
|
23
|
+
const FILE = 'live-events.jsonl';
|
|
24
|
+
const MAX = 256 * 1024;
|
|
25
|
+
const KEEP = 200;
|
|
26
|
+
const EDIT_FIELDS = ['state', 'due', 'start', 'owner', 'notes', 'section', 'parent', 'milestone'];
|
|
27
|
+
|
|
28
|
+
function emit(stateDir, ev) {
|
|
29
|
+
if (!stateDir) return 0;
|
|
30
|
+
const list = (Array.isArray(ev) ? ev : [ev]).filter((e) => e && typeof e.id === 'string' && e.id && typeof e.field === 'string' && e.field);
|
|
31
|
+
if (!list.length) return 0;
|
|
32
|
+
const f = path.join(stateDir, FILE), at = new Date().toISOString();
|
|
33
|
+
try {
|
|
34
|
+
fs.appendFileSync(f, list.map((e) => JSON.stringify({ at, kind: e.kind || 'task', id: e.id, field: e.field, value: e.value === undefined ? null : e.value, undo: !!e.undo })).join('\n') + '\n');
|
|
35
|
+
const size = fs.statSync(f).size;
|
|
36
|
+
if (size > MAX) {
|
|
37
|
+
// the last KEEP lines, and no more than half of MAX, so the next cut is a while away
|
|
38
|
+
const all = fs.readFileSync(f, 'utf8').split('\n').filter(Boolean).slice(-KEEP), keep = [];
|
|
39
|
+
let bytes = 0;
|
|
40
|
+
for (let i = all.length - 1; i >= 0 && bytes + all[i].length + 1 <= MAX / 2; i--) { keep.unshift(all[i]); bytes += all[i].length + 1; }
|
|
41
|
+
fs.writeFileSync(f, keep.join('\n') + (keep.length ? '\n' : ''));
|
|
42
|
+
}
|
|
43
|
+
return list.length;
|
|
44
|
+
} catch { return 0; }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function fieldEvents(id, body) {
|
|
48
|
+
const out = [];
|
|
49
|
+
for (const k of EDIT_FIELDS) if (body && body[k] !== undefined && body[k] !== null) out.push({ kind: 'task', id, field: k, value: k === 'milestone' ? !!body[k] : body[k] });
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function read(file, from = 0) {
|
|
54
|
+
let size = 0;
|
|
55
|
+
try { size = fs.statSync(file).size; } catch { return { events: [], size: 0 }; }
|
|
56
|
+
// the writer cut the file short: read it from the start again
|
|
57
|
+
const start = size < from ? 0 : from;
|
|
58
|
+
if (size === start) return { events: [], size };
|
|
59
|
+
let text = '';
|
|
60
|
+
try {
|
|
61
|
+
const fd = fs.openSync(file, 'r');
|
|
62
|
+
try { const buf = Buffer.alloc(size - start); fs.readSync(fd, buf, 0, buf.length, start); text = buf.toString('utf8'); } finally { fs.closeSync(fd); }
|
|
63
|
+
} catch { return { events: [], size: from }; }
|
|
64
|
+
// a line still being written waits for the next poll
|
|
65
|
+
const end = text.lastIndexOf('\n');
|
|
66
|
+
if (end < 0) return { events: [], size: start };
|
|
67
|
+
const events = [];
|
|
68
|
+
for (const line of text.slice(0, end).split('\n')) { if (!line.trim()) continue; try { events.push(JSON.parse(line)); } catch { /* a torn line is skipped */ } }
|
|
69
|
+
return { events, size: start + Buffer.byteLength(text.slice(0, end + 1)) };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** One watcher for every open page: it starts at the files' current ends (a page that opens now reads its lists itself), polls every
|
|
73
|
+
* ms while a page listens, and stops when none does. */
|
|
74
|
+
function hub(dirsOf, { ms = 200 } = {}) {
|
|
75
|
+
const fns = new Set(), at = new Map();
|
|
76
|
+
let timer = null;
|
|
77
|
+
const files = () => { let d = []; try { d = dirsOf() || []; } catch { d = []; } return [...new Set(d.filter(Boolean))].map((x) => path.join(x, FILE)); };
|
|
78
|
+
const mark = () => { for (const f of files()) if (!at.has(f)) { let s = 0; try { s = fs.statSync(f).size; } catch { s = 0; } at.set(f, s); } };
|
|
79
|
+
function poll() {
|
|
80
|
+
for (const f of files()) {
|
|
81
|
+
// a workspace added while pages listen starts at its file's current end, like the others did
|
|
82
|
+
if (!at.has(f)) { let s = 0; try { s = fs.statSync(f).size; } catch { s = 0; } at.set(f, s); continue; }
|
|
83
|
+
const r = read(f, at.get(f));
|
|
84
|
+
at.set(f, r.size);
|
|
85
|
+
for (const e of r.events) for (const fn of fns) { try { fn(e); } catch { /* one page's failed send never stops the others */ } }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
on(fn) {
|
|
90
|
+
if (!fns.size) { at.clear(); mark(); timer = setInterval(poll, ms); if (timer.unref) timer.unref(); }
|
|
91
|
+
fns.add(fn);
|
|
92
|
+
return () => { fns.delete(fn); if (!fns.size && timer) { clearInterval(timer); timer = null; } };
|
|
93
|
+
},
|
|
94
|
+
poll,
|
|
95
|
+
listeners: () => fns.size,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
module.exports = { FILE, MAX, KEEP, EDIT_FIELDS, emit, fieldEvents, read, hub };
|
|
@@ -169,6 +169,9 @@ const VERBS = Object.freeze({
|
|
|
169
169
|
// Not a pm-os-absorb verb (run: null): initiative strategy-draft (Wawan 2026-11-24) added it through the same table.
|
|
170
170
|
strategy: Object.freeze({ module: 'strategy-cli.js', run: null, guide: 'cli.md',
|
|
171
171
|
help: 'pmos strategy show|sources|draft|set|undo — the product\'s five-line strategy; PMOS drafts blank lines from the product\'s files, each citing them (pmos strategy help)' }),
|
|
172
|
+
// Not a pm-os-absorb verb (run: null): initiative declined-asks-reply (bet A326) added it through the same table.
|
|
173
|
+
declined: Object.freeze({ module: 'declined-cli.js', run: null, guide: 'cli.md',
|
|
174
|
+
help: 'pmos declined list|draft|record — asks closed without being done, each with a kind reply draft PMOS never sends; record one in the out-of-scope list (pmos declined help)' }),
|
|
172
175
|
// Not a pm-os-absorb verb (run: null): initiative sprint-retro-one-change (bet A76) added it through the same table.
|
|
173
176
|
sprint: Object.freeze({ module: 'sprint-cli.js', run: null, guide: 'cli.md',
|
|
174
177
|
help: 'pmos sprint retro|change — a closed sprint\'s retro from PMOS\'s own close numbers, and its one tracked change (pmos sprint help)' }),
|
|
@@ -29,6 +29,7 @@ const RULE = [
|
|
|
29
29
|
'Run `pmos program help` when unsure. If a command refuses, say what it printed and what would let it through; never send the PM to Work for a change a command makes.',
|
|
30
30
|
'To see a program: press its name on Work, or open /premium-board.html?program=<id>.',
|
|
31
31
|
'You can read programs.jsonl to answer a question about a program. If the PM asks you to sort a turned program\'s tasks into program, initiative or epic, propose a level for each task in a list and let the PM decide.',
|
|
32
|
+
/* card-catalog:begin, generated by bin/card-catalog-gen.js: edit lib/card-catalog.json, not this block */"The card buttons run these pmos commands (the card catalog; who acts: you = one press with Undo, agent = PMOS starts a run, waits = only after the PM says yes). Run the one that fits the PM's ask, and tell the PM the Undo line it prints: pmos program check <id> <milestone> (Check a milestone; you); pmos program milestone <id> move <m> --date <date> (Move a milestone, Add a milestone, Rename a milestone, Drop a milestone; you); pmos program join <id> <initiative> (Add an initiative; you); pmos program leave <id> <initiative> (Take one out; you); pmos program charter <id> --goal <text> --why <text> (Set goal and why; you); pmos program capacity <team> <n> (Set team capacity; you); pmos program decide --team <team> --first <initiative> (Decide what goes first; you); pmos program order <id> <id,id,…> (Order its initiatives; you); pmos program archive <id> (Archive; you); pmos program task <id> \"<title>\" --key <key> (Add; you); pmos program task-done <id> <key> (Done; you); pmos units show <unit> (Open; you)."/* card-catalog:end */,
|
|
32
33
|
].join('\n');
|
|
33
34
|
|
|
34
35
|
/** The message as PMOS types it into the session: the rule, then the PM's words. */
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* section 'check' (Check these: a maybe, with its reason; a duplicate already in another initiative, LINKED, never copied: they
|
|
14
14
|
* need their own ✓ and never ride on Keep all) and section 'unplaced' (Not placed: kept under Linked)
|
|
15
15
|
* dates one proposal per stage: its late and at-risk tasks to new dates and its plan with them, plus what a moved task's links reach
|
|
16
|
+
* scope the scope cuts that save the date (lib/scope-cuts.js, idea A43): computed fresh like dates, never filed; type cut; section
|
|
17
|
+
* 'check' and class C (its own ✓). ✓ moves each cut task to after the committed end with a note (op dates + notes, scope: true)
|
|
16
18
|
* status "looks done": the evidence says the work happened
|
|
17
19
|
* names tidy names, before → after; the detail cut moves to the task's notes
|
|
18
20
|
* outcome the expected outcome and its check date (D57; lib/outcomes.js, filed by lib/outcome-props.js): type new (no outcome yet) or date
|
|
@@ -516,11 +518,12 @@ function datesOf(ini, T, o = {}) {
|
|
|
516
518
|
}
|
|
517
519
|
|
|
518
520
|
/* ── what r.props carries ── */
|
|
519
|
-
const ORDER = { build: -3, harness: -2.5, description: -2, outcome: -1, live: -0.7, prototyped: -0.6, improved: -0.5, scanned: -0.4, found: 0, dates: 1, status: 2, names: 3, links: 4, grill: 5 };
|
|
521
|
+
const ORDER = { build: -3, harness: -2.5, description: -2, outcome: -1, live: -0.7, prototyped: -0.6, improved: -0.5, scanned: -0.4, found: 0, dates: 1, scope: 1.5, status: 2, names: 3, links: 4, grill: 5 };
|
|
520
522
|
const GRILL_SHOWN = 3;
|
|
521
523
|
/**
|
|
522
524
|
* One initiative's proposals, as the ✦ and the Viewer draw them, or null when there is nothing to show.
|
|
523
|
-
* o: { T (Map uid → task), today (iso), stages: [{ key, name }], links: approved task links, settle, linkProps: [task-links proposal], grillAll (no fold)
|
|
525
|
+
* o: { T (Map uid → task), today (iso), stages: [{ key, name }], links: approved task links, settle, linkProps: [task-links proposal], grillAll (no fold),
|
|
526
|
+
* limit (day number: the committed end, for the scope cuts), named(title) (the PRD names it) }
|
|
524
527
|
* → { n, sure, look: { run, why, at, ended, stopped, sources: [{ source, name, state, n, what }] } | null, groups: [{ group, props: [p] }], t }
|
|
525
528
|
*/
|
|
526
529
|
function viewOf(F, ini, o = {}) {
|
|
@@ -547,6 +550,14 @@ function viewOf(F, ini, o = {}) {
|
|
|
547
550
|
const grillHidden = o.grillAll ? [] : grill.slice(GRILL_SHOWN).map((p) => ({ id: p.id, group: 'grill', type: p.type, title: p.title, why: p.why, at: p.at, sig: p.sig, sources: p.sources, data: p.data, items: [] }));
|
|
548
551
|
if (!o.grillAll) for (const p of grill.slice(GRILL_SHOWN)) props.splice(props.indexOf(p), 1);
|
|
549
552
|
if (today != null) for (const p of datesOf(ini, T, { today, filed: [...F.props.values()].filter((x) => x.group === 'dates' && x.ini === ini), stages: o.stages, links: o.links, settle: o.settle, drops: F.drops })) if (!kept.has(p.id + ':' + p.sig)) props.push(p);
|
|
553
|
+
// the scope cuts that save the date (lib/scope-cuts.js, idea A43): computed fresh like the dates ✦, never filed; its own ✓ (class C)
|
|
554
|
+
if (today != null && o.limit != null) {
|
|
555
|
+
for (const p of require('./scope-cuts.js').cutsOf(ini, T, { today: o.today, limit: o.limit, links: o.links, named: o.named })) {
|
|
556
|
+
if (kept.has(p.id + ':' + p.sig) || F.drops.has(p.sig)) continue;
|
|
557
|
+
p.items = p.items.filter((x) => !F.drops.has(itemSig(p, x)));
|
|
558
|
+
if (p.items.length) props.push(p);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
550
561
|
// one-change-record-no-source-no-auto: a link cites where it was read (the PRD line, a Jira dependency); a link guessed from the plan's
|
|
551
562
|
// order or from two dates that meet cites nothing, so lib/source-guard.js holds it for the PM instead of adding it by itself
|
|
552
563
|
const SG = require('./source-guard.js');
|
|
@@ -41,6 +41,7 @@ const RULE = [
|
|
|
41
41
|
' To change a saved dashboard, add its "id" (from premium-dashboards.jsonl in the state folder); {"kind":"dashboard","id":"…"} alone opens it.',
|
|
42
42
|
' You never save, change or delete a chart or a dashboard yourself either: the PM presses Save in the Chart tab.',
|
|
43
43
|
'If the message is not about a report, a chart or a dashboard, answer it and add no block.',
|
|
44
|
+
/* card-catalog:begin, generated by bin/card-catalog-gen.js: edit lib/card-catalog.json, not this block */"The card buttons run these pmos commands (the card catalog; who acts: you = one press with Undo, agent = PMOS starts a run, waits = only after the PM says yes). Run the one that fits the PM's ask, and tell the PM the Undo line it prints: pmos report draft <cadence> <slot> (Draft; agent); pmos report check <id> (Check; you); pmos report rule <id> add voice|wording|off|keep (Add a rule; you); pmos report issue <cadence> <slot> (Send; waits); pmos schedule run <id> (Run now; you); pmos schedule disable|enable <id> (Pause / resume; you); pmos schedule edit <id> (Edit; you); pmos schedule rm <id> (Remove; you); pmos press-release <initiative> --again (Draft again; agent)."/* card-catalog:end */,
|
|
44
45
|
].join('\n');
|
|
45
46
|
|
|
46
47
|
const REMIND = 'This chat is about a report. If it is set up (report-setups.jsonl, by name) every refinement is a change to its open draft: end with {"kind":"report","id":"<its id>","change":"the whole change, in the PM\'s words"} in a pmos-report block, the page passes it by itself, and say in one line what you passed and that the draft is updating. A look change (palette, tables, Gantt, a deck or screenshot to follow) is "design":"the look" with "sample":"<the attached file path>" instead of "change": the page starts the next look and the PM keeps it with ✓. Never say "the draft stays as it is" or "press Draft it" or "the proposal is unchanged" for a set-up report; ask anything unknown once and pass what is known. An issued report is frozen: pass nothing. Same rules as before.';
|
|
@@ -147,6 +147,7 @@ const MODULES = Object.freeze([
|
|
|
147
147
|
'routes-strategy-card', // bet A458: a product's five-line strategy above its Board, and the gentle "doesn't fit" note on new work (records strategy-card.jsonl; page-press POST)
|
|
148
148
|
'routes-principles', // bet A352: a product's principles drafted from its decisions, kept or dropped on the Board (records principles.jsonl; page-press POST)
|
|
149
149
|
'routes-prefs', // bet A461: view preferences that follow the person to the phone and other browsers (runtime view-prefs.json; page-press POST)
|
|
150
|
+
'routes-live-rows', // bet A458: chat-made task changes streamed to open pages (runtime live-events.jsonl; read-only event stream)
|
|
150
151
|
]);
|
|
151
152
|
const PM_DIR = path.join(__dirname, '..', 'public', 'pm');
|
|
152
153
|
const MODULE_NAME = /^[a-z0-9][a-z0-9-]*\.js$/;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* routes-live-rows.js — the live changes stream (bet A458, path-level live updates; job #1750).
|
|
3
|
+
*
|
|
4
|
+
* GET /api/live-rows → text/event-stream; one `data: {at, kind, id, field, value, undo}` message per change that `pmos task …` made from
|
|
5
|
+
* the chat, in any workspace this server holds (lib/live-events.js). A comment line every 25 s keeps it open.
|
|
6
|
+
*
|
|
7
|
+
* Read only: the stream writes nothing, and an open page draws each change on the rows it already holds (public/pm/live-feed.js). */
|
|
8
|
+
const LE = require('./live-events.js');
|
|
9
|
+
|
|
10
|
+
let HUB = null;
|
|
11
|
+
const hubOf = (ctx) => HUB || (HUB = LE.hub(() => (ctx.workspaceList ? ctx.workspaceList() : []).map((w) => { try { return ctx.stateDirFor(w); } catch { return null; } })));
|
|
12
|
+
|
|
13
|
+
module.exports = {
|
|
14
|
+
prefixes: ['/api/live-rows'],
|
|
15
|
+
handle: async (req, res, url, ctx) => {
|
|
16
|
+
if (url.pathname !== '/api/live-rows') return false;
|
|
17
|
+
if (req.method !== 'GET') { ctx.json(res, { ok: false, error: 'GET only' }, 405); return true; }
|
|
18
|
+
res.writeHead(200, { 'Content-Type': 'text/event-stream; charset=utf-8', 'Cache-Control': 'no-cache', Connection: 'keep-alive' });
|
|
19
|
+
res.write(': live\n\n');
|
|
20
|
+
const off = hubOf(ctx).on((e) => res.write('data: ' + JSON.stringify(e) + '\n\n'));
|
|
21
|
+
const beat = setInterval(() => res.write(': beat\n\n'), 25000);
|
|
22
|
+
if (beat.unref) beat.unref();
|
|
23
|
+
const end = () => { off(); clearInterval(beat); };
|
|
24
|
+
req.on('close', end);
|
|
25
|
+
res.on('error', end);
|
|
26
|
+
return true;
|
|
27
|
+
},
|
|
28
|
+
// tests: forget the shared watcher
|
|
29
|
+
_reset: () => { HUB = null; },
|
|
30
|
+
};
|
|
@@ -62,7 +62,19 @@ function view(ctx, p, ini, f, o = {}) {
|
|
|
62
62
|
let linkProps = [];
|
|
63
63
|
try { const lv = TL.viewOf(LF, ini, { T: f.T, today: todayIso(), limit: f.limit, src: TLR.sourcesOf(p.w.root, ini, f.items) }); linkProps = lv ? lv.proposals : []; } catch { linkProps = []; }
|
|
64
64
|
const T = new Map(); for (const x of f.items) { if (!x || !(x.uid || x.key)) continue; const t = PR.taskOf(x); T.set(t.uid, t); }
|
|
65
|
-
|
|
65
|
+
// the scope cuts (lib/scope-cuts.js): the committed end, and the PRD's words to say which cut costs more
|
|
66
|
+
const prd = (() => { try { return TLR.prdText(p.w.root, ini) || ''; } catch { return ''; } })();
|
|
67
|
+
const named = (title) => { const t = String(title || '').replace(/^\d+(\.\d+)*\s+/, '').trim(); return t.length >= 6 && prd.toLowerCase().includes(t.toLowerCase()); };
|
|
68
|
+
return PR.viewOf(F, ini, { T, today: todayIso(), stages: stagesOf(ctx, p, ini), links, settle: TL.settle, linkProps, grillAll: !!o.grillAll, limit: limitOf(f, T, ini), named });
|
|
69
|
+
}
|
|
70
|
+
/** The date the scope cuts keep: the initiative's committed end (its plan items), else the plan end its tasks make, as the Board's row
|
|
71
|
+
* shows it (routes-boards boardRow: the latest due date of its tasks). → day number | null */
|
|
72
|
+
function limitOf(f, T, ini) {
|
|
73
|
+
const base = f.limit ? f.limit(ini) : null;
|
|
74
|
+
if (base != null) return base;
|
|
75
|
+
let end = null;
|
|
76
|
+
for (const t of T.values()) if (t.ini === ini && t.kind !== 'Epic' && t.e != null && (end == null || t.e > end)) end = t.e;
|
|
77
|
+
return end;
|
|
66
78
|
}
|
|
67
79
|
function viewFor(ctx, w, boardId, ini) {
|
|
68
80
|
const fr = RB.frameFor(ctx, w), board = fr.boards.find((b) => b.id === boardId);
|
|
@@ -97,7 +109,8 @@ function keepCore(ctx, p, g, f, ini, want, choices = {}, extra = {}) {
|
|
|
97
109
|
if ((x.group === 'prototyped' || x.group === 'improved') && !w.length && x.failed) { failed.push({ id: x.id, why: x.failed }); continue; } // a round still being made stays open
|
|
98
110
|
wrote.push(...w);
|
|
99
111
|
if (x.group === 'dates' && x.plan && w.some((y) => y.op === 'dates')) plans++;
|
|
100
|
-
keptIds.push(x.group === 'dates' ? x.id + ':' + x.sig : x.id);
|
|
112
|
+
keptIds.push(x.group === 'dates' || x.group === 'scope' ? x.id + ':' + x.sig : x.id); // computed fresh: kept while its signature holds
|
|
113
|
+
if (x.group === 'scope' && w.length) console.error(`${require('./scope-cuts.js').TAG} kept ${ini}: ${w.filter((y) => y.op === 'dates').length} moved to after ${(x.data && x.data.date) || ''}`);
|
|
101
114
|
}
|
|
102
115
|
for (const a of outbox) { const id = toOutbox(ctx, a); if (id) wrote.push({ op: 'outbox', task: a.task, entry: id, why: a.text }); }
|
|
103
116
|
const batch = PR.newBatch();
|
|
@@ -463,6 +476,19 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
|
|
|
463
476
|
const mine = own && x.data && x.data.next && own !== x.data.next ? { edited: { from: String(x.data.next).slice(0, 200), to: own } } : {};
|
|
464
477
|
if (W.ok(r)) add({ op: 'add', task: r.body.item && (r.body.item.uid || r.body.item.id), title: next, to: { start: '', due: '' }, ...mine });
|
|
465
478
|
}
|
|
479
|
+
} else if (x.group === 'scope') {
|
|
480
|
+
// the scope cuts that save the date (lib/scope-cuts.js): each task moves to after the date, with a note saying why; Undo puts both back
|
|
481
|
+
const SC = require('./scope-cuts.js'), note = SC.noteOf(x), date = (x.data && x.data.date) || '';
|
|
482
|
+
for (const it of items) {
|
|
483
|
+
const t = f.T.get(it.task), xi = f.byUid.get(it.task) || {};
|
|
484
|
+
if (!t || t.closed) continue;
|
|
485
|
+
if (t.jira) { outbox.push({ task: it.task, text: 'Could ' + it.task + ' move to after ' + PR.md(PR.dn(date)) + '? ' + why }); continue; }
|
|
486
|
+
const r = W.dates(ctx, p, g, it.task, xi, it.to);
|
|
487
|
+
if (!W.ok(r)) continue;
|
|
488
|
+
add({ op: 'dates', task: it.task, title: t.title, from: { start: xi.start || '', due: xi.end || '' }, to: { start: it.to.start || xi.start || '', due: it.to.due || '' }, scope: true, cut: date });
|
|
489
|
+
const was = xi.notes || '';
|
|
490
|
+
if (!was.includes(note)) { const r2 = RB.taskEdit(ctx, { ws: p.w.id, board: p.board.id, task: it.task, notes: (was ? was + '\n' : '') + note }, g); if (W.ok(r2)) add({ op: 'notes', task: it.task, from: was, to: (was ? was + '\n' : '') + note, scope: true }); }
|
|
491
|
+
}
|
|
466
492
|
} else if (x.group === 'status') {
|
|
467
493
|
for (const it of items) {
|
|
468
494
|
const t = f.T.get(it.task); if (!t || t.closed) continue;
|
|
@@ -515,7 +541,9 @@ function saidOf(wrote, plans, left) {
|
|
|
515
541
|
const found = [n('stage') ? 'the stage' : '', n('doc') ? plural(n('doc'), 'document', 'documents') : '', n('add') ? plural(n('add'), 'task', 'tasks') : '', n('linked') ? plural(n('linked'), 'link', 'links') : ''].filter(Boolean);
|
|
516
542
|
const bits = [];
|
|
517
543
|
if (found.length) bits.push('Kept ' + (found.length > 1 ? found.slice(0, -1).join(', ') + ' and ' + found[found.length - 1] : found[0]));
|
|
518
|
-
const
|
|
544
|
+
const cuts = wrote.filter((w) => w.op === 'dates' && w.scope), cutN = new Set(cuts.map((w) => w.task)).size;
|
|
545
|
+
if (cutN) bits.push((bits.length ? 'moved ' : 'Moved ') + plural(cutN, 'task', 'tasks') + ' to after ' + PR.md(PR.dn(cuts[0].cut)));
|
|
546
|
+
const moved = new Set(wrote.filter((w) => w.op === 'dates' && !w.scope).map((w) => w.task)).size;
|
|
519
547
|
if (moved) bits.push((bits.length ? 'moved ' : 'Moved ') + plural(moved, 'task', 'tasks') + (plans ? ' and ' + plural(plans, 'plan', 'plans') : ''));
|
|
520
548
|
if (n('state')) bits.push((bits.length ? 'ticked ' : 'Ticked ') + n('state') + ' done');
|
|
521
549
|
if (n('rename')) bits.push((bits.length ? 'renamed ' : 'Renamed ') + n('rename'));
|