create-pmos 0.575.0 → 0.577.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +27 -27
- package/payload/AGENTS.md +35 -2
- package/payload/KIT-VERSION +2 -2
- package/payload/okf/core/templates/agent-eval-set-template.md +65 -0
- package/payload/okf/core/templates/index.md +1 -0
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/scripts/agent-eval-set.js +85 -0
- package/payload/scripts/factory-guardrail.js +50 -8
- package/payload/scripts/work-item.js +49 -3
- package/payload/scripts/workflow-state.js +28 -3
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/payload/templates/pmos-guardrail.yml +38 -10
- package/payload/templates/pmos-review-check.yml +59 -0
- package/workspace/changelog.json +26 -0
- package/workspace/fixtures/builder-bench.json +121 -0
- package/workspace/guide/cli.md +71 -4
- package/workspace/guide/settings-and-switches.md +7 -0
- package/workspace/lib/agent-team.js +5 -2
- package/workspace/lib/build-cli.js +119 -7
- package/workspace/lib/build-engine.js +106 -25
- package/workspace/lib/builder-bench.js +267 -0
- package/workspace/lib/engine/agent-eval-set.js +85 -0
- package/workspace/lib/engine/workflow-state.js +28 -3
- package/workspace/lib/factory-checks.js +117 -0
- package/workspace/lib/factory-ci.js +151 -0
- package/workspace/lib/factory-fleet.js +263 -0
- package/workspace/lib/factory-identity.js +182 -0
- package/workspace/lib/factory-lessons.js +183 -0
- package/workspace/lib/factory-needs.js +48 -0
- package/workspace/lib/factory-review.js +241 -0
- package/workspace/lib/factory-rollout.js +56 -10
- package/workspace/lib/factory-traces.js +229 -0
- package/workspace/lib/headless.js +11 -2
- package/workspace/lib/job-graph.js +9 -1
- package/workspace/lib/needs-providers.js +1 -0
- package/workspace/lib/pmos-verbs.js +1 -1
- package/workspace/lib/project-onboard.js +1 -1
- package/workspace/lib/proposals.js +3 -1
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-factory-metrics.js +41 -0
- package/workspace/lib/routes-proposals.js +9 -1
- package/workspace/lib/signals.js +272 -0
- package/workspace/lib/team-cli.js +2 -2
- package/workspace/lib/team-runs.js +13 -3
- package/workspace/lib/vendor/scripts/agent-eval-set.js +85 -0
- package/workspace/lib/vendor/scripts/workflow-state.js +28 -3
- package/workspace/lib/verify-runs.js +89 -1
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/ini-props.js +1 -1
- package/workspace/server.js +4 -0
- package/workspace/test-files.json +2 -1
- package/workspace/test-lists/adlc-identity.json +9 -0
- package/workspace/test-lists/build-engine.json +5 -3
- package/workspace/test-lists/builder-bench.json +9 -0
- package/workspace/test-lists/factory-checks.json +9 -0
- package/workspace/test-lists/factory-fleet.json +9 -0
- package/workspace/test-lists/factory-lessons.json +9 -0
- package/workspace/test-lists/factory-real-run.json +9 -0
- package/workspace/test-lists/factory-run-traces.json +9 -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
|
-
|
|
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
|
-
|
|
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-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-17T01:37:13Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/payload/state/log.md
CHANGED
|
@@ -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:
|
|
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: ${{
|
|
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: ${{
|
|
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
|
-
|
|
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"
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.577.0",
|
|
4
|
+
"at": "2026-11-17T01:37:16.629Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1310,
|
|
9
|
+
"t": "Improvement signals ledger, 183 feedback items, honest shallow clone, verifier that runs anywhere",
|
|
10
|
+
"s": "Improvement signals ledger, 183 feedback items, honest shallow clone, verifier that runs anywhere",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"v": "0.576.0",
|
|
17
|
+
"at": "2026-11-16T11:57:06.812Z",
|
|
18
|
+
"f": 4,
|
|
19
|
+
"prs": [
|
|
20
|
+
{
|
|
21
|
+
"n": 1308,
|
|
22
|
+
"t": "Close the nine ADLC agent-factory gaps",
|
|
23
|
+
"s": "Close the nine ADLC agent-factory gaps",
|
|
24
|
+
"k": "new"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
2
28
|
{
|
|
3
29
|
"v": "0.575.0",
|
|
4
30
|
"at": "2026-11-16T11:43:16.900Z",
|
|
@@ -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
|
+
}
|
package/workspace/guide/cli.md
CHANGED
|
@@ -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),
|
|
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
|
|
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.
|
|
@@ -98,9 +98,13 @@ An "off" switch accepts `off`, `0`, `false` or `no` unless the row says a differ
|
|
|
98
98
|
| `PMOS_AI` | `off` turns every AI job off (the kill switch of [what agents may do](agent-capabilities.md)). | on | `pmos ai off` (the `ai.on` setting) |
|
|
99
99
|
| `PMOS_AI_<JOB>` | `off` turns one AI job off. The names are `PMOS_AI_PAST_REPEAT`, `PMOS_AI_DECISION_MEMORY`, `PMOS_AI_OUTCOMES`, `PMOS_AI_DESCRIPTIONS`, `PMOS_AI_DRIFT`, `PMOS_AI_REHEARSE`, `PMOS_AI_NEXT_PROMPT`, `PMOS_AI_SHARPEN_PROMPT` and `PMOS_AI_IDLE_LAB`. | on | `pmos ai off <job>` (the `ai.off` setting) |
|
|
100
100
|
| `PMOS_AUTONOMY` | `off` stops every change PMOS applies by itself (D106) and every goal loop; proposals still wait for your ✓. | on | `pmos ai off` |
|
|
101
|
+
| `PMOS_BUILD_SANDBOX` | `docker` or `podman` runs `pmos build check` in a container with no network (the image is `check.image` in `pmos/factory.json`). Without it the check runs in the worktree, and only you can run it. | off | — |
|
|
102
|
+
| `PMOS_FACTORY_GH_TOKEN` | The factory's own GitHub token, when `pmos/factory.json` names it in `identity.token_env`. The name must start with `PMOS_FACTORY_`. PMOS gives it to gh for its own calls and removes it from every agent run. Never put it in a file. | not set: your gh login | — |
|
|
101
103
|
| `PMOS_VERIFY` | `off` stops the verifier that checks each merged pull request. | on | `pmos ai off verify` |
|
|
102
104
|
| `PMOS_VERIFY_CHANGES` | `off` stops the check of the changes PMOS made by itself. A failed check sends that kind of change back to asking. | on | `pmos ai off verify` |
|
|
105
|
+
| `PMOS_SIGNALS` | `off` stops the hourly harvest of improvement signals (feedback, Undo, reverts, verifier failures) into the signals ledger. | on | `PMOS_SIGNALS=off` |
|
|
103
106
|
| `PMOS_CHECK_REF`, `PMOS_CHECK_DIR` | Set by PMOS for one check run only. They name the change it checks and the ledger it writes to. Do not set them yourself. | — | — |
|
|
107
|
+
| `PMOS_FACTORY_REVIEW` | `off` stops the independent review of factory pull requests. With no review, the guardrail reads HUMAN and you merge. | on | `pmos ai off verify` |
|
|
104
108
|
| `PMOS_STORY_SEED` | `off` stops PMOS from writing the first story so far for a product that has none. | on | `pmos ai off story-seed` |
|
|
105
109
|
| `PMOS_DRIVER` | `off` starts no [Initiative Driver](initiatives-and-next-steps.md) run and no horizon scan. | on | — |
|
|
106
110
|
| `PMOS_CHECKER` | `off` stops the check of the Driver's drafts. | on | — |
|
|
@@ -137,6 +141,7 @@ An "off" switch accepts `off`, `0`, `false` or `no` unless the row says a differ
|
|
|
137
141
|
| `PMOS_LEAN_JOBS` | How background runs start. `off` starts every run with all tools, skills and settings. `all` also starts the runs that read your connectors lean. By default a run that reads no connector starts lean, with only its own tools. | lean for runs with no connector | — |
|
|
138
142
|
| `PMOS_RUN_MEMORY` | `off` stops adding the repository's curated memory (what PMOS remembers about you and the product) to each background run, and stops each team role's notebook (what became of its earlier work). A web run never gets it. | on | — |
|
|
139
143
|
| `PMOS_CORRECTION_MEMORY` | `off` stops your ✕ reasons from becoming memory. By default a reason of 12 characters or more is remembered as one unconfirmed entry for 30 days, at most 6 at once. | on | — |
|
|
144
|
+
| `PMOS_FACTORY_LESSONS` | `off` stops factory lessons. By default each factory setback (a failed check, a revert or rollback, a pull request the guardrail sent to a person, your Undo of one, a reviewer FAIL) becomes one Lessons line on its initiative and one line in the Builder's notebook. The Builder prompt carries the last 5. The same setback 3 times in 14 days files one proposal, "Change the factory harness", for your ✓. | on | — |
|
|
140
145
|
| `PMOS_CLAUDE_HOME` | The one folder where PMOS looks for PMOS transcripts. | the PMOS config folders | — |
|
|
141
146
|
| `PMOS_HEADLESS_TIMEOUT_MS` | The longest time a background run may take. | 20 minutes | — |
|
|
142
147
|
|
|
@@ -257,7 +262,9 @@ PMOS sets these in the environment of a terminal session or a background run. Do
|
|
|
257
262
|
| `PMOS_SHARE_PARENT` | The process id of the workspace server, so the share server stops with it. | none | — |
|
|
258
263
|
| `PMOS_AI_RUN` | Set inside an AI run, so the run cannot change its own switch. | none | — |
|
|
259
264
|
| `PMOS_VERIFY_RUN` | Set inside a verifier run: the one run its verdict may be recorded for, never the builder's own session. | none | — |
|
|
265
|
+
| `PMOS_REVIEW_RUN` | Set inside a pre-merge review run: the one work item and commit (`<item>@<sha>`) its verdict may be recorded for. Never the Builder's run. | none | — |
|
|
260
266
|
| `PMOS_BUILD_DIR` | The folder where `pmos build claim` makes each work item's worktree, outside the repository. | `~/.pmos/build` | — |
|
|
267
|
+
| `PMOS_CHECK` | Set to `1` inside each product check that `pmos build check` and `pmos build propose` run in a work item's worktree, with no network. A check can read it. | none | — |
|
|
261
268
|
| `PMOS_TEAM_FILE`, `PMOS_TEAM_ROOT`, `PMOS_TEAM_WS`, `PMOS_TEAM_ROLE`, `PMOS_TEAM_RUN`, `PMOS_TEAM_INI`, `PMOS_TEAM_MODE` | Set inside a role agent's run: its ledger, product folder, workspace, role, run, initiative, and whether it proposes or applies (`auto`). | none | — |
|
|
262
269
|
| `PMOS_GRILL_FILE`, `PMOS_GRILL_LOG`, `PMOS_GRILL_ROOT`, `PMOS_GRILL_BOARD`, `PMOS_GRILL_INI`, `PMOS_GRILL_RUN`, `PMOS_GRILL_BUDGET`, `PMOS_GRILL_WS` | Pin a grill run to its ledger, log, repository, board, initiative, run id and budget. No command reads `PMOS_GRILL_WS`. | none | — |
|
|
263
270
|
| `PMOS_PROPOSE_FILE`, `PMOS_PROPOSE_BOARD`, `PMOS_PROPOSE_INI`, `PMOS_PROPOSE_RUN`, `PMOS_PROPOSE_WS` | Pin a proposal run to its ledger, board, initiative and run id. No command reads `PMOS_PROPOSE_WS`. | none | — |
|
|
@@ -105,9 +105,12 @@ const TEAM = Object.freeze({
|
|
|
105
105
|
* a dispatch elsewhere) and only when dispatched. Class C: it claims a declared work item, builds it in a worktree of its own, commits and
|
|
106
106
|
* FILES "Open a draft pull request" under the ✦ (lib/build-engine.js). The push and the PR wait for the PM's ✓; it holds no push, no gh and
|
|
107
107
|
* no merge (the lethal-trifecta audit in kit/AGENTS.md). It writes no repository path of the PM's checkout: its Write and Edit reach its
|
|
108
|
-
* worktrees only (toolsOf).
|
|
108
|
+
* worktrees only (toolsOf). `pmos build check` (ADLC P1) runs its item's declared check only in a container with --network none;
|
|
109
|
+
* outside a sandbox build-engine check() refuses a role run. */
|
|
109
110
|
build: role('build', { cls: 'C', runs: true, skills: ['builder'], budget: 2,
|
|
110
|
-
|
|
111
|
+
// factory-builder-inner-loop: `check` runs exactly the checks the product declares in pmos/factory.json, in its worktree, with no
|
|
112
|
+
// network (lib/factory-checks.js); `fix` re-claims a verified item for a CI-fix round on its own branch. Neither pushes or calls gh.
|
|
113
|
+
owns: { paths: [], verbs: ['pmos build next', 'pmos build claim', 'pmos build propose', 'pmos build status', 'pmos build check', 'pmos build fix'] }, reads: ['planning/prd/', 'planning/evals/', 'the work items'],
|
|
111
114
|
triggers: [{ on: 'asked' }], connectors: [],
|
|
112
115
|
what: 'draft pull requests for declared work items (the factory, D65: it files them for your ✓ and never merges)' }),
|
|
113
116
|
});
|