create-pmos 0.808.0 → 0.810.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 +24 -57
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +23 -12
- package/workspace/guide/claude-proposes.md +5 -1
- package/workspace/guide/cli.md +1 -0
- package/workspace/lib/briefing-premium.js +1 -1
- package/workspace/lib/kill-check.js +108 -0
- package/workspace/lib/outcome-judge.js +1 -1
- package/workspace/lib/outcome-props.js +48 -3
- package/workspace/lib/outcomes.js +8 -0
- package/workspace/lib/routes-proposals.js +3 -1
- package/workspace/lib/try-it.js +62 -3
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/test-lists/kill-check.json +9 -0
- package/workspace/test-lists/try-answers-as-evidence.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.810.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -34,24 +34,29 @@
|
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
36
|
{
|
|
37
|
-
"v": "0.
|
|
38
|
-
"at": "2026-11-25T05:
|
|
37
|
+
"v": "0.810.0",
|
|
38
|
+
"at": "2026-11-25T05:54:34.966Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1853,
|
|
43
|
+
"t": "Try-it answers count as outcome evidence (job #1837, A487)",
|
|
44
|
+
"s": "Try-it answers count as outcome evidence (job #1837, A487)",
|
|
45
|
+
"k": "new",
|
|
46
|
+
"i": "try-answers-as-evidence"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"v": "0.809.0",
|
|
52
|
+
"at": "2026-11-25T05:38:37.920Z",
|
|
39
53
|
"f": 4,
|
|
40
54
|
"prs": [
|
|
41
55
|
{
|
|
42
56
|
"n": 1849,
|
|
43
57
|
"t": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
|
|
44
58
|
"s": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
|
|
45
|
-
"k": "new"
|
|
46
|
-
"try": {
|
|
47
|
-
"steps": [
|
|
48
|
-
"On Work, open an initiative whose record has baseline: 10%, min_change: 1pp, weekly_traffic: 500 and outcome_horizon a week away.",
|
|
49
|
-
"Look at the Overview's lines.",
|
|
50
|
-
"Change weekly_traffic to 50000 and open the popup again."
|
|
51
|
-
],
|
|
52
|
-
"see": "First the Overview shows 'It cannot conclude by <date>: it needs about 30,000 people, 60 weeks at 500 a week.' from the record; with 50,000 a week the line is gone.",
|
|
53
|
-
"open": "/premium-board.html"
|
|
54
|
-
}
|
|
59
|
+
"k": "new"
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
62
|
"n": 1848,
|
|
@@ -64,6 +69,12 @@
|
|
|
64
69
|
"t": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
65
70
|
"s": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
66
71
|
"k": "new"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"n": 1850,
|
|
75
|
+
"t": "Kill lines are read like outcome checks (job #1843, A530)",
|
|
76
|
+
"s": "Kill lines are read like outcome checks (job #1843, A530)",
|
|
77
|
+
"k": "new"
|
|
67
78
|
}
|
|
68
79
|
]
|
|
69
80
|
},
|
|
@@ -372,50 +383,6 @@
|
|
|
372
383
|
}
|
|
373
384
|
}
|
|
374
385
|
]
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
"v": "0.786.0",
|
|
378
|
-
"at": "2026-11-24T17:39:55.270Z",
|
|
379
|
-
"f": 4,
|
|
380
|
-
"prs": [
|
|
381
|
-
{
|
|
382
|
-
"n": 1779,
|
|
383
|
-
"t": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
384
|
-
"s": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
385
|
-
"k": "new",
|
|
386
|
-
"h": "A weekly sweep of quiet work — keep, park or close each initiative quiet 30 days",
|
|
387
|
-
"try": {
|
|
388
|
-
"steps": [
|
|
389
|
-
"Open Today and press the row that says how many initiatives are quiet 30 days or more",
|
|
390
|
-
"Press Park on one row, then Undo in the message",
|
|
391
|
-
"Open Work and find an initiative you parked or closed"
|
|
392
|
-
],
|
|
393
|
-
"see": "One list of quiet initiatives, most quiet first, each with Keep, Park and Close; the row leaves the list at once, Undo puts it back, and Work shows the parked one on hold",
|
|
394
|
-
"open": "/today.html"
|
|
395
|
-
}
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
"n": 1788,
|
|
399
|
-
"t": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
400
|
-
"s": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
401
|
-
"k": "new",
|
|
402
|
-
"h": "The One change block on a past sprint (sprint-retro-one-change, step 2)",
|
|
403
|
-
"try": {
|
|
404
|
-
"steps": [
|
|
405
|
-
"Open Work, then Backlog, and press the sprint name to pick a past sprint",
|
|
406
|
-
"Read the One change block beside Lessons, or ask the chat on Today: what was the retro of our last sprint?"
|
|
407
|
-
],
|
|
408
|
-
"see": "The block (and the chat) give done of total, why work was carried (never started, started, in review, carried twice, added after the start), names one change for the next sprint, and for a sprint…",
|
|
409
|
-
"open": "/premium-board.html"
|
|
410
|
-
}
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
"n": 1789,
|
|
414
|
-
"t": "A published read-only Board opens no live stream",
|
|
415
|
-
"s": "A published read-only Board opens no live stream",
|
|
416
|
-
"k": "fix"
|
|
417
|
-
}
|
|
418
|
-
]
|
|
419
386
|
}
|
|
420
387
|
]
|
|
421
388
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-25T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T05:54:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-25T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T05:54:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-25T05:
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-25T05:54:30Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"v": "0.
|
|
4
|
-
"at": "2026-11-25T05:
|
|
3
|
+
"v": "0.810.0",
|
|
4
|
+
"at": "2026-11-25T05:54:34.966Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1853,
|
|
9
|
+
"t": "Try-it answers count as outcome evidence (job #1837, A487)",
|
|
10
|
+
"s": "Try-it answers count as outcome evidence (job #1837, A487)",
|
|
11
|
+
"k": "new",
|
|
12
|
+
"i": "try-answers-as-evidence"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"v": "0.809.0",
|
|
18
|
+
"at": "2026-11-25T05:38:37.920Z",
|
|
5
19
|
"f": 4,
|
|
6
20
|
"prs": [
|
|
7
21
|
{
|
|
8
22
|
"n": 1849,
|
|
9
23
|
"t": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
|
|
10
24
|
"s": "Warn when an experiment cannot conclude by its check date (job #1840, A404)",
|
|
11
|
-
"k": "new"
|
|
12
|
-
"try": {
|
|
13
|
-
"steps": [
|
|
14
|
-
"On Work, open an initiative whose record has baseline: 10%, min_change: 1pp, weekly_traffic: 500 and outcome_horizon a week away.",
|
|
15
|
-
"Look at the Overview's lines.",
|
|
16
|
-
"Change weekly_traffic to 50000 and open the popup again."
|
|
17
|
-
],
|
|
18
|
-
"see": "First the Overview shows 'It cannot conclude by <date>: it needs about 30,000 people, 60 weeks at 500 a week.' from the record; with 50,000 a week the line is gone.",
|
|
19
|
-
"open": "/premium-board.html"
|
|
20
|
-
}
|
|
25
|
+
"k": "new"
|
|
21
26
|
},
|
|
22
27
|
{
|
|
23
28
|
"n": 1848,
|
|
@@ -30,6 +35,12 @@
|
|
|
30
35
|
"t": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
31
36
|
"s": "The capture line reads the words — kind, date, time and owner as chips with Undo (job #1845, A535, A538)",
|
|
32
37
|
"k": "new"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"n": 1850,
|
|
41
|
+
"t": "Kill lines are read like outcome checks (job #1843, A530)",
|
|
42
|
+
"s": "Kill lines are read like outcome checks (job #1843, A530)",
|
|
43
|
+
"k": "new"
|
|
33
44
|
}
|
|
34
45
|
]
|
|
35
46
|
},
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Guide
|
|
3
3
|
title: "PMOS proposes: the ✦, drafts and checks you keep or drop"
|
|
4
4
|
description: "The one ✦ on each initiative, the grill, descriptions, expected outcomes, metric drafts, rehearsals, ask the past, your impact and the weekly drift check."
|
|
5
|
-
timestamp: 2026-11-
|
|
5
|
+
timestamp: 2026-11-25
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# PMOS proposes
|
|
@@ -159,6 +159,10 @@ A new initiative gets its draft at the next daily read after its PRD or its task
|
|
|
159
159
|
|
|
160
160
|
When the check date passes, Today shows the check. Tell PMOS whether it worked, did not work, or you cannot tell yet, and what shows it: a number, a link or what you saw. PMOS records your verdict with the evidence. A verdict is always yours. PMOS never records one from a metric alone.
|
|
161
161
|
|
|
162
|
+
### When a kill line is met
|
|
163
|
+
|
|
164
|
+
On the check date, or once a week when there is none, PMOS reads the initiative's `kill:` line. A line with a number and a direction, such as "Stop if weekly buyers stay below 45", is compared with the newest reading of the initiative's goal. A line such as "Stop if it is not shipped by 2026-12-01" is met when that date passes and the initiative is not done. PMOS does not judge a line that names no number and no date. When the line is met, Today shows one ✦, **Stop <initiative>? Kill line met**, with the line and the reading it read. ✓ stops the initiative, and **Undo** brings it back. ✕ keeps it going, and PMOS does not ask again for that line. Nothing stops until you press ✓.
|
|
165
|
+
|
|
162
166
|
### Switch it off
|
|
163
167
|
|
|
164
168
|
`pmos ai off outcomes` stops the drafts, and `pmos ai on outcomes` starts them again. `PMOS_OUTCOMES=off` stops the daily read.
|
package/workspace/guide/cli.md
CHANGED
|
@@ -294,6 +294,7 @@ On a computer that follows the beta line, each update brings a short list of cha
|
|
|
294
294
|
|
|
295
295
|
- `pmos try` (or `pmos try list`) lists the changes to try, newest first: what changed, 1 to 3 steps, what you should see, and the page to open.
|
|
296
296
|
- `pmos try works <n>`, `pmos try broken <n> [--note "…"]` and `pmos try note <n> --note "…"` keep your answer. `<n>` is the number in the list. `pmos try undo <n>` takes it back.
|
|
297
|
+
- An answer to a change whose pull request names its initiative also counts as evidence for that initiative. The factory writes it to the repository's `planning/runs/try-evidence.jsonl`, and the initiative's outcome check shows it, with the version, the pull request and the date. `pmos try undo <n>` takes it out of the check too.
|
|
297
298
|
- `pmos try later` hides Today's row until tomorrow. `pmos try count` prints the percent of recent changes you answered.
|
|
298
299
|
- Your answers stay on this computer. A computer on the GA line has no list.
|
|
299
300
|
|
|
@@ -692,4 +692,4 @@ const settle = () => inflight || Promise.resolve();
|
|
|
692
692
|
const stale = () => { if (kept) kept.at = 0; };
|
|
693
693
|
const forget = () => { kept = null; partial = null; inflight = null; lastError = null; startedAt = 0; };
|
|
694
694
|
|
|
695
|
-
module.exports = { build, buildMany, allRowsOf, readMeetings, hooks, refresh, readSources, readFast, readInitiatives, repoKey, readFm, readTripwires, modelOf, refreshNow, settle, stale, forget, rebuild, peekModel, rowsOf, heroOf, todayOf, failedReviews, num };
|
|
695
|
+
module.exports = { OPT_TRIPWIRE, build, buildMany, allRowsOf, readMeetings, hooks, refresh, readSources, readFast, readInitiatives, repoKey, readFm, readTripwires, modelOf, refreshNow, settle, stale, forget, rebuild, peekModel, rowsOf, heroOf, todayOf, failedReviews, num };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* kill-check.js — kill lines are read like outcome checks (initiative kill-lines-checked, job #1843, idea A530).
|
|
3
|
+
* Before this, lib/outcomes.js read an initiative's `kill:` line only after an outcome check said it did not work, so a kill line that was met
|
|
4
|
+
* with no check recorded was never read: 254 of 825 PMOS initiatives carry one and none was ever stopped by it.
|
|
5
|
+
* Pure apart from reading the product's own ledgers; no model, no clock of its own (`today` comes in). It writes nothing: lib/outcome-props.js
|
|
6
|
+
* files what it drafts, and only the PM's ✓ stops anything (lib/routes-proposals.js, the refuted-outcome `kill` step).
|
|
7
|
+
*
|
|
8
|
+
* dueKey(it, today) → the key of the read that is due today, or '' when none is: the check date once it passed ("2026-12-09"),
|
|
9
|
+
* else, with no check date, the Monday of this week ("w2026-11-23"): once a week
|
|
10
|
+
* judge({ root, it, src, recordsDir, refDir, today }) → { met: true, why, claims } | { met: false | null, why }
|
|
11
|
+
* number a kill line with a number and a direction (lib/outcome-judge.js barOf: "under 3 uses", "below 40%") is met when the anchor
|
|
12
|
+
* goal's newest reading on or before today is on that side; the reading's line in kr-metrics.jsonl is cited
|
|
13
|
+
* tracker a kill line that says "not <done|shipped|live|launched|released|started|merged> by <YYYY-MM-DD>" is met when that date passed and
|
|
14
|
+
* the initiative is not done (accepted, or its status says done)
|
|
15
|
+
* Anything else is not judged (met null): PMOS reads no meaning into words it cannot compare.
|
|
16
|
+
* drafts(S, { src, recordsDir, refDir, refuted }) → [draft] the ✦ of every met kill line, in the refuted-outcome shape (data.kind
|
|
17
|
+
* 'refuted', next 'kill'): class C, so it waits for the PM on Today; ✓ stops it, Undo brings it back, ✕ keeps it going.
|
|
18
|
+
* refuted: the ids that already have a current refuted check (lib/outcomes.js refutedDrafts asks for those)
|
|
19
|
+
* isKillRef(ref) → true for a ✦ ref that points at a record's kill line, or at the Experiment artefact's kill set (the refuted-outcome pass leaves those alone)
|
|
20
|
+
* The copy says PMOS, never Claude. */
|
|
21
|
+
const fs = require('fs');
|
|
22
|
+
const path = require('path');
|
|
23
|
+
const O = require('./outcomes.js');
|
|
24
|
+
const J = require('./outcome-judge.js');
|
|
25
|
+
|
|
26
|
+
const DAY = 864e5;
|
|
27
|
+
const clip = (s, n) => { const t = String(s == null ? '' : s).replace(/\s+/g, ' ').trim(); return t.length <= n ? t : t.slice(0, n - 1).replace(/[,;:\s]+$/, '') + '…'; };
|
|
28
|
+
const fin = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
29
|
+
const isDay = (d) => /^\d{4}-\d{2}-\d{2}$/.test(String(d || ''));
|
|
30
|
+
const fmt = (v, unit) => { const r = Math.abs(v) >= 100 ? Math.round(v) : Math.round(v * 100) / 100, s = Math.abs(r) >= 1000 ? r.toLocaleString('en-US') : String(r), u = String(unit || '').trim(); return u ? (/^[A-Za-z]/.test(u) ? s + ' ' + u : s + u) : s; };
|
|
31
|
+
const DONE_STATUS = /\b(done|shipped|live|launched|released|merged|complete|completed)\b/i;
|
|
32
|
+
const TRACKER = /\bnot\s+(?:yet\s+)?(done|shipped|live|launched|released|started|merged)\s+(?:by|before|on)\s+(\d{4}-\d{2}-\d{2})\b/i;
|
|
33
|
+
const KILL_REF = /(\.md|artefacts\.jsonl):\d+$/; // the record's kill: line, or the Experiment artefact's kill set
|
|
34
|
+
|
|
35
|
+
function monday(today) {
|
|
36
|
+
const t = Date.parse(today + 'T00:00:00Z'), dow = (new Date(t).getUTCDay() + 6) % 7;
|
|
37
|
+
return new Date(t - dow * DAY).toISOString().slice(0, 10);
|
|
38
|
+
}
|
|
39
|
+
function dueKey(it, today) {
|
|
40
|
+
if (!it || !isDay(today)) return '';
|
|
41
|
+
if (it.horizon) return it.horizon <= today ? it.horizon : '';
|
|
42
|
+
return 'w' + monday(today);
|
|
43
|
+
}
|
|
44
|
+
const isKillRef = (ref) => KILL_REF.test(String(ref || ''));
|
|
45
|
+
const doneOf = (it) => !!it.accepted || !!(it.fm && it.fm.status && DONE_STATUS.test(String(it.fm.status.value || '')) && !/\bnot\b/i.test(String(it.fm.status.value || '')));
|
|
46
|
+
|
|
47
|
+
function judge({ root, it, src, recordsDir, refDir, today }) {
|
|
48
|
+
root = path.resolve(root);
|
|
49
|
+
const kill = O.experimentField(root, it, 'kill');
|
|
50
|
+
if (!kill) return { met: null, why: 'It has no kill line.' };
|
|
51
|
+
const killClaim = { text: `Its kill line: ${clip(kill.text, 200)}`, sources: [kill.source] };
|
|
52
|
+
// tracker state: "not shipped by 2026-12-01"
|
|
53
|
+
const tm = TRACKER.exec(kill.text);
|
|
54
|
+
if (tm) {
|
|
55
|
+
if (tm[2] >= today) return { met: false, why: `Its kill line's date, ${tm[2]}, has not passed.` };
|
|
56
|
+
if (doneOf(it)) return { met: false, why: 'It is done, so its kill line is not met.' };
|
|
57
|
+
const claims = [killClaim];
|
|
58
|
+
const st = it.fm && it.fm.status;
|
|
59
|
+
if (st && st.n) { const s = J.srcOf(root, refDir, path.join(root, it.record), st.n, st.text, 'Its status'); if (s) claims.push({ text: `Its status: ${clip(st.value, 160)}`, sources: [s] }); }
|
|
60
|
+
return { met: true, why: `${tm[2]} passed and it is not ${tm[1].toLowerCase()}.`, claims };
|
|
61
|
+
}
|
|
62
|
+
// a number with a direction, against the anchor goal's reading
|
|
63
|
+
const bar = J.barOf(kill.text);
|
|
64
|
+
if (!bar) return { met: null, why: 'Its kill line names no number or date PMOS can compare with.' };
|
|
65
|
+
const GS = require('./goal-source.js');
|
|
66
|
+
const rec = it.anchor && src ? GS.resolve(src, it.anchor) : null;
|
|
67
|
+
if (!rec) return { met: null, why: it.anchor ? `Its anchor ${it.anchor} has no goal that PMOS reads.` : 'It has no anchor goal.' };
|
|
68
|
+
const R = (Array.isArray(rec.readings) ? rec.readings : []).filter((x) => x && fin(x.value) && String(x.at || '').slice(0, 10) <= today);
|
|
69
|
+
if (!R.length) return { met: null, why: `"${clip(rec.title || rec.rid, 80)}" has no reading yet.` };
|
|
70
|
+
const reading = R[R.length - 1], v = reading.value;
|
|
71
|
+
if (!J.meets(bar, v)) return { met: false, why: `"${clip(rec.title || rec.rid, 80)}" reads ${fmt(v, rec.unit)}, which does not meet its kill line.` };
|
|
72
|
+
const file = path.join(recordsDir || GS.recordsDirOf(root), 'kr-metrics.jsonl');
|
|
73
|
+
const line = J.readingLine(file, rec.rid, reading);
|
|
74
|
+
const rs = line ? J.srcOf(root, refDir, file, line.n, line.text, 'The goal\'s reading') : null;
|
|
75
|
+
if (!rs) return { met: null, why: 'The reading could not be cited by its line.' };
|
|
76
|
+
const goal = clip(rec.title || rec.rid, 80), on = String(reading.at).slice(0, 10);
|
|
77
|
+
return { met: true, why: `"${goal}" read ${fmt(v, rec.unit)} on ${on}, which meets it.`, claims: [killClaim, { text: `"${goal}" read ${fmt(v, rec.unit)} on ${on}`, sources: [rs] }] };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The other choices of a missed tripwire (lib/briefing-premium.js OPT_TRIPWIRE), in one sentence. */
|
|
81
|
+
function tripwireWords() {
|
|
82
|
+
let opts = [];
|
|
83
|
+
try { opts = require('./briefing-premium.js').OPT_TRIPWIRE || []; } catch { opts = []; }
|
|
84
|
+
const L = opts.map((o) => String(o.t || '').replace(/^\w/, (c) => c.toLowerCase())).filter(Boolean);
|
|
85
|
+
return L.length ? ` If you keep it, you can also ${L.slice(0, -1).join(', ')}${L.length > 1 ? ' or ' : ''}${L[L.length - 1]}: write why in pm-decisions.md.` : '';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function drafts(S, { src, recordsDir, refDir, refuted = new Set() } = {}) {
|
|
89
|
+
const out = [];
|
|
90
|
+
for (const it of S.subjects) {
|
|
91
|
+
if (refuted.has(it.id)) continue; // a current refuted check asks already (lib/outcomes.js refutedDrafts)
|
|
92
|
+
const key = dueKey(it, S.today); if (!key) continue;
|
|
93
|
+
let j = null;
|
|
94
|
+
try { j = judge({ root: S.root, it, src, recordsDir, refDir, today: S.today }); } catch { j = null; }
|
|
95
|
+
if (!j || j.met !== true) continue;
|
|
96
|
+
const kill = O.experimentField(S.root, it, 'kill');
|
|
97
|
+
const evidence = clip(`Kill line met: ${kill.text}. ${j.why}`, 300);
|
|
98
|
+
out.push({
|
|
99
|
+
id: `outcome-kill:${it.id}:${String(kill.source.ref).split(":").pop()}`, title: clip(`Stop ${it.title}? Kill line met`, 120), confidence: 'medium', claims: j.claims,
|
|
100
|
+
say: `Its kill line is met: "${clip(kill.text, 160)}" (${kill.source.ref}). ${j.why} I suggest stopping it. ✓ stops it with this reason; Undo brings it back. ✕ keeps it going.${tripwireWords()}`,
|
|
101
|
+
data: { kind: 'refuted', initiative: it.id, next: 'kill', check: S.today, ref: kill.source.ref, evidence, metric: it.metric, horizon: null,
|
|
102
|
+
killMet: true, anchor: it.anchor || '', title: it.title, lane: it.lane, work: (it.fm.kind && it.fm.kind.value) || '' },
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return out;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
module.exports = { dueKey, judge, drafts, isKillRef, monday };
|
|
@@ -159,4 +159,4 @@ function drafts(S, { src, recordsDir, stateDir, refDir = stateDir, only = null }
|
|
|
159
159
|
return out;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
module.exports = { judge, drafts, barOf, ASK_AFTER, WORDS };
|
|
162
|
+
module.exports = { judge, drafts, barOf, meets, srcOf, readingLine, ASK_AFTER, WORDS }; // meets, srcOf, readingLine: lib/kill-check.js reads a kill line the same way
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
* that says it did not work, files PMOS's next step under the ✦ (lib/outcomes.js refutedDrafts): stop it when the evidence meets the
|
|
27
27
|
* kill condition, a new experiment after a second refuted check, else one more round. Class C (lib/autonomy.js): only the PM's ✓ does it.
|
|
28
28
|
*
|
|
29
|
+
* A MET KILL LINE (initiative kill-lines-checked, A530). In the hours the PM allows, on each initiative's check date (or weekly with none),
|
|
30
|
+
* PMOS reads its kill line against the anchor goal's reading or the tracker state (lib/kill-check.js). A met one files ONE ✦ to stop it, in
|
|
31
|
+
* the refuted-outcome shape (next `kill`, class C): ✓ stops it, Undo brings it back, ✕ keeps it going.
|
|
32
|
+
*
|
|
29
33
|
* A DUE CHECK (initiative outcome-checks-run-themselves, bet 1 of the factory line). Every tick in the hours the PM allows, PMOS judges each
|
|
30
34
|
* outcome whose check date passed (duePass, lib/outcome-judge.js): the anchor goal's own reading files a verdict ✦ (class B: recorded by
|
|
31
35
|
* itself with Undo); a goal PMOS failed to read twice the same way files ONE ask (class C); else one short run per initiative and check date
|
|
@@ -55,6 +59,7 @@ const path = require('path');
|
|
|
55
59
|
const O = require('./outcomes.js');
|
|
56
60
|
const ST = require('./smallest-test.js');
|
|
57
61
|
const PR = require('./proposals.js');
|
|
62
|
+
const KC = require('./kill-check.js');
|
|
58
63
|
|
|
59
64
|
const PER_DAY = 3;
|
|
60
65
|
const flagOff = (v) => /^(off|0|false|no)$/i.test(String(v == null ? '' : v).trim());
|
|
@@ -209,6 +214,7 @@ function create(deps) {
|
|
|
209
214
|
const live = new Set(D.map((d) => d.data.initiative + '|' + d.data.ref));
|
|
210
215
|
for (const p of F.props.values()) {
|
|
211
216
|
if (p.group !== 'outcome' || p.type !== 'refuted' || kept.has(p.id) || F.drops.has(PR.sigOf(p))) continue;
|
|
217
|
+
if (KC.isKillRef(p.data && p.data.ref)) continue; // a met kill line's ✦ (killPass) is not this pass's to drop
|
|
212
218
|
if (!live.has(p.ini + '|' + ((p.data && (p.data.ref || p.data.check)) || ''))) PR.append(dir, { by: 'pmos:outcomes' }, { kind: 'drop', ini: p.ini, sig: PR.sigOf(p) }); // answered another way: zero is silence
|
|
213
219
|
}
|
|
214
220
|
for (const d of D) {
|
|
@@ -231,6 +237,44 @@ function create(deps) {
|
|
|
231
237
|
return { ws: w.id, filed: (r.filed || []).length, held: !!r.held, off: r.off || null };
|
|
232
238
|
}
|
|
233
239
|
|
|
240
|
+
/** A met kill line (initiative kill-lines-checked, A530; lib/kill-check.js): on the check date, or weekly with none, PMOS reads each kill
|
|
241
|
+
* line against the anchor goal's reading or the tracker state. A met one files ONE ✦ in the refuted-outcome shape (next `kill`, class C):
|
|
242
|
+
* ✓ stops it, Undo brings it back, ✕ keeps it going. Filed once per kill line; a ✦ whose line is no longer met, and not answered, goes. */
|
|
243
|
+
async function killPass(w, { now = Date.now() } = {}) {
|
|
244
|
+
const dir = deps.stateDirFor(w); if (!dir) return { ws: w.id, filed: 0 };
|
|
245
|
+
const S = O.scan(w.root, { today: localDay(now) });
|
|
246
|
+
const GS = require('./goal-source.js');
|
|
247
|
+
let recordsDir = null; try { recordsDir = (deps.recordsDir && deps.recordsDir(w)) || GS.recordsDirOf(w.root); } catch { recordsDir = GS.recordsDirOf(w.root); }
|
|
248
|
+
let src = null; try { src = GS.source({ root: w.root, recordsDir }); } catch { src = null; }
|
|
249
|
+
const refuted = new Set(); try { for (const v of O.verdictsOf(S).values()) if (v.current) refuted.add(v.it.id); } catch { /* none */ }
|
|
250
|
+
const D = KC.drafts(S, { src, recordsDir, refDir: dir, refuted });
|
|
251
|
+
const F = PR.read(dir), kept = PR.keptIds(F), fresh = [];
|
|
252
|
+
const live = new Set(D.map((d) => d.data.initiative + '|' + d.data.ref)), subj = new Set(S.subjects.map((it) => it.id));
|
|
253
|
+
for (const p of F.props.values()) {
|
|
254
|
+
if (p.group !== 'outcome' || p.type !== 'refuted' || !KC.isKillRef(p.data && p.data.ref) || kept.has(p.id) || F.drops.has(PR.sigOf(p))) continue;
|
|
255
|
+
// read on its own day only: a weekly read that is not due today keeps its ✦; one whose line is read and no longer met goes
|
|
256
|
+
const it = S.subjects.find((x) => x.id === p.ini);
|
|
257
|
+
if (!subj.has(p.ini) || (it && KC.dueKey(it, S.today) && !live.has(p.ini + '|' + p.data.ref))) PR.append(dir, { by: 'pmos:outcomes' }, { kind: 'drop', ini: p.ini, sig: PR.sigOf(p) });
|
|
258
|
+
}
|
|
259
|
+
for (const d of D) {
|
|
260
|
+
const board = deps.boardOf(w, d.data.initiative); if (!board) continue;
|
|
261
|
+
const l = lineOf(d, board, ''); if (!l) continue;
|
|
262
|
+
if (F.props.has(l.id)) continue; // filed once per kill line: kept, dropped (keep going) or waiting, never again
|
|
263
|
+
fresh.push({ d, board });
|
|
264
|
+
}
|
|
265
|
+
if (!fresh.length) return { ws: w.id, filed: 0 };
|
|
266
|
+
const AG = guardLib(); if (!AG) return { ws: w.id, filed: 0, why: 'the shared guard is not installed' };
|
|
267
|
+
const rt = deps.runtime && deps.runtime(), version = versionOf(w), run = 'ok' + now.toString(36) + crypto.randomBytes(3).toString('hex');
|
|
268
|
+
if (!AG.off(O.JOB, { env: deps.env || process.env, settingsDir: rt }) && !AG.ready(rt, O.JOB, version)) {
|
|
269
|
+
const rep = await AG.replay(O.JOB, version, cases(S, fresh.map((x) => x.d)), { root: w.root, stateDir: rt, refDir: dir, max: PER_DAY });
|
|
270
|
+
if (!rep.ok) { warn('outcomes replay ' + w.id, new Error(rep.failed.map((f) => f.name + ': ' + f.why).join('; '))); return { ws: w.id, filed: 0, replay: rep }; }
|
|
271
|
+
}
|
|
272
|
+
const byId = new Map(fresh.map((x) => [x.d.id, x]));
|
|
273
|
+
const r = await AG.file({ job: O.JOB, version, run, root: w.root, stateDir: rt, refDir: dir, settingsDir: rt, env: deps.env || process.env, max: PER_DAY }, fresh.map((x) => x.d),
|
|
274
|
+
async (acc) => { for (const p of acc) { const x = byId.get(p.id); const l = x && lineOf(x.d, x.board, run); if (l) PR.append(dir, { by: 'agent:outcomes' }, l); } });
|
|
275
|
+
return { ws: w.id, filed: (r.filed || []).length, held: !!r.held, off: r.off || null };
|
|
276
|
+
}
|
|
277
|
+
|
|
234
278
|
/** The due checks (initiative outcome-checks-run-themselves): PMOS judges each one by itself (lib/outcome-judge.js). A goal's own reading
|
|
235
279
|
* that decides it files a verdict ✦ (class B: lib/auto-keep.js records it with Undo); a goal PMOS failed to read twice the same way files
|
|
236
280
|
* ONE ask; anything else starts one short outcome run per initiative and check date (deps.startRun → lib/proposal-runs.js why `outcome`).
|
|
@@ -318,16 +362,17 @@ function create(deps) {
|
|
|
318
362
|
async function tick({ now = Date.now() } = {}) {
|
|
319
363
|
if (off(deps.env) || busy) return { off: off(deps.env), running: busy };
|
|
320
364
|
busy = true;
|
|
321
|
-
const refuted = [];
|
|
365
|
+
const refuted = [], kills = [];
|
|
322
366
|
try {
|
|
323
367
|
for (const w of deps.workspaces()) {
|
|
324
368
|
try { if (deps.isLead && !deps.isLead(w)) continue; } catch { continue; }
|
|
325
369
|
try { refuted.push(await refutedPass(w, { now })); } catch (e) { warn('outcomes refuted ' + w.id, e); }
|
|
370
|
+
try { if (!deps.open || deps.open(now)) kills.push(await killPass(w, { now })); } catch (e) { warn('outcomes kill ' + w.id, e); } // in the hours the PM allows
|
|
326
371
|
}
|
|
327
372
|
} finally { busy = false; }
|
|
328
373
|
const due = await dueTick({ now });
|
|
329
374
|
const r = await dailyTick({ now });
|
|
330
|
-
return { ...r, refuted, due };
|
|
375
|
+
return { ...r, refuted, kills, due };
|
|
331
376
|
}
|
|
332
377
|
/** Every tick in the hours the PM allows (deps.open): the due checks of each product (duePass). */
|
|
333
378
|
async function dueTick({ now = Date.now() } = {}) {
|
|
@@ -366,7 +411,7 @@ function create(deps) {
|
|
|
366
411
|
const t = setInterval(() => { try { if (deps.mayRun && !deps.mayRun()) return; } catch { /* no lock: run */ } tick({}).catch((e) => warn('outcomes tick', e)); }, deps.every);
|
|
367
412
|
if (t.unref) t.unref();
|
|
368
413
|
}
|
|
369
|
-
return { tick, runProduct, refutedPass, duePass, draftPass };
|
|
414
|
+
return { tick, runProduct, refutedPass, killPass, duePass, draftPass };
|
|
370
415
|
}
|
|
371
416
|
|
|
372
417
|
/** The outcome runs started, as `ini|horizon` keys (<state>/outcome-runs.jsonl). */
|
|
@@ -357,6 +357,14 @@ function dueDraft(S, it) {
|
|
|
357
357
|
const claims = [claim(`It expects: ${clip(it.metric, 160)}`, [recSrc(S, it, 'outcome_metric', 'Expected outcome')]),
|
|
358
358
|
claim(`Its check date was ${short(it.horizon)}`, [recSrc(S, it, 'outcome_horizon', 'Check date')])];
|
|
359
359
|
if (p) claims.push(claim('The PRD says what success looks like', [p.source]));
|
|
360
|
+
// try-answers-as-evidence (job #1837): what the PM said when they tried the change on a beta computer, each with its ledger line
|
|
361
|
+
let tries = [];
|
|
362
|
+
try { tries = require('./try-it.js').evidenceFor(S.root, it.id); } catch { tries = []; }
|
|
363
|
+
for (const t of tries.slice(0, 3)) {
|
|
364
|
+
const said = t.verdict === 'works' ? 'it works' : t.verdict === 'broken' ? 'it did not work' : 'a note';
|
|
365
|
+
claims.push(claim(`Tried ${t.v || 'the change'}${t.pr ? ' (#' + t.pr + ')' : ''} on ${short(t.date)}: ${said}${t.note ? ': ' + clip(t.note, 100) : ''}`,
|
|
366
|
+
[{ label: 'Try it answer', ref: t.ref, quote: t.quote }]));
|
|
367
|
+
}
|
|
360
368
|
return {
|
|
361
369
|
id: `outcome-due:${it.id}`, title: `Check the outcome of ${clip(it.title, 80)}`, confidence: 'medium', claims,
|
|
362
370
|
say: `Its check date passed on ${short(it.horizon)}. Did "${clip(it.metric, 120)}" happen? Tell me worked, didn't work or can't tell yet, and what shows it, and I'll record it.`,
|
|
@@ -425,7 +425,9 @@ function applyOne(ctx, p, g, f, ini, x, choices, outbox) {
|
|
|
425
425
|
// iterate a task to change what the check showed, and a new check date (the outcome is open again, so the status reads again)
|
|
426
426
|
// new a new experiment on the same anchor, and this one cancelled
|
|
427
427
|
const O = require('./outcomes.js'), IW = require('./initiative-writer.js'), d = x.data || {};
|
|
428
|
-
|
|
428
|
+
// a met kill line (lib/kill-check.js, its ref is the record's kill line) says so, not "the outcome check said"
|
|
429
|
+
const reason = (require('./kill-check.js').isKillRef(d.ref) ? `${String(d.evidence || '').replace(/[.\s]+$/, '')} (read ${d.check}).`
|
|
430
|
+
: `The outcome check on ${d.check} said it did not work: ${String(d.evidence || '').replace(/[.\s]+$/, '')}.`).slice(0, 440);
|
|
429
431
|
const stop = (why) => { const r = O.setLife(p.w.root, ini, 'cancelled', why, g.actor); if (r.ok) add({ op: 'life', from: r.from || 'active', to: 'cancelled' }); };
|
|
430
432
|
if (d.next === 'kill') stop(reason);
|
|
431
433
|
else if (d.next === 'iterate') {
|
package/workspace/lib/try-it.js
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
* answer(dir, { key, verdict, note }, list) → { ok, line } | { ok: false, error } refuses a key the list does not hold
|
|
20
20
|
* count(lines, changes, now) → { tried, answered, pct } PURE, the health number
|
|
21
21
|
* rowOf(list, { later, today }) → the Home row or null PURE (public/pm/try-view.js has the same rule for the page)
|
|
22
|
+
* evidenceOf(lines) PURE · recordEvidence(root, lines) · evidenceFor(root, initiative) try-it answers as outcome evidence
|
|
23
|
+
* (try-answers-as-evidence, job #1837): <repo>/planning/runs/try-evidence.jsonl, append-only
|
|
22
24
|
* CLI: pmos try [list|works|broken|note|undo|later|count] … (run), and node lib/try-it.js count (the health number on its last line) */
|
|
23
25
|
const fs = require('fs');
|
|
24
26
|
const path = require('path');
|
|
@@ -34,6 +36,8 @@ const localDay = (t = Date.now()) => { const d = new Date(t); return new Date(d.
|
|
|
34
36
|
const vnum = (v) => String(v || '').split('-')[0].split('.').map((x) => Number(x) || 0);
|
|
35
37
|
const vcmp = (a, b) => { const A = vnum(a), B = vnum(b); for (let i = 0; i < 3; i++) if ((A[i] || 0) !== (B[i] || 0)) return (A[i] || 0) - (B[i] || 0); return 0; };
|
|
36
38
|
const str = (x, max) => (typeof x === 'string' ? x.replace(/\s+/g, ' ').trim().slice(0, max) : '');
|
|
39
|
+
const INI_RE = /^[a-z0-9][a-z0-9-]{0,99}$/; // an initiative id (try-answers-as-evidence)
|
|
40
|
+
const EVIDENCE = 'try-evidence.jsonl'; // in the repository's runs folder: planning/runs/, or pmos/state/ in a kit layout
|
|
37
41
|
const OPEN_RE = /^\/(?!\/)[A-Za-z0-9._~!$&'()*+,;=:@%/?#-]{0,300}$/;
|
|
38
42
|
|
|
39
43
|
function changesOf(appDir = APP_DIR) {
|
|
@@ -73,7 +77,7 @@ function cardsOf(changes, installed, now) {
|
|
|
73
77
|
if (!steps.length) continue;
|
|
74
78
|
const open = typeof y.open === 'string' && OPEN_RE.test(y.open) ? y.open : null;
|
|
75
79
|
out.push({ key: `${e.v}#${p.n == null ? str(p.h || p.t, 40) : p.n}`, v: e.v, n: p.n == null ? null : p.n, at: e.at,
|
|
76
|
-
title: str(p.h || p.t || p.s, 120), kind: p.k || null, steps, see: str(y.see, 200) || null, open });
|
|
80
|
+
title: str(p.h || p.t || p.s, 120), kind: p.k || null, steps, see: str(y.see, 200) || null, open, ini: typeof p.i === 'string' && INI_RE.test(p.i) ? p.i : null });
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
return out.sort((a, b) => vcmp(b.v, a.v) || (b.n || 0) - (a.n || 0));
|
|
@@ -106,7 +110,7 @@ function answer(dir, { key, verdict, note } = {}, { changes = [], installed = nu
|
|
|
106
110
|
if (!known) return { ok: false, error: 'no change to try has that key' };
|
|
107
111
|
const text = str(note, 1000);
|
|
108
112
|
if (verdict === 'note' && !text) return { ok: false, error: 'a note needs its text' };
|
|
109
|
-
const line = { at: new Date(now).toISOString(), key, v: known.v, n: known.n, title: known.title, verdict, ...(text ? { note: text } : {}) };
|
|
113
|
+
const line = { at: new Date(now).toISOString(), key, v: known.v, n: known.n, title: known.title, verdict, ...(text ? { note: text } : {}), ...(known.ini ? { ini: known.ini } : {}) };
|
|
110
114
|
append(dir, line);
|
|
111
115
|
console.log(`${TAG} ${verdict} ${key}`);
|
|
112
116
|
return { ok: true, line };
|
|
@@ -125,6 +129,61 @@ function count(lines, changes, now = Date.now()) {
|
|
|
125
129
|
return { tried: cards.length, answered, pct: cards.length ? Math.round((answered / cards.length) * 100) : 0 };
|
|
126
130
|
}
|
|
127
131
|
|
|
132
|
+
/* ── answers as outcome evidence (try-answers-as-evidence, job #1837, idea A487) ──────────────────────────────────────────────────
|
|
133
|
+
* The answers stay on the beta computer; the factory copies them (factory/checker/try-feedback.js) and writes the standing ones that name an
|
|
134
|
+
* initiative to the repository's evidence ledger, which the outcome check cites (lib/outcomes.js dueDraft). No model, nothing sent. */
|
|
135
|
+
|
|
136
|
+
/** The standing answers that name an initiative: the last press per change; an undo takes the change out. PURE → [{ ini, key, verdict, … }] */
|
|
137
|
+
function evidenceOf(lines) {
|
|
138
|
+
const by = new Map();
|
|
139
|
+
for (const l of lines || []) {
|
|
140
|
+
if (!l || typeof l.key !== 'string' || l.key === '*') continue;
|
|
141
|
+
if (l.verdict === 'undo') { by.delete(l.key); continue; }
|
|
142
|
+
if (!VERDICTS.has(l.verdict)) continue;
|
|
143
|
+
if (typeof l.ini === 'string' && INI_RE.test(l.ini)) by.set(l.key, l); else by.delete(l.key);
|
|
144
|
+
}
|
|
145
|
+
return [...by.values()].map((l) => ({ ini: l.ini, key: l.key, verdict: l.verdict, v: l.v || null, n: l.n == null ? null : l.n, title: str(l.title, 120), note: str(l.note, 300), at: l.at }));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function evidenceFile(root) {
|
|
149
|
+
const kit = fs.existsSync(path.join(root, 'pmos', 'state'));
|
|
150
|
+
return path.join(root, ...(kit ? ['pmos', 'state'] : ['planning', 'runs']), EVIDENCE);
|
|
151
|
+
}
|
|
152
|
+
/** The ledger folded: each change's standing evidence line, with its line number for the source. PURE over the file → Map key → { line, ln } */
|
|
153
|
+
function evidenceLedger(root) {
|
|
154
|
+
const f = evidenceFile(root), by = new Map();
|
|
155
|
+
let text = ''; try { text = fs.readFileSync(f, 'utf8'); } catch { return { file: f, by }; }
|
|
156
|
+
text.split('\n').forEach((s, i) => {
|
|
157
|
+
if (!s.trim()) return;
|
|
158
|
+
let l; try { l = JSON.parse(s); } catch { return; }
|
|
159
|
+
if (!l || typeof l.key !== 'string') return;
|
|
160
|
+
if (l.type === 'undo') by.delete(l.key); else if (l.type === 'evidence' && INI_RE.test(String(l.initiative || ''))) by.set(l.key, { line: l, ln: i + 1, quote: s });
|
|
161
|
+
});
|
|
162
|
+
return { file: f, by };
|
|
163
|
+
}
|
|
164
|
+
/** Write the standing answers to the ledger: one evidence line per new or changed answer, an undo line per answer taken back. Append-only;
|
|
165
|
+
* a second run with the same answers writes nothing. → { ok, wrote, undone, file } */
|
|
166
|
+
function recordEvidence(root, lines, { now = Date.now(), by = 'agent:checker' } = {}) {
|
|
167
|
+
const want = new Map(evidenceOf(lines).map((e) => [e.key, e]));
|
|
168
|
+
const L = evidenceLedger(root), out = [];
|
|
169
|
+
for (const [key, had] of L.by) if (!want.has(key)) out.push({ type: 'undo', key, initiative: had.line.initiative, at: new Date(now).toISOString(), by });
|
|
170
|
+
for (const e of want.values()) {
|
|
171
|
+
const had = L.by.get(e.key);
|
|
172
|
+
if (had && had.line.verdict === e.verdict && had.line.answered === e.at && had.line.initiative === e.ini) continue;
|
|
173
|
+
out.push({ type: 'evidence', initiative: e.ini, source: 'try', key: e.key, verdict: e.verdict, v: e.v, pr: e.n, title: e.title, ...(e.note ? { note: e.note } : {}),
|
|
174
|
+
answered: e.at, date: String(e.at || '').slice(0, 10), at: new Date(now).toISOString(), by });
|
|
175
|
+
}
|
|
176
|
+
if (out.length) { fs.mkdirSync(path.dirname(L.file), { recursive: true }); fs.appendFileSync(L.file, out.map((l) => JSON.stringify(l)).join('\n') + '\n'); }
|
|
177
|
+
console.log(`${TAG} evidence wrote ${out.filter((l) => l.type === 'evidence').length}, undone ${out.filter((l) => l.type === 'undo').length}`);
|
|
178
|
+
return { ok: true, wrote: out.filter((l) => l.type === 'evidence').length, undone: out.filter((l) => l.type === 'undo').length, file: L.file };
|
|
179
|
+
}
|
|
180
|
+
/** The standing evidence of one initiative, each with its source (path:line from the root and the line's text), newest first. */
|
|
181
|
+
function evidenceFor(root, initiative) {
|
|
182
|
+
const L = evidenceLedger(root), rel = path.relative(root, L.file).split(path.sep).join('/');
|
|
183
|
+
return [...L.by.values()].filter((x) => x.line.initiative === initiative).sort((a, b) => String(b.line.answered).localeCompare(String(a.line.answered)))
|
|
184
|
+
.map((x) => ({ ...x.line, ref: rel + ':' + x.ln, quote: x.quote }));
|
|
185
|
+
}
|
|
186
|
+
|
|
128
187
|
/* ── pmos try ─────────────────────────────────────────────────────────────────────────────────────────────── */
|
|
129
188
|
const USAGE = [
|
|
130
189
|
'usage: pmos try [list|works|broken|note|undo|later|count] — try what shipped in your recent updates (beta only)',
|
|
@@ -191,4 +250,4 @@ if (require.main === module) {
|
|
|
191
250
|
else process.exitCode = run(a);
|
|
192
251
|
}
|
|
193
252
|
|
|
194
|
-
module.exports = { TAG, DAYS, SHOW, ledgerFile, localDay, vcmp, changesOf, installedOf, readLines, fold, cardsOf, listOf, rowOf, answer, later, count, run, ctxOf, USAGE, COMMANDS: { try: ['list', 'works', 'broken', 'note', 'undo', 'later', 'count'] } };
|
|
253
|
+
module.exports = { TAG, DAYS, SHOW, EVIDENCE, evidenceOf, evidenceFile, recordEvidence, evidenceFor, ledgerFile, localDay, vcmp, changesOf, installedOf, readLines, fold, cardsOf, listOf, rowOf, answer, later, count, run, ctxOf, USAGE, COMMANDS: { try: ['list', 'works', 'broken', 'note', 'undo', 'later', 'count'] } };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.810.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.810.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "Kill lines are read like outcome checks (kill-lines-checked, idea A530, done test planning/done-tests/kill-lines-checked.md K1-K4, N1-N3): when a kill line is due, a number against the goal's reading, tracker state, the Stop ✦ and the outcome pass. No server, network, model or browser.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"kill-check.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"kill-check.test.js": 2
|
|
8
|
+
}
|
|
9
|
+
}
|