create-pmos 0.633.0 → 0.634.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 +14 -86
- 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 +13 -0
- package/workspace/lib/repo-identity.js +99 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/server.js +8 -7
- package/workspace/test-lists/repo-identity.json +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.634.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": {
|
|
@@ -33,6 +33,19 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.634.0",
|
|
38
|
+
"at": "2026-11-19T14:37:52.789Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1416,
|
|
43
|
+
"t": "Read repo identity off the event loop (stops the 15 s freezes)",
|
|
44
|
+
"s": "Read repo identity off the event loop (stops the 15 s freezes)",
|
|
45
|
+
"k": "fix"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
36
49
|
{
|
|
37
50
|
"v": "0.633.0",
|
|
38
51
|
"at": "2026-11-19T13:29:42.454Z",
|
|
@@ -327,91 +340,6 @@
|
|
|
327
340
|
"k": "fix"
|
|
328
341
|
}
|
|
329
342
|
]
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
"v": "0.612.0",
|
|
333
|
-
"at": "2026-11-19T02:31:02.656Z",
|
|
334
|
-
"f": 4,
|
|
335
|
-
"prs": [
|
|
336
|
-
{
|
|
337
|
-
"n": 1371,
|
|
338
|
-
"t": "Events matches its board: a suggestion on every late date, Late folds, a full calendar",
|
|
339
|
-
"s": "Events matches its board: a suggestion on every late date, Late folds, a full calendar",
|
|
340
|
-
"k": "fix"
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
"n": 1374,
|
|
344
|
-
"t": "Match the boards — plain When and Next, one row per report, clean report popup",
|
|
345
|
-
"s": "Match the boards — plain When and Next, one row per report, clean report popup",
|
|
346
|
-
"k": "fix"
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
"n": 1375,
|
|
350
|
-
"t": "Goals, am I on track from the North Star to the work (nav slice 9)",
|
|
351
|
-
"s": "Goals, am I on track from the North Star to the work (nav slice 9)",
|
|
352
|
-
"k": "new"
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
"n": 1377,
|
|
356
|
-
"t": "Make the popup for work match its boards (audit of nav slices 2 and 3)",
|
|
357
|
-
"s": "Make the popup for work match its boards (audit of nav slices 2 and 3)",
|
|
358
|
-
"k": "fix"
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
"n": 1380,
|
|
362
|
-
"t": "Every row repeats with one switch, a product chip, Type and set widths",
|
|
363
|
-
"s": "Every row repeats with one switch, a product chip, Type and set widths",
|
|
364
|
-
"k": "fix"
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
"n": 1379,
|
|
368
|
-
"t": "Events round 2: every dated source, a type on each row, a product, program and project filter",
|
|
369
|
-
"s": "Events round 2: every dated source, a type on each row, a product, program and project filter",
|
|
370
|
-
"k": "new"
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
"n": 1382,
|
|
374
|
-
"t": "Manage every routine in the popup, and + asks what should repeat",
|
|
375
|
-
"s": "Manage every routine in the popup, and + asks what should repeat",
|
|
376
|
-
"k": "new"
|
|
377
|
-
},
|
|
378
|
-
{
|
|
379
|
-
"n": 1384,
|
|
380
|
-
"t": "The shared scope chip filters Routine by product, program and project",
|
|
381
|
-
"s": "The shared scope chip filters Routine by product, program and project",
|
|
382
|
-
"k": "new"
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
"n": 1385,
|
|
386
|
-
"t": "Scope chip shows product names and the page's count word",
|
|
387
|
-
"s": "Scope chip shows product names and the page's count word",
|
|
388
|
-
"k": "fix"
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
"n": 1378,
|
|
392
|
-
"t": "Work draws the Board's own bar, stage card on press (round 2)",
|
|
393
|
-
"s": "Work draws the Board's own bar, stage card on press (round 2)",
|
|
394
|
-
"k": "fix"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
"n": 1381,
|
|
398
|
-
"t": "Round 3 of the popup for work (Wawan's production review)",
|
|
399
|
-
"s": "Round 3 of the popup for work (Wawan's production review)",
|
|
400
|
-
"k": "new"
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
"n": 1376,
|
|
404
|
-
"t": "Library as a catalogue (design audit + round 2): specific Kind, filters, shelves, search by meaning",
|
|
405
|
-
"s": "Library as a catalogue (design audit + round 2): specific Kind, filters, shelves, search by meaning",
|
|
406
|
-
"k": "new"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
"n": 1386,
|
|
410
|
-
"t": "Routine folds reads and jobs under a picked program; chip counts routines",
|
|
411
|
-
"s": "Routine folds reads and jobs under a picked program; chip counts routines",
|
|
412
|
-
"k": "new"
|
|
413
|
-
}
|
|
414
|
-
]
|
|
415
343
|
}
|
|
416
344
|
]
|
|
417
345
|
}
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-19T14:37:49Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-19T14:37:49Z"}
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-19T14:37:49Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.634.0",
|
|
4
|
+
"at": "2026-11-19T14:37:52.789Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1416,
|
|
9
|
+
"t": "Read repo identity off the event loop (stops the 15 s freezes)",
|
|
10
|
+
"s": "Read repo identity off the event loop (stops the 15 s freezes)",
|
|
11
|
+
"k": "fix"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.633.0",
|
|
4
17
|
"at": "2026-11-19T13:29:42.454Z",
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/* repo-identity — which repository a workspace folder belongs to, its working tree, its origin and its branch, read
|
|
3
|
+
* WITHOUT blocking the server (workspace-event-loop-lag).
|
|
4
|
+
*
|
|
5
|
+
* server.js used to read this with four to six synchronous `git` calls per workspace, again every 15 seconds, on the
|
|
6
|
+
* request path (sessionList → treeOfWsMap → repoIdentity). With a dozen workspaces that froze the one Node process —
|
|
7
|
+
* every HTTP answer and every terminal — for about 1.2 s every 15 s, and for 3 to 10 s when a slow repository joined
|
|
8
|
+
* in. The launcher's keep-alive probe (2.5 s) then logged "no workspace server answered", and the tunnel answered 502.
|
|
9
|
+
*
|
|
10
|
+
* Now: the first read of a folder is synchronous, as before, because callers need a real answer (the tree is the
|
|
11
|
+
* collision key). After that a caller always gets the cached answer at once. When the answer is older than the TTL,
|
|
12
|
+
* one background read (async `git`) replaces it; a folder already being read is not read twice.
|
|
13
|
+
*
|
|
14
|
+
* The answer's fields and meanings are unchanged: { at, key, name, branch, branchError, branchCode, remote, tree }.
|
|
15
|
+
*/
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const { execFile } = require('child_process');
|
|
19
|
+
|
|
20
|
+
const TTL_MS = 15000;
|
|
21
|
+
const GIT_TIMEOUT = 5000;
|
|
22
|
+
|
|
23
|
+
/** Async git: { code, out, failed }. Never rejects. */
|
|
24
|
+
function gitAsync(cwd, args) {
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
execFile('git', args, { cwd, encoding: 'utf8', timeout: GIT_TIMEOUT, maxBuffer: 1 << 20, env: { ...process.env, GIT_OPTIONAL_LOCKS: '0' } },
|
|
27
|
+
(err, stdout, stderr) => {
|
|
28
|
+
const code = err ? (typeof err.code === 'number' ? err.code : null) : 0;
|
|
29
|
+
const failed = !!err && typeof err.code !== 'number'; // spawn failure or timeout, not a git exit code
|
|
30
|
+
resolve({ code, out: String(stdout || '').trim(), err: String(stderr || '').trim(), failed });
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const isDir = (p) => { try { return fs.statSync(p).isDirectory(); } catch { return false; } };
|
|
36
|
+
const hasGitMarker = (root) => { try { return fs.existsSync(path.join(root, '.git')); } catch { return false; } };
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Reads one folder with async git. Mirrors what repoIdentity did with git-info's sync helpers:
|
|
40
|
+
* repoRoot (tree), worktrees()[0] (key, name), originUrl (remote), headInfo (branch / branchError / branchCode).
|
|
41
|
+
*/
|
|
42
|
+
async function readIdentity(root, run = gitAsync, now = () => Date.now()) {
|
|
43
|
+
let key = root, name = path.basename(root), branch = null, branchError = null, branchCode = null, remote = null, tree = null;
|
|
44
|
+
const dir = isDir(root);
|
|
45
|
+
if (dir) {
|
|
46
|
+
const top = await run(root, ['rev-parse', '--show-toplevel']);
|
|
47
|
+
if (!top.failed && top.code === 0 && top.out) tree = path.resolve(top.out.split('\n')[0].trim());
|
|
48
|
+
}
|
|
49
|
+
if (tree) {
|
|
50
|
+
const [wt, origin, head] = await Promise.all([
|
|
51
|
+
run(tree, ['worktree', 'list', '--porcelain']),
|
|
52
|
+
run(root, ['remote', 'get-url', 'origin']),
|
|
53
|
+
run(root, ['rev-parse', '--abbrev-ref', 'HEAD']),
|
|
54
|
+
]);
|
|
55
|
+
if (!wt.failed && wt.code === 0 && wt.out) {
|
|
56
|
+
const first = wt.out.split('\n').find((l) => l.startsWith('worktree '));
|
|
57
|
+
if (first) { key = path.resolve(first.slice(9).trim()); name = path.basename(key); }
|
|
58
|
+
}
|
|
59
|
+
if (!origin.failed && origin.code === 0 && origin.out) remote = origin.out.split('\n')[0].trim() || null;
|
|
60
|
+
if (head.failed) { branchError = 'git not available'; branchCode = 'git-error'; }
|
|
61
|
+
else if (head.code !== 0) { branchError = head.err || 'could not read HEAD'; branchCode = 'git-error'; }
|
|
62
|
+
else branch = head.out === 'HEAD' ? null : head.out;
|
|
63
|
+
} else if (dir && hasGitMarker(root)) {
|
|
64
|
+
branchError = 'git not available'; branchCode = 'git-error';
|
|
65
|
+
} else {
|
|
66
|
+
branchError = 'not a git repository'; branchCode = 'no-git';
|
|
67
|
+
}
|
|
68
|
+
return { at: now(), key, name, branch, branchError, branchCode, remote, tree };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The cache. `compute(root)` is the synchronous first read (the server's existing one); `read(root)` is the async one.
|
|
73
|
+
* get(root) never waits on git after the first read of a folder.
|
|
74
|
+
*/
|
|
75
|
+
function createRepoIdentityCache({ compute, read = readIdentity, ttlMs = TTL_MS, now = () => Date.now() } = {}) {
|
|
76
|
+
const cache = new Map();
|
|
77
|
+
const pending = new Map();
|
|
78
|
+
function refresh(root) {
|
|
79
|
+
if (pending.has(root)) return pending.get(root);
|
|
80
|
+
const p = Promise.resolve().then(() => read(root)).then((v) => { if (v) cache.set(root, v); return v; })
|
|
81
|
+
.catch(() => null)
|
|
82
|
+
.finally(() => pending.delete(root));
|
|
83
|
+
pending.set(root, p);
|
|
84
|
+
return p;
|
|
85
|
+
}
|
|
86
|
+
function get(root) {
|
|
87
|
+
const hit = cache.get(root);
|
|
88
|
+
if (hit) {
|
|
89
|
+
if (!(now() - hit.at < ttlMs)) refresh(root); // an answer with no clock counts as stale
|
|
90
|
+
return hit;
|
|
91
|
+
}
|
|
92
|
+
const val = compute(root);
|
|
93
|
+
cache.set(root, val);
|
|
94
|
+
return val;
|
|
95
|
+
}
|
|
96
|
+
return { get, refresh, cache, pending };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
module.exports = { TTL_MS, readIdentity, gitAsync, createRepoIdentityCache };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.634.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.634.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
|
@@ -781,12 +781,15 @@ function wsByRoot(root) {
|
|
|
781
781
|
// first from any of a repo's trees (git-info.worktreesAt), so index 0 is the group key: it is what
|
|
782
782
|
// turns `pmos` and `pmos ⑂ initiative/foo` from two peer rows into a parent and its child.
|
|
783
783
|
// Both shell git, so both are memoised — wsList() runs on every workspace push.
|
|
784
|
+
// Off the event loop (workspace-event-loop-lag, lib/repo-identity.js): the first read of a folder is the synchronous one
|
|
785
|
+
// below; after that every caller gets the cached answer at once, and a stale one is replaced by ONE background async read.
|
|
786
|
+
// Reading it synchronously every 15 s for every workspace froze the server ~1.2 s each time (the launcher's "no workspace
|
|
787
|
+
// server answered" lines and the tunnel's 502s on the PM's Mac).
|
|
784
788
|
const REPO_KEY_TTL_MS = 15000;
|
|
785
|
-
const
|
|
786
|
-
function repoIdentity(root) {
|
|
787
|
-
|
|
789
|
+
const repoKeys = require('./lib/repo-identity.js').createRepoIdentityCache({ compute: computeRepoIdentity, ttlMs: REPO_KEY_TTL_MS });
|
|
790
|
+
function repoIdentity(root) { return repoKeys.get(root); }
|
|
791
|
+
function computeRepoIdentity(root) {
|
|
788
792
|
const now = Date.now();
|
|
789
|
-
if (hit && now - hit.at < REPO_KEY_TTL_MS) return hit;
|
|
790
793
|
let key = root, name = path.basename(root), branch = null, branchError = null, branchCode = null;
|
|
791
794
|
let remote = null, tree = null;
|
|
792
795
|
try {
|
|
@@ -818,9 +821,7 @@ function repoIdentity(root) {
|
|
|
818
821
|
// one drifts.
|
|
819
822
|
else { branchError = bi.error || 'branch could not be read'; branchCode = bi.code || 'git-error'; }
|
|
820
823
|
} catch { branchError = 'branch could not be read'; branchCode = 'git-error'; }
|
|
821
|
-
|
|
822
|
-
repoKeyCache.set(root, val);
|
|
823
|
-
return val;
|
|
824
|
+
return { at: now, key, name, branch, branchError, branchCode, remote, tree };
|
|
824
825
|
}
|
|
825
826
|
|
|
826
827
|
// ── Shared-tree co-tenancy (workspace-session-concurrency) ────────────────────────────────────
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_comment": "workspace-event-loop-lag: a workspace's repository identity is read with async git after the first read, so sessionList never blocks the server (lib/repo-identity.js). Real git in temporary repositories.",
|
|
3
|
+
"modules": [
|
|
4
|
+
"repo-identity.test.js"
|
|
5
|
+
],
|
|
6
|
+
"seconds": {
|
|
7
|
+
"repo-identity.test.js": 3
|
|
8
|
+
}
|
|
9
|
+
}
|