@magnusekdahl/parallix 1.0.5 → 1.1.1

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 (75) hide show
  1. package/README.md +13 -17
  2. package/config/agents.json +3 -3
  3. package/config/workflow.config.schema.json +13 -1
  4. package/docs/adr/0047-per-mission-change-size-budget.md +161 -0
  5. package/docs/adr/index.md +1 -0
  6. package/docs/agents.md +8 -8
  7. package/docs/authority-reference.md +2 -2
  8. package/docs/doc-standards.md +89 -0
  9. package/docs/forgejo-setup.md +28 -4
  10. package/docs/migration/task-classification.md +1 -1
  11. package/docs/operator-setup.md +1 -1
  12. package/docs/readme-rewrite-benchmark.md +1 -1
  13. package/docs/use-cases.md +46 -2
  14. package/examples/README.md +1 -1
  15. package/index.js +7 -0
  16. package/lib/agents/agents.js +163 -110
  17. package/lib/agents/claude-telemetry.js +14 -10
  18. package/lib/agents/claude.js +32 -11
  19. package/lib/agents/codex-telemetry.js +32 -19
  20. package/lib/agents/codex.js +36 -11
  21. package/lib/agents/limit-hit.js +43 -26
  22. package/lib/agents/mistral-telemetry.js +1 -1
  23. package/lib/agents/mistral.js +13 -3
  24. package/lib/agents/opencode-export.js +11 -5
  25. package/lib/agents/opencode-telemetry.js +103 -108
  26. package/lib/agents/opencode.js +102 -31
  27. package/lib/agents/stage-telemetry.js +3 -7
  28. package/lib/commands/active.js +141 -95
  29. package/lib/commands/checkpoint.js +3 -1
  30. package/lib/commands/config.js +5 -3
  31. package/lib/commands/coverage-gate.js +17 -10
  32. package/lib/commands/diff.js +11 -5
  33. package/lib/commands/draft.js +128 -77
  34. package/lib/commands/handoff.js +159 -65
  35. package/lib/commands/integrate.js +313 -197
  36. package/lib/commands/mission-start.js +40 -35
  37. package/lib/commands/rebase.js +45 -26
  38. package/lib/commands/repair-handoff.js +21 -18
  39. package/lib/commands/resolve-conflict.js +5 -2
  40. package/lib/commands/review.js +1 -0
  41. package/lib/commands/setup-review.js +1 -0
  42. package/lib/commands/stats-backfill.js +50 -41
  43. package/lib/commands/stats.js +658 -207
  44. package/lib/commands/status.js +33 -28
  45. package/lib/core/fmt.js +65 -18
  46. package/lib/core/git.js +7 -5
  47. package/lib/core/gitignore.js +6 -4
  48. package/lib/core/mission-utils.js +161 -88
  49. package/lib/core/persistent-data-migration.js +63 -23
  50. package/lib/core/product-config.js +44 -23
  51. package/lib/core/runtime-matrix.js +15 -2
  52. package/lib/core/spawn-tee.js +40 -13
  53. package/lib/core/state-map.js +32 -13
  54. package/lib/core/storage.js +19 -5
  55. package/lib/core/subagent-limit.js +28 -0
  56. package/lib/core/verification.js +29 -12
  57. package/lib/review/rebase.js +11 -3
  58. package/lib/review/review-adapter.js +93 -6
  59. package/lib/review/review-artifacts.js +89 -23
  60. package/lib/review/review-commands.js +139 -45
  61. package/lib/review/review-events.js +103 -52
  62. package/lib/review/review-loop.js +119 -86
  63. package/lib/review/review-polling.js +25 -5
  64. package/lib/review/review-prompts.js +37 -6
  65. package/lib/review/review-state.js +39 -15
  66. package/lib/tools/backlog.js +162 -71
  67. package/lib/tools/forgejo.js +343 -134
  68. package/lib/tools/gatekeeper.js +15 -0
  69. package/lib/tools/redgreen.js +220 -0
  70. package/lib/tools/sessions.js +12 -5
  71. package/lib/tools/setup-review.js +170 -70
  72. package/package.json +11 -3
  73. package/prompts/draft.md +6 -0
  74. package/prompts/review.md +8 -62
  75. package/tools/setup-forgejo-docker.sh +5 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Parallix is a local-first Git workflow CLI for running AI coding agents in isolated, reviewable missions instead of letting one long-lived agent session mutate your main checkout.**
4
4
 
5
- It is for engineers who already use Git and terminal-first coding agents such as Claude Code, Codex, OpenCode/Qwen, and Vibe/Mistral, and want branch isolation, resumable checkpoints, agent-family failover, and a forced review step without building that harness by hand.
5
+ It is for engineers who already use Git and terminal-first coding agents such as Claude Code, Codex, OpenCode/custom, and Vibe/Mistral, and want branch isolation, resumable checkpoints, agent-family failover, and a forced review step without building that harness by hand.
6
6
 
7
7
  It wraps your existing AI coding workflow without replacing it: each mission gets its own branch and worktree, long runs checkpoint to markdown, review is a separate phase, and integration still goes through your repo's own verification command. A human still chooses the mission, launches each phase, reads the output, and decides what lands.
8
8
 
@@ -12,11 +12,10 @@ It wraps your existing AI coding workflow without replacing it: each mission get
12
12
  npm install -g @magnusekdahl/parallix
13
13
  px draft "create a hello world program"
14
14
  px active
15
- px review
16
15
  px integrate
17
16
  ```
18
17
 
19
- That path shows the whole value: isolate the work on its own branch and worktree, let an agent execute it with checkpoints, run a separate review phase, and only then integrate it back.
18
+ That path shows the whole value: isolate the work on its own branch and worktree, let an agent execute it with checkpoints, autorun a separate review phase, and only then integrate it back when you are satisfied with the result.
20
19
 
21
20
  ## Why Parallix?
22
21
 
@@ -33,14 +32,14 @@ Parallix is a mission-based development workflow that addresses each of these di
33
32
 
34
33
  Each capability below is tied to a use case in [`docs/use-cases.md`](docs/use-cases.md), with the confidence level (Confirmed / Partial) carried through honestly.
35
34
 
36
- - **Run several AI coding agents on one repo without clobbering each other** *(UC-1 — Confirmed mechanic).* Every mission gets its own `mission/<slug>` branch and its own sibling git worktree (`../<repo>-<slug>`) automatically, so N agents make progress independently and each lands by squash-merge.
35
+ - **Run several AI coding agents on one repo without clobbering each other**. Every mission gets its own `mission/<slug>` branch and its own sibling git worktree (`../<repo>-<slug>`) automatically, so N agents make progress independently and each lands by squash-merge.
37
36
  - **Fail over automatically when an agent hits its usage limit** *(UC-2 — Confirmed).* Per-family limit messages are pattern-detected; the agent family is written to a timed blocklist and the run retries with the next eligible, unblocked family. Only when all are exhausted does it fail loudly. Agent usage limits stop a single session; they don't have to stop the mission.
38
- - **Resume a long mission deterministically** *(UC-3 — Confirmed).* Every checkpoint runs the gate, commits a checkpoint document with a literal `Next action:` line, and pushes it — so a later session or a different agent resumes from a written instruction, not a guess.
37
+ - **Resume a long mission deterministically**. Every checkpoint runs the gate, commits a checkpoint document with a literal `Next action:` line, and pushes it — so a later session or a different agent resumes from a written instruction, not a guess.
39
38
  - **Force a second, preferentially-different coding agent review before merge** *(UC-4 — Partial).* Review is a separate step whose reviewer selection excludes the implementer to prefer a different agent family, and a self-approval is code-blocked at the provider. It falls back to the same family when no other agent is runnable, so this forces a second review *attempt* — it does not guarantee a different reviewer.
40
- - **Publish work to a Forgejo reviewer surface without making Forgejo your branch authority** *(Confirmed mechanic).* When the review provider is enabled, Parallix syncs the local baseline to a dedicated `review` remote and opens or updates the PR there; if Forgejo is disabled, the branch/worktree flow still runs locally.
41
- - **Use a repo-local Graphify knowledge graph for smaller codebase context pulls** *(Confirmed mechanic, optional, unproven payoff).* In repositories where the operator has already installed the Graphify skill, the workflow keeps `graphify-out/` isolated per worktree and refreshes it during review/integration, while the installed agent guidance steers codebase questions toward `graphify query` / `path` / `explain` before full reports or raw grep. That should reduce context bloat, but this repo does not currently claim a measured token-usage reduction.
42
- - **Keep your existing verification gate instead of agent self-reporting** *(UC-5 — Confirmed).* The gate is a configured shell command with a no-op default: declare your existing `make` / `npm` / script command in `workflow.config.json` and it runs verbatim; declare nothing and verification is a documented no-op pass, not an invented gate.
43
- - **See which agent family actually pays off across every repo one runtime drives** *(UC-6 — Partial).* A single operator-owned `stats.csv` accumulates per-agent usage telemetry across repositories. Token-cost comparison is complete today only for the families with structured telemetry (codex, claude, opencode/qwen); vibe/mistral record honest zeros by design.
39
+ - **Publish work to a Forgejo reviewer surface without making Forgejo your branch authority**. When the review provider is enabled, Parallix syncs the local baseline to a dedicated `review` remote and opens or updates the PR there; if Forgejo is disabled, the branch/worktree flow still runs locally.
40
+ - **Use a repo-local Graphify knowledge graph for smaller codebase context pulls**. In repositories where the operator has already installed the Graphify skill, the workflow keeps `graphify-out/` isolated per worktree and refreshes it during review/integration, while the installed agent guidance steers codebase questions toward `graphify query` / `path` / `explain` before full reports or raw grep. That reduces token-usage.
41
+ - **Keep your existing verification gate instead of agent self-reporting**. The gate is a configured shell command with a no-op default: declare your existing `make` / `npm` / script command in `workflow.config.json` and it runs verbatim; declare nothing and verification is a documented no-op pass, not an invented gate.
42
+ - **See which agent family actually pays off across every repo one runtime drives** *(UC-6 — Partial).* A single operator-owned `stats.csv` accumulates per-agent usage telemetry across repositories. Token-cost comparison is complete today only for the families with structured telemetry (codex, claude, opencode/local AI/custom); vibe/mistral record honest zeros by design.
44
43
 
45
44
  ## The core workflow
46
45
 
@@ -62,14 +61,12 @@ Install from the public npm registry and run a complete mission:
62
61
 
63
62
  ```sh
64
63
  npm install -g @magnusekdahl/parallix
65
- px --version
66
64
  px draft "hello world"
67
65
  px active
68
- px review
69
66
  px integrate
70
67
  ```
71
68
 
72
- `px draft` creates the mission branch, sibling worktree, mission file, and task record. Then `cd` into the mission worktree and run `px active`, `px review`, and `px integrate` there with no slug; the CLI infers the mission from the current branch/worktree.
69
+ `px draft` creates the mission branch, sibling worktree, mission file, and task record. Then `cd` into the mission worktree and run `px active` and `px integrate` there with no slug; the CLI infers the mission from the current branch/worktree.
73
70
 
74
71
  Other draft entry points are available when you need them:
75
72
 
@@ -145,7 +142,6 @@ px active task-042
145
142
  # A second, preferentially-different agent reviews <main>..HEAD.
146
143
  # If Forgejo review is enabled, the PR is published to the dedicated
147
144
  # review surface; a self-approval by the implementing agent is blocked.
148
- px review task-042
149
145
 
150
146
  # Land it: runs configured integration gates, squash-merges to
151
147
  # the primary branch, updates board state, removes the branch
@@ -165,7 +161,7 @@ The full evidence-backed inventory is in [`docs/use-cases.md`](docs/use-cases.md
165
161
 
166
162
  ## What Parallix is not
167
163
 
168
- - **Not a model and not an AI coding agent.** It does not generate code itself. It coordinates the agents and models you already use (Claude Code, Codex, OpenCode/Qwen, and Vibe/Mistral).
164
+ - **Not a model and not an AI coding agent.** It does not generate code itself. It coordinates the agents and models you already use (Claude Code, Codex, OpenCode/custom, and Vibe/Mistral).
169
165
  - **Not an IDE or an editor plugin.** It is a CLI workflow harness around Git and your existing toolchain — there is no UI, no autocomplete, no inline suggestions.
170
166
  - **Not a magic autonomous engineer.** This is a human-in-the-loop workflow. Nothing merges itself, and the safe operating model is that a human decides what to queue, when to run `px active`, how to respond to review findings, and whether `px integrate` should happen at all.
171
167
  - **Not a guaranteed throughput multiplier.** The observed gain varies with context. In the data we have, it ranges from roughly **+57%** on strict user-value output to about **+1,280%** on total completed-mission throughput in a later productized setup. Those are both real observations, but they are different mission-output measures and should be labeled that way.
@@ -177,8 +173,8 @@ The full evidence-backed inventory is in [`docs/use-cases.md`](docs/use-cases.md
177
173
  - **Distribution:** Published to the public npm registry as `@magnusekdahl/parallix`. Local tarball install (`npm pack`) is also supported. No Homebrew, no Docker image, no standalone binary, and no CI/release automation today.
178
174
  - **Review surface:** Forgejo is supported as the hosted PR viewer/publication surface, but the workflow remains local-first and can run without Forgejo when that provider is disabled.
179
175
  - **Versioning:** `CHANGELOG.md` is the versioning authority; PATCH bumps are the release discipline.
180
- - **Telemetry:** structured token/usage telemetry exists for the codex and claude families; the local-Qwen and mistral paths record honest zeros by design rather than fabricated numbers.
181
- - **Graphify:** the knowledge-graph path is supported for codex, claude, and qwen/opencode after one-time operator setup. It is optional, not a workflow prerequisite. The credible claim today is better-scoped context retrieval, not a proven token-savings benchmark.
176
+ - **Telemetry:** structured token/usage telemetry exists for the codex and claude families; the local-custom and mistral paths record honest zeros by design rather than fabricated numbers.
177
+ - **Graphify:** the knowledge-graph path is supported for codex, claude, and custom/opencode after one-time operator setup. It is optional, not a workflow prerequisite. The credible claim today is better-scoped context retrieval, not a proven token-savings benchmark.
182
178
  - **Review coverage** is best-effort, not guaranteed — see UC-4's caveats in [`docs/use-cases.md`](docs/use-cases.md).
183
179
 
184
180
  This is a tool for a local-first developer workflow on one machine, driven by an operator who reads the caveats.
@@ -188,7 +184,7 @@ This is a tool for a local-first developer workflow on one machine, driven by an
188
184
  - [`docs/use-cases.md`](docs/use-cases.md) — evidence-backed use-case inventory with confidence levels and red-team analysis (primary source of truth for what Parallix actually does today).
189
185
  - [`docs/authority-reference.md`](docs/authority-reference.md) — the internal operator reference: workflow modes, the authority model, agent selection, the layered validation model, checkpoint model, state mapping, command aliases, stats, persistent operator data, and the full public-distribution story.
190
186
  - [`docs/forgejo-setup.md`](docs/forgejo-setup.md) — how the Forgejo review surface, tokens, and `review` remote are bootstrapped.
191
- - [`docs/operator-setup.md`](docs/operator-setup.md) — one-time Graphify skill installation for codex, claude, and qwen/opencode.
187
+ - [`docs/operator-setup.md`](docs/operator-setup.md) — one-time Graphify skill installation for codex, claude, and custom/opencode.
192
188
  - [`docs/readme-rewrite-benchmark.md`](docs/readme-rewrite-benchmark.md) — how comparable developer-tool READMEs are structured, and the decisions behind this one.
193
189
  - [`AGENTS.md`](AGENTS.md) — hard rules, restricted actions, and verification entrypoints.
194
190
  - `docs/adr/` — architecture decision records, including ADR 0044 (distribution model).
@@ -3,11 +3,11 @@
3
3
  "_weights_comment": "Weights are relative integers (not percentages). Agent is selected by weighted random draw from eligible-and-supported set. Omit weights to use equal probability.",
4
4
  "steps": {
5
5
  "draft": {
6
- "eligible": ["codex", "qwen", "mistral"],
6
+ "eligible": ["codex", "custom", "mistral"],
7
7
  "selection": "random"
8
8
  },
9
9
  "active": {
10
- "eligible": ["codex", "claude", "qwen", "mistral"],
10
+ "eligible": ["codex", "claude", "custom", "mistral"],
11
11
  "selection": "random"
12
12
  },
13
13
  "conflict-resolution": {
@@ -15,7 +15,7 @@
15
15
  "selection": "random"
16
16
  },
17
17
  "review": {
18
- "eligible": ["codex", "claude", "qwen", "mistral"],
18
+ "eligible": ["codex", "claude", "custom", "mistral"],
19
19
  "selection": "random"
20
20
  }
21
21
  },
@@ -87,8 +87,20 @@
87
87
  "properties": {
88
88
  "models": {
89
89
  "type": "object",
90
- "description": "Optional per-agent-family LLM model override, keyed by agent family name (e.g. codex, claude, gemini, glm, mistral, qwen). Each value is the model identifier passed to that agent's CLI. A family that is not listed sends no model parameter, so the agent uses its own default. There is no 'default' key.",
90
+ "description": "Optional per-agent-family LLM model override, keyed by agent family name (e.g. codex, claude, gemini, glm, mistral, custom). Each value is the model identifier passed to that agent's CLI. A family that is not listed sends no model parameter, so the agent uses its own default. There is no 'default' key.",
91
91
  "additionalProperties": { "type": "string" }
92
+ },
93
+ "subagents": {
94
+ "type": "object",
95
+ "description": "Operational limits for subagent spawning within an agent.",
96
+ "additionalProperties": false,
97
+ "properties": {
98
+ "maxParallel": {
99
+ "type": ["integer", "null"],
100
+ "minimum": 0,
101
+ "description": "Maximum number of parallel subagent forks. When unset, null, or zero, no limit is applied."
102
+ }
103
+ }
92
104
  }
93
105
  }
94
106
  }
@@ -0,0 +1,161 @@
1
+ # ADR 0047: Estimate Mission Size in Net Engineering Lines, Not Agent-Usage %
2
+
3
+ **Status:** Accepted
4
+ **Date:** 2026-06-27
5
+ **Task:** task-1355 (research; depends on the task-1267 hypothesis)
6
+
7
+ ## Context
8
+
9
+ [task-1267](../../backlog/tasks/task-1267%20-%20Hypothesis-reduce-mission-size-to-increase-quality-controls.md)
10
+ hypothesized that smaller missions correlate with fewer defects and proposed a
11
+ flat **<1000-row ceiling**. task-1355 researched this against this repository's own
12
+ archived missions. The full reproducible dataset and method are in
13
+ [`missions/task-1355/data/dataset.md`](../../missions/task-1355/data/dataset.md);
14
+ the analysis is in [`missions/task-1355/findings.md`](../../missions/task-1355/findings.md).
15
+ Every quantitative claim in that research was re-verified against `git log` while
16
+ authoring this ADR (line counts, review rounds, correlations, terciles all
17
+ reproduce exactly), so the decisions below rest on measured data.
18
+
19
+ ### Today missions are estimated in the wrong unit
20
+
21
+ Per [ADR 0032](0032-mission-refinement-state-and-usage-budget-signals.md) and
22
+ [ADR 0036](0036-mission-sizing-and-dependency-wave-heuristics.md), a mission's
23
+ draft-time size signal is **"Estimated agent % usage limit"** (e.g. "25–50%"). That
24
+ unit is agent-specific, non-portable across models, untethered from the artifact a
25
+ reviewer actually reads, and impossible to verify after the fact — there is no
26
+ ground truth to compare a "%-usage" estimate against, so it can never be calibrated.
27
+
28
+ ### Not all lines are equal
29
+
30
+ Parallix missions are line-heavy by construction. Each mission emits `MISSION.md`,
31
+ per-checkpoint `CP-*.md`, `review-state.json`, and `review-events/*` files. These are
32
+ **administrative bookkeeping**, not delivery. The risk a reviewer must reason about
33
+ lives in the **engineering change** the mission ships — code and tests — not in its
34
+ workflow paperwork or prose.
35
+
36
+ Conflating them produces an actively misleading metric. Counting *total* commit lines
37
+ correlates with review rounds at **+0.65**, much stronger than the engineering change
38
+ alone (**+0.39**) — but this is **reverse causation, not signal**: every review round
39
+ writes more `review-events/*` files into the same squash commit, so a mission that was
40
+ hard to review mechanically grows its own line count. Any size signal must therefore
41
+ exclude administrative and documentation lines, or it measures the workflow rather than
42
+ the work.
43
+
44
+ ## Decision
45
+
46
+ **Change the basis on which missions estimate their size, from agent-usage % to a
47
+ predicted count of Net Engineering Lines (NEL), expressed as one of three buckets.
48
+ Then capture the actual NEL at handoff so the draft estimate can, for the first time,
49
+ be checked for reliability.** This ADR records the design and the data-gathering plan;
50
+ it does **not** yet impose any gate or breach action — see "Why no enforcement yet".
51
+
52
+ ### 1. The metric — Net Engineering Lines (NEL)
53
+
54
+ **NEL = insertions + deletions in code and test files**, computed `-w`
55
+ (whitespace-insensitive), **excluding**:
56
+
57
+ - workflow/process bookkeeping — `missions/**`, `backlog/**`, `review-*`, `*CP-*`;
58
+ - documentation — `**/*.md`, `docs/**`;
59
+ - generated / vendored — `package-lock.json`, `coverage/**`, and other lockfiles/build output.
60
+
61
+ "Net Engineering Lines" is chosen as the name precisely to make the exclusions
62
+ self-evident: *engineering* (code and tests, not prose), *net* (the diff, not the
63
+ whole tree). It is the only one of task-1355's four candidate metrics that has both a
64
+ usable correlation with review rework and **zero new tooling** — it is computable from
65
+ `git diff --numstat` today:
66
+
67
+ | Candidate | Correlation w/ review rounds (Pearson/Spearman) | Tooling | Verdict |
68
+ |---|---|---|---|
69
+ | **Net Engineering Lines** | **+0.39 / +0.37** | none | **Chosen** |
70
+ | Files touched | +0.15 / +0.21 | none | weak signal |
71
+ | Hunks (`@@`) | +0.06 / +0.27 | none | weakest |
72
+ | Cyclomatic complexity delta | not measurable in-repo | high (AST) | deferred (see Future Work) |
73
+
74
+ ### 2. The draft estimate — a NEL bucket, replacing "% usage"
75
+
76
+ At draft, the `MISSION.md` size signal becomes a **predicted NEL bucket**, replacing
77
+ "Estimated agent % usage limit". The buckets are the empirical risk terciles found in
78
+ this repo's archived missions (see §4):
79
+
80
+ | Bucket | Predicted NEL | Observed rework rate in this repo (review round ≥ 3) |
81
+ |---|---|---|
82
+ | **Small** | 0–80 | 11% |
83
+ | **Medium** | 81–235 | 22% |
84
+ | **Large** | 235+ | 73% |
85
+
86
+ ### 3. The actual — capture NEL at handoff
87
+
88
+ At handoff the **actual** NEL is computed from the merge diff (exact, cheap,
89
+ tamper-evident) and recorded alongside the draft bucket. This produces, per mission, a
90
+ `(predicted bucket, actual NEL, actual bucket, review rounds)` record — the
91
+ prediction-vs-actual series the workflow has never had.
92
+
93
+ ### 4. Why these buckets — the data
94
+
95
+ Binning the 29 archived missions into terciles by NEL, against the share needing
96
+ rework (`review round ≥ 3`):
97
+
98
+ | Bucket | NEL range | mean review rounds | % needing rework |
99
+ |---|---|--:|--:|
100
+ | small | 0–79 | 1.89 | **11%** |
101
+ | medium | 92–235 | 2.00 | **22%** |
102
+ | large | 270–1106 | 3.91 | **73%** |
103
+
104
+ Missions above ~270 NEL needed rework **73%** of the time vs **11%** below ~80 — a
105
+ ~6.6× higher rate, concentrated at the small→large boundary. The bucket edges (80, 235)
106
+ sit at these tercile boundaries. Note this places the risk inflection far below
107
+ task-1267's proposed 1000-row ceiling, so a 1000-line wall would have missed the entire
108
+ elevated-risk band.
109
+
110
+ ### Why no enforcement yet — calibrate before you gate
111
+
112
+ task-1355 found the workflow has **no calibration data**: it never recorded a predicted
113
+ size, so there has never been a way to know whether an up-front estimate is trustworthy.
114
+ The findings show good reasons to doubt it — task-1360 shipped 1106 NEL but approved in
115
+ **1 round** (a mechanical ESLint cleanup), while task-1332 shipped only 105 NEL but took
116
+ **5 rounds** (small but hard) — i.e. whether a mission is large or *hard* depends on
117
+ facts discovered during implementation.
118
+
119
+ Gating on an uncalibrated estimate would therefore fire on noise. So this ADR
120
+ deliberately stops at **changing the unit and gathering the data**. A threshold and a
121
+ breach action (escalate review depth, force decomposition, block, etc.) are **deferred
122
+ to a follow-up decision** that will be made only once the draft NEL bucket is shown to
123
+ be a reliable estimator of the actual bucket. The whole point of capturing
124
+ `(predicted, actual)` pairs now is to make that future decision evidence-based instead
125
+ of guessed.
126
+
127
+ ## Consequences
128
+
129
+ ### Positive
130
+ - Size is estimated in a **portable, verifiable** unit (lines of engineering change)
131
+ instead of an agent-specific, uncheckable "% usage".
132
+ - The signal measures **delivery risk**, not workflow paperwork; the +0.65 total-line
133
+ confound is designed out by construction.
134
+ - For the first time the workflow accumulates **prediction-vs-actual** data, so the
135
+ reliability of up-front sizing becomes an observable fact rather than an assumption.
136
+ - Zero new tooling — NEL is computable from `git diff --numstat` today.
137
+ - No disruption: nothing is blocked or escalated yet, so a wrong bucket costs nothing.
138
+
139
+ ### Negative / Limitations
140
+ - The bucket edges (80 / 235) are provisional — n=29, single repo — and should be
141
+ re-tuned as the corpus grows.
142
+ - NEL excludes documentation, so it **under-counts docs-heavy deliverables** (e.g.
143
+ research/ADR missions). This is an accepted trade-off for now: such missions carry
144
+ little executable-defect risk. Revisit if doc-only missions prove risky.
145
+ - NEL is gameable at the margin (padding logic with dead code); since nothing is gated
146
+ on it yet, this is not yet a concern.
147
+
148
+ ### Future Work
149
+ - Once enough `(predicted, actual)` pairs exist, **assess whether the draft NEL bucket
150
+ is a reliable estimator** of the actual bucket — this is the trigger for a follow-up
151
+ ADR on enforcement (threshold + breach action).
152
+ - Add a **cyclomatic-complexity-delta** metric once AST tooling lands; evaluate it
153
+ against NEL on a larger sample.
154
+
155
+ ## Links
156
+ - [task-1267 hypothesis](../../backlog/tasks/task-1267%20-%20Hypothesis-reduce-mission-size-to-increase-quality-controls.md)
157
+ - [Research findings (task-1355)](../../missions/task-1355/findings.md)
158
+ - [Reproducible dataset](../../missions/task-1355/data/dataset.md)
159
+ - [ADR 0032](0032-mission-refinement-state-and-usage-budget-signals.md) — amended: this ADR replaces the "% usage limit" draft signal with a NEL bucket.
160
+ - [ADR 0036](0036-mission-sizing-and-dependency-wave-heuristics.md) — amended: "Too Large" sizing is restated in NEL rather than agent-usage %.
161
+ - Implementation: [task-1379](../../backlog/tasks/task-1379%20-%20Replace-agent-usage-size-signal-with-Net-Engineering-Lines-NEL-bucket-capture-actual-at-handoff.md) (replace the % usage signal with a NEL bucket; capture actual NEL at handoff).
package/docs/adr/index.md CHANGED
@@ -15,6 +15,7 @@ ADR 0023 remains in WrGroceries and is cross-referenced here instead of copied.
15
15
  - `docs/adr/0044-workflow-distribution-model.md` — parallix productization path with `px` naming, runtime/target-state boundary, and a 5-alternative decision matrix; Accepted (2026-06-22, task-1331) on the near-term local npm tarball / global `px` install stance
16
16
  - `docs/adr/0045-parallax-branch-model.md` — Two integration modes (trunk-based and feature-branch), Forgejo as PR viewer only, `review` remote wiring, and branch naming conventions
17
17
  - `docs/adr/0046-npm-publish-process-and-security.md` — Adopt public npm registry publication for `@magnusekdahl/parallix` alongside the local tarball path; zero-dependency security posture, manual publish process, and rollback considerations
18
+ - `docs/adr/0047-per-mission-change-size-budget.md` — Change the mission size-estimation basis from agent-usage % to **Net Engineering Lines (NEL)** — code+test diff, excluding docs and workflow/admin bookkeeping (the +0.65 reverse-causation confound). Draft estimate becomes a NEL bucket (0–80 / 81–235 / 235+, the empirical risk terciles); capture actual NEL at handoff to calibrate the estimate. No enforcement until the draft bucket is shown reliable.
18
19
 
19
20
  ## Cross-reference
20
21
  - `docs/adr/0023-ai-sdlc-configuration.md` remains in WrGroceries at `/home/magnus/code/visualBoard-task-1302/docs/adr/0023-ai-sdlc-configuration.md`.
package/docs/agents.md CHANGED
@@ -7,13 +7,13 @@
7
7
  | codex | `codex` |
8
8
  | claude | `claude` |
9
9
  | mistral | `vibe` |
10
- | qwen | `opencode` |
10
+ | custom | `opencode` |
11
11
 
12
12
  All four listed launchers are supported on this workstation. Step eligibility for all workflow steps (`draft`, `active`, `conflict-resolution`, `review`) is controlled by `parallix/config/agents.json`. If a launcher is missing from `PATH`, the harness fails loudly with the exact blocker before launching.
13
13
 
14
- ## Tool Calling Workaround (qwen/opencode)
14
+ ## Tool Calling Workaround (custom/opencode)
15
15
 
16
- Opencode (qwen agent family) may encounter issues with concurrent tool calls or tool call timeouts during long-running workflow sessions. When working with opencode:
16
+ Opencode (custom agent family) may encounter issues with concurrent tool calls or tool call timeouts during long-running workflow sessions. When working with opencode:
17
17
 
18
18
  - **Prefer sequential tool calls** over parallel calls for dependent operations — if tool B needs output from tool A, call them separately.
19
19
  - **Use `workdir` parameter instead of `cd` chains** — avoid `cd <dir> && command` patterns; always use `workdir` for directory changes.
@@ -27,7 +27,7 @@ Opencode (qwen agent family) may encounter issues with concurrent tool calls or
27
27
  | codex | `codex exec --sandbox danger-full-access --cd <worktree> <prompt>` with a worktree-local `HOME` under `.workflow/codex-home`; resume uses `codex exec resume <session-id-or---last> <prompt>`; the launcher also seeds `.workflow/codex-home/.codex/config.toml` with the repo-standard trusted posture and copies `.codex/auth.json` so headless review commands can start and keep localhost Forgejo access |
28
28
  | claude | `claude --dangerously-skip-permissions --output-format stream-json --verbose --include-partial-messages -p <prompt>` (cwd=worktree) — uses `--output-format stream-json --verbose --include-partial-messages` to stream real-time JSONL events (tool calls, assistant text chunks) to the operator's terminal via the spawn-tee mechanism. `--include-partial-messages` is required: without it, the assistant event contains the full response at once and no intermediate progress is emitted. Session-id extraction parses the `result` event from stream-json output, falling back to the `claude --resume <id>` regex on plain text. |
29
29
  | mistral | `vibe --prompt <prompt> --trust --output text` (cwd=worktree) — **Note: NOT resume-capable in current Vibe version**; session management uses internal state in `~/.vibe/logs/session/` but does not emit a parseable resume hint to stdout/stderr. |
30
- | qwen | `opencode run --pure --dangerously-skip-permissions <prompt>` (cwd=worktree); resume uses `-s <session>` when a session id is known or `--continue` when only the family marker is known |
30
+ | custom | `opencode run --pure --dangerously-skip-permissions <prompt>` (cwd=worktree); resume uses `-s <session>` when a session id is known or `--continue` when only the family marker is known |
31
31
 
32
32
  ## Launch output watchdog
33
33
 
@@ -74,10 +74,10 @@ Eligibility is controlled by `parallix/config/agents.json`. The default config c
74
74
  ```json
75
75
  {
76
76
  "steps": {
77
- "draft": { "eligible": ["codex", "qwen", "mistral"], "selection": "random" },
78
- "active": { "eligible": ["codex", "claude", "qwen", "mistral"], "selection": "random" },
77
+ "draft": { "eligible": ["codex", "custom", "mistral"], "selection": "random" },
78
+ "active": { "eligible": ["codex", "claude", "custom", "mistral"], "selection": "random" },
79
79
  "conflict-resolution": { "eligible": ["claude", "codex", "mistral"], "selection": "random" },
80
- "review": { "eligible": ["codex", "claude", "qwen", "mistral"], "selection": "random" }
80
+ "review": { "eligible": ["codex", "claude", "custom", "mistral"], "selection": "random" }
81
81
  }
82
82
  }
83
83
  ```
@@ -141,7 +141,7 @@ The workflow detects limit-hit messages in agent stdout/stderr and automatically
141
141
 
142
142
  ### Detection
143
143
 
144
- `parallix/lib/limit-hit.js` ships a regex catalog per agent family (`claude`, `codex`, `qwen`, `mistral`) covering the common shapes:
144
+ `parallix/lib/limit-hit.js` ships a regex catalog per agent family (`claude`, `codex`, `custom`, `mistral`) covering the common shapes:
145
145
  - explicit phrases like `Claude usage limit reached`, `weekly limit`, `Quota exceeded`, `RESOURCE_EXHAUSTED`
146
146
  - HTTP signals (`429 Too Many Requests`, `rate_limit_exceeded`, `Retry-After: ...`)
147
147
 
@@ -45,7 +45,7 @@ Mission flow: `backlog → draft → ready → active → review → approved
45
45
 
46
46
  ## 3. Agent Selection
47
47
 
48
- Four families: `codex`, `claude`, `mistral`, `qwen`. Step eligibility is in `config/agents.json`. Launchers are resolved from `PATH` by bare executable name.
48
+ Four families: `codex`, `claude`, `mistral`, `custom`. Step eligibility is in `config/agents.json`. Launchers are resolved from `PATH` by bare executable name.
49
49
 
50
50
  `WORKFLOW_AGENT=<name>` overrides random selection only when that agent is eligible and unblocked. The effective blocklist is operator-owned at `<PARALLIX_HOME>/agents.local.json`; on first use parallix non-destructively migrates the legacy runtime-config, repo-root, and main-worktree files in that precedence order. Per-agent values: `true` (permanent block), `{ "until": "YYYY-MM-DD HH" }` (timed), `{ "blocked": false }` (unblock).
51
51
 
@@ -256,7 +256,7 @@ Behavior:
256
256
  Telemetry capture contract (task-1285):
257
257
  - Stage rows are keyed by `(mission, stage)`; `draft.js`, `active.js`, and the review loop each record their phase via `recordStageStats`/`recordActiveStats`/`recordReviewStats`.
258
258
  - Structured sources: Codex (`codex-telemetry.js`, rollout JSONL) and Claude (`claude-telemetry.js`, stdout SSE) populate real token/usage fields.
259
- - `opencode` (local Qwen) exposes no structured usage source, so `opencode-telemetry.js` records honest zeros with provider/model falling back to the agent family — never fabricated numbers.
259
+ - `opencode` (local custom) exposes no structured usage source, so `opencode-telemetry.js` records honest zeros with provider/model falling back to the agent family — never fabricated numbers.
260
260
  - `vibe`/`mistral` telemetry is **blocked** in this environment; `mistral-telemetry.js` records honest zeros and the verification is tracked as follow-up task-1288.
261
261
 
262
262
  ---
@@ -0,0 +1,89 @@
1
+ # Documentation Standard
2
+
3
+ Rules for writing and editing README.md and subdirectory READMEs in this repository. Derived from `docs/readme-rewrite-benchmark.md` (task-1336) and applied to the current product state.
4
+
5
+ ---
6
+
7
+ ## 1. Headline / Tagline
8
+
9
+ - The first line after the H1 must be a **one-line capability statement** that tells a skeptical engineer what the tool does.
10
+ - Zero internal jargon. Do not use terms like `authority stack`, `state-map`, `adapter internals`, `worktree pattern`, or any abstraction that only makes sense to someone who has read the code.
11
+ - Name the audience or the execution context if it matters (e.g., "local-first", "CLI", "for Git operators").
12
+ - **Bad:** "Parallix is an authority-driven mission orchestration engine."
13
+ - **Good:** "Parallix is a local-first Git workflow CLI for running AI coding agents in isolated, reviewable missions."
14
+
15
+ ## 2. Opening Paragraph
16
+
17
+ - After the headline, the first paragraph should be **problem-first or contrast-first**: name the pain or define against the adjacent category before describing the mechanism.
18
+ - Keep it to 2-4 sentences. Do not lead with features, screenshots, or install commands.
19
+ - If the tool has a potentially surprising default behavior, state it early (like Aider stating Git auto-commit behavior, like Cline stating the permission model).
20
+
21
+ ## 3. Quickstart Depth
22
+
23
+ - Provide a **shallow path to value**: 2-3 commands to a first working result.
24
+ - Do not bury the quickstart behind enterprise walkthroughs, multi-provider setups, or configuration steps.
25
+ - The quickstart section must be visually separated (fenced code block) and immediately scannable.
26
+
27
+ ## 4. Caveats and Honesty
28
+
29
+ - Caveats are **trust signals** when stated early and specifically. Alpha status, local-first constraints, limited telemetry, and best-effort guarantees belong in their own visible section ("Current status" or "Limitations").
30
+ - Stating limitations upfront builds more credibility than hiding them in fine print.
31
+ - Every quantitative claim must travel with its caveats and source references.
32
+
33
+ ## 5. Superlative Prohibition
34
+
35
+ - No superlatives ("leading", "best", "fastest", "2x faster") without **adoption data or measured benchmarks** to back them.
36
+ - If a claim cannot be falsified with a specific number and source, do not use it.
37
+ - This is a hard rule for alpha-stage projects with limited measured data.
38
+
39
+ ## 6. "What It Is Not" Section
40
+
41
+ - Every README must include a section titled **"What \<tool\> is not"** (or equivalent).
42
+ - Pre-empt the top 3 objections a skeptical user would have (e.g., "not a model", "not an IDE", "not a magic autonomous engineer").
43
+ - This section should appear after use cases and before current status.
44
+
45
+ ## 7. Structural Ordering
46
+
47
+ The canonical order for this repository's README.md is:
48
+
49
+ 1. H1 title + one-line capability headline (bold)
50
+ 2. Audience + positioning paragraph
51
+ 3. **The first concrete thing you can do** (brief intro to quickstart)
52
+ 4. Quick start (fenced code block, 2-3 commands)
53
+ 5. Why \<tool\>? (problem-first)
54
+ 6. What it does (capabilities with evidence refs)
55
+ 7. The core workflow (diagram or description)
56
+ 8. Example (realistic human-in-the-loop pass)
57
+ 9. Use cases (summary with link to full inventory)
58
+ 10. What \<tool\> is not
59
+ 11. Current status (alpha caveats, distribution, review surface, versioning, telemetry)
60
+ 12. Documentation (links to supporting docs)
61
+ 13. Development (test command)
62
+ 14. License
63
+
64
+ Subdirectory READMEs follow a simplified variant: H1 with capability statement, brief description, and relevant sections.
65
+
66
+ ## 8. Tone and Voice
67
+
68
+ - **Plain, anti-hype, engineer-to-engineer.** Write like an engineer wrote it for engineers, not a marketing team.
69
+ - Precise and sober. Casual is fine but do not drift into jokes or bluntness that undermines credibility with a skeptical engineering manager.
70
+ - Use active voice. Prefer concrete verbs over abstract nouns.
71
+ - When describing capabilities, tie them to evidence: use-case IDs, file paths, test names, or config references.
72
+
73
+ ## 9. Link Hygiene
74
+
75
+ - All relative links in README.md must resolve to existing files.
76
+ - Before editing any README, verify: `docs/use-cases.md`, `docs/authority-reference.md`, `docs/forgejo-setup.md`, `docs/operator-setup.md`, `docs/readme-rewrite-benchmark.md`, `AGENTS.md`, `CHANGELOG.md`, `LICENSE`, `docs/adr/`.
77
+ - Broken links are defects, not acceptable trade-offs.
78
+
79
+ ## 10. Subdirectory READMEs
80
+
81
+ - `lib/README.md`, `examples/README.md`, and any future subdirectory READMEs must begin with a one-line capability statement (no internal jargon).
82
+ - Use consistent heading hierarchy: H1 for the directory name, H2 for sections, H3 for subsections.
83
+ - Keep them concise — they are navigation aids, not deep documentation.
84
+
85
+ ---
86
+
87
+ ## Enforcement Hook
88
+
89
+ These rules are enforced by the hook in `AGENTS.md` under the "Documentation" section. Agents editing any `.md` file in the repo root or `docs/` directory MUST consult this standard before committing changes.
@@ -10,18 +10,42 @@ Standalone workflow installs need three review-surface pieces before `active`, `
10
10
 
11
11
  1. Export the workflow into the repo.
12
12
  2. If you need a local Forgejo instance, run `parallix/tools/setup-forgejo-docker.sh` and start it with Docker Compose.
13
- 3. Run `px setup`.
14
- 4. Choose whether to keep the standard Backlog.md-style layout:
13
+ 3. Create the Forgejo accounts the workflow will use (see [Create the agent accounts](#create-the-agent-accounts-fresh-instance)). On a fresh instance these do not exist yet, and `px setup` only mints *tokens* for accounts that already exist — it does not create the accounts themselves.
14
+ 4. Run `px setup`.
15
+ 5. Choose whether to keep the standard Backlog.md-style layout:
15
16
  - task storage in `backlog/`
16
17
  - missions in `missions/`
17
18
  - `mission/*` branches on `main`
18
19
  - worktrees in `../<repo>-<slug>`
19
20
  - verification via `npm test`
20
- 5. If you keep Forgejo bootstrap enabled, enter the Forgejo password for the login that can create the review repo.
21
- 6. Enter passwords for the agent users you want available on this machine, or leave them blank to skip token creation for that user.
21
+ 6. If you keep Forgejo bootstrap enabled, enter the Forgejo password for the login that can create the review repo.
22
+ 7. Enter passwords for the agent users you want available on this machine, or leave them blank to skip token creation for that user.
22
23
 
23
24
  `setup` writes `workflow.config.json`, writes token files into `.forgejo-local/tokens/`, grants the listed agent users write access to the configured review repo, creates or updates the git `review` remote, and runs `verify-env` so the install is validated before you start missions.
24
25
 
26
+ ## Create the agent accounts (fresh instance)
27
+
28
+ `px setup` / `px setup-review` create **tokens** and grant repo access, but they do **not** create Forgejo user accounts — both the basic-auth token path and the owner-token bootstrap path call `POST /users/<user>/tokens` and `PUT /repos/<repo>/collaborators/<user>`, which require the account to already exist. On a fresh Forgejo you must create the accounts first, or token creation fails with HTTP 404 / 401 for users that don't exist.
29
+
30
+ Create one account per identity the workflow uses:
31
+
32
+ - the **owner** that holds the review repo (default `human`),
33
+ - one account per agent family that runs `active`/`review` steps. The canonical list comes from `suggestedForgejoUsers()` — currently `codex`, `claude`, `custom`, `mistral`. (`custom` is the opencode-backed local-model family; it is a first-class identity just like the hosted agents.)
34
+
35
+ For the bundled Docker instance, create them with the Forgejo admin CLI inside the container (replace `<container>` with your Forgejo container name, e.g. `workflow-forgejo`):
36
+
37
+ ```bash
38
+ for u in human codex claude custom mistral; do
39
+ docker exec -u 1000 <container> forgejo admin user create \
40
+ --username "$u" --email "$u@localhost" \
41
+ --password "CHANGE-ME-$u" --must-change-password=false
42
+ done
43
+ ```
44
+
45
+ Then run `px setup` and enter each account's password so the token files are minted into `.forgejo-local/tokens/`.
46
+
47
+ > **Adding or renaming an agent family later** (e.g. the `qwen` → `custom` rename): the new family name is a new Forgejo identity. Create its account with `forgejo admin user create`, grant it write on the review repo, then re-run `px setup-review` to mint its token. Without this, `integrate`/`review` fail with `no token file found for <family>` even though every other agent works.
48
+
25
49
  ## Notes
26
50
 
27
51
  - The configured review repo is created only if it does not already exist.
@@ -15,7 +15,7 @@
15
15
  | `TASK-1275` | move | workflow/parallix subject from title and mission context |
16
16
  | `TASK-1277` | stay | model-capacity tuning note for GPT family selection; not the parallix workflow tool itself |
17
17
  | `TASK-1281` | move | workflow/parallix subject from title and mission context |
18
- | `TASK-1287` | stay | qwen-9B benchmark note; a model-evaluation task, not a parallix workflow change |
18
+ | `TASK-1287` | stay | custom-9B benchmark note; a model-evaluation task, not a parallix workflow change |
19
19
  | `TASK-1288` | move | workflow/parallix subject from title and mission context |
20
20
  | `TASK-1290` | move | workflow/parallix subject from title and mission context |
21
21
  | `TASK-1294` | move | workflow/parallix subject from title and mission context |
@@ -25,7 +25,7 @@ Run the installer once per agent family. It copies a platform-specific skill (an
25
25
  |--------|---------|-----------------|
26
26
  | claude | `graphify install --platform claude` | `~/.claude/skills/graphify/` + `CLAUDE.md` directive |
27
27
  | codex | `graphify install --platform codex` | `~/.agents/skills/graphify/` |
28
- | qwen/opencode | `graphify install --platform opencode` | `~/.config/opencode/skills/graphify/` |
28
+ | custom/opencode | `graphify install --platform opencode` | `~/.config/opencode/skills/graphify/` |
29
29
 
30
30
  Each command produces a `SKILL.md` file in the target directory. After running all three, verify:
31
31
 
@@ -73,7 +73,7 @@ line-by-line transcription. The decisions column is the actionable output.
73
73
  caveats are light.
74
74
  - **Borrow:** Naming the audience inside the positioning ("for operators comfortable with
75
75
  Git and CLI"); stating provider-agnosticism (Parallix's multi-family support is a
76
- genuine parallel — codex/claude/mistral/qwen).
76
+ genuine parallel — codex/claude/mistral/custom).
77
77
  - **Avoid:** The screenshot-first above-the-fold — Parallix's mission is explicitly *out
78
78
  of scope* for screenshots/demos (task-1336 Out of Scope), and a CLI workflow harness is
79
79
  better shown by a command-flow block than a TUI image. Lead with text and a fenced