create-pmos 0.633.0 → 0.635.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 +20 -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 +19 -0
- package/workspace/guide/layout.md +1 -1
- package/workspace/lib/repo-identity.js +99 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-today-model.js +53 -4
- 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.635.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,25 @@
|
|
|
33
33
|
"audit"
|
|
34
34
|
],
|
|
35
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.635.0",
|
|
38
|
+
"at": "2026-11-19T14:42:50.865Z",
|
|
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
|
+
"n": 1417,
|
|
49
|
+
"t": "One line per brief item or Jira ticket; Jira Work shows its key",
|
|
50
|
+
"s": "One line per brief item or Jira ticket; Jira Work shows its key",
|
|
51
|
+
"k": "fix"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
36
55
|
{
|
|
37
56
|
"v": "0.633.0",
|
|
38
57
|
"at": "2026-11-19T13:29:42.454Z",
|
|
@@ -327,91 +346,6 @@
|
|
|
327
346
|
"k": "fix"
|
|
328
347
|
}
|
|
329
348
|
]
|
|
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
349
|
}
|
|
416
350
|
]
|
|
417
351
|
}
|
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:42:47Z"}
|
|
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:42:47Z"}
|
|
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:42:47Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.635.0",
|
|
4
|
+
"at": "2026-11-19T14:42:50.865Z",
|
|
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
|
+
"n": 1417,
|
|
15
|
+
"t": "One line per brief item or Jira ticket; Jira Work shows its key",
|
|
16
|
+
"s": "One line per brief item or Jira ticket; Jira Work shows its key",
|
|
17
|
+
"k": "fix"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
2
21
|
{
|
|
3
22
|
"v": "0.633.0",
|
|
4
23
|
"at": "2026-11-19T13:29:42.454Z",
|
|
@@ -39,7 +39,7 @@ The log is a table, kept the Bullet Journal way, in three groups:
|
|
|
39
39
|
Each row is one short line:
|
|
40
40
|
|
|
41
41
|
- The bullet says what it is: **•** a task, **○** an event, **–** a note, **×** done, **✦** something PMOS suggests. **!** marks what you marked first.
|
|
42
|
-
- **What** (the thing to do), **Type**, **Work** (the initiative or program it belongs to; the column is left out when no line names one), **Job** and **When**. The type is **Ask** (a person asked you; the line starts with who, then the ask; an ask with no person behind it can wait), **Decision**, **Check** ("did it work?"), **Milestone**, **Task**, **Report** or **Note**. The same ask from the same people shows once, with every name ("Suhas and Betty: …"). **Decide** is a call you make up your mind on, **Do** is something you do yourself ("Draft the PRD, or let PMOS draft it"), **Reply** is an answer a person waits for, and **Send** is a thing of yours that is ready to go out. PMOS's own note, such as the asks that expired with no answer, closes the log with the Job **Note**.
|
|
42
|
+
- **What** (the thing to do), **Type**, **Work** (the initiative or program it belongs to; the column is left out when no line names one), **Job** and **When**. The type is **Ask** (a person asked you; the line starts with who, then the ask; an ask with no person behind it can wait), **Decision**, **Check** ("did it work?"), **Milestone**, **Task**, **Report** or **Note**. The same ask from the same people shows once, with every name ("Suhas and Betty: …"). One thing shows once, however it reached Today: an item of the morning brief that you put on today, a Jira ticket in your tasks, and a brief item that says what a person asked you are each one row. Done, Move to tomorrow and Set a date act on the whole row. A Jira ticket's Work is its key, for example "CONHUB-233". **Decide** is a call you make up your mind on, **Do** is something you do yourself ("Draft the PRD, or let PMOS draft it"), **Reply** is an answer a person waits for, and **Send** is a thing of yours that is ready to go out. PMOS's own note, such as the asks that expired with no answer, closes the log with the Job **Note**.
|
|
43
43
|
- The rows are the calls only you can make, your late tasks, the next steps, your own items for today, the drafts to send, and what you typed yourself.
|
|
44
44
|
- The title line counts the log ("Today's log · 12"), with the jobs at the right, for example "5 to decide · 6 to do · 15 to reply · 1 to send".
|
|
45
45
|
|
|
@@ -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.635.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.635.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED
|
@@ -65,6 +65,21 @@ const jobOfAsk = (r) => (r.kind === 'call' ? (r.call && r.call.kind === 'update'
|
|
|
65
65
|
const cap1 = (s) => String(s || '').replace(/^[a-z]/, (c) => c.toUpperCase());
|
|
66
66
|
/** No ids in a title (audit round 2): "KR-A1 Signup conversion up: …" reads "Signup conversion up: …". */
|
|
67
67
|
const ID_SHAPED = /^(?:[0-9a-f]{8,}|[a-z0-9]+(?:[-_][a-z0-9]+)+)$/;
|
|
68
|
+
/* ── one thing, one line (Wawan's live Today, 2026-11-19): the morning brief's item reaches Today up to three ways, as a call (call:n:src:<id>),
|
|
69
|
+
* as a need of Your move (n:src:<id>) and as the item the PM put on today (work:brief:<id>); a Jira ticket as n:src:jira:<KEY> and work:jira:<KEY>.
|
|
70
|
+
* srcOf names the one thing behind a key: 'brief:<id>' or 'jira:<KEY>'; '' for any other key. */
|
|
71
|
+
export function srcOf(key) {
|
|
72
|
+
let k = String(key || '').replace(/^(?:call:|work:|n:)+/, '');
|
|
73
|
+
if (/^brief:[0-9a-f]{12}$/.test(k)) return k;
|
|
74
|
+
k = k.replace(/^src:/, '');
|
|
75
|
+
if (/^[0-9a-f]{12}$/.test(k)) return 'brief:' + k;
|
|
76
|
+
const j = ticketOf(k);
|
|
77
|
+
return j ? 'jira:' + j : '';
|
|
78
|
+
}
|
|
79
|
+
/** A Jira ticket's key from a source id: 'jira:jira:IDP-55' → 'IDP-55'; '' when it is not one. */
|
|
80
|
+
export function ticketOf(id) { const m = /^(?:jira:)+([A-Za-z][A-Za-z0-9_]*-\d+)$/.exec(String(id || '')); return m ? m[1].toUpperCase() : ''; }
|
|
81
|
+
/** An initiative id, or null: a source id ('jira:…', 'brief:…', 'src:…') is where a line came from, never an initiative. */
|
|
82
|
+
export const iniOnly = (x) => (x && !/^(?:jira|brief|src|n):/i.test(String(x)) ? x : null);
|
|
68
83
|
export const noId = (t) => String(t || '').replace(/^(?:[A-Z]{1,4}-[A-Z0-9][\w.]*|health:[\w-]+)\s+/, '');
|
|
69
84
|
/** An ask's What and Work, split as the board says them: the rank names a row "<work>: <what>" (a verdict, a grill finding, a meeting's or a
|
|
70
85
|
* program's milestone changes, the changes to keep); What is the thing to do, Work the initiative or program it is about. */
|
|
@@ -192,8 +207,9 @@ export function logModel(o = {}) {
|
|
|
192
207
|
}
|
|
193
208
|
// Work holds an initiative; a product shows by its display name, never its id (audit round 2)
|
|
194
209
|
const prodW = c ? c.sub : (r.shared || []).map((x) => productOf(x)).filter(Boolean)[0] || productOf(r.ws || '');
|
|
195
|
-
|
|
196
|
-
|
|
210
|
+
const ai = iniOnly(r.ini || (c && c.ini));
|
|
211
|
+
put({ key: c ? 'call:' + c.id : r.key, src: 'ask', bullet: 'task', title: noId(sp.what || r.title || (c && c.name) || ''), ini: ai, ws: r.ws || '',
|
|
212
|
+
work: work(ai, prodW) || sp.work || ticketOf(r.ini || (c && c.ini)), job: jobOfAsk(r), carried, late: carried >= LATE_DAYS,
|
|
197
213
|
when: whenWord({ carried, send }, today), first: r.rank <= 2 || (c && c.kind === 'update' && /^(today|now)/i.test(String(c.when || ''))) || false, ref: r });
|
|
198
214
|
}
|
|
199
215
|
// the rest of Your move: the PM's own late tasks and the next steps (a call is in the asks already; an item is in the items)
|
|
@@ -203,7 +219,8 @@ export function logModel(o = {}) {
|
|
|
203
219
|
const late = r.kind === 'task' && due && due < today ? between(due, today) : 0;
|
|
204
220
|
// a task whose date passed long ago and nobody touched (an old import) is not a Today row: one ✦ line in the Overview (round 3 point 12)
|
|
205
221
|
if (late > OLD_TASK_DAYS) { const m = marks[r.id] || {}; if (!m.dropped && !(m.kept && between(m.kept, today) < CARRY_DROP)) old.push(r.id); if (!(m.kept && between(m.kept, today) < CARRY_DROP)) continue; }
|
|
206
|
-
|
|
222
|
+
const mi = iniOnly(r.ini);
|
|
223
|
+
put({ key: r.id, src: 'move', bullet: 'task', title: r.name, ini: mi, work: mi ? work(mi, r.sub) : ticketOf(r.ini) || work(null, r.sub), job: 'Do', late: late > 0, carried: late,
|
|
207
224
|
when: whenWord({ late, due }, today), dates: r.kind === 'task' ? 'task' : 'mark', ref: r });
|
|
208
225
|
}
|
|
209
226
|
// the PM's own items placed in Today
|
|
@@ -211,7 +228,8 @@ export function logModel(o = {}) {
|
|
|
211
228
|
if (!it || !it.id) continue;
|
|
212
229
|
const from = it.due && it.due < today ? it.due : !it.due && it.at ? dayKey(Date.parse(it.at)) : '';
|
|
213
230
|
const carried = from && from < today ? between(from, today) : 0;
|
|
214
|
-
|
|
231
|
+
const ii = iniOnly(it.ini);
|
|
232
|
+
put({ key: 'work:' + it.id, src: 'item', bullet: 'task', title: it.title, ini: ii, work: ii ? work(ii, '') : ticketOf(it.id) || ticketOf(it.ini), job: 'Do', carried, late: !!it.overdue || carried >= LATE_DAYS,
|
|
215
233
|
when: whenWord({ carried, due: it.due }, today), dates: 'item', ref: it });
|
|
216
234
|
}
|
|
217
235
|
for (const d of o.drafts || []) if (d && d.id) put({ key: 'draft:' + d.id, src: 'draft', bullet: 'task', title: d.title, ini: d.ini || null, work: work(d.ini, ''), job: 'Send', did: ['finished the draft'], ref: d });
|
|
@@ -224,6 +242,7 @@ export function logModel(o = {}) {
|
|
|
224
242
|
when: whenWord({ carried, time: e.bullet === 'event' && !carried ? e.time : '' }, today), done: !!e.done, ref: e });
|
|
225
243
|
}
|
|
226
244
|
for (const f of o.lab || []) if (f && f.id) put({ key: 'lab:' + (f.ws || '') + ':' + f.id, src: 'lab', bullet: 'lab', title: f.title, work: '', job: 'Decide', why: f.why || '', ref: f });
|
|
245
|
+
oneLine(out);
|
|
227
246
|
// a row done today whose source has let it go keeps its × from what it said when it was done
|
|
228
247
|
for (const [k, m] of Object.entries(marks)) {
|
|
229
248
|
if (!m || !m.done || seen.has(k) || !m.snap) continue;
|
|
@@ -249,6 +268,36 @@ export function logModel(o = {}) {
|
|
|
249
268
|
const merged = open.reduce((k, r) => k + (r.merged ? r.merged - 1 : 0), 0);
|
|
250
269
|
return { rows: G.first.concat(G.today, done, G.wait), first: G.first, todayRows: G.today.concat(done), wait: G.wait, open: open.length, done: done.length, counts, types, merged, line, today, old };
|
|
251
270
|
}
|
|
271
|
+
/** ONE THING, ONE LINE (Wawan's live Today, 2026-11-19): the lines of one brief item or one Jira ticket (srcOf) are one line, with every key
|
|
272
|
+
* behind it (a mark goes to each). The item the PM put on today stays, since Done, Later and a date write to it; it takes the ask's Work, Type
|
|
273
|
+
* and Job when it has none. Then a brief item that says what an open Ask (a mention) says is that Ask: the Ask stays. In place, on out. */
|
|
274
|
+
export function oneLine(out) {
|
|
275
|
+
const join = (keep, r) => {
|
|
276
|
+
for (const k of r.keys || [r.key]) if (!keep.keys.includes(k)) keep.keys.push(k);
|
|
277
|
+
keep.merged = (keep.merged || 1) + (r.merged || 1);
|
|
278
|
+
keep.carried = Math.max(keep.carried || 0, r.carried || 0); keep.late = !!(keep.late || r.late); keep.first = !!(keep.first || r.first);
|
|
279
|
+
};
|
|
280
|
+
const by = new Map();
|
|
281
|
+
for (const r of out) { const s = r.done ? '' : srcOf(r.key); if (s) { if (!by.has(s)) by.set(s, []); by.get(s).push(r); } }
|
|
282
|
+
for (const L of by.values()) {
|
|
283
|
+
if (L.length < 2) continue;
|
|
284
|
+
const keep = L.find((r) => r.src === 'item') || L[0], at = out.indexOf(L[0]);
|
|
285
|
+
for (const r of L) {
|
|
286
|
+
if (r === keep) continue;
|
|
287
|
+
join(keep, r);
|
|
288
|
+
if (keep.src === 'item' && r.src !== 'item') { if (!keep.work) keep.work = r.work; if (r.type && r.type !== 'Task') keep.type = r.type; if (r.job && r.job !== 'Do') keep.job = r.job; }
|
|
289
|
+
out.splice(out.indexOf(r), 1);
|
|
290
|
+
}
|
|
291
|
+
out.splice(out.indexOf(keep), 1); out.splice(Math.min(at, out.length), 0, keep);
|
|
292
|
+
}
|
|
293
|
+
for (const r of [...out]) {
|
|
294
|
+
if (r.done || r.src === 'item' || !/^brief:/.test(srcOf(r.key))) continue;
|
|
295
|
+
const ask = out.find((x) => x !== r && x.type === 'Ask' && !x.done && sameAsk(x.ask, r.title));
|
|
296
|
+
if (!ask) continue;
|
|
297
|
+
join(ask, r); out.splice(out.indexOf(r), 1);
|
|
298
|
+
}
|
|
299
|
+
return out;
|
|
300
|
+
}
|
|
252
301
|
/** SAME JOB, MANY INITIATIVES (audit round 2): open asks that read the same for two or more initiatives ("Draft the PRD, or let PMOS draft
|
|
253
302
|
* it" five times) become one row: "5 initiatives have no PRD", its members under it when opened. When each one is a step PMOS drafts, a ✦
|
|
254
303
|
* line says "PMOS drafts them for you to read" with ✓ ✕ (✕ is kept for a month as the mark kept on the group). In place, on out. */
|
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
|
+
}
|