create-pmos 0.576.0 → 0.578.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 +27 -27
- package/payload/KIT-VERSION +2 -2
- 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/payload/state/log.md +1 -1
- package/workspace/changelog.json +26 -0
- package/workspace/guide/cli.md +9 -0
- package/workspace/guide/settings-and-switches.md +4 -0
- package/workspace/lib/bg-queue.js +17 -2
- package/workspace/lib/grill-cli.js +10 -1
- package/workspace/lib/headless.js +10 -2
- package/workspace/lib/improve-cli.js +69 -0
- package/workspace/lib/improve-loop.js +453 -0
- package/workspace/lib/improve-runs.js +219 -0
- package/workspace/lib/job-graph.js +18 -1
- package/workspace/lib/pmos-verbs.js +3 -0
- package/workspace/lib/routes-autonomy.js +7 -2
- package/workspace/lib/settings-store.js +3 -0
- package/workspace/lib/signals.js +272 -0
- package/workspace/lib/verify-runs.js +28 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/server.js +15 -0
- package/workspace/test-files.json +2 -1
- package/workspace/test-lists/improve-loop-engine.json +11 -0
|
@@ -35,6 +35,10 @@
|
|
|
35
35
|
* check and posts the commit status pmos-review; each turn also posts the verdicts still waiting. At most REVIEWS_PER_DAY a day; a head tried once
|
|
36
36
|
* is not tried again that day. Off with PMOS_FACTORY_REVIEW=off. The review comes before the verifier, because a merge waits for it.
|
|
37
37
|
*
|
|
38
|
+
* THE SIGNALS HARVEST (initiative improve-signals). Each tick, at most every HARVEST_MS per repository and before anything else, the
|
|
39
|
+
* improvement signals of each open repository are read into its ledger (lib/signals.js harvestSelf / harvestProduct). No model, no
|
|
40
|
+
* network. Off with PMOS_SIGNALS=off.
|
|
41
|
+
*
|
|
38
42
|
* deps: { roots() → [{ id, root }], open(now) → bool, headlessOff() → bool, env, spawn(spec), stop(session), warn(what, err),
|
|
39
43
|
* run(root, args) → { code, stdout } (default: spawnSync node), perDay?, stateDirs(w) → [the autonomy ledgers of a workspace] }
|
|
40
44
|
*/
|
|
@@ -46,6 +50,7 @@ const { spawnSync } = require('child_process');
|
|
|
46
50
|
const PER_DAY = 4;
|
|
47
51
|
const CHECKS_PER_DAY = 4;
|
|
48
52
|
const SWEEP_MS = 6 * 3600000;
|
|
53
|
+
const HARVEST_MS = 3600000;
|
|
49
54
|
const REVIEWS_PER_DAY = 8;
|
|
50
55
|
const one = (v, n) => String(v == null ? '' : v).replace(/\s+/g, ' ').trim().slice(0, n);
|
|
51
56
|
/** The prompt of one applied-change check. a: the applied entry (lib/autonomy.js). */
|
|
@@ -177,6 +182,27 @@ function create(deps) {
|
|
|
177
182
|
return null;
|
|
178
183
|
}
|
|
179
184
|
|
|
185
|
+
/* improve-signals: each open repository's signals into its ledger, at most every HARVEST_MS (no model). A PMOS checkout reads its own
|
|
186
|
+
* records into planning/improve/signals.jsonl; any other repository reads its state folders into <state>/improve-signals.jsonl,
|
|
187
|
+
* which keeps no words (lib/signals.js). */
|
|
188
|
+
const harvested = new Map(); // root → when
|
|
189
|
+
function harvest(roots, now) {
|
|
190
|
+
const e = deps.env || process.env;
|
|
191
|
+
if (/^(off|0|false|no)$/i.test(String(e.PMOS_SIGNALS || '').trim())) return 0;
|
|
192
|
+
const S = require('./signals.js');
|
|
193
|
+
let added = 0;
|
|
194
|
+
for (const w of roots) {
|
|
195
|
+
if (!w || !w.root || now - (harvested.get(w.root) || 0) < HARVEST_MS) continue;
|
|
196
|
+
harvested.set(w.root, now);
|
|
197
|
+
const dirs = dirsOf(w);
|
|
198
|
+
try {
|
|
199
|
+
if (isCheckout(w.root)) added += S.appendSignals(S.pmosSelfFile(w.root), S.harvestSelf(w.root, { run, stateDirs: dirs, now })).added;
|
|
200
|
+
else for (const d of dirs) added += S.appendSignals(S.productFile(d), S.harvestProduct(w.root, d), { product: true }).added;
|
|
201
|
+
} catch (err) { warn('signals', err); }
|
|
202
|
+
}
|
|
203
|
+
return added;
|
|
204
|
+
}
|
|
205
|
+
|
|
180
206
|
/* factory-premerge-reviewer: one review of a factory pull request's head, before it may merge by itself */
|
|
181
207
|
const reviewed = new Map(); // day → [item@sha tried]
|
|
182
208
|
function reviewOne(roots, now, day) {
|
|
@@ -247,6 +273,7 @@ function create(deps) {
|
|
|
247
273
|
function tick({ now = Date.now() } = {}) {
|
|
248
274
|
if (off(deps.env) || (deps.headlessOff && deps.headlessOff())) return { off: true };
|
|
249
275
|
const rolled = factory(now);
|
|
276
|
+
harvest((deps.roots && deps.roots()) || [], now);
|
|
250
277
|
if (active) return { running: active.run_id, ...(rolled.length ? { rolled } : {}) };
|
|
251
278
|
let open = true;
|
|
252
279
|
try { open = deps.open ? !!deps.open(now) : true; } catch { open = true; }
|
|
@@ -291,4 +318,4 @@ function create(deps) {
|
|
|
291
318
|
return { tick, active: () => (active ? active.run_id : null) };
|
|
292
319
|
}
|
|
293
320
|
|
|
294
|
-
module.exports = { off, startsToday, create, isCheckout, PER_DAY, REVIEWS_PER_DAY, CHECKS_PER_DAY, statusOf, changePrompt, runEvidence };
|
|
321
|
+
module.exports = { off, startsToday, create, isCheckout, PER_DAY, HARVEST_MS, REVIEWS_PER_DAY, CHECKS_PER_DAY, statusOf, changePrompt, runEvidence };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.578.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.578.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
package/workspace/server.js
CHANGED
|
@@ -3125,6 +3125,20 @@ const verifyRuns = require('./lib/verify-runs.js').create({
|
|
|
3125
3125
|
warn: (what, e) => warnWriteFail(what, e),
|
|
3126
3126
|
});
|
|
3127
3127
|
const verifyTick = () => { try { verifyRuns.tick({}); } catch (e) { warnWriteFail('verify tick', e); } };
|
|
3128
|
+
// improve-loop-engine (Wawan 2026-11-17 "Ok build"): the self-improvement loop in every product (lib/improve-runs.js). bg-queue step 5, so it
|
|
3129
|
+
// runs only while the PM is away; one headless run at a time; its only writes are a curated-memory lesson with Undo or a class C ✦. A PMOS
|
|
3130
|
+
// checkout is skipped: PMOS itself runs the same loop through scripts/improve.js and a cloud trigger. Off with `pmos ai off improve`.
|
|
3131
|
+
const improveRuns = require('./lib/improve-runs.js').create({
|
|
3132
|
+
roots: () => [...workspaces.values()].map((w) => ({ id: w.id, root: w.root })),
|
|
3133
|
+
stateDirFor: (r) => { const w = workspaces.get(r.id); return w ? stateDirFor(w) : null; },
|
|
3134
|
+
selfRoot: () => (require('./lib/improve-runs.js').isSelf(SELF_ROOT) ? SELF_ROOT : null),
|
|
3135
|
+
quota: () => orchQuota.read(STATE),
|
|
3136
|
+
env: process.env,
|
|
3137
|
+
spawn: (spec) => orchSpawn.spawn({ name: spec.name, agent: 'claude', ws: spec.ws, origin: spec.origin, initialInput: spec.initialInput, extraEnv: spec.env, autoDelete: undefined }),
|
|
3138
|
+
stop: (s) => { if (s && s.child) stopHeadless(s); },
|
|
3139
|
+
warn: (what, e) => warnWriteFail(what, e),
|
|
3140
|
+
});
|
|
3141
|
+
const improveTick = () => { try { improveRuns.tick({}); } catch (e) { warnWriteFail('improve tick', e); } };
|
|
3128
3142
|
// weekly-drift-check (What would I have missed): each Monday the server reads every open product's records for quiet drift (lib/drift-runs.js).
|
|
3129
3143
|
// Structured signals only, no session and no model. Its only write is the person's own ledger <runtime>/drift/drift.jsonl, through the shared
|
|
3130
3144
|
// guard (lib/ai-guard.js). Off with PMOS_DRIFT=off or `pmos ai off drift`. Nothing is sent.
|
|
@@ -3342,6 +3356,7 @@ bgQueue.register('grill', () => grillTick());
|
|
|
3342
3356
|
bgQueue.register('metric-drafts', () => metricDraftTick());
|
|
3343
3357
|
bgQueue.register('impact', () => impactTick());
|
|
3344
3358
|
bgQueue.register('verify', () => verifyTick());
|
|
3359
|
+
bgQueue.register('improve', () => improveTick());
|
|
3345
3360
|
bgQueue.register('metric-reads', () => metricReadTick());
|
|
3346
3361
|
bgQueue.register('forecast', () => forecastTick());
|
|
3347
3362
|
bgQueue.register('report-design', () => reportDesignTick());
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "improve-loop-engine (done test IL1-IL10): the self-improvement loop's pure engine (lib/improve-loop.js) and the workspace job `improve` (lib/improve-runs.js). Scratch folders; no model runs.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"improve-loop.test.js",
|
|
5
|
+
"improve-runs.test.js"
|
|
6
|
+
],
|
|
7
|
+
"seconds": {
|
|
8
|
+
"improve-loop.test.js": 1,
|
|
9
|
+
"improve-runs.test.js": 2
|
|
10
|
+
}
|
|
11
|
+
}
|