create-pmos 0.305.0 → 0.306.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 +1 -1
- 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/lib/orchestrator-gate.js +7 -6
- package/workspace/lib/orchestrator-health.js +1 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/server.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.306.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": {
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T12:15:02Z"}
|
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T12:15:02Z"}
|
|
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-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-19T12:15:02Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* gate.mayStart({ running }) → the governor's answer { allowed, mode, cap, reason }, with the day's count and the stop switch read in
|
|
9
9
|
* gate.granted(at?) a start was made: it counts toward today's cap
|
|
10
10
|
* gate.status({ running }) → { stopped, mode, cap, allowed, reason, running, startedToday, settings, lastActivityAt }
|
|
11
|
-
* gate.settings() · gate.backupDir() → the governor's settings (defaults for what the file leaves out) · the nightly backup destination
|
|
11
|
+
* gate.settings() · gate.backupDir() → the governor's settings (defaults for what the file leaves out) · the nightly backup destination (the PM's choice, else `defaultBackupDir`, else null)
|
|
12
12
|
* gate.setStopped(stopped, actor) the stop switch
|
|
13
13
|
*
|
|
14
14
|
* STATE: <dir>/orchestrator.json the PM's settings, written by the PM only: { v: 1, settings: {…governor keys}, backupDir? }
|
|
@@ -24,15 +24,16 @@ const L = require('./orchestrator-ledger.js');
|
|
|
24
24
|
const localDay = (ms) => { const d = new Date(ms); return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; };
|
|
25
25
|
const readJson = (f) => { try { return JSON.parse(fs.readFileSync(f, 'utf8')); } catch { return null; } };
|
|
26
26
|
|
|
27
|
-
function create({ dir, now = Date.now, load = () => ({ memFreeFrac: G.memFreeFrac(), cpuPerCore: G.cpuPerCore() }), quota = () => null, bootAt } = {}) {
|
|
27
|
+
function create({ dir, defaultBackupDir = null, now = Date.now, load = () => ({ memFreeFrac: G.memFreeFrac(), cpuPerCore: G.cpuPerCore() }), quota = () => null, bootAt } = {}) {
|
|
28
28
|
let lastActivityAt = Number.isFinite(bootAt) ? bootAt : now(); // a restart counts as the PM being here: the safer mode
|
|
29
29
|
const cfgFile = path.join(dir, 'orchestrator.json'), dayFile = path.join(dir, 'orchestrator-day.json');
|
|
30
30
|
|
|
31
31
|
function config() {
|
|
32
32
|
const raw = readJson(cfgFile);
|
|
33
|
-
if (raw === null) return { settings: { ...G.DEFAULTS }, backupDir:
|
|
33
|
+
if (raw === null) return { settings: { ...G.DEFAULTS }, backupDir: defaultBackupDir, backupIsDefault: !!defaultBackupDir, problem: null };
|
|
34
34
|
const n = G.normalize(raw && raw.settings);
|
|
35
|
-
|
|
35
|
+
const chosen = raw && typeof raw.backupDir === 'string' && raw.backupDir.trim() ? raw.backupDir.trim() : null;
|
|
36
|
+
return { settings: n.ok ? n.settings : { ...G.DEFAULTS }, backupDir: chosen || defaultBackupDir, backupIsDefault: !chosen && !!defaultBackupDir,
|
|
36
37
|
problem: n.ok ? null : `orchestrator.json is not valid (${n.error}); the defaults apply` };
|
|
37
38
|
}
|
|
38
39
|
function startedToday(t) { const d = readJson(dayFile); return d && d.day === localDay(t) && Number.isInteger(d.count) ? d.count : 0; }
|
|
@@ -49,12 +50,12 @@ function create({ dir, now = Date.now, load = () => ({ memFreeFrac: G.memFreeFra
|
|
|
49
50
|
function status({ running = 0 } = {}) {
|
|
50
51
|
const t = now(), c = config(), d = mayStart({ running });
|
|
51
52
|
return { stopped: L.isStopped(dir), mode: d.mode, cap: d.cap, allowed: d.allowed, reason: d.reason, running, startedToday: startedToday(t), settings: c.settings,
|
|
52
|
-
settingsProblem: c.problem, backupDir: c.backupDir, lastActivityAt };
|
|
53
|
+
settingsProblem: c.problem, backupDir: c.backupDir, backupIsDefault: c.backupIsDefault, lastActivityAt };
|
|
53
54
|
}
|
|
54
55
|
return {
|
|
55
56
|
touch: (at = now()) => { lastActivityAt = at; },
|
|
56
57
|
mayStart, granted, status,
|
|
57
|
-
settings: () => config().settings, backupDir: () => config().backupDir,
|
|
58
|
+
settings: () => config().settings, backupDir: () => config().backupDir, backupIsDefault: () => config().backupIsDefault,
|
|
58
59
|
setStopped: (stopped, actor) => L.setStopped(dir, stopped, actor, now()),
|
|
59
60
|
};
|
|
60
61
|
}
|
|
@@ -25,6 +25,7 @@ function rows({ now = Date.now(), stopped = false, lastTickAt = null, tickMs = 6
|
|
|
25
25
|
if (!backup.configured) out.push({ id: 'backup', level: 'warn', text: 'The nightly backup has no destination yet. Choose a folder outside this one (an external disk or a synced folder).' });
|
|
26
26
|
else if (backup.lastError) out.push({ id: 'backup', level: 'bad', text: `The last backup failed: ${backup.lastError}` });
|
|
27
27
|
else if (!Number.isFinite(backup.lastOkAt) || now - backup.lastOkAt > 36 * HOUR) out.push({ id: 'backup', level: 'bad', text: 'There has been no good backup in over 36 hours.' });
|
|
28
|
+
else if (backup.isDefault) out.push({ id: 'backup', level: 'warn', text: `Backups go to ${backup.dir || 'a folder'} on this machine's own disk. If the disk fails, the state and the backups are lost together. Set backupDir in orchestrator.json to an external disk or a synced folder.` });
|
|
28
29
|
}
|
|
29
30
|
return out;
|
|
30
31
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.306.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.306.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/workspace/package.json
CHANGED
package/workspace/server.js
CHANGED
|
@@ -2583,7 +2583,7 @@ const dashboardScheduleTick = () => {
|
|
|
2583
2583
|
// window, and starts its short headless runs. Everything it decides is in lib/driver.js; this only hands it the server's parts.
|
|
2584
2584
|
// agent-orchestrator: the capacity governor in front of every run the orchestrator may start. The Driver asks it before each start; the status route reads it.
|
|
2585
2585
|
// PMOS_TICK_MS is the suites' fast clock: a suite runs beside forty others, so the machine-load check is skipped there (the rest of the gate applies).
|
|
2586
|
-
const orchGate = require('./lib/orchestrator-gate.js').create({ dir: STATE, ...(process.env.PMOS_TICK_MS ? { load: () => null } : {}) });
|
|
2586
|
+
const orchGate = require('./lib/orchestrator-gate.js').create({ dir: STATE, ...(process.env.PMOS_TICK_MS ? { load: () => null } : { defaultBackupDir: path.join(require('os').homedir(), 'pmos-backups') }) });
|
|
2587
2587
|
const driver = driverRunLib.create({
|
|
2588
2588
|
mayStart: ({ running }) => orchGate.mayStart({ running }),
|
|
2589
2589
|
started: () => orchGate.granted(),
|
|
@@ -2612,7 +2612,7 @@ const orchHealth = () => {
|
|
|
2612
2612
|
const backupLib = require('./lib/state-backup.js'), log = backupLib.readLog(STATE);
|
|
2613
2613
|
return require('./lib/orchestrator-health.js').rows({ now: Date.now(), stopped: orchGate.status({}).stopped, lastTickAt: orchLastTickAt, tickMs: TICK_MS,
|
|
2614
2614
|
diskFreeFrac: require('./lib/orchestrator-health.js').diskFreeFrac(STATE), loginHeld: driver.loginHeld(),
|
|
2615
|
-
backup: { configured: !!orchGate.backupDir(), lastOkAt: log.lastOkAt, lastError: log.lastError } });
|
|
2615
|
+
backup: { configured: !!orchGate.backupDir(), lastOkAt: log.lastOkAt, lastError: log.lastError, isDefault: orchGate.backupIsDefault(), dir: orchGate.backupDir() } });
|
|
2616
2616
|
};
|
|
2617
2617
|
const orchTick = () => {
|
|
2618
2618
|
orchLastTickAt = Date.now();
|