create-pmos 0.552.0 → 0.554.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 +33 -27
- 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/briefing-premium-board-test.js +4 -4
- package/workspace/briefing-premium-initiative-test.js +2 -2
- package/workspace/briefing-premium-test.js +1 -1
- package/workspace/changelog.json +32 -0
- package/workspace/chat-asks-test.js +5 -5
- package/workspace/ev-everywhere-test.js +2 -2
- package/workspace/goals-clear-ui-test.js +1 -1
- package/workspace/guide/agent-capabilities.md +31 -31
- package/workspace/guide/claude-proposes.md +68 -68
- package/workspace/guide/cli.md +22 -22
- package/workspace/guide/cloud.md +3 -3
- package/workspace/guide/home.md +38 -38
- package/workspace/guide/index.md +5 -5
- package/workspace/guide/intelligence-okr-goals.md +4 -4
- package/workspace/guide/layout.md +23 -23
- package/workspace/guide/notes.md +8 -8
- package/workspace/guide/programs.md +18 -18
- package/workspace/guide/reports.md +16 -16
- package/workspace/guide/settings-and-switches.md +37 -37
- package/workspace/guide/statuses.md +3 -3
- package/workspace/home-other-product-test.js +8 -8
- package/workspace/home-pill-test.js +3 -3
- package/workspace/home-rows-test.js +7 -7
- package/workspace/intel-report-ui-test.js +1 -1
- package/workspace/intelligence-gaps-ui-test.js +2 -2
- package/workspace/lib/agent-roles.js +1 -1
- package/workspace/lib/autonomy.js +1 -1
- package/workspace/lib/bg-queue.js +1 -1
- package/workspace/lib/board-pack-route.js +18 -2
- package/workspace/lib/briefing-premium-agent.js +2 -2
- package/workspace/lib/decision-memory.js +2 -2
- package/workspace/lib/driver-decide.js +2 -2
- package/workspace/lib/driver.js +6 -2
- package/workspace/lib/folder-needs.js +1 -1
- package/workspace/lib/goal-chat.js +5 -5
- package/workspace/lib/goal-watch.js +1 -1
- package/workspace/lib/grill-runs.js +5 -5
- package/workspace/lib/idle-lab.js +5 -5
- package/workspace/lib/impact-runs.js +2 -2
- package/workspace/lib/job-graph.js +2 -2
- package/workspace/lib/metric-draft-runs.js +4 -4
- package/workspace/lib/metric-read-runs.js +5 -5
- package/workspace/lib/news-for-you.js +1 -1
- package/workspace/lib/proposal-runs.js +6 -6
- package/workspace/lib/refresh.js +1 -1
- package/workspace/lib/routes-board-premium.js +1 -1
- package/workspace/lib/routes-goal-status.js +4 -4
- package/workspace/lib/routes-impact.js +1 -1
- package/workspace/lib/routes-insight-moves.js +1 -1
- package/workspace/lib/routes-loose.js +2 -2
- package/workspace/lib/routes-mentions.js +1 -1
- package/workspace/lib/routes-metric-drafts.js +9 -9
- package/workspace/lib/routes-proposals.js +8 -8
- package/workspace/lib/routes-ready-reports.js +1 -1
- package/workspace/lib/routes-slash.js +1 -1
- package/workspace/lib/source-heal.js +3 -3
- package/workspace/lib/state-root.js +22 -1
- package/workspace/lib/task-items.js +1 -1
- package/workspace/lib/task-links.js +2 -2
- package/workspace/lib/today.js +2 -2
- package/workspace/live-pill-round-test.js +1 -1
- package/workspace/metric-drafts-ui-test.js +1 -1
- package/workspace/milestone-suggest-test.js +5 -5
- package/workspace/news-viewers-test.js +3 -3
- package/workspace/okr-goals-ui-test.js +1 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-chat-chart-tab-test.js +1 -1
- package/workspace/premium-chat-context-test.js +4 -4
- package/workspace/premium-chat-goal-setup-test.js +3 -3
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-line-test.js +6 -6
- package/workspace/premium-chat-notes-test.js +4 -4
- package/workspace/premium-chat-report-tab-test.js +4 -4
- package/workspace/premium-rec-now-test.js +2 -2
- package/workspace/public/pm/batch-press.js +4 -4
- package/workspace/public/pm/bd-fc-card.js +1 -1
- package/workspace/public/pm/bd-goal.js +39 -2
- package/workspace/public/pm/bd-next.js +10 -10
- package/workspace/public/pm/bd-prog-panel.js +5 -5
- package/workspace/public/pm/bd-views.js +9 -4
- package/workspace/public/pm/chat-ask.js +1 -1
- package/workspace/public/pm/chat-context.js +3 -3
- package/workspace/public/pm/cozy-board.css +15 -0
- package/workspace/public/pm/cozy-evmodel.js +1 -1
- package/workspace/public/pm/cozy-home.css +1 -1
- package/workspace/public/pm/cozy-lab-ins.js +4 -4
- package/workspace/public/pm/cozy-lab.js +1 -1
- package/workspace/public/pm/cozy-news.js +2 -2
- package/workspace/public/pm/cozy-onboard.js +2 -2
- package/workspace/public/pm/cozy-rec-now.js +5 -5
- package/workspace/public/pm/cozy-rec-present.js +1 -1
- package/workspace/public/pm/cozy-reveal.js +2 -2
- package/workspace/public/pm/cozy-settings.js +19 -19
- package/workspace/public/pm/cozy-steps.js +2 -2
- package/workspace/public/pm/cozy-viewer.js +1 -1
- package/workspace/public/pm/ctx-wedge.js +1 -1
- package/workspace/public/pm/dash-view.js +1 -1
- package/workspace/public/pm/goal-chat.js +6 -6
- package/workspace/public/pm/good-morning.js +2 -2
- package/workspace/public/pm/grill-words.js +1 -1
- package/workspace/public/pm/home-app.js +19 -19
- package/workspace/public/pm/home-ask.js +1 -1
- package/workspace/public/pm/home-chat.js +6 -6
- package/workspace/public/pm/home-data.js +2 -2
- package/workspace/public/pm/home-day.js +3 -3
- package/workspace/public/pm/home-drift.js +1 -1
- package/workspace/public/pm/home-goal.js +1 -1
- package/workspace/public/pm/home-impact.js +1 -1
- package/workspace/public/pm/home-ini.js +1 -1
- package/workspace/public/pm/home-line.js +5 -5
- package/workspace/public/pm/home-mentions.js +4 -4
- package/workspace/public/pm/home-moment.js +1 -1
- package/workspace/public/pm/home-need.js +1 -1
- package/workspace/public/pm/home-phone-card.js +1 -1
- package/workspace/public/pm/home-stage-card.js +2 -2
- package/workspace/public/pm/home-sweep.js +1 -1
- package/workspace/public/pm/home-today.js +2 -2
- package/workspace/public/pm/ini-about.js +2 -2
- package/workspace/public/pm/ini-agent.js +5 -5
- package/workspace/public/pm/ini-links.js +5 -5
- package/workspace/public/pm/ini-props.js +11 -11
- package/workspace/public/pm/ini-view-model.js +1 -1
- package/workspace/public/pm/ini-view.js +2 -2
- package/workspace/public/pm/intent.js +3 -3
- package/workspace/public/pm/loose-props.js +5 -5
- package/workspace/public/pm/metric-drafts.js +1 -1
- package/workspace/public/pm/ms-suggest.js +3 -3
- package/workspace/public/pm/next-prompt-ui.js +2 -2
- package/workspace/public/pm/okr-list.js +1 -1
- package/workspace/public/pm/page-chat.js +2 -2
- package/workspace/public/pm/premium-attach.js +1 -1
- package/workspace/public/pm/premium-board.js +15 -8
- package/workspace/public/pm/premium-initiative-head.js +1 -1
- package/workspace/public/pm/premium-insights.js +3 -3
- package/workspace/public/pm/premium-meeting.js +1 -1
- package/workspace/public/pm/premium-mtg-replay.js +1 -1
- package/workspace/public/pm/premium-notes.js +2 -2
- package/workspace/public/pm/premium-report-read.js +6 -6
- package/workspace/public/pm/premium-report-tab.js +7 -7
- package/workspace/public/pm/premium-shell.js +18 -18
- package/workspace/public/pm/premium-vw-ctx.js +3 -3
- package/workspace/public/pm/premium-vw-jira.js +1 -1
- package/workspace/public/pm/premium-welcome.js +1 -1
- package/workspace/public/pm/prog-order.js +2 -2
- package/workspace/public/pm/program-charter.js +3 -3
- package/workspace/public/pm/program-model.js +1 -1
- package/workspace/public/pm/ready-lib.js +4 -4
- package/workspace/public/pm/report-flow.js +7 -7
- package/workspace/public/pm/report-orders-ui.js +2 -2
- package/workspace/public/pm/split-merge.js +5 -5
- package/workspace/public/pm/story.js +1 -1
- package/workspace/public/pm/task-card.js +1 -1
- package/workspace/public/pm/tk-draft.js +1 -1
- package/workspace/public/pm/tk-send.js +2 -2
- package/workspace/public/pm/wf-page.js +2 -2
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/rec-present-test.js +2 -2
- package/workspace/server.js +12 -8
- package/workspace/session-names-test.js +3 -3
- package/workspace/skills/doc-check.skill +2 -0
- package/workspace/skills/idle-lab-prototype.skill +2 -0
- package/workspace/skills/measure.skill +2 -0
- package/workspace/skills/metric-read.skill +2 -0
- package/workspace/skills/milestone-review.skill +2 -0
- package/workspace/skills/report-biweekly.skill +2 -0
- package/workspace/skills/report-daily.skill +2 -0
- package/workspace/skills/report-design.skill +2 -0
- package/workspace/skills/report-monthly.skill +2 -0
- package/workspace/skills/report-weekly.skill +2 -0
- package/workspace/split-merge-ui-test.js +3 -3
- package/workspace/stage-card-test.js +4 -4
- package/workspace/task-links-test.js +1 -1
- package/workspace/task-views-test.js +7 -7
- package/workspace/tk-tasks-test.js +2 -2
|
@@ -67,7 +67,7 @@ function heldOrCompare(ctx, w, what, body, { root, id, rec }) {
|
|
|
67
67
|
const reading = { at: h.day, value: h.value, source: h.source || 'held reading', via: 'held', read_at: h.at };
|
|
68
68
|
for (const k of ['num', 'den']) if (Number.isFinite(h[k])) reading[k] = h[k];
|
|
69
69
|
if (h.period) reading.period = h.period;
|
|
70
|
-
const r = records().addReading(root, rec.rid, reading, UI(), 'The PM filed a reading
|
|
70
|
+
const r = records().addReading(root, rec.rid, reading, UI(), 'The PM filed a reading PMOS held');
|
|
71
71
|
if (!r.ok) return bad(400, (r.reasons || []).join('; '));
|
|
72
72
|
MR.append(dir, UI(), { kind: 'filed', rid: rec.rid, held: h.at }, now);
|
|
73
73
|
if (h.ticket) { try { MD.append(dir, UI(), { kind: 'clear', scope: 'product', id: w.id, row: h.ticket }, now); } catch { /* the ticket stays a draft */ } }
|
|
@@ -159,12 +159,12 @@ async function handle(req, res, url, ctx) {
|
|
|
159
159
|
}
|
|
160
160
|
if (body.close_band !== undefined) { const b = Number(body.close_band); if (!Number.isFinite(b) || b < 0) return send(bad(400, 'close_band is a number, 0 or more')); set.close_band = b; }
|
|
161
161
|
if (!Object.keys(set).length) return send(bad(400, 'Say the recipe, the rhythm or the close band.'));
|
|
162
|
-
const out = edit(set, body.recipe === undefined && body.rhythm !== undefined ? 'How often
|
|
162
|
+
const out = edit(set, body.recipe === undefined && body.rhythm !== undefined ? 'How often PMOS reads this goal' : 'How PMOS reads this goal');
|
|
163
163
|
if (out.status === 200 && set.recipe) out.body.rhythm = MR.rhythmOf(set.recipe);
|
|
164
164
|
return send(out);
|
|
165
165
|
}
|
|
166
166
|
if (what === 'read' || what === 'test') {
|
|
167
|
-
if (!ctx.metricReadRuns) return send(bad(503, '
|
|
167
|
+
if (!ctx.metricReadRuns) return send(bad(503, 'PMOS\'s runs are off on this server.'));
|
|
168
168
|
let rids;
|
|
169
169
|
if (what === 'test') {
|
|
170
170
|
rids = Array.isArray(body.rows) ? body.rows.filter((x) => typeof x === 'string').slice(0, 8) : [];
|
|
@@ -172,7 +172,7 @@ async function handle(req, res, url, ctx) {
|
|
|
172
172
|
} else rids = rec ? [rec.rid] : id ? [] : liveRecords(ctx, w).filter((r) => r.recipe && r.recipe.connector).map((r) => r.rid);
|
|
173
173
|
if (!rids.length) return send(bad(id ? 404 : 409, id ? 'There is no such goal.' : 'No goal has a way to be read yet.'));
|
|
174
174
|
const r = ctx.metricReadRuns.start({ ws: w.id, rids, why: what === 'test' ? 'test' : 'press' });
|
|
175
|
-
return send(r && r.ok ? { status: 200, body: { ok: true, run: r.run, rids: r.rids } } : bad(409, (r && r.error) || '
|
|
175
|
+
return send(r && r.ok ? { status: 200, body: { ok: true, run: r.run, rids: r.rids } } : bad(409, (r && r.error) || 'PMOS could not start reading.'));
|
|
176
176
|
}
|
|
177
177
|
if (what === 'file-held' || what === 'compare' || what === 'compare-pick') return send(heldOrCompare(ctx, w, what, body, { root, id, rec }));
|
|
178
178
|
// csv: the fallback when no connector reads it
|
|
@@ -53,7 +53,7 @@ async function handle(req, res, url, ctx) {
|
|
|
53
53
|
}
|
|
54
54
|
if (!['verdict', 'verdict-all', 'undo', 'seen', 'looked'].includes(what)) return send(bad(404, 'no such impact route'));
|
|
55
55
|
if (req.method !== 'POST') return send(bad(405, 'POST only'));
|
|
56
|
-
if (req.headers && req.headers['x-pmos-session']) return send(bad(403, 'Only you check your impact, from the page.
|
|
56
|
+
if (req.headers && req.headers['x-pmos-session']) return send(bad(403, 'Only you check your impact, from the page. PMOS\'s run files items with pmos impact.'));
|
|
57
57
|
const rd = await ctx.readJson(req);
|
|
58
58
|
if (!rd.ok) return send(bad(400, 'the body is not JSON'));
|
|
59
59
|
const body = rd.body || {};
|
|
@@ -37,7 +37,7 @@ const movesIn = (m) => { const I = (m && m.insight) || {}; return [I.move].conca
|
|
|
37
37
|
function write(ctx, w, mv, actor) {
|
|
38
38
|
if (mv.kind === 'date') {
|
|
39
39
|
let e;
|
|
40
|
-
try { e = records().edit(recordsDirFor(ctx, w.id), 'kr-metrics', mv.goal, { by: mv.to }, UI(), 'Moved the target date
|
|
40
|
+
try { e = records().edit(recordsDirFor(ctx, w.id), 'kr-metrics', mv.goal, { by: mv.to }, UI(), 'Moved the target date PMOS drafted on Intelligence'); } catch (x) { e = { ok: false, reasons: [String((x && x.message) || x).slice(0, 160)] }; }
|
|
41
41
|
return e.ok ? { undo: { by: mv.from } } : { error: 'The date could not be moved: ' + (e.reasons || []).join('; ') };
|
|
42
42
|
}
|
|
43
43
|
if (mv.kind === 'anchor') {
|
|
@@ -171,9 +171,9 @@ const WRITES = {
|
|
|
171
171
|
ctx.json(res, { ok: true, back, kept, ...viewNow(ctx, dir, dayOf(body)) });
|
|
172
172
|
},
|
|
173
173
|
'/api/loose-props/look': (ctx, res, body, g) => {
|
|
174
|
-
if (!ctx.proposalRuns || !ctx.proposalRuns.startLoose) return fail(ctx, res, 503, '
|
|
174
|
+
if (!ctx.proposalRuns || !ctx.proposalRuns.startLoose) return fail(ctx, res, 503, 'PMOS\'s runs are off on this server');
|
|
175
175
|
const r = ctx.proposalRuns.startLoose({ why: 'check', press: true });
|
|
176
|
-
if (!r || !r.ok) return fail(ctx, res, 409, (r && r.error) || '
|
|
176
|
+
if (!r || !r.ok) return fail(ctx, res, 409, (r && r.error) || 'PMOS could not start looking');
|
|
177
177
|
ctx.json(res, { ok: true, started: r.run });
|
|
178
178
|
},
|
|
179
179
|
};
|
|
@@ -81,7 +81,7 @@ module.exports = {
|
|
|
81
81
|
if (!g.ok) { ctx.json(res, { ok: false, error: g.error }, g.status); return true; }
|
|
82
82
|
if (!ctx.runtimeDir) { ctx.json(res, { ok: false, error: 'no runtime folder' }, 500); return true; }
|
|
83
83
|
if (p === '/api/mentions/act') {
|
|
84
|
-
if (store.AGENT_ACTS.has(b.act)) { ctx.json(res, { ok: false, error: b.act + ' is what
|
|
84
|
+
if (store.AGENT_ACTS.has(b.act)) { ctx.json(res, { ok: false, error: b.act + ' is what PMOS writes: pmos mention ' + (b.act === 'offer' ? 'watch' : b.act) }, 400); return true; }
|
|
85
85
|
const r = store.mark(ctx.runtimeDir, b, new Date(), 'pm');
|
|
86
86
|
ctx.json(res, r, r.ok ? 200 : 400);
|
|
87
87
|
return true;
|
|
@@ -108,14 +108,14 @@ async function handle(req, res, url, ctx) {
|
|
|
108
108
|
const S = () => MD.read(dir).scopes.get(MD.keyOf(scope, id));
|
|
109
109
|
|
|
110
110
|
if (what === 'start') {
|
|
111
|
-
if (!ctx.metricDraftRuns) return send(bad(503, '
|
|
111
|
+
if (!ctx.metricDraftRuns) return send(bad(503, 'PMOS\'s runs are off on this server.'));
|
|
112
112
|
const r = ctx.metricDraftRuns.start({ ws: w.id, scope, id, why: 'press' });
|
|
113
|
-
if (!r || !r.ok) return send(bad(409, (r && r.error) || '
|
|
113
|
+
if (!r || !r.ok) return send(bad(409, (r && r.error) || 'PMOS could not start drafting.'));
|
|
114
114
|
return send({ status: 200, body: { ok: true, run: r.run, ...(r.already ? { already: true } : {}) } });
|
|
115
115
|
}
|
|
116
116
|
if (what === 'stop') {
|
|
117
117
|
const s = S();
|
|
118
|
-
if (!s || !s.run || s.run.ended) return send(bad(409, '
|
|
118
|
+
if (!s || !s.run || s.run.ended) return send(bad(409, 'PMOS is not drafting now.'));
|
|
119
119
|
try { if (ctx.metricDraftRuns) ctx.metricDraftRuns.stop(s.run.run); } catch { /* the end line below says it stopped */ }
|
|
120
120
|
MD.append(dir, g.actor, { kind: 'end', scope, id, run: s.run.run, ok: true, stopped: true }, at());
|
|
121
121
|
return send({ status: 200, body: { ok: true } });
|
|
@@ -143,19 +143,19 @@ async function handle(req, res, url, ctx) {
|
|
|
143
143
|
if (k === 'outcome') Object.assign(kf.fields, { kr: row.goal, was: row.old || '' });
|
|
144
144
|
if (row.recipe) kf.fields.recipe = row.recipe;
|
|
145
145
|
kf.fields.draft = row.id;
|
|
146
|
-
let r; try { r = records().add(root, 'kr-metrics', kf.fields, UI(), k === 'outcome' ? 'Kept the outcome
|
|
146
|
+
let r; try { r = records().add(root, 'kr-metrics', kf.fields, UI(), k === 'outcome' ? 'Kept the outcome PMOS drafted for a project-shaped goal' : 'Kept next quarter\'s goal PMOS drafted'); } catch (e) { return { error: 'The record could not be written: ' + String((e && e.message) || e).slice(0, 160) }; }
|
|
147
147
|
if (!r.ok) return { error: r.reasons.join('; ') };
|
|
148
148
|
// the test read (lib/metric-reads.js), else the reading it was drafted from, is the first reading, with its source
|
|
149
149
|
let test = null; try { const x = require('./metric-reads.js').read(dir).rids.get(row.id); test = x && x.test && x.test.ok && !x.test.held ? x.test : null; } catch { test = null; }
|
|
150
150
|
const first = test ? { at: test.day, value: test.value, source: test.source, via: 'run', read_at: test.at } : kf.reading;
|
|
151
|
-
if (first) { try { records().addReading(root, r.rid, first, UI(), test ? 'The test read before you kept it' : 'The reading
|
|
151
|
+
if (first) { try { records().addReading(root, r.rid, first, UI(), test ? 'The test read before you kept it' : 'The reading PMOS drafted it from'); } catch { /* the record stands */ } }
|
|
152
152
|
return done({ rid: r.rid });
|
|
153
153
|
}
|
|
154
154
|
if (k === 'connect') return done({ open: 'settings:connectors', connector: row.connector });
|
|
155
155
|
const editKeep = (fields, why) => { if (!cur(row.goal)) return { error: 'The goal this fix repairs is not recorded any more.' }; const before = beforeOf(row.goal, Object.keys(fields)); const e = editRec(row.goal, fields, why); return e ? { error: e } : done({ rid: row.goal, before }); };
|
|
156
|
-
if (k === 'recipe') return editKeep({ recipe: row.recipe }, 'Kept how
|
|
156
|
+
if (k === 'recipe') return editKeep({ recipe: row.recipe }, 'Kept how PMOS reads this goal');
|
|
157
157
|
if (k === 'carry') return editKeep({ by: row.by, ...(typeof row.target === 'number' ? { target: row.target } : {}) }, 'Carried on to next quarter');
|
|
158
|
-
if (k === 'owner') return editKeep({ owner: row.owner.name, owner_from: row.owner.from }, 'Kept the owner
|
|
158
|
+
if (k === 'owner') return editKeep({ owner: row.owner.name, owner_from: row.owner.from }, 'Kept the owner PMOS proposed');
|
|
159
159
|
if (k === 'chase') { const o = row.channel === 'jira-write' ? toOutbox('jira-write', row.epic, 'About ' + row.goal, row.body) : toOutbox('team-note', row.to, 'A note on ' + row.goal, row.body); return o.error ? o : done({ rid: row.goal, outbox: o.id }); }
|
|
160
160
|
if (k === 'ticket') { const o = toOutbox('jira-write', (row.ticket && row.ticket.project) || null, row.ticket.title, row.ticket.text); return o.error ? o : done({ rid: row.goal, outbox: o.id }); }
|
|
161
161
|
return { error: 'This draft cannot be kept.' };
|
|
@@ -165,12 +165,12 @@ async function handle(req, res, url, ctx) {
|
|
|
165
165
|
const k = MD.keepFields(scope, id, row, { today });
|
|
166
166
|
if (k.error) return { error: k.error };
|
|
167
167
|
let r;
|
|
168
|
-
try { r = records().add(root, 'kr-metrics', k.fields, UI(), 'Kept a metric
|
|
168
|
+
try { r = records().add(root, 'kr-metrics', k.fields, UI(), 'Kept a metric PMOS drafted'); } catch (e) { return { error: 'The record could not be written: ' + String((e && e.message) || e).slice(0, 160) }; }
|
|
169
169
|
if (!r.ok) return { error: r.reasons.join('; ') };
|
|
170
170
|
// batch 18 item 11: a good live read (not held) is the first reading, with its counts; else the reading it was drafted from
|
|
171
171
|
let live = null; try { const x = require('./metric-reads.js').read(dir).rids.get(row.id); live = x && x.test && x.test.ok && !x.test.held ? x.test : null; } catch { live = null; }
|
|
172
172
|
const first = live ? { at: live.day, value: live.value, source: live.source, via: 'run', read_at: live.at, ...(Number.isFinite(live.num) ? { num: live.num } : {}), ...(Number.isFinite(live.den) ? { den: live.den } : {}), ...(live.period ? { period: live.period } : {}) } : k.reading;
|
|
173
|
-
if (first) { try { records().addReading(root, r.rid, first, UI(), live ? 'The live read before you kept it' : 'The reading
|
|
173
|
+
if (first) { try { records().addReading(root, r.rid, first, UI(), live ? 'The live read before you kept it' : 'The reading PMOS drafted it from'); } catch { /* the record stands; the next reading fills it */ } }
|
|
174
174
|
MD.append(dir, g.actor, { kind: 'keep', scope, id, row: row.id, rid: r.rid }, at());
|
|
175
175
|
return { rid: r.rid };
|
|
176
176
|
};
|
|
@@ -100,13 +100,13 @@ function undoCore(ctx, p, g, id) {
|
|
|
100
100
|
for (const w of k.wrote.slice().reverse()) {
|
|
101
101
|
const xi = w.task ? f.byUid.get(w.task) : null, t = w.task ? f.T.get(w.task) : null;
|
|
102
102
|
let r = null;
|
|
103
|
-
if (w.op === 'add') { if (xi && (xi.status || 'To do') === 'To do') r = RB.taskDelete(ctx, { ws: p.w.id, board: p.board.id, task: w.task, why: 'Undo:
|
|
103
|
+
if (w.op === 'add') { if (xi && (xi.status || 'To do') === 'To do') r = RB.taskDelete(ctx, { ws: p.w.id, board: p.board.id, task: w.task, why: 'Undo: PMOS ✦ added it' }, g); }
|
|
104
104
|
// a task changed since keeps its change: Undo never overwrites a later edit
|
|
105
105
|
else if (w.op === 'dates') { if (xi && (xi.end || '') === (w.to.due || xi.end || '')) r = W.dates(ctx, p, g, w.task, xi, { start: w.from.start, due: w.from.due }); }
|
|
106
106
|
else if (w.op === 'state') { if (t && t.status === w.to) r = RB.taskState(ctx, { ws: p.w.id, board: p.board.id, task: w.task, state: w.from || 'To do', why: 'Undo' }, g); }
|
|
107
107
|
else if (w.op === 'rename') { if (t && t.title === w.to) r = RB.writeAs(ctx, '/api/boards/tasks/rename', { ws: p.w.id, board: p.board.id, task: w.task, title: w.from }, g); }
|
|
108
108
|
else if (w.op === 'notes') { if (xi && (xi.notes || '') === w.to) r = RB.taskEdit(ctx, { ws: p.w.id, board: p.board.id, task: w.task, notes: w.from || '' }, g); }
|
|
109
|
-
else if (w.op === 'stage') { const row = rowOf(f, k.ini); if (row && row.stage === w.to && w.from) r = RB.move(ctx, { ws: p.w.id, board: p.board.id, id: k.ini, to: w.from, why: 'Undo:
|
|
109
|
+
else if (w.op === 'stage') { const row = rowOf(f, k.ini); if (row && row.stage === w.to && w.from) r = RB.move(ctx, { ws: p.w.id, board: p.board.id, id: k.ini, to: w.from, why: 'Undo: PMOS ✦ moved it' }, g); }
|
|
110
110
|
else if (w.op === 'epics') r = RB.writeAs(ctx, '/api/boards/ini-epics', { ws: p.w.id, board: p.board.id, id: k.ini, epics: w.from }, g);
|
|
111
111
|
else if (w.op === 'unlink') { TL.append(dir, g.actor, { kind: 'link', board: p.board.id, ini: k.ini, from: w.from, to: w.to, type: w.link.type, lag: w.link.lag, source: w.link.source }); back++; continue; }
|
|
112
112
|
else if (w.op === 'link') { TL.append(dir, g.actor, { kind: 'unlink', from: w.from, to: w.to }); back++; continue; }
|
|
@@ -172,7 +172,7 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
|
|
|
172
172
|
if (x.type === 'stage') {
|
|
173
173
|
const row = rowOf(f, ini), stage = x.data && x.data.stage;
|
|
174
174
|
if (stage && row && row.stage !== stage) {
|
|
175
|
-
const r = RB.move(ctx, { ws: p.w.id, board: p.board.id, id: ini, to: stage, why: '
|
|
175
|
+
const r = RB.move(ctx, { ws: p.w.id, board: p.board.id, id: ini, to: stage, why: 'PMOS found it there: ' + why }, g);
|
|
176
176
|
if (W.ok(r)) add({ op: 'stage', from: row.stage || '', to: stage });
|
|
177
177
|
}
|
|
178
178
|
for (const it of items) add({ op: 'ran', stage: it.stage, from: it.start || null, to: it.due || null, source: it.source || source });
|
|
@@ -241,7 +241,7 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
|
|
|
241
241
|
// the idle lab (lib/idle-lab.js): ✓ keeps it as the initiative's own document. A prototype is each specimen of round 1, or the new
|
|
242
242
|
// round; a scan finding is evidence. The specimen stays in the runtime folder; the document links it (GET /api/lab/specimen)
|
|
243
243
|
const LAB = require('./idle-lab.js'), d = x.data || {}, name = (sp) => 'Prototype ' + sp.key + ' · ' + sp.title;
|
|
244
|
-
const docOf = (title, ref, kind) => add({ op: 'doc', id: 'fd-' + PR.hash(ini + '|' + x.id + '|' + (ref || title)), title: String(title).slice(0, 140), source: '
|
|
244
|
+
const docOf = (title, ref, kind) => add({ op: 'doc', id: 'fd-' + PR.hash(ini + '|' + x.id + '|' + (ref || title)), title: String(title).slice(0, 140), source: 'PMOS, while you were away', at: x.at || '', ref, kind, claude: true });
|
|
245
245
|
if (x.group === 'prototyped') for (const sp of d.specimens || []) docOf(name(sp), LAB.specimenUrl(sp.file), 'prototype');
|
|
246
246
|
else if (x.group === 'improved') docOf('Prototype ' + (d.base || '') + ' · round ' + d.round + ': ' + (d.changed || ''), LAB.specimenUrl(d.file), 'prototype');
|
|
247
247
|
else docOf(x.why, ((x.sources || [])[0] || {}).ref || '', 'evidence');
|
|
@@ -261,7 +261,7 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
|
|
|
261
261
|
for (const it of items) {
|
|
262
262
|
const t = f.T.get(it.task); if (!t || t.closed) continue;
|
|
263
263
|
if (t.jira) { outbox.push({ task: it.task, text: 'It looks done: ' + why + ' Could you close ' + it.task + '?' }); continue; }
|
|
264
|
-
const r = RB.taskState(ctx, { ws: p.w.id, board: p.board.id, task: it.task, state: 'Done', why: '
|
|
264
|
+
const r = RB.taskState(ctx, { ws: p.w.id, board: p.board.id, task: it.task, state: 'Done', why: 'PMOS ✦: ' + why }, g);
|
|
265
265
|
if (W.ok(r)) add({ op: 'state', task: it.task, title: t.title, from: t.status, to: 'Done' });
|
|
266
266
|
}
|
|
267
267
|
} else if (x.group === 'names') {
|
|
@@ -388,7 +388,7 @@ const WRITES = {
|
|
|
388
388
|
const ini = String(body.initiative || '');
|
|
389
389
|
if (!ini) return fail(ctx, res, 400, 'initiative is required');
|
|
390
390
|
const dir = dirOf(ctx, p.w), L = PR.read(dir).looks.get(ini);
|
|
391
|
-
if (!L || L.ended) return fail(ctx, res, 409, '
|
|
391
|
+
if (!L || L.ended) return fail(ctx, res, 409, 'PMOS is not looking now');
|
|
392
392
|
try { if (ctx.proposalRuns) ctx.proposalRuns.stop(L.run); } catch { /* the end line below says it stopped */ }
|
|
393
393
|
PR.append(dir, g.actor, { kind: 'end', ini, run: L.run, ok: true, stopped: true });
|
|
394
394
|
ctx.json(res, { ok: true });
|
|
@@ -396,9 +396,9 @@ const WRITES = {
|
|
|
396
396
|
'/api/proposals/look': (ctx, res, body, g, p) => {
|
|
397
397
|
const ini = String(body.initiative || ''), why = body.why === 'check' ? 'check' : 'populate';
|
|
398
398
|
if (!ini) return fail(ctx, res, 400, 'initiative is required');
|
|
399
|
-
if (!ctx.proposalRuns) return fail(ctx, res, 503, '
|
|
399
|
+
if (!ctx.proposalRuns) return fail(ctx, res, 503, 'PMOS\'s runs are off on this server');
|
|
400
400
|
const r = ctx.proposalRuns.start({ ws: p.w.id, board: p.board.id, ini, why });
|
|
401
|
-
if (!r || !r.ok) return fail(ctx, res, 409, (r && r.error) || '
|
|
401
|
+
if (!r || !r.ok) return fail(ctx, res, 409, (r && r.error) || 'PMOS could not start looking');
|
|
402
402
|
ctx.json(res, { ok: true, started: r.run });
|
|
403
403
|
},
|
|
404
404
|
};
|
|
@@ -94,7 +94,7 @@ function needsOf(ctx, w, boardId, ids) {
|
|
|
94
94
|
const ps = v.groups.flatMap((g) => g.props || []).sort((a, b) => (a.group === 'dates' ? -1 : 0) - (b.group === 'dates' ? -1 : 0));
|
|
95
95
|
const p = ps[0]; if (!p) continue;
|
|
96
96
|
const first = (p.items || [])[0] || null;
|
|
97
|
-
out.push({ id: p.id, q: String(p.title || (first && first.title) || 'A change
|
|
97
|
+
out.push({ id: p.id, q: String(p.title || (first && first.title) || 'A change PMOS proposes').slice(0, 160), sub: String(p.why || '').slice(0, 200), pick: pickOf(first), from: ini, ini, board: boardId, group: p.group,
|
|
98
98
|
keep: { ids: [p.id] }, drop: { sig: p.sig } });
|
|
99
99
|
}
|
|
100
100
|
return out.sort((a, b) => (a.group === 'dates' ? -1 : 0) - (b.group === 'dates' ? -1 : 0));
|
|
@@ -13,7 +13,7 @@ const fs = require('fs');
|
|
|
13
13
|
const os = require('os');
|
|
14
14
|
const path = require('path');
|
|
15
15
|
|
|
16
|
-
const PMOS = [{ cmd: '/goal', name: 'Give
|
|
16
|
+
const PMOS = [{ cmd: '/goal', name: 'Give PMOS a goal', say: 'It asks a few questions to make the goal SMART, then works on it after you press Start.' }];
|
|
17
17
|
const CLAUDE = [
|
|
18
18
|
['/compact', 'Compact the conversation', 'Claude Code summarises the conversation so far to free room.'],
|
|
19
19
|
['/clear', 'Clear the conversation', 'Claude Code starts again with an empty context in the same session.'],
|
|
@@ -35,7 +35,7 @@ const CAUSES = Object.freeze({
|
|
|
35
35
|
'claude-signin': { why: 'Claude is signed out on this computer', user: true, after: 2 },
|
|
36
36
|
'connector-missing': { why: 'its connector is not connected', user: true, after: 1 },
|
|
37
37
|
'sign-in': { why: 'its sign-in has expired', user: true, after: 2 },
|
|
38
|
-
'rate-limit': { why: 'it asked
|
|
38
|
+
'rate-limit': { why: 'it asked PMOS to slow down', user: false },
|
|
39
39
|
network: { why: 'the network or the proxy did not answer', user: false },
|
|
40
40
|
'connector-failed': { why: 'its connector did not start', user: false },
|
|
41
41
|
interrupted: { why: 'the read was stopped before it ended', user: false },
|
|
@@ -116,13 +116,13 @@ function view(h, name = 'It') {
|
|
|
116
116
|
if (!h) return null;
|
|
117
117
|
const c = h.cause ? CAUSES[h.cause] : null;
|
|
118
118
|
const n = (h.attempts || []).length;
|
|
119
|
-
const tried = n ? `
|
|
119
|
+
const tried = n ? `PMOS read it again ${n === 1 ? 'once' : n + ' times'} since ${hm(h.attempts[0].at)}${c ? `, and ${c.why}` : ''}.` : '';
|
|
120
120
|
let action = null;
|
|
121
121
|
if (h.state === 'needs-you') {
|
|
122
122
|
if (h.cause === 'claude-signin') action = { label: 'Sign in to Claude', how: require('./claude-signin.js').how(), sec: 'claude' };
|
|
123
123
|
else if (h.cause === 'connector-missing') action = { label: 'Connect ' + name, how: 'Turn on its connector in your Claude connectors.', href: CONNECTORS };
|
|
124
124
|
else if (h.cause === 'sign-in') action = { label: 'Reconnect ' + name, how: 'Sign in to its connector again in your Claude connectors.', href: CONNECTORS };
|
|
125
|
-
else action = { label: 'Read ' + name + ' again', how: h.cause === 'manual' ? 'You chose to read it only when you press ↻.' : '
|
|
125
|
+
else action = { label: 'Read ' + name + ' again', how: h.cause === 'manual' ? 'You chose to read it only when you press ↻.' : 'PMOS stopped after ' + n + ' tries.', read: true };
|
|
126
126
|
}
|
|
127
127
|
return { state: h.state, cause: h.cause || null, why: c ? c.why : '', tried, action, attempts: n, next_at: h.next_at ? new Date(h.next_at).toISOString() : null,
|
|
128
128
|
...(h.repaired_at ? { repaired_at: new Date(h.repaired_at).toISOString() } : {}) };
|
|
@@ -581,7 +581,28 @@ function stateHealth({ migration, fellBack = [], rootError = null } = {}) {
|
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
583
|
|
|
584
|
-
|
|
584
|
+
/* ── PMOS-SELF'S FILE-MODE RECORDS WHEN THE CHECKOUT HAS NO pmos/state/ ───────────────────────
|
|
585
|
+
*
|
|
586
|
+
* A PMOS checkout run from source (a cloud session, CI, a dev clone) with no pmos/state/ used to
|
|
587
|
+
* write its file-mode records (tasks.jsonl, proposals.jsonl, driver.jsonl, needs.json) into
|
|
588
|
+
* workspace/state/ — inside the application directory, and two of those files were tracked, so
|
|
589
|
+
* every cloud or CI run that touched them committed machine events with the next PR.
|
|
590
|
+
*
|
|
591
|
+
* So the fallback goes to the per-user root, like the runtime state: <root>/self-records. One
|
|
592
|
+
* exception keeps a running machine from forking its records: when workspace/state/ already holds
|
|
593
|
+
* a record (any *.jsonl, or needs.json), that copy stays in use. A fresh clone holds none, so it
|
|
594
|
+
* never writes into the checkout again. driver.js, today.js and server.js all ask here, so the
|
|
595
|
+
* reader and the writer always agree. */
|
|
596
|
+
const SELF_RECORDS = 'self-records';
|
|
597
|
+
function holdsRecords(dir) {
|
|
598
|
+
try { return fs.readdirSync(dir).some((n) => n.endsWith('.jsonl') || n === 'needs.json'); } catch { return false; }
|
|
599
|
+
}
|
|
600
|
+
function selfRecordsDir({ legacy = null, env = process.env, platform = process.platform, home = os.homedir() } = {}) {
|
|
601
|
+
if (legacy && holdsRecords(legacy)) return legacy;
|
|
602
|
+
return path.join(defaultRoot({ env, platform, home }), SELF_RECORDS);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
module.exports = { SELF_RECORDS, selfRecordsDir, holdsRecords, APP, NOTE_NAME, NOT_STATE, SETTLED_ACTIONS,
|
|
585
606
|
WHY_REFUSED, whyRefused, WHY_UNREADABLE, whyUnreadable, isSettled,
|
|
586
607
|
overrideDir, defaultRoot, readState, presence, migrateLegacy, resolveStateRoot, resolveStore,
|
|
587
608
|
stateHealth };
|
|
@@ -28,7 +28,7 @@ const isItemId = (id) => typeof id === 'string' && !/^task-/.test(id) && planIte
|
|
|
28
28
|
/** An item's owner in the words the Board uses for a task's owner. */
|
|
29
29
|
function ownerName(o) {
|
|
30
30
|
if (o === 'you') return 'pm:' + actorLib.PM_SLUG;
|
|
31
|
-
if (o === 'agent') return '
|
|
31
|
+
if (o === 'agent') return 'PMOS';
|
|
32
32
|
const m = /^(?:person|tracker):(.+)$/s.exec(String(o || ''));
|
|
33
33
|
return m ? m[1] : null;
|
|
34
34
|
}
|
|
@@ -377,7 +377,7 @@ function viewOf(F, ini, o) {
|
|
|
377
377
|
if (F.drops.has(id)) continue;
|
|
378
378
|
const word = a.why === 'milestone' ? 'It is a milestone (' + md(b.e) + ')' : a.why === 'other' ? 'It is in another initiative' : 'It would end after the committed date';
|
|
379
379
|
asks.push({ id, kind: 'promise', why: a.why, task: a.uid, title: b.title, ms: b.ms, days: a.days, to: { start: isoN(a.to.s), due: isoN(a.to.e) }, after: a.after,
|
|
380
|
-
text: word + '.
|
|
380
|
+
text: word + '. PMOS recommends moving it ' + (a.days === 1 ? 'a day' : a.days + ' days') + '; ' + clip((T.get(a.after) || {}).title, 40) + ' needs it.' });
|
|
381
381
|
}
|
|
382
382
|
for (const c of S.clashes) {
|
|
383
383
|
if (c.kind !== 'jira') continue;
|
|
@@ -386,7 +386,7 @@ function viewOf(F, ini, o) {
|
|
|
386
386
|
const want = c.need.start != null ? c.need.start : b.s + c.days;
|
|
387
387
|
asks.push({ id, kind: 'jira', task: c.uid, title: b.title, days: c.days, after: c.after, sent: F.sent.has(id),
|
|
388
388
|
head: c.uid + ' starts ' + md(b.s) + ', ' + (c.days === 1 ? 'a day' : c.days + ' days') + ' too early',
|
|
389
|
-
text: 'Jira, so PMOS can’t move it.
|
|
389
|
+
text: 'Jira, so PMOS can’t move it. PMOS drafted a comment asking to start ' + md(want) + '.',
|
|
390
390
|
comment: 'Could ' + c.uid + ' start on ' + md(want) + ' or later? It waits on "' + clip(a ? a.title : c.after, 80) + '", which finishes ' + md(effOf(a, today).e) + '.' });
|
|
391
391
|
}
|
|
392
392
|
// the proposals: Claude's links, Pull N tasks in, and (with the quiet moves off) the moves Claude would have made
|
package/workspace/lib/today.js
CHANGED
|
@@ -133,8 +133,8 @@ function stateDirOf(root) {
|
|
|
133
133
|
const d = path.join(root, ...rel);
|
|
134
134
|
if (isDir(d)) return d;
|
|
135
135
|
}
|
|
136
|
-
// PMOS-self with no pmos/state/:
|
|
137
|
-
if (SELF.embedded && path.resolve(root) === SELF.root) return path.join(SELF.appDir, 'state');
|
|
136
|
+
// PMOS-self with no pmos/state/: lib/state-root.js#selfRecordsDir, the same answer server.js stateDirFor gives
|
|
137
|
+
if (SELF.embedded && path.resolve(root) === SELF.root) return require('./state-root.js').selfRecordsDir({ legacy: path.join(SELF.appDir, 'state') });
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -80,7 +80,7 @@ const ASKS = () => RUNNING().concat([{ id: 'b', name: 'Redistribute plan items',
|
|
|
80
80
|
/* L3 */
|
|
81
81
|
live = ASKS(); await kick();
|
|
82
82
|
const l3 = await until(() => page.evaluate(() => { const l = document.getElementById('czLive'); return l && l.classList.contains('asks') ? { text: l.textContent.trim(), bg: getComputedStyle(l).backgroundColor, card: getComputedStyle(document.body).getPropertyValue('--cz-card') } : null; }));
|
|
83
|
-
ok('L3
|
|
83
|
+
ok('L3 PMOS asks: the pill turns blue, with the count', l3 && l3.text === '3' && !/255, 255, 255/.test(l3.bg), JSON.stringify(l3));
|
|
84
84
|
await shot(page, 'pill-asks');
|
|
85
85
|
|
|
86
86
|
/* L4 */
|
|
@@ -121,7 +121,7 @@ const INITIATIVE = () => ({
|
|
|
121
121
|
ok('P checkpoint chips at its milestones, and the guardrail', !!c && c.cps.join(' / ') === '40% at Legacy IdP off · Feb 27 / 85% at All microsites · Mar 20 / Guardrail: Sign-in success · stays above 99%', c && c.cps.join(' / '));
|
|
122
122
|
ok('P Built from: Now and Target, a drafted ticket as a pill', !!c && c.built.join(' / ') === 'idpf · sign-ins on CIAM | 15% | 100% by Feb 27 / Microsites · sign-ins on CIAM | — | Ticket MS-212 drafted'
|
|
123
123
|
&& await p.evaluate(() => !!document.querySelector('#czViewer .md-card .md-ru .md-pill')), c && c.built.join(' / '));
|
|
124
|
-
ok('P one line of why, in
|
|
124
|
+
ok('P one line of why, in PMOS\'s words', !!c && c.why === 'idpf is 80% of all sign-ins, so it carries the goal. I check it every morning once you keep it.', c && c.why);
|
|
125
125
|
ok('P Discuss in Home, Edit (in place, batch 16) and a solid ✓ Keep this goal: icon-only, each with a label and a title', !!c && c.presses.map((x) => x.label).join() === 'Discuss the proposed goal in Home,Edit the proposed goal,Keep this goal'
|
|
126
126
|
&& c.presses.every((x) => x.title && !x.text && x.svg) && c.presses[2].solid && /ask=program%3Aproject-ascent/.test(c.presses[0].href) && !c.presses[1].href, JSON.stringify(c && c.presses));
|
|
127
127
|
ok('P the read names the program and its product', D.gets.some((g) => g.scope === 'program' && g.id === 'project-ascent' && g.ws === 'idpf'), JSON.stringify(D.gets));
|
|
@@ -87,7 +87,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
87
87
|
const N = await open({ programs: withReview(FIRST, { empty: true }) });
|
|
88
88
|
const f = await rows(N.page, '#czViewer .msg-box');
|
|
89
89
|
const fh = await N.page.evaluate(() => ({ head: (document.querySelector('#czViewer .msg-box .msg-hd .msg-ht') || {}).textContent || '', ghost: !!document.querySelector('#czViewer [data-pp="first"]'), all: [...document.querySelectorAll('#czViewer .msg-hd [data-ms-act]')].map((b) => b.dataset.msAct) }));
|
|
90
|
-
ok('F a program with no milestones:
|
|
90
|
+
ok('F a program with no milestones: PMOS\'s first suggestions take the place of "Add the first milestone"', f.length === 4 && !fh.ghost && fh.head === 'PMOS suggests 4 milestones from a task, the initiatives\' ◆ dates and the target date', JSON.stringify(fh));
|
|
91
91
|
ok('F each row: its name, date, why and source; ✓ ✎ ✕ icon-only with a label', f[0].t === 'Vendor contract signed' && f[0].d === 'Oct 28' && /order form is due Oct 28/.test(f[0].why) && f[0].src === 'Task, due Oct 28'
|
|
92
92
|
&& f.every((r) => r.presses.join() === 'keep,edit,drop'), JSON.stringify(f[0]));
|
|
93
93
|
await shot(N.page, 'XmsgB-first-built');
|
|
@@ -111,7 +111,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
111
111
|
ok('W the changes lead the proposals, in plain words, each with why and its source', w.map((r) => r.t).join('|') === 'Move Pilot live to Dec 2|Partner SSO cut-over|Mark Legacy IdP off at risk' && w[0].src === 'Jira, read 2h ago' && /DSC-41/.test(w[0].why), JSON.stringify(w));
|
|
112
112
|
ok('W the proposals count includes them', /^\d+$/.test(cnt.trim()) && Number(cnt) >= 3, cnt);
|
|
113
113
|
ok('W the track stays as it is until the PM keeps a change', await p.evaluate(() => !!document.querySelector('#czViewer .pp-mt') && !document.querySelector('#czViewer .msg-box')));
|
|
114
|
-
ok('K the ◆ dates the page reads are reported once, so a moved date asks
|
|
114
|
+
ok('K the ◆ dates the page reads are reported once, so a moved date asks PMOS for a review', await until(() => D.posts.filter((x) => x.path === '/api/programs/facts').length === 1, 4000) && /descope-parity:\d{4}-\d{2}-\d{2}/.test((D.posts.find((x) => x.path === '/api/programs/facts') || { body: {} }).body.fp || ''), JSON.stringify(D.posts.filter((x) => x.path === '/api/programs/facts')));
|
|
115
115
|
await shot(p, 'XmsgB-asks-built');
|
|
116
116
|
await p.click('#czViewer [data-ms-act="keep"][data-key="k-move"]');
|
|
117
117
|
await until(() => D.posts.some((x) => x.path === '/api/programs/suggestion'), 4000);
|
|
@@ -126,8 +126,8 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
126
126
|
await p.click('#czViewer [data-ms-act="edit"][data-key="k-move"]');
|
|
127
127
|
ok('C the pencil opens the charter', await charterShown(p));
|
|
128
128
|
const cv = await p.evaluate(() => { const r = document.querySelector('#czViewer .pc-lnw.msg-on'); return { day: r && r.querySelector('.pc-fd span').textContent, note: r && (r.querySelector('.msg-chg') || {}).textContent, save: !!document.querySelector('#czViewer .cz-vw-hd .cz-vw-pri'), chk: (document.querySelector('#czViewer .msg-chk span') || {}).textContent || '', now: !!document.querySelector('#czViewer [data-pc="checknow"][aria-label="Check now"]') }; });
|
|
129
|
-
ok('C the change is filled in, unsaved: the row says what it was, and Save shows', cv.day === 'Dec 2' && /^
|
|
130
|
-
ok('C the charter says when
|
|
129
|
+
ok('C the change is filled in, unsaved: the row says what it was, and Save shows', cv.day === 'Dec 2' && /^PMOS's change, was Nov 18, ready to save\. Edit it, then Save\.$/.test(cv.note || '') && cv.save, JSON.stringify(cv));
|
|
130
|
+
ok('C the charter says when PMOS last checked, with Check now', /^PMOS checks every Monday and when a date, Jira or a meeting changes\. Last checked today, \d\d:\d\d\.$/.test(cv.chk) && cv.now, cv.chk);
|
|
131
131
|
await shot(p, 'XmsgB-charter-built');
|
|
132
132
|
await p.click('#czViewer .cz-vw-hd .cz-vw-pri');
|
|
133
133
|
await until(() => D.posts.some((x) => x.body.key === 'k-move' && x.body.answer === 'edit'), 5000);
|
|
@@ -135,7 +135,7 @@ const withReview = (open, o = {}) => F.programs().map((p) => ({ ...p, ...(o.empt
|
|
|
135
135
|
ok('C Save writes the charter with the new date (ids kept) and answers the suggestion', !!sv && sv.body.program.milestones.find((m) => m.id === 'pilot-live').date === '2026-12-02' && D.posts.some((x) => x.body.key === 'k-move' && x.body.answer === 'edit'), JSON.stringify(sv && sv.body.program.milestones.map((m) => m.id + ':' + m.date)));
|
|
136
136
|
await p.click('#czViewer [data-pc="checknow"]');
|
|
137
137
|
await until(() => D.posts.some((x) => x.path === '/api/programs/review'), 4000);
|
|
138
|
-
ok('C Check now asks
|
|
138
|
+
ok('C Check now asks PMOS to review', D.posts.some((x) => x.path === '/api/programs/review' && x.body.program === 'project-ascent'));
|
|
139
139
|
ok('0 no page error (desk)', D.errors.length === 0, D.errors.join(' | '));
|
|
140
140
|
await D.ctx.close();
|
|
141
141
|
|
|
@@ -54,7 +54,7 @@ const ROWS = { 'psle-article-paywall-lock': { title: 'PSLE Article Paywall Lock'
|
|
|
54
54
|
const p = await ctx.newPage(), posts = [], errs = [];
|
|
55
55
|
p.on('pageerror', (e) => errs.push(String(e)));
|
|
56
56
|
const news = () => { const o = items.filter((x) => x.kind === 'overlap'), t = items.filter((x) => x.kind === 'task');
|
|
57
|
-
const groups = [o.length && { key: 'propose', label: '
|
|
57
|
+
const groups = [o.length && { key: 'propose', label: 'PMOS proposes', items: o }, t.length && { key: 'given', label: 'Given to you', items: t }].filter(Boolean);
|
|
58
58
|
return { ok: true, count: o.length + t.length, groups, read: { inbox: true, work: true } }; };
|
|
59
59
|
await p.route('**/api/news-for-you', (r) => json(r, news()));
|
|
60
60
|
await p.route('**/api/news-for-you?*', (r) => json(r, news()));
|
|
@@ -78,13 +78,13 @@ const ROWS = { 'psle-article-paywall-lock': { title: 'PSLE Article Paywall Lock'
|
|
|
78
78
|
await openItem(p, OVERLAP.id);
|
|
79
79
|
const shown = await until(() => p.evaluate(() => /Plan · Mei’s/.test((document.querySelector('#czViewer') || {}).textContent || '')));
|
|
80
80
|
const t = await vwText(p);
|
|
81
|
-
ok('O1 the overlap opens as its own Viewer: one header named "Possible overlap",
|
|
81
|
+
ok('O1 the overlap opens as its own Viewer: one header named "Possible overlap", PMOS noticed, no second back press', shown && /Possible overlap/.test(await p.evaluate(() => document.querySelector('#czVwTitle').textContent)) && /PMOS noticed/.test(t)
|
|
82
82
|
&& !(await p.evaluate(() => !!document.querySelector('#czViewer [data-ev-back]'))), t.slice(0, 300));
|
|
83
83
|
ok('O2 both initiatives by name with stage and owner, first and second; never a slug or "a source"', /PSLE Article Paywall Lock/.test(t) && /Discover · yours/.test(t) && /Plan · Mei’s/.test(t) && /1st/.test(t) && /2nd/.test(t)
|
|
84
84
|
&& !/psle-companion-addon-follow-on|a source|Open in Home/.test(t), t);
|
|
85
85
|
ok('O3 the summary: "2 of 6 parts overlap", the sentence and how sure', /2 of 6 parts overlap/.test(t) && /The rest is separate/.test(t) && /How sure: high\. Both plans name the same checkout screens/.test(t), t);
|
|
86
86
|
const picks = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-nv-pick]')].map((b) => b.getAttribute('aria-checked') + ':' + b.textContent.trim().slice(0, 60)));
|
|
87
|
-
ok('O4 the pick: Keep both, in this order (
|
|
87
|
+
ok('O4 the pick: Keep both, in this order (PMOS\'s, checked), Merge into the first, Not an overlap', picks.length === 3 && /^true:Keep both, in this order/.test(picks[0]) && /Merge into PSLE Article Paywall Lock/.test(picks[1]) && /^false:Not an overlap/.test(picks[2]), picks);
|
|
88
88
|
const fold = await p.evaluate(() => { const b = document.querySelector('#czViewer .czs-row[data-czs-fold="parts"]'); return b ? b.textContent : ''; });
|
|
89
89
|
ok('O5 the parts that overlap fold under the pick', /The 2 parts that overlap/.test(fold), fold);
|
|
90
90
|
const tight = await p.evaluate(() => { const s = document.scrollingElement; return s.scrollWidth <= s.clientWidth + 1 && [...document.querySelectorAll('#czViewer .nv-opt, #czViewer .nv-ini, #czViewer .nv-pri')].every((b) => b.getBoundingClientRect().height >= 44); });
|
|
@@ -115,7 +115,7 @@ const ROWS = [
|
|
|
115
115
|
ok('D2 a draft has ✕ / ✎ / ✓, and ✓ says its act (Send)', under.acts.join('|') === 'Not now|Edit|Send', under.acts.join('|'));
|
|
116
116
|
ok('D3 an outcome draft says what it was', under.old === 'Was “Time to first call”', under.old);
|
|
117
117
|
const line = await p.evaluate(() => ({ t: document.querySelector('#brief').textContent + ' ' + document.querySelector('#insWhy').textContent, all: !!document.querySelector('#insAct [data-okl="keep-all"]') }));
|
|
118
|
-
ok('D4 the ✦ line says what
|
|
118
|
+
ok('D4 the ✦ line says what PMOS drafted, with ✓✓ to keep them all, and never "no insight"', /I drafted 3 (changes|fixes)/.test(line.t) && line.all && !/no insight/i.test(line.t), JSON.stringify(line));
|
|
119
119
|
await p.click('[data-draft="d-chase"] [data-okd="keep"]');
|
|
120
120
|
ok('D5 ✓ posts that draft\'s row', await until(() => R.posts.some((x) => x.path === '/api/metric-drafts/keep' && x.body.row === 'd-chase')));
|
|
121
121
|
await p.click('#insAct [data-okl="keep-all"]');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.554.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.554.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -92,7 +92,7 @@ const look = () => {
|
|
|
92
92
|
|
|
93
93
|
{ const { p, ctx, errs } = await open(1280, [ASK('chart partner activation as bars'), { role: 'assistant', text: 'Partner activation is at 33%.\n\n' + block(CHART) }]);
|
|
94
94
|
const s0 = await p.evaluate(look);
|
|
95
|
-
ok('C1 the chart block is a chip under
|
|
95
|
+
ok('C1 the chart block is a chip under PMOS\'s words', /Partners activating/.test(s0.chip || '') && /New chart/.test(s0.chip || ''), JSON.stringify(s0));
|
|
96
96
|
await p.click('#hmLog [data-report-open]');
|
|
97
97
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.pane && v.tiles.length ? v : null; }) || await p.evaluate(look);
|
|
98
98
|
ok('C1 the Chart view draws the measure from its five readings as bars, as proposed: three stat tiles, the newest bar in ember', s1.tabs.includes('Chart') && /New chart/.test(s1.pane || '') && s1.bars === 5 && s1.form === 'Bars' && s1.kpis === 3 && s1.ember === 1 && !(await p.$('#czViewer .rt, #czViewer .obody, #czViewer .mt1')), JSON.stringify(s1));
|
|
@@ -77,12 +77,12 @@ const second = (k) => [
|
|
|
77
77
|
{ const { p, ctx, errs, conv } = await open(1280);
|
|
78
78
|
await sleep(2500); // a read after the first: an answer already there opens nothing
|
|
79
79
|
const s0 = await p.evaluate(look);
|
|
80
|
-
ok('C1 the answer that was there has its chips, the file
|
|
80
|
+
ok('C1 the answer that was there has its chips, the file PMOS wrote first and the file it read after', JSON.stringify(s0.chips) === JSON.stringify([['file:signup-drop.md*', 'file:signup-fix.md']]), JSON.stringify(s0.chips));
|
|
81
81
|
ok('C1 it opens nothing by itself: the viewer stays closed', s0.shut && s0.out === 0 && s0.tabs.length === 0, JSON.stringify(s0));
|
|
82
82
|
await answer(p, conv, 1, true);
|
|
83
83
|
await sleep(2600);
|
|
84
84
|
const s1 = await p.evaluate(look);
|
|
85
|
-
ok('C2 while
|
|
85
|
+
ok('C2 while PMOS still works, the new answer has no chips and nothing opens', s1.shut && s1.chips.length === 1, JSON.stringify(s1));
|
|
86
86
|
conv.turn = 'user';
|
|
87
87
|
const s2 = await until(async () => { const v = await p.evaluate(look); return !v.shut && v.tabs.length ? v : null; }, 6000) || await p.evaluate(look);
|
|
88
88
|
ok('C2 when it has finished, its main item (the file it changed) opens in the viewer', !s2.shut && s2.out > 300 && JSON.stringify(s2.tabs) === JSON.stringify(['signup-plan1.md']), JSON.stringify(s2));
|
|
@@ -112,7 +112,7 @@ const second = (k) => [
|
|
|
112
112
|
{ role: 'assistant', text: 'I summed them up.', at: '2026-10-21T08:02:20Z' }];
|
|
113
113
|
const fold = () => p.evaluate(() => { const c = [...document.querySelectorAll('#hmLog .ctxc[role=list]')].pop(); if (!c) return null; const d = c.querySelector('details.ctxmore'); const vis = [...c.querySelectorAll('.ctxchip')].filter((b) => b.getBoundingClientRect().height > 0).map((b) => b.querySelector('b').textContent); return { vis, more: d ? d.querySelector('summary').textContent : null, open: !!(d && d.open), n: document.querySelectorAll('#hmLog .ctxc[role=list]').length }; });
|
|
114
114
|
const f0 = await until(async () => { const v = await fold(); return v && v.n >= 2 && v.more ? v : null; }, 6000) || await fold();
|
|
115
|
-
ok('C7 three files
|
|
115
|
+
ok('C7 three files PMOS only read fold into "+3 read"; the file it wrote stays in sight', !!f0 && JSON.stringify(f0.vis) === JSON.stringify(['summary.md']) && f0.more === '+3 read', JSON.stringify(f0));
|
|
116
116
|
ok('C7 the first answer\'s one read file is not folded', JSON.stringify((await p.evaluate(look)).chips[0]) === JSON.stringify(['file:signup-drop.md*', 'file:signup-fix.md']));
|
|
117
117
|
await p.click('#hmLog details.ctxmore > summary');
|
|
118
118
|
const f1 = await fold();
|
|
@@ -129,7 +129,7 @@ const second = (k) => [
|
|
|
129
129
|
await sleep(2500);
|
|
130
130
|
await answer(p, conv, 2, false);
|
|
131
131
|
const s0 = await until(async () => { const v = await p.evaluate(look); return v.peek ? v : null; }, 6000) || await p.evaluate(look);
|
|
132
|
-
ok(`C5 at 390 (${scheme}) a new answer shows a bar over the message box and leaves the conversation uncovered`, /
|
|
132
|
+
ok(`C5 at 390 (${scheme}) a new answer shows a bar over the message box and leaves the conversation uncovered`, /PMOS wrote this · signup-plan2\.md\s*View/.test(s0.peek || '') && !s0.layer && s0.tab === 'chat', JSON.stringify(s0));
|
|
133
133
|
if (shots) await p.screenshot({ path: `${shots}/chat-context-390-${scheme}.png` });
|
|
134
134
|
await p.click('#hmPeek');
|
|
135
135
|
const s1 = await until(async () => { const v = await p.evaluate(look); return v.tab === 'out' && v.tabs.length ? v : null; }) || await p.evaluate(look);
|
|
@@ -109,7 +109,7 @@ const look = () => {
|
|
|
109
109
|
if (shots) await p.screenshot({ path: `${shots}/plan-${width}-${scheme}.png` });
|
|
110
110
|
await p.click('#hmLog .gplan [data-goal="change"]');
|
|
111
111
|
const s1 = await poll(p, (v) => v.ed);
|
|
112
|
-
ok(`E1 ${tag} Change turns the card into the editor in place, one field per point`, s1.ed && s1.fields.length === 4 && s1.fields[2] === DRAFT.done[2] && s1.ph === 'Or tell
|
|
112
|
+
ok(`E1 ${tag} Change turns the card into the editor in place, one field per point`, s1.ed && s1.fields.length === 4 && s1.fields[2] === DRAFT.done[2] && s1.ph === 'Or tell PMOS what to change', JSON.stringify(s1));
|
|
113
113
|
const f3 = '#hmLog [data-goal-ed] .edl li:nth-child(3) textarea';
|
|
114
114
|
await p.fill(f3, 'Out-of-scope list, with SSO and Okta on it');
|
|
115
115
|
await p.click('#hmLog [data-goal-ed] [data-goal-add]');
|
|
@@ -153,13 +153,13 @@ const look = () => {
|
|
|
153
153
|
await p.evaluate(() => import('/pm/premium-viewer.js').then(() => document.querySelector('#hmLog [data-goal-open]') && document.querySelector('#hmLog [data-goal-open]').click()));
|
|
154
154
|
let s0 = await poll(p, (v) => v.view, 3000);
|
|
155
155
|
if (!s0.view) { await p.evaluate(() => { const b = document.querySelector('.hm-pl [data-pl="toggle"], #hmLog [data-goal-open]'); if (b) b.click(); }); s0 = await poll(p, (v) => v.view, 3000); }
|
|
156
|
-
ok(`K1 ${tag} the Goal view has × on a point that has not started, none on the point
|
|
156
|
+
ok(`K1 ${tag} the Goal view has × on a point that has not started, none on the point PMOS is on`, s0.skips.includes(DRAFT.done[2]) && s0.skips.includes(DRAFT.done[3]) && !s0.skips.includes(DRAFT.done[1]) && !s0.skips.includes(DRAFT.done[0]), JSON.stringify(s0));
|
|
157
157
|
await p.click(`#czViewer [data-goal-skip="${DRAFT.done[2]}"]`);
|
|
158
158
|
const sk = await until(() => st.posts.find((x) => x.act === 'skip'));
|
|
159
159
|
ok(`K1 ${tag} × sends the skip for that point`, sk && sk.point === DRAFT.done[2] && sk.id === 'g2', JSON.stringify(st.posts));
|
|
160
160
|
st.goal = started({ skipped: [DRAFT.done[2]], skipAt: { [DRAFT.done[2]]: '2026-10-25T02:00:00Z' } });
|
|
161
161
|
const s1 = await poll(p, (v) => v.unskip.length);
|
|
162
|
-
ok(`K1 ${tag} the skipped point is struck through with Undo, and the count leaves it out`, s1.unskip[0] === DRAFT.done[2] && /Skipped by you ·
|
|
162
|
+
ok(`K1 ${tag} the skipped point is struck through with Undo, and the count leaves it out`, s1.unskip[0] === DRAFT.done[2] && /Skipped by you · PMOS drops it after this step/.test(s1.view || '') && /1 of 3 (done )?points met/.test(s1.view || ''), JSON.stringify(s1));
|
|
163
163
|
await p.click(`#czViewer [data-goal-unskip="${DRAFT.done[2]}"]`);
|
|
164
164
|
const un = await until(() => st.posts.find((x) => x.act === 'unskip'));
|
|
165
165
|
ok(`K1 ${tag} Undo sends the point back`, un && un.point === DRAFT.done[2], JSON.stringify(st.posts));
|
|
@@ -96,7 +96,7 @@ const look = () => {
|
|
|
96
96
|
const posted = await until(() => st.posts.find((x) => x.act === 'stop'));
|
|
97
97
|
ok('G4 Stop reaches the server for this goal', posted && posted.id === 'g1', JSON.stringify(st.posts));
|
|
98
98
|
st.goal = goalOf('done', { met: DRAFT.done });
|
|
99
|
-
const s3 = await until(async () => { const v = await p.evaluate(look); return v.pane && /Done, as
|
|
99
|
+
const s3 = await until(async () => { const v = await p.evaluate(look); return v.pane && /Done, as PMOS reports it/.test(v.pane) ? v : null; }) || await p.evaluate(look);
|
|
100
100
|
ok('G2 the open Goal tab follows the next change; the line goes and "Goal done" stays where it finished', /3 of 3 done points met/.test(s3.pane || '') && !s3.stop && !s3.line && /Goal done/.test(s3.divider || ''), JSON.stringify(s3));
|
|
101
101
|
ok('F1 no page error and no sideways scroll', !errs.length && !s3.wide, errs.join(' | '));
|
|
102
102
|
await ctx.close(); }
|