create-pmos 0.574.0 → 0.576.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.
Files changed (69) hide show
  1. package/package.json +27 -27
  2. package/payload/AGENTS.md +35 -2
  3. package/payload/KIT-VERSION +1 -1
  4. package/payload/okf/core/templates/agent-eval-set-template.md +65 -0
  5. package/payload/okf/core/templates/index.md +1 -0
  6. package/payload/planning/evals/eval-calibration.md +1 -1
  7. package/payload/planning/okrs/health-budgets.md +1 -1
  8. package/payload/scripts/agent-eval-set.js +85 -0
  9. package/payload/scripts/factory-guardrail.js +50 -8
  10. package/payload/scripts/work-item.js +49 -3
  11. package/payload/scripts/workflow-state.js +28 -3
  12. package/payload/state/discoveries.md +1 -1
  13. package/payload/templates/pmos-guardrail.yml +38 -10
  14. package/payload/templates/pmos-review-check.yml +59 -0
  15. package/workspace/briefing-premium-calendar-3-test.js +3 -10
  16. package/workspace/changelog.json +26 -0
  17. package/workspace/fixtures/agenda/invites.json +73 -0
  18. package/workspace/fixtures/builder-bench.json +121 -0
  19. package/workspace/guide/cli.md +71 -4
  20. package/workspace/guide/notes.md +1 -1
  21. package/workspace/guide/settings-and-switches.md +6 -0
  22. package/workspace/lib/agenda-topics.js +401 -0
  23. package/workspace/lib/agent-team.js +5 -2
  24. package/workspace/lib/build-cli.js +119 -7
  25. package/workspace/lib/build-engine.js +106 -25
  26. package/workspace/lib/builder-bench.js +267 -0
  27. package/workspace/lib/engine/agent-eval-set.js +85 -0
  28. package/workspace/lib/engine/workflow-state.js +28 -3
  29. package/workspace/lib/factory-checks.js +117 -0
  30. package/workspace/lib/factory-ci.js +151 -0
  31. package/workspace/lib/factory-fleet.js +263 -0
  32. package/workspace/lib/factory-identity.js +182 -0
  33. package/workspace/lib/factory-lessons.js +183 -0
  34. package/workspace/lib/factory-needs.js +48 -0
  35. package/workspace/lib/factory-review.js +241 -0
  36. package/workspace/lib/factory-rollout.js +56 -10
  37. package/workspace/lib/factory-traces.js +229 -0
  38. package/workspace/lib/headless.js +11 -2
  39. package/workspace/lib/meeting-focus.js +26 -13
  40. package/workspace/lib/needs-providers.js +1 -0
  41. package/workspace/lib/pmos-verbs.js +1 -1
  42. package/workspace/lib/project-onboard.js +1 -1
  43. package/workspace/lib/proposals.js +3 -1
  44. package/workspace/lib/route-modules.js +1 -0
  45. package/workspace/lib/routes-factory-metrics.js +41 -0
  46. package/workspace/lib/routes-meeting-focus.js +79 -10
  47. package/workspace/lib/routes-proposals.js +9 -1
  48. package/workspace/lib/team-cli.js +2 -2
  49. package/workspace/lib/team-runs.js +13 -3
  50. package/workspace/lib/vendor/scripts/agent-eval-set.js +85 -0
  51. package/workspace/lib/vendor/scripts/workflow-state.js +28 -3
  52. package/workspace/lib/verify-runs.js +62 -1
  53. package/workspace/package-lock.json +2 -2
  54. package/workspace/package.json +1 -1
  55. package/workspace/public/pm/agenda-live.css +44 -0
  56. package/workspace/public/pm/agenda-live.js +100 -0
  57. package/workspace/public/pm/cozy-rec-now.js +20 -2
  58. package/workspace/public/pm/ini-props.js +1 -1
  59. package/workspace/public/pm/premium-vw-mtg.js +20 -21
  60. package/workspace/server.js +4 -0
  61. package/workspace/test-lists/adlc-identity.json +9 -0
  62. package/workspace/test-lists/build-engine.json +5 -3
  63. package/workspace/test-lists/builder-bench.json +9 -0
  64. package/workspace/test-lists/factory-checks.json +9 -0
  65. package/workspace/test-lists/factory-fleet.json +9 -0
  66. package/workspace/test-lists/factory-lessons.json +9 -0
  67. package/workspace/test-lists/factory-real-run.json +9 -0
  68. package/workspace/test-lists/factory-run-traces.json +9 -0
  69. package/workspace/test-lists/live-agenda-topics.json +7 -0
@@ -598,6 +598,17 @@ function surfaceRoute(v) {
598
598
  // D77 — the lane lists, tracks and rung sets are DATA in scripts/lane-defs.js. This file reads them;
599
599
  // it holds no lane list of its own, so editing a definition changes the ladder with no edit here.
600
600
  const laneDefs = require('./lane-defs');
601
+ // agent-product-lane (ADLC gap P1): a record with `agent: true` builds a product that is itself an AI agent; its done test is a
602
+ // simulation eval set (scripts/agent-eval-set.js), required before the build on both ladders.
603
+ const agentEvalSet = require('./agent-eval-set');
604
+ /** '' when the done test at `rel` is a valid simulation eval set, else what is missing (one line). */
605
+ function evalSetGap(root, rel) {
606
+ let text;
607
+ try { text = fs.readFileSync(path.resolve(root, rel), 'utf8'); } catch { return `${rel} cannot be read`; }
608
+ const r = agentEvalSet.parse(text);
609
+ return r.ok ? '' : r.missing.join('; ');
610
+ }
611
+ const AGENT_FIX = 'write the simulation eval set (okf/core/templates/agent-eval-set-template.md): pass_threshold, and at least 3 scenarios, each with Input (a user: turn), Expected and Scoring';
601
612
  function profileOf(root) {
602
613
  try {
603
614
  const line = fs.readFileSync(path.join(root, '.pmos-profile'), 'utf8')
@@ -1010,7 +1021,11 @@ function computeWorkflowDerived(id, opts) {
1010
1021
  // PRD already on the record still satisfies the spec rung after a kind change: a gate already passed stays passed.
1011
1022
  const workKind = (() => { const k = String(fm.kind || '').trim().replace(/^["']|["']$/g, ''); return k === 'sdlc' || k === 'project' ? k : 'product'; })();
1012
1023
  const planPath = String(fm.plan_path || '').trim();
1013
- if (!doneTest && workKind === 'sdlc' && !prd) {
1024
+ const agentMode = agentEvalSet.isAgent(fm);
1025
+ if (agentMode && !doneTest) {
1026
+ steps.push(step('spec', 'spec', 'blocked', 'an agent product (agent: true) needs a simulation eval set as its done test before the build — never a PRD',
1027
+ `${AGENT_FIX}; set done_test_path and kill: in ${recRel}`, { blocking: true, rule: 'R2' }));
1028
+ } else if (!doneTest && workKind === 'sdlc' && !prd) {
1014
1029
  steps.push(step('spec', 'spec', 'blocked', 'Full SDLC needs a done test and a kill condition before the first pull request — never a PRD',
1015
1030
  `write the done test (okf/core/templates/done-test-template.md), set done_test_path and kill: in ${recRel}`, { blocking: true, rule: 'R2' }));
1016
1031
  } else if (!doneTest && workKind === 'project' && (planPath || !prd)) {
@@ -1035,8 +1050,11 @@ function computeWorkflowDerived(id, opts) {
1035
1050
  } else if (!killCond) {
1036
1051
  steps.push(step('spec', 'spec', 'blocked', 'no kill condition — an experiment states what would stop it (D107)',
1037
1052
  `write kill: "<the result that would make us stop>" in ${recRel}`, { blocking: true, rule: 'R2' }));
1053
+ } else if (agentMode && evalSetGap(root, doneTest)) {
1054
+ steps.push(step('spec', 'spec', 'blocked', `an agent product's done test is a simulation eval set: ${evalSetGap(root, doneTest)}`,
1055
+ `${AGENT_FIX} in ${doneTest}`, { blocking: true, rule: 'R2' }));
1038
1056
  } else {
1039
- steps.push(orderOf(`done test ${doneTest}`, dtIdx, 'O1'));
1057
+ steps.push(orderOf(agentMode ? `eval set ${doneTest}` : `done test ${doneTest}`, dtIdx, 'O1'));
1040
1058
  }
1041
1059
  } else {
1042
1060
  const wants = {
@@ -1651,7 +1669,14 @@ function pmLadder({ id, fm, lane, effLane, knownLane, legacy, steps, root, L, re
1651
1669
  const planPath = String(fm.plan_path || '').trim();
1652
1670
  const kindSpec = !doneTest && !exists(briefPath) && !foundBrief && (workKind === 'sdlc' || (workKind === 'project'));
1653
1671
  const tasksPlan = kindSpec && workKind === 'project' && !planPath ? taskPlanOf(root, id) : null;
1654
- if (doneTest && dtPresent && killCond) steps.push(step('brief', def.brief_label, 'done', `done test ${doneTest} + kill condition (D107)`));
1672
+ const agentMode = agentEvalSet.isAgent(fm);
1673
+ const agentGap = agentMode && dtPresent ? evalSetGap(root, doneTest) : '';
1674
+ if (agentMode && !doneTest) steps.push(step('brief', 'eval set', legacy ? 'pending' : 'blocked',
1675
+ 'an agent product (agent: true) needs a simulation eval set as its done test before the build — never a brief or a PRD',
1676
+ `${AGENT_FIX}; set done_test_path and kill: in ${recRel}`, { blocking: !legacy, rule: 'R2' }));
1677
+ else if (agentGap && killCond) steps.push(step('brief', 'eval set', legacy ? 'pending' : 'blocked', `an agent product's done test is a simulation eval set: ${agentGap}`,
1678
+ `${AGENT_FIX} in ${doneTest}`, { blocking: !legacy, rule: 'R2' }));
1679
+ else if (doneTest && dtPresent && killCond) steps.push(step('brief', def.brief_label, 'done', agentMode ? `eval set ${doneTest} + kill condition (agent product)` : `done test ${doneTest} + kill condition (D107)`));
1655
1680
  else if (kindSpec && workKind === 'sdlc') steps.push(step('brief', 'done test', legacy ? 'pending' : 'blocked',
1656
1681
  'Full SDLC needs a done test and a kill condition before the first pull request — never a brief or a PRD',
1657
1682
  `write the done test, set done_test_path and kill: in ${recRel} (pmos artefacts set experiment:${id} done-test check --text "…" writes both)`, { blocking: !legacy, rule: 'R2' }));
@@ -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-16T06:14:01Z"}
5
+ generated: {by: process:create-pmos, at: "2026-11-16T11:57:03Z"}
6
6
  status: stable
7
7
  ---
8
8
 
@@ -7,6 +7,11 @@
7
7
  # off and names every reason in the run summary; a person merges. Any other pull request: nothing. To stop one merge, add the
8
8
  # line "PMOS-Merge: human" to the pull request's description: the edit runs this check again and turns auto-merge off.
9
9
  #
10
+ # The independent review (initiative factory-premerge-reviewer): AUTO also needs the commit status "pmos-review" to be success on
11
+ # the head this check diffs. PMOS posts that status from its own process after a separate read-only review run. No status, a
12
+ # pending one or a failure reads HUMAN. When PMOS posts the status, the "status" event runs this check again on the same rules.
13
+ # Copy kit/templates/pmos-review-check.yml too: it reruns the item's declared check cold on the head, and PMOS reads its result.
14
+ #
10
15
  # Why pull_request_target: it runs THIS workflow and THE DEFAULT BRANCH'S guardrail, never the pull request's code. The head
11
16
  # is fetched and diffed only. Do not add a step that runs, installs or builds anything from the head in this workflow.
12
17
  #
@@ -20,19 +25,22 @@ name: pmos-guardrail
20
25
  on:
21
26
  pull_request_target:
22
27
  types: [opened, synchronize, reopened, ready_for_review, edited]
28
+ status:
23
29
 
24
30
  permissions:
25
31
  contents: write
26
32
  pull-requests: write
27
33
 
28
34
  concurrency:
29
- group: pmos-guardrail-${{ github.event.pull_request.number }}
35
+ group: pmos-guardrail-${{ github.event.pull_request.number || github.event.sha }}
30
36
  cancel-in-progress: true
31
37
 
32
38
  jobs:
33
39
  classify:
34
40
  name: classify
35
- if: startsWith(github.event.pull_request.head.ref, 'pmos/')
41
+ if: >-
42
+ (github.event_name == 'pull_request_target' && startsWith(github.event.pull_request.head.ref, 'pmos/')) ||
43
+ (github.event_name == 'status' && github.event.context == 'pmos-review')
36
44
  runs-on: ubuntu-latest
37
45
  steps:
38
46
  - uses: actions/checkout@v4
@@ -40,22 +48,42 @@ jobs:
40
48
  ref: ${{ github.event.pull_request.base.sha }}
41
49
  fetch-depth: 0
42
50
  persist-credentials: false
51
+ - name: Find the pull request (a status event names only a commit)
52
+ id: find
53
+ env:
54
+ GH_TOKEN: ${{ github.token }}
55
+ GH_REPO: ${{ github.repository }}
56
+ PR_EVENT: ${{ github.event.pull_request.number }}
57
+ SHA: ${{ github.event.sha }}
58
+ run: |
59
+ PR="$PR_EVENT"
60
+ if [ -z "$PR" ]; then
61
+ PR=$(gh api "repos/$GH_REPO/commits/$SHA/pulls" --jq '[.[] | select(.state == "open" and (.head.ref | startswith("pmos/")))][0].number // empty')
62
+ fi
63
+ echo "pr=$PR" >> "$GITHUB_OUTPUT"
64
+ [ -n "$PR" ] || { echo "No open factory pull request carries this commit. Nothing to do."; exit 0; }
65
+ gh pr view "$PR" --json baseRefOid,headRefName,body,headRepository,headRepositoryOwner > "$RUNNER_TEMP/pmos-pr.json"
43
66
  - name: Fetch the pull request's head (diffed, never run)
67
+ if: steps.find.outputs.pr != ''
44
68
  env:
45
- PR: ${{ github.event.pull_request.number }}
69
+ PR: ${{ steps.find.outputs.pr }}
46
70
  run: git fetch --no-tags origin "+refs/pull/${PR}/head:refs/remotes/pmos-pr/head"
47
71
  - name: Guardrail
72
+ if: steps.find.outputs.pr != ''
48
73
  env:
49
74
  GH_TOKEN: ${{ github.token }}
50
75
  GH_REPO: ${{ github.repository }}
51
- PR: ${{ github.event.pull_request.number }}
52
- HEAD_REF: ${{ github.event.pull_request.head.ref }}
53
- BASE_SHA: ${{ github.event.pull_request.base.sha }}
54
- PR_BODY: ${{ github.event.pull_request.body }}
55
- HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
76
+ PR: ${{ steps.find.outputs.pr }}
56
77
  BASE_REPO: ${{ github.repository }}
57
78
  run: |
58
- printf '%s' "$PR_BODY" > "$RUNNER_TEMP/pmos-pr-body.txt"
79
+ F="$RUNNER_TEMP/pmos-pr.json"
80
+ BASE_SHA=$(jq -r '.baseRefOid' "$F")
81
+ HEAD_REF=$(jq -r '.headRefName' "$F")
82
+ HEAD_REPO=$(jq -r '"\(.headRepositoryOwner.login)/\(.headRepository.name)"' "$F")
83
+ jq -r '.body // ""' "$F" > "$RUNNER_TEMP/pmos-pr-body.txt"
84
+ # the review state of the exact head this check diffs; a newer push has no review yet, so it reads HUMAN
85
+ HEAD_SHA=$(git rev-parse refs/remotes/pmos-pr/head)
86
+ REVIEW_STATE=$(gh api "repos/$GH_REPO/commits/$HEAD_SHA/status" --jq '[.statuses[] | select(.context == "pmos-review")][0].state // ""' || true)
59
87
  node pmos/scripts/factory-guardrail.js --base "$BASE_SHA" --head refs/remotes/pmos-pr/head \
60
88
  --branch "$HEAD_REF" --body-file "$RUNNER_TEMP/pmos-pr-body.txt" --head-repo "$HEAD_REPO" --base-repo "$BASE_REPO" \
61
- --github --pr "$PR"
89
+ --review-state "$REVIEW_STATE" --github --pr "$PR"
@@ -0,0 +1,59 @@
1
+ # PMOS independent review, the cold check (initiative factory-premerge-reviewer). Copy to
2
+ # .github/workflows/pmos-review-check.yml in the product repository, next to pmos-guardrail.yml.
3
+ #
4
+ # What it does: for a pull request the PMOS factory opened (branch pmos/<item>), it reruns the item's declared check on a fresh
5
+ # checkout of the head. It reads the check from THE DEFAULT BRANCH'S work-item ledger, so the pull request cannot change which
6
+ # check runs. PMOS reads this job's result (check run "pmos-review-check"). A red result is a FAIL of the review with no model;
7
+ # PMOS then posts the commit status "pmos-review" as failure, and the guardrail reads HUMAN.
8
+ #
9
+ # Why here and not on the PM's computer: the check runs the pull request's code. This job holds a read-only token and no secret,
10
+ # so that code reaches nothing PMOS holds (no push, no gh login, no merge right).
11
+ #
12
+ # Add your own setup steps (install, build, services) in the marked place. Do not add a secret or a write permission to this job.
13
+ # A work item whose check is not a command (a rubric dimension, or a file name alone) runs nothing here and passes this job;
14
+ # PMOS's read-only review run judges it.
15
+ name: pmos-review-check
16
+ on:
17
+ pull_request:
18
+ types: [opened, synchronize, reopened, ready_for_review]
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ concurrency:
24
+ group: pmos-review-check-${{ github.event.pull_request.number }}
25
+ cancel-in-progress: true
26
+
27
+ jobs:
28
+ check:
29
+ name: pmos-review-check
30
+ if: startsWith(github.event.pull_request.head.ref, 'pmos/')
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ ref: ${{ github.event.pull_request.head.sha }}
36
+ fetch-depth: 0
37
+ persist-credentials: false
38
+ - name: Read the declared check from the default branch
39
+ id: declared
40
+ env:
41
+ HEAD_REF: ${{ github.event.pull_request.head.ref }}
42
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
43
+ run: |
44
+ ITEM="${HEAD_REF#pmos/}"
45
+ git show "$BASE_SHA:pmos/planning/work-items.jsonl" > "$RUNNER_TEMP/pmos-ledger.jsonl" 2>/dev/null || : > "$RUNNER_TEMP/pmos-ledger.jsonl"
46
+ jq -rs --arg id "$ITEM" '[.[] | select(.item_id == $id and .event == "declared")] | last | .criterion // {} |
47
+ select(.check == "test" or .check == "assertion") | .ref // empty' "$RUNNER_TEMP/pmos-ledger.jsonl" > "$RUNNER_TEMP/pmos-check.txt" || : > "$RUNNER_TEMP/pmos-check.txt"
48
+ echo "item=$ITEM" >> "$GITHUB_OUTPUT"
49
+ # ---- your setup steps go here (for example actions/setup-node and npm ci) ----
50
+ - name: Run the declared check cold
51
+ run: |
52
+ CHECK=$(cat "$RUNNER_TEMP/pmos-check.txt")
53
+ case "$CHECK" in
54
+ "") echo "The item declares no check command. Nothing runs here; PMOS's review reads the change." ; exit 0 ;;
55
+ *" "*) ;;
56
+ *) echo "The item's check names one file ($CHECK), not a command. Nothing runs here; PMOS's review reads it." ; exit 0 ;;
57
+ esac
58
+ echo "Running: $CHECK"
59
+ bash -c "$CHECK"
@@ -133,20 +133,13 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
133
133
  const B = await open('/premium-viewer.html?open=meeting&note=n2', { noLive: false, init: () => { window.__premiumHolding = { id: 'n2' }; } });
134
134
  const q = B.page;
135
135
  await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-czs-fold="agenda"]')), 15000);
136
- // Viewer kit (XvALive): the topic now is in the summary; the agenda with the minutes used and Change topic are the Agenda fold
136
+ // Viewer kit (XvALive): the topic now is in the summary; the agenda with the minutes used is the Agenda fold
137
137
  if (await q.evaluate(() => document.querySelector('#czViewer [data-czs-fold="agenda"]').getAttribute('aria-expanded') !== 'true')) await tap(q, '[data-czs-fold="agenda"]');
138
138
  ok('R5 Focus: Now on the topic, topic 2 of 3, and the agenda with the minutes used', await until(async () => { const t = await text(q); return /Now on: The Issue button, topic 2 of 3\./.test(t) && /One toolbar row/.test(t) && /Phone layout/.test(t) && /\d+ of 10/.test(t) && !(await q.$('#czViewer [data-cz-placeholder]')); }), (await text(q)).slice(0, 600));
139
139
  const f0 = B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length;
140
140
  ok('R5 Focus reads again while the meeting is live', await until(() => B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length >= f0 + 2, 12000));
141
- // Focus reads again every few seconds while the meeting is live and the card is drawn anew: Change topic opens the list again
142
- // when that draw took it away before the press reached it
143
- await until(async () => {
144
- if (!(await q.$('#czViewer [data-a="topicgo"][data-i="2"]'))) { await tap(q, '[data-a="topic"]').catch(() => {}); await until(() => q.$('#czViewer [data-a="topicgo"][data-i="2"]'), 2000); }
145
- if (!(await q.$eval('#czViewer [data-a="topicgo"][data-i="2"]', (b) => { b.click(); return true; }).catch(() => false))) return false;
146
- return until(() => B.S.posts.some((x) => x.path === '/api/meeting-focus/topic'), 2000);
147
- }, 12000);
148
- const tp = await until(() => B.S.posts.find((x) => x.path === '/api/meeting-focus/topic'));
149
- ok('R5 Change topic posts one set for that topic on this meeting', tp && tp.body.event === 'ev-live' && tp.body.action === 'set' && tp.body.topic === 'Phone layout', JSON.stringify(B.S.posts) + (await text(q)).slice(0, 300));
141
+ // live-agenda-topics (batch 30 item 3): no Change topic. PMOS follows the talk; the PM corrects it with "Not this one" on the Now card
142
+ ok('R5 the agenda has no Change topic', !(await q.$('#czViewer [data-a="topic"]')) && !(await q.$('#czViewer [data-a="topicgo"]')), (await text(q)).slice(0, 300));
150
143
  /* R6 a refused read */
151
144
  await q.route('**/api/meeting-focus?*', (r) => json(r, { ok: false, error: 'the companion is off' }, 503));
152
145
  ok('R6 a refused read says why and offers no topic to change', await until(async () => /Focus could not read this meeting/.test(await text(q)) && !(await q.$('#czViewer [data-a="topic"]')), 12000), (await text(q)).slice(0, 400));
@@ -1,4 +1,30 @@
1
1
  [
2
+ {
3
+ "v": "0.576.0",
4
+ "at": "2026-11-16T11:57:06.812Z",
5
+ "f": 4,
6
+ "prs": [
7
+ {
8
+ "n": 1308,
9
+ "t": "Close the nine ADLC agent-factory gaps",
10
+ "s": "Close the nine ADLC agent-factory gaps",
11
+ "k": "new"
12
+ }
13
+ ]
14
+ },
15
+ {
16
+ "v": "0.575.0",
17
+ "at": "2026-11-16T11:43:16.900Z",
18
+ "f": 4,
19
+ "prs": [
20
+ {
21
+ "n": 1307,
22
+ "t": "A live meeting's agenda as 3 to 5 topics",
23
+ "s": "A live meeting's agenda as 3 to 5 topics",
24
+ "k": "new"
25
+ }
26
+ ]
27
+ },
2
28
  {
3
29
  "v": "0.574.0",
4
30
  "at": "2026-11-16T06:14:05.146Z",
@@ -0,0 +1,73 @@
1
+ {
2
+ "_comment": "Agenda shapes for agenda-topics.test.js (initiative live-agenda-topics). 'psle-uat-live' lines 1-19 are Wawan's live meeting of 16 Nov 2026 as his screenshots show them; lines 20-26 are not on the screenshots and are written to match the design's 'Release and wrap-up' topic. 'smrt-technical' and 'psle-marketing' are copied from the release-check backup (pmos-ooh-digital planning/comms/smrt-stellar-ace-technical-2026-07-23-agenda-shared.md and pmos-microsites planning/comms/psle-marketing-alignment-brief-2026-07-27.md), one invite line per heading, bullet or table row.",
3
+ "psle-uat-live": { "length": 55, "lines": [
4
+ "UAT hands-on walkthrough",
5
+ "PSLE & Vertical add-on UAT plan",
6
+ "PSLE add-on as a free upgrade for existing subscribers",
7
+ "PSLE microsite revamp and paywall-to-checkout integration",
8
+ "Landing page paywall variants",
9
+ "Article paywall lock for non-subscribers",
10
+ "Test case sheet structure (purpose, precondition, steps)",
11
+ "Parallel runs across three user scenarios",
12
+ "Article tag naming for PSLE 2027",
13
+ "Adding articles to top stories and editor uploads",
14
+ "Copy check against the latest highlight text",
15
+ "Back-data access for 2026 and 2027 subscribers",
16
+ "Data patch for 2026 subscribers' 2027 back-data access",
17
+ "Old PSLE bundle entitlement for 2026 buyers",
18
+ "Add-on extension for 2026 subscribers",
19
+ "Commerce service step for the 2026 buyer add-on route",
20
+ "2026 buyer add-on vs data patch decision",
21
+ "End-to-end checkout test for non-subscribers",
22
+ "Add-on eligibility for existing subscribers (section C)",
23
+ "Release date for the PSLE add-on",
24
+ "Go-live checklist and release owner",
25
+ "Rollback plan if the release slips",
26
+ "Release notes for the editors",
27
+ "Open defects to close before the release",
28
+ "Next UAT session date",
29
+ "Wrap-up and owners for each action"
30
+ ] },
31
+ "smrt-technical": { "length": 60, "lines": [
32
+ "1. What SPH Media runs today · 3:00–3:10",
33
+ "A short demonstration of our live billboard microsites and a prototype at true aspect ratio",
34
+ "Our own billboards already run on Broadsign, the same platform as Stellar Ace's network",
35
+ "2. Screen estate in scope · 3:10–3:22",
36
+ "Which formats are in scope: iView, iPlasma, STARiS, digital walls, station LED",
37
+ "Whether the Thomson–East Coast Line falls within Stellar Ace's inventory",
38
+ "Advertising screens versus operational passenger information displays",
39
+ "Screen specifications for each format: resolution, orientation, safe areas, size limits",
40
+ "3. Content delivery model · 3:22–3:45",
41
+ "Accepted content formats: live web URL, HTML bundle, or scheduled image and video assets",
42
+ "Whether HTML5 or a live web page is supported on iView",
43
+ "What programmatic rollout means in practice",
44
+ "Rendering model: full-screen asset or inside a Stellar Ace layout template",
45
+ "Player and browser versions across the fleet",
46
+ "Refresh cadence, and who controls the refresh",
47
+ "Failure behaviour and the fallback when our content is unavailable",
48
+ "4. Scheduling, operations and approvals · 3:45–3:55",
49
+ "Dedicated slot or shared rotation with commercial inventory",
50
+ "Slot duration and loop length",
51
+ "Who schedules the content, support and escalation path",
52
+ "Content approval workflow and turnaround time",
53
+ "Removal timeframe for breaking news",
54
+ "5. Security, network and environment · 3:55–4:00",
55
+ "Network constraints for content delivered onto transit infrastructure",
56
+ "Vendor or security review for a content partner, and its lead time"
57
+ ] },
58
+ "psle-marketing": { "length": 45, "lines": [
59
+ "0–5 | Where things stand; the package-level correction",
60
+ "5–15 | Q1 — the take-back",
61
+ "15–22 | Q2 — the denominator",
62
+ "22–30 | Q3 — the offer",
63
+ "30–37 | Q4 — is Q4 the right moment",
64
+ "37–42 | Q5 + Q6",
65
+ "42–45 | Dependency sequence; confirm 7 Aug holds"
66
+ ] },
67
+ "weekly-sync": { "length": 30, "lines": [
68
+ "What shipped last week",
69
+ "Blockers",
70
+ "Saved views and the migration",
71
+ "Release date"
72
+ ] }
73
+ }
@@ -0,0 +1,121 @@
1
+ {
2
+ "_comment": "The golden set of the Builder benchmark (initiative factory-builder-benchmark, lib/builder-bench.js). One file, so the set has one version. product: the files of the small product the bench copies into a sandbox. items: each work item with its held-out check and its known-good solution, which never enter the sandbox. Each check fails on the untouched product and passes with its solution (builder-bench.test.js B1). Change anything here and the set version changes, so old rows stay comparable only with their own set.",
3
+ "product": {
4
+ "src/text.js": "'use strict';\n/* text.js: small string helpers. */\nfunction capitalize(s) {\n return s[0].toUpperCase() + s.slice(1);\n}\nmodule.exports = { capitalize };\n",
5
+ "src/num.js": "'use strict';\n/* num.js: small number helpers. */\nfunction sum(xs) {\n return xs.reduce((a, b) => a + b);\n}\nmodule.exports = { sum };\n",
6
+ "src/list.js": "'use strict';\n/* list.js: small array helpers. */\nfunction last(xs) {\n return xs[xs.length - 1];\n}\nmodule.exports = { last };\n",
7
+ "README.txt": "A small product for the PMOS Builder benchmark. Plain Node.js, no dependencies.\nEach module in src/ is a CommonJS module.\n"
8
+ },
9
+ "items": [
10
+ {
11
+ "n": 1,
12
+ "id": "01",
13
+ "type": "feature-slice",
14
+ "file": "src/text.js",
15
+ "criterion": "src/text.js exports slugify(s): lower case, every run of characters that are not a-z or 0-9 becomes one \"-\", and no \"-\" at the start or end. slugify(\"Hello, World!\") is \"hello-world\".",
16
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { slugify } = need('src/text.js');\nassert.strictEqual(slugify('Hello, World!'), 'hello-world');\nassert.strictEqual(slugify(' PMOS -- Builder 2026 '), 'pmos-builder-2026');\nassert.strictEqual(slugify('---'), '');\nassert.strictEqual(need('src/text.js').capitalize('abc'), 'Abc');\n",
17
+ "solution": {
18
+ "src/text.js": "'use strict';\n/* text.js: small string helpers. */\nfunction capitalize(s) {\n return s[0].toUpperCase() + s.slice(1);\n}\nfunction slugify(s) {\n return String(s).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n}\nmodule.exports = { capitalize, slugify };\n"
19
+ }
20
+ },
21
+ {
22
+ "n": 2,
23
+ "id": "02",
24
+ "type": "feature-slice",
25
+ "file": "src/text.js",
26
+ "criterion": "src/text.js exports truncate(s, n): s unchanged when it has n characters or fewer; otherwise the first n - 1 characters followed by \"…\", so the result has exactly n characters.",
27
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { truncate } = need('src/text.js');\nassert.strictEqual(truncate('short', 10), 'short');\nassert.strictEqual(truncate('exactly10!', 10), 'exactly10!');\nassert.strictEqual(truncate('a longer sentence', 8), 'a longe…');\nassert.strictEqual(truncate('a longer sentence', 8).length, 8);\n",
28
+ "solution": {
29
+ "src/text.js": "'use strict';\n/* text.js: small string helpers. */\nfunction capitalize(s) {\n return s[0].toUpperCase() + s.slice(1);\n}\nfunction truncate(s, n) {\n return s.length <= n ? s : s.slice(0, n - 1) + '…';\n}\nmodule.exports = { capitalize, truncate };\n"
30
+ }
31
+ },
32
+ {
33
+ "n": 3,
34
+ "id": "03",
35
+ "type": "feature-slice",
36
+ "file": "src/num.js",
37
+ "criterion": "src/num.js exports clamp(x, lo, hi): lo when x < lo, hi when x > hi, else x.",
38
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { clamp } = need('src/num.js');\nassert.strictEqual(clamp(5, 0, 10), 5);\nassert.strictEqual(clamp(-3, 0, 10), 0);\nassert.strictEqual(clamp(42, 0, 10), 10);\nassert.strictEqual(clamp(0, 0, 0), 0);\n",
39
+ "solution": {
40
+ "src/num.js": "'use strict';\n/* num.js: small number helpers. */\nfunction sum(xs) {\n return xs.reduce((a, b) => a + b);\n}\nfunction clamp(x, lo, hi) {\n return x < lo ? lo : x > hi ? hi : x;\n}\nmodule.exports = { sum, clamp };\n"
41
+ }
42
+ },
43
+ {
44
+ "n": 4,
45
+ "id": "04",
46
+ "type": "bugfix",
47
+ "file": "src/num.js",
48
+ "criterion": "Bug: sum([]) in src/num.js throws. sum([]) returns 0, and sum([1, 2, 3]) still returns 6.",
49
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { sum } = need('src/num.js');\nassert.strictEqual(sum([]), 0);\nassert.strictEqual(sum([1, 2, 3]), 6);\nassert.strictEqual(sum([-1.5]), -1.5);\n",
50
+ "solution": {
51
+ "src/num.js": "'use strict';\n/* num.js: small number helpers. */\nfunction sum(xs) {\n return xs.reduce((a, b) => a + b, 0);\n}\nmodule.exports = { sum };\n"
52
+ }
53
+ },
54
+ {
55
+ "n": 5,
56
+ "id": "05",
57
+ "type": "feature-slice",
58
+ "file": "src/list.js",
59
+ "criterion": "src/list.js exports chunk(xs, size): the items of xs in order, in arrays of size items; the last array may be shorter. chunk([1,2,3,4,5], 2) is [[1,2],[3,4],[5]]; chunk([], 3) is [].",
60
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { chunk } = need('src/list.js');\nassert.deepStrictEqual(chunk([1, 2, 3, 4, 5], 2), [[1, 2], [3, 4], [5]]);\nassert.deepStrictEqual(chunk([1, 2, 3], 3), [[1, 2, 3]]);\nassert.deepStrictEqual(chunk([], 3), []);\n",
61
+ "solution": {
62
+ "src/list.js": "'use strict';\n/* list.js: small array helpers. */\nfunction last(xs) {\n return xs[xs.length - 1];\n}\nfunction chunk(xs, size) {\n const out = [];\n for (let i = 0; i < xs.length; i += size) out.push(xs.slice(i, i + size));\n return out;\n}\nmodule.exports = { last, chunk };\n"
63
+ }
64
+ },
65
+ {
66
+ "n": 6,
67
+ "id": "06",
68
+ "type": "feature-slice",
69
+ "file": "src/list.js",
70
+ "criterion": "src/list.js exports uniqBy(xs, key): the items of xs in order, keeping only the first item for each value of key(item).",
71
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { uniqBy } = need('src/list.js');\nconst xs = [{ id: 1, v: 'a' }, { id: 2, v: 'b' }, { id: 1, v: 'c' }];\nassert.deepStrictEqual(uniqBy(xs, (x) => x.id), [{ id: 1, v: 'a' }, { id: 2, v: 'b' }]);\nassert.deepStrictEqual(uniqBy([3, 1, 3, 2, 1], (x) => x), [3, 1, 2]);\nassert.deepStrictEqual(uniqBy([], (x) => x), []);\n",
72
+ "solution": {
73
+ "src/list.js": "'use strict';\n/* list.js: small array helpers. */\nfunction last(xs) {\n return xs[xs.length - 1];\n}\nfunction uniqBy(xs, key) {\n const seen = new Set();\n return xs.filter((x) => { const k = key(x); if (seen.has(k)) return false; seen.add(k); return true; });\n}\nmodule.exports = { last, uniqBy };\n"
74
+ }
75
+ },
76
+ {
77
+ "n": 7,
78
+ "id": "07",
79
+ "type": "feature-slice",
80
+ "file": "src/date.js",
81
+ "criterion": "A new module src/date.js exports isoDay(date): the date as YYYY-MM-DD in UTC. isoDay(new Date(Date.UTC(2026, 0, 5, 23, 30))) is \"2026-01-05\".",
82
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { isoDay } = need('src/date.js');\nassert.strictEqual(isoDay(new Date(Date.UTC(2026, 0, 5, 23, 30))), '2026-01-05');\nassert.strictEqual(isoDay(new Date(Date.UTC(1999, 11, 31, 0, 0))), '1999-12-31');\n",
83
+ "solution": {
84
+ "src/date.js": "'use strict';\n/* date.js: small date helpers. */\nfunction isoDay(date) {\n return date.toISOString().slice(0, 10);\n}\nmodule.exports = { isoDay };\n"
85
+ }
86
+ },
87
+ {
88
+ "n": 8,
89
+ "id": "08",
90
+ "type": "feature-slice",
91
+ "file": "src/num.js",
92
+ "criterion": "src/num.js exports formatBytes(n), with 1024 bytes in a KB: below 1024 \"<n> B\"; else one decimal and the largest unit of KB, MB, GB that keeps the number at 1 or more. formatBytes(0) is \"0 B\", formatBytes(1536) is \"1.5 KB\", formatBytes(1048576) is \"1.0 MB\".",
93
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { formatBytes } = need('src/num.js');\nassert.strictEqual(formatBytes(0), '0 B');\nassert.strictEqual(formatBytes(1023), '1023 B');\nassert.strictEqual(formatBytes(1536), '1.5 KB');\nassert.strictEqual(formatBytes(1048576), '1.0 MB');\nassert.strictEqual(formatBytes(3 * 1024 ** 3), '3.0 GB');\n",
94
+ "solution": {
95
+ "src/num.js": "'use strict';\n/* num.js: small number helpers. */\nfunction sum(xs) {\n return xs.reduce((a, b) => a + b);\n}\nfunction formatBytes(n) {\n if (n < 1024) return n + ' B';\n const units = ['KB', 'MB', 'GB'];\n let v = n / 1024, i = 0;\n while (v >= 1024 && i < units.length - 1) { v /= 1024; i++; }\n return v.toFixed(1) + ' ' + units[i];\n}\nmodule.exports = { sum, formatBytes };\n"
96
+ }
97
+ },
98
+ {
99
+ "n": 9,
100
+ "id": "09",
101
+ "type": "bugfix",
102
+ "file": "src/text.js",
103
+ "criterion": "Bug: capitalize(\"\") in src/text.js throws. capitalize(\"\") returns \"\", and capitalize(\"pmos\") still returns \"Pmos\".",
104
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { capitalize } = need('src/text.js');\nassert.strictEqual(capitalize(''), '');\nassert.strictEqual(capitalize('pmos'), 'Pmos');\nassert.strictEqual(capitalize('a'), 'A');\n",
105
+ "solution": {
106
+ "src/text.js": "'use strict';\n/* text.js: small string helpers. */\nfunction capitalize(s) {\n return s ? s[0].toUpperCase() + s.slice(1) : '';\n}\nmodule.exports = { capitalize };\n"
107
+ }
108
+ },
109
+ {
110
+ "n": 10,
111
+ "id": "10",
112
+ "type": "feature-slice",
113
+ "file": "src/config.js",
114
+ "criterion": "A new module src/config.js exports parseEnvLine(line): for \"KEY=value\" it returns { key: \"KEY\", value: \"value\" }, with spaces around the key and value trimmed and one pair of surrounding double quotes taken off the value. A blank line or a line that starts with \"#\" returns null.",
115
+ "check": "'use strict';\n// Held-out check of the Builder benchmark. Never copied into the sandbox. Usage: node <this file> <product folder>; exit 0 = pass.\nconst assert = require('assert');\nconst path = require('path');\nconst dir = process.argv[2];\nconst need = (rel) => require(path.join(dir, rel));\nconst { parseEnvLine } = need('src/config.js');\nassert.deepStrictEqual(parseEnvLine('PORT=8080'), { key: 'PORT', value: '8080' });\nassert.deepStrictEqual(parseEnvLine(' NAME = \"PMOS bench\" '), { key: 'NAME', value: 'PMOS bench' });\nassert.deepStrictEqual(parseEnvLine('EMPTY='), { key: 'EMPTY', value: '' });\nassert.strictEqual(parseEnvLine(''), null);\nassert.strictEqual(parseEnvLine(' '), null);\nassert.strictEqual(parseEnvLine('# a comment'), null);\n",
116
+ "solution": {
117
+ "src/config.js": "'use strict';\n/* config.js: read one line of a .env file. */\nfunction parseEnvLine(line) {\n const t = String(line).trim();\n if (!t || t.startsWith('#')) return null;\n const i = t.indexOf('=');\n if (i < 0) return null;\n let value = t.slice(i + 1).trim();\n if (value.length >= 2 && value.startsWith('\"') && value.endsWith('\"')) value = value.slice(1, -1);\n return { key: t.slice(0, i).trim(), value };\n}\nmodule.exports = { parseEnvLine };\n"
118
+ }
119
+ }
120
+ ]
121
+ }
@@ -450,7 +450,29 @@ The Builder does these steps:
450
450
  5. PMOS opens the pull request by itself: it pushes only `pmos/<item>` and opens a draft pull request with `gh`. The push comes from PMOS, never from the Builder's run. Undo on the ✦ closes the pull request. When agents are off (`pmos ai off`), or the factory is back to propose-only after a revert, the proposal waits for your ✓. You can also run `pmos build open <item>` yourself.
451
451
  6. The product's `pmos-guardrail` check decides who merges (see below). Then `pmos verify-work` marks the item integrated.
452
452
 
453
- `pmos build status` lists every work item, its branch and whether its worktree is on this computer.
453
+ `pmos build status` lists every work item, its branch and whether its worktree is on this computer. It also shows how the last check ran: in the worktree, or in a sandbox with no network.
454
+
455
+ #### The check, the sandbox and the factory's identity
456
+
457
+ `pmos build check <item>` runs the item's check in its worktree. The command is `check.command` in `pmos/factory.json`, else the item's criterion when it is an `assertion`. To run it in a container with no network, set `PMOS_BUILD_SANDBOX=docker` (or `podman`) and name `check.image` in `pmos/factory.json`. A declared `check.install` step runs first with the network, only when the change touches no dependency or lock file. With no sandbox the check runs in the worktree, and only you can run it there: a Builder run is refused.
458
+
459
+ By default factory commits use this repository's git identity, and pull requests use your gh login. To give the factory its own identity, add `"identity": { "name": "…", "email": "…", "token_env": "PMOS_FACTORY_GH_TOKEN" }` to `pmos/factory.json`. Factory commits then have the bot as author and you as co-author. PMOS gives gh the token from that variable for its own calls. Never put the token in the file. `pmos/AGENTS.md` says how to make a narrow token. `pmos build policy <item>` says which identity is in use.
460
+
461
+ #### The product's checks and the CI-fix rounds
462
+
463
+ Declare the product's checks in `pmos/factory.json`. Each name is a check, and each value is the command that runs it:
464
+
465
+ ```json
466
+ { "checks": { "test": "npm test", "lint": "npm run lint", "secrets": "gitleaks detect --no-git" },
467
+ "checks_timeout_minutes": 15 }
468
+ ```
469
+
470
+ - `pmos build check <item>` runs these commands in the item's worktree. The Builder can run them, and no other command.
471
+ - `propose` runs them too. A failing check stops the proposal, and nothing is committed. When all of them pass, the evidence is their exit codes, which PMOS writes. `--evidence` is then not needed. The output of each run is in `factory-checks.jsonl` in the state folder.
472
+ - The checks run with no network and with no tokens in their environment. PMOS uses `unshare` on Linux and `sandbox-exec` on macOS. When neither works on this computer, PMOS does not run the checks, and `propose` says why.
473
+ - PMOS reads the checks from your checkout, never from the Builder's worktree. The Builder cannot change `pmos/factory.json`.
474
+
475
+ When the product's CI fails on the factory's open pull request, PMOS starts the Builder again on the same branch (`pmos build fix <item>`). It does this at most 2 times for one item, and only inside the Builder's daily budget. PMOS reads the CI result with `gh` in its own process, never in the Builder's run. After 2 fix rounds, a third failure marks the item blocked, and Today shows it with the reason.
454
476
 
455
477
  #### Who merges: the guardrail
456
478
 
@@ -458,12 +480,25 @@ PMOS never merges and the Builder holds no merge right (D108). The product repos
458
480
 
459
481
  For each pull request on a `pmos/` branch, the check runs the default branch's copy of `pmos/scripts/factory-guardrail.js`. It reads the pull request's changes and never runs its code. The answer is one of these:
460
482
 
461
- - **AUTO.** The item is verified in the default branch's records, every changed file is inside the item's declared scope, the change reads its flag (or the item has no user-facing effect), and no trigger fires. The check marks the pull request ready and turns on auto-merge. GitHub merges when every required check is green.
483
+ - **AUTO.** The item is verified in the default branch's records, every changed file is inside the item's declared scope, the change reads its flag (or the item has no user-facing effect), no trigger fires, and the independent review passed (the `pmos-review` check is green on this head). The check marks the pull request ready and turns on auto-merge. GitHub merges when every required check is green.
462
484
  - **HUMAN.** The check names every reason and turns auto-merge off. You merge.
463
485
 
464
486
  These triggers always make the answer HUMAN: migrations or data deletion; auth, permissions, payments, personal data or secrets; CI, gates, the guardrail or PMOS records; a new dependency; a public API or contract; anything sent outward; a new agent path; a changed existing test, test configuration or the item's own check; an item that failed before; a revert on the default branch in the last 14 days; a folder untouched for 90 days. When agents are switched off (`pmos ai off`) or the factory is back to propose-only after a revert, PMOS writes `PMOS-Merge: human` in the pull request, and the check reads HUMAN. `pmos ai off` also reaches pull requests that are already open: PMOS turns each open pull request on a `pmos/` branch back into a draft, which drops GitHub's auto-merge, and adds `PMOS-Merge: human` to its description. The server does the same when the factory goes back to propose-only. To stop one merge yourself, add that line to the pull request's description. A pull request from a fork always reads HUMAN.
465
487
 
466
- `pmos build policy <item>` shows the answer on this computer before the check runs.
488
+ `pmos build policy <item>` shows the answer on this computer before the check runs. It does not include the review.
489
+
490
+ #### The independent review: pmos-review
491
+
492
+ Before a factory pull request merges by itself, PMOS reviews it in three separate parts:
493
+
494
+ 1. **The cold check.** Copy `pmos/templates/pmos-review-check.yml` to `.github/workflows/`. On each `pmos/` pull request it runs the item's declared check on a fresh checkout of the head, with a read-only token. Add your own setup steps (install, build) before the check. The pull request's code never runs on your computer.
495
+ 2. **The reading.** PMOS starts a separate read-only run that reads the diff against the item's done test and records PASS or FAIL. It is never the Builder's run.
496
+ 3. **The post.** PMOS posts the result as the commit status `pmos-review` on that commit. A red cold check is a FAIL, with no model. A PASS waits as pending until the cold check is green.
497
+
498
+ No `pmos-review`, a pending one or a failed one makes the guardrail answer HUMAN. A new push has no review, so it waits for the next one. Each FAIL counts against the factory: two in a row put it back to propose-only for 7 days.
499
+
500
+ - `pmos build review <item>` shows the verdict for the branch's head and posts it again.
501
+ - `pmos build reviewed <item> --sha <commit> --verdict PASS|FAIL --why "<one line>"` is the review run's one write. It refuses a role run, another item or commit, and PASS when the cold check failed.
467
502
 
468
503
  A work item says what the guardrail reads when it is declared: `node pmos/scripts/work-item.js declare <initiative> … --scope src/login/ --flag otp_login --metric login_errors --budget 0.02`. Use `--no-user-facing` instead of a flag for a change users cannot see, and `--kr` for an item that moves a key result.
469
504
 
@@ -487,16 +522,48 @@ PMOS uses your flag service through the commands in `pmos/factory.json`:
487
522
 
488
523
  `pmos ai off` stops the rollout too.
489
524
 
525
+ #### The factory's numbers
526
+
527
+ After each Builder or reviewer run, PMOS writes one trace for the work item to `pmos/state/factory-traces.jsonl`: the turns, the names of the tools it called and how often, the files it wrote, the tokens and the cost. A trace holds no prompt, no answer and no command.
528
+
529
+ - `pmos build metrics [--days <n>]` shows the last 30 days (or n days): items claimed, how many merged, pull requests auto and human, reverts, the median time from claim to merge, the cost per merged pull request and the human corrections per item (Undo, a human guardrail verdict, your own commits on `pmos/<item>`).
530
+
531
+ With no factory run in the window, the command prints nothing.
532
+
533
+ #### Order, more Builders, and the integrator
534
+
535
+ A work item can wait for other items. Declare it with `--depends-on <item,…>`. Each item it names must be declared first. `pmos build next` offers it only after each of those items is integrated, and `pmos build claim` refuses it before then.
536
+
537
+ One Builder works at a time by default. To let more Builders work, add `builders` to `pmos/factory.json`:
538
+
539
+ ```json
540
+ { "builders": { "max_parallel": 2, "per_day": 6 } }
541
+ ```
542
+
543
+ `max_parallel` is how many items Builders hold at once (1 to 20, default 1). `per_day` is how many claims they make in a day (1 to 100, default 2). A claim past either limit is refused. Before you set `builders`, only `max_parallel` is checked.
544
+
545
+ When two pull requests change the same file, the first one merges and the second falls behind. PMOS brings it up to date: `pmos build integrate` rebases the branch onto the default branch, and the server does this by itself every 10 minutes. PMOS turns the pull request back into a draft and pushes only `pmos/<item>`, with a lease. The checks run again. If the rebase conflicts, the item goes back to the Builder once to resolve the conflict. If it conflicts again, PMOS adds `PMOS-Merge: human` to the pull request, and you resolve it.
546
+
490
547
  The command refuses these cases:
491
548
 
492
549
  - The repository has no git identity of its own. Set it once with `pmos git-identity set`. PMOS never guesses who commits.
493
550
  - The change touches a PMOS record, CI or the agent rules: `pmos/`, `.github/`, `planning/initiatives/`, `CLAUDE.md`, `AGENTS.md`.
494
- - `propose` without `--evidence`. The check comes before the pull request.
551
+ - `propose` without `--evidence`, when the product declares no checks. The check comes before the pull request.
495
552
  - `open` inside a role run. PMOS or you open the pull request, never the Builder's run.
496
553
  - `open` without `gh`. The branch is pushed, and the command tells you to open the pull request on your Git host.
497
554
 
498
555
  PMOS never pushes to the default branch and never merges. Every command takes `--json` and `--root <dir>`.
499
556
 
557
+ #### The Builder benchmark
558
+
559
+ `pmos build bench [--model <id>]` measures the Builder. PMOS copies a small product with 10 work items to a temporary folder, and the Builder builds each item in its own worktree, with the same steps and tools as in your product. A held-out check that the Builder never sees scores each proposed commit. PMOS adds one line to `planning/runs/builder-bench.jsonl` with the model, the harness version, the pass rate, the cost and the time.
560
+
561
+ - Run it after you change the model, and after a PMOS update that changes the Builder (its prompt, its tools or `pmos build`).
562
+ - `pmos build bench --report` shows the pass rate, cost and time per model and harness version. A new model or harness starts a new line. It never takes the old pass rate.
563
+ - `--only 1,4` runs some items. `--keep` keeps the sandbox to look at.
564
+
565
+ The benchmark needs a signed-in agent CLI. It never pushes and never opens a pull request. A role run cannot start it.
566
+
500
567
  ### pmos jira
501
568
 
502
569
  [Jira tickets](jira.md) explains each step with its examples.
@@ -318,7 +318,7 @@ To stop taking screenshots, clear **Capture the shared screen** in the settings.
318
318
 
319
319
  While a meeting records, the recording tab shows the Now panel. With a shared screen, it is the card at the right. In the room (microphone only), it fills the page. The panel has no tabs. A part with nothing to show is not shown.
320
320
 
321
- - **To cover** lists the topics from the prep. A check mark shows a topic that is done, with its time. The blue dot shows the topic now. The header shows the minutes left until the meeting ends. In the room, the topic now is large, with "4 min on it · 22 min left", and chips show the done topics and the next one.
321
+ - **To cover** shows the meeting's agenda as 3 to 5 topics. At prep, PMOS merges the invite's agenda lines into about one topic per 8 to 12 minutes, by subject. Each line stays under its topic. A short invite (for example 4 lines in 30 minutes) is not merged. Press the undo icon to undo the merge: every line of the invite is its own topic again, and PMOS does not merge that invite again. The header shows the end time, the minutes left, and the minutes planned for what is left. Each topic shows minutes used of minutes planned, in amber when it is over. The minutes of a topic are shared out by how many lines it holds. A mark shows each line: a check mark for settled (a decision was written while it was on), a ring for talked about but still open, a dot for not yet, and **Skipped**. The open topic holds the **Now** card: "line N of M", the minutes on it, and who moved there. A line PMOS adds during the talk goes under a topic, so the number of topics does not grow. There is no Change topic button: PMOS follows the talk. If the line now is wrong, press **Not this one**. The line before comes back on, and PMOS does not move to the refused line again for 5 minutes. The Viewer's **Agenda** shows the same topics, the same way.
322
322
  - **Raise now** shows at most 2 prompts from PMOS:
323
323
  - **Check**: the shared screen and the talk do not agree, for example a date on a slide.
324
324
  - **Follow-up**: an action from the last meeting is still open, and nobody raised it.