@magnusekdahl/parallix 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/LICENSE +661 -0
  3. package/README.md +196 -0
  4. package/config/agents.json +25 -0
  5. package/config/agents.local.json.template +8 -0
  6. package/config/state-map.json +4 -0
  7. package/config/state-map.json.template +31 -0
  8. package/config/workflow.config.schema.json +98 -0
  9. package/data/.gitkeep +0 -0
  10. package/docs/adr/0031-ai-agent-instruction-boundary-and-command-floor.md +114 -0
  11. package/docs/adr/0032-mission-refinement-state-and-usage-budget-signals.md +135 -0
  12. package/docs/adr/0034-module-and-skill-invocation-model.md +202 -0
  13. package/docs/adr/0036-mission-sizing-and-dependency-wave-heuristics.md +79 -0
  14. package/docs/adr/0037-ai-workflow-coordination-architecture.md +162 -0
  15. package/docs/adr/0041-integration-pipeline-gates.md +165 -0
  16. package/docs/adr/0042-workflow-cli-color-rendering-approach.md +106 -0
  17. package/docs/adr/0043-git-target-resolution-strategy.md +185 -0
  18. package/docs/adr/0044-workflow-distribution-model.md +277 -0
  19. package/docs/adr/0045-parallax-branch-model.md +182 -0
  20. package/docs/adr/0046-npm-publish-process-and-security.md +138 -0
  21. package/docs/adr/index.md +20 -0
  22. package/docs/agents.md +212 -0
  23. package/docs/authority-reference.md +298 -0
  24. package/docs/forgejo-setup.md +31 -0
  25. package/docs/migration/extraction.md +61 -0
  26. package/docs/migration/task-classification.md +36 -0
  27. package/docs/operator-setup.md +76 -0
  28. package/docs/readme-rewrite-benchmark.md +188 -0
  29. package/docs/use-cases.md +105 -0
  30. package/examples/README.md +62 -0
  31. package/examples/run-enterprise-tarball-workflow-smoke.sh +257 -0
  32. package/examples/run-verify-env-smoke.sh +40 -0
  33. package/index.js +250 -0
  34. package/lib/README.md +13 -0
  35. package/lib/agents/agents.js +867 -0
  36. package/lib/agents/claude-telemetry.js +233 -0
  37. package/lib/agents/claude.js +139 -0
  38. package/lib/agents/codex-telemetry.js +202 -0
  39. package/lib/agents/codex.js +219 -0
  40. package/lib/agents/limit-hit.js +252 -0
  41. package/lib/agents/mistral-telemetry.js +44 -0
  42. package/lib/agents/mistral.js +68 -0
  43. package/lib/agents/opencode-export.js +110 -0
  44. package/lib/agents/opencode-telemetry.js +356 -0
  45. package/lib/agents/opencode.js +218 -0
  46. package/lib/agents/stage-telemetry.js +37 -0
  47. package/lib/commands/active.js +625 -0
  48. package/lib/commands/checkpoint.js +76 -0
  49. package/lib/commands/config.js +39 -0
  50. package/lib/commands/coverage-gate.js +358 -0
  51. package/lib/commands/diff.js +119 -0
  52. package/lib/commands/draft.js +854 -0
  53. package/lib/commands/handoff.js +501 -0
  54. package/lib/commands/integrate.js +1528 -0
  55. package/lib/commands/mission-start.js +246 -0
  56. package/lib/commands/rebase.js +597 -0
  57. package/lib/commands/repair-handoff.js +227 -0
  58. package/lib/commands/resolve-conflict.js +109 -0
  59. package/lib/commands/review.js +13 -0
  60. package/lib/commands/setup-review.js +13 -0
  61. package/lib/commands/setup.js +3 -0
  62. package/lib/commands/stats-backfill.js +395 -0
  63. package/lib/commands/stats.js +1601 -0
  64. package/lib/commands/status.js +183 -0
  65. package/lib/commands/verify.js +1 -0
  66. package/lib/core/fmt.js +202 -0
  67. package/lib/core/git.js +73 -0
  68. package/lib/core/gitignore.js +110 -0
  69. package/lib/core/mission-utils.js +1017 -0
  70. package/lib/core/persistent-data-migration.js +201 -0
  71. package/lib/core/product-config.js +508 -0
  72. package/lib/core/runtime-matrix.js +82 -0
  73. package/lib/core/spawn-tee.js +173 -0
  74. package/lib/core/state-map.js +89 -0
  75. package/lib/core/storage.js +165 -0
  76. package/lib/core/verification.js +149 -0
  77. package/lib/index.js +77 -0
  78. package/lib/review/rebase.js +163 -0
  79. package/lib/review/review-adapter.js +135 -0
  80. package/lib/review/review-artifacts.js +619 -0
  81. package/lib/review/review-commands.js +1375 -0
  82. package/lib/review/review-events.js +1007 -0
  83. package/lib/review/review-loop.js +1004 -0
  84. package/lib/review/review-polling.js +141 -0
  85. package/lib/review/review-prompts.js +212 -0
  86. package/lib/review/review-state.js +280 -0
  87. package/lib/review/review.js +96 -0
  88. package/lib/tools/backlog.js +680 -0
  89. package/lib/tools/forgejo.js +1585 -0
  90. package/lib/tools/gatekeeper.js +106 -0
  91. package/lib/tools/sessions.js +74 -0
  92. package/lib/tools/setup-review.js +1053 -0
  93. package/package.json +56 -0
  94. package/prompts/act-on-review-verbose.md +20 -0
  95. package/prompts/act-on-review.md +22 -0
  96. package/prompts/draft.md +20 -0
  97. package/prompts/execute.md +24 -0
  98. package/prompts/portfolio.md +30 -0
  99. package/prompts/review-verbose.md +20 -0
  100. package/prompts/review.md +17 -0
  101. package/px.js +236 -0
  102. package/templates/AGENTS-snippet.md +14 -0
  103. package/templates/AGENTS.md.template +34 -0
  104. package/templates/CLAUDE.md.template +27 -0
  105. package/templates/CODEX.md.template +38 -0
  106. package/templates/MISTRAL.md.template +24 -0
  107. package/templates/claude-commands/act-on-review.md +3 -0
  108. package/templates/claude-commands/area-review.md +3 -0
  109. package/templates/claude-commands/draft.md +6 -0
  110. package/templates/claude-commands/execute.md +6 -0
  111. package/templates/claude-commands/integrate.md +4 -0
  112. package/templates/claude-commands/portfolio.md +5 -0
  113. package/templates/claude-commands/review.md +4 -0
  114. package/templates/codex/config.toml +6 -0
  115. package/templates/mission-scaffold.md +39 -0
  116. package/templates/vibe/skills/act-on-review/SKILL.md +16 -0
  117. package/templates/vibe/skills/area-review/SKILL.md +16 -0
  118. package/templates/vibe/skills/draft/SKILL.md +16 -0
  119. package/templates/vibe/skills/execute/SKILL.md +16 -0
  120. package/templates/vibe/skills/integrate/SKILL.md +16 -0
  121. package/templates/vibe/skills/portfolio/SKILL.md +21 -0
  122. package/templates/vibe/skills/review/SKILL.md +16 -0
  123. package/tools/setup-forgejo-docker.sh +84 -0
package/README.md ADDED
@@ -0,0 +1,196 @@
1
+ # Parallix
2
+
3
+ **Parallix is a CLI for a local-first, human-in-the-loop developer workflow that runs several supported AI coding agents against one repository as isolated, resumable, reviewable missions — instead of one agent improvising in your working tree.**
4
+
5
+ It is built for solo maintainers and small-team leads who already drive AI coding agents such as Claude Code, Codex, OpenCode/Qwen, and Vibe/Mistral and have hit the real problems: two agents fighting over one checkout, a run dying when a provider hits its usage cap, no clean way to resume a long task where it stopped, and the agent that wrote the code also being the one that declares it done.
6
+
7
+ It wraps your AI coding workflow without replacing it: Parallix turns each piece of work into a *mission* with its own branch and its own git worktree, fails over to another agent family when one hits its usage limit, checkpoints long runs so they resume deterministically, and forces a second coding agent review step plus your own repo-configured verification gates before anything is integrated. A human still chooses the task, launches each phase, reads the review, and decides whether the work should land.
8
+
9
+ **Why not just use Claude Code, Codex, or OpenCode directly?** Those are the agents — Parallix is the harness around them. It does not replace your agent or your model. It coordinates several of them as one multi-agent coding workflow with isolation, automatic failover, deterministic checkpoints, and a forced review pass that a single agent session does not give you.
10
+
11
+ **The first concrete thing you can do** is install the px CLI, create one Backlog.md-style task, and draft it:
12
+
13
+ ```sh
14
+ npm pack && npm install -g ./magnusekdahl-parallix-*.tgz
15
+ px draft task-001
16
+ ```
17
+
18
+ `px draft` does not accept free-text slugs like `my-first-task`, and it does not create the task for you. It expects an existing Backlog.md-style task key such as `task-001`.
19
+
20
+ Everything below is the longer version, with the proof and the caveats kept honest.
21
+
22
+ ## Why Parallix?
23
+
24
+ Running AI coding agents one session at a time hits a ceiling fast:
25
+
26
+ - **One working tree, many agents.** Point two agents at the same checkout and they fight over the index, the branch, and uncommitted files. You either serialize them — one idle while the other runs — or hand-manage `git worktree` and branch names yourself.
27
+ - **Runs die on usage caps.** An agent prints "usage limit reached", the run stops, and you babysit it: restart later, or hand-switch to a different model.
28
+ - **Long tasks lose their place.** A crashed or context-exhausted agent leaves you reconstructing what was already done by re-reading diffs.
29
+ - **The author grades its own homework.** The agent that wrote the change also declares it done. Nobody independent looks before it lands.
30
+
31
+ Parallix is a mission-based development workflow that addresses each of these directly, with the mechanics living in tested code rather than in prompts. It is not another agent or model — it is the operator-owned layer around the agents you already use.
32
+
33
+ ## What it does
34
+
35
+ 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.
36
+
37
+ - **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.
38
+ - **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.
39
+ - **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.
40
+ - **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.
41
+ - **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.
42
+ - **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.
43
+ - **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.
44
+ - **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 telemetry across repositories. Token-cost comparison is complete today only for the families with structured telemetry (codex, claude); two families record honest zeros by design.
45
+
46
+ ## The core workflow
47
+
48
+ A mission moves through a fixed lifecycle, one branch and one worktree at a time:
49
+
50
+ ```
51
+ backlog → draft → active → review → approved → done
52
+ │ │ │ │
53
+ worktree agent second squash-
54
+ + branch run + review + merge +
55
+ checkpoints gates cleanup
56
+ ```
57
+
58
+ In practice: a human drafts a mission, Parallix creates the branch and worktree, an agent runs and writes checkpoints, a verification gate runs, a second (preferentially different) agent reviews the diff, and only then is the work integrated back to your primary branch by squash-merge. Blocking review findings loop back to `active` on the same branch and PR.
59
+
60
+ ## Quick start
61
+
62
+ The current install path is a **local npm tarball** built from this repository. A **scoped npm package** (`@magnusekdahl/parallix`) will be available after publication (see [Current status](#current-status)).
63
+
64
+ ```sh
65
+ # Build and install from the local tarball
66
+ npm pack
67
+ npm install -g ./magnusekdahl-parallix-*.tgz
68
+
69
+ # Confirm which px is on PATH
70
+ px --version
71
+ ```
72
+
73
+ Optional but useful: add `px shell-init` to your shell rc so mission transitions can `cd` your terminal into the next worktree:
74
+
75
+ ```sh
76
+ echo 'eval "$(px shell-init bash)"' >> ~/.bashrc
77
+ ```
78
+
79
+ **Post-publish install:** Once published to the npm registry, Parallix can be installed with a single command:
80
+
81
+ ```sh
82
+ npm install -g @magnusekdahl/parallix
83
+ ```
84
+
85
+ `px setup` is an optional convenience wizard that writes `workflow.config.json` and appends workflow entries to `.gitignore`. Parallix runs on built-in defaults without it — `px setup` becomes useful when you want to configure your verification command, customize the mission layout, or bootstrap the Forgejo review surface (repo, token files, and `review` remote). Forgejo is the PR viewer and publication surface here, not the authority for local branch ancestry or integration.
86
+
87
+ Before `px draft`, create a task first. If you already use Backlog.md, create it there. If you do not, create the markdown file yourself under `backlog/tasks/`:
88
+
89
+ ```md
90
+ backlog/tasks/task-001 - my-first-task.md
91
+ ---
92
+ id: TASK-001
93
+ title: my first task
94
+ status: backlog
95
+ assignee: []
96
+ labels: ["user_value"]
97
+ dependencies: []
98
+ ---
99
+ ```
100
+
101
+ Then draft and run it with the actual workflow command:
102
+
103
+ ```sh
104
+ px draft task-001
105
+ px active task-001
106
+ ```
107
+
108
+ Optional but useful: install the Graphify skill once per supported agent family if you want graph-backed codebase navigation in long missions and reviews. This is not a hard requirement like having a task file for `px draft`; when Graphify is not installed, Parallix skips graph updates and continues the workflow. The operator setup is documented separately because it is a workstation capability, not a minimum install step.
109
+
110
+ ## Example
111
+
112
+ A realistic human-in-the-loop pass — mission → worktree → agent run → checkpoint → review → integrate:
113
+
114
+ ```sh
115
+ # Start from a real Backlog task key. Draft creates branch mission/task-042
116
+ # and a sibling worktree ../myrepo-task-042
117
+ px draft task-042
118
+
119
+ # Run the implementer in that isolated worktree. If the chosen family
120
+ # hits its usage cap mid-run, Parallix blocks it and retries on
121
+ # the next eligible family. Each checkpoint commits a doc with a
122
+ # literal "Next action:" line, so the work is resumable.
123
+ px active task-042
124
+
125
+ # A second, preferentially-different agent reviews <main>..HEAD.
126
+ # If Forgejo review is enabled, the PR is published to the dedicated
127
+ # review surface; a self-approval by the implementing agent is blocked.
128
+ px review task-042
129
+
130
+ # Land it: runs configured integration gates, squash-merges to
131
+ # the primary branch, updates board state, removes the branch
132
+ # and worktree.
133
+ px integrate task-042
134
+ ```
135
+
136
+ The verification gate that runs at each checkpoint is whatever you declare in `workflow.config.json` (this repo declares `npm test`), so the workflow adopts your existing CI rather than replacing it.
137
+
138
+ ## Use cases
139
+
140
+ The full evidence-backed inventory is in [`docs/use-cases.md`](docs/use-cases.md). The README focuses on the three claims that are best supported by the current code and retrospective data:
141
+
142
+ 1. **Parallel multi-agent execution (UC-1).** The isolated worktree-per-mission model is the *specific* mechanic an internal retrospective measured as the only configuration to beat a human baseline. Depending on whether you frame output as direct user-value missions or total completed missions in an already-productized setup, the observed gain ranges from roughly **+57%** to about **+1,280%**.
143
+ 2. **Usage-limit auto-failover (UC-2).** Family-specific limit detection → timed blocklist → retry-next-eligible is a tested control loop, not a retry button.
144
+ 3. **Second review gate (UC-4, Partial).** A self-approval is code-blocked and reviewer selection excludes the implementer family — forcing a second review *attempt* by a preferentially different agent, with an honest same-family fallback.
145
+
146
+ ## What Parallix is not
147
+
148
+ - **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).
149
+ - **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.
150
+ - **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.
151
+ - **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.
152
+
153
+ ## Current status
154
+
155
+ **Alpha, local-first, and best suited to operators comfortable with Git and CLI workflows.**
156
+
157
+ - **Distribution:** Local `npm pack` + global install is the current install path. The scoped package `@magnusekdahl/parallix` will be available on the public npm registry after the operator publishes (ADR 0044, ADR 0046). No Homebrew, no Docker image, no standalone binary, and no CI/release automation today.
158
+ - **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.
159
+ - **Versioning:** `CHANGELOG.md` is the versioning authority; PATCH bumps are the release discipline.
160
+ - **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.
161
+ - **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.
162
+ - **Review coverage** is best-effort, not guaranteed — see UC-4's caveats in [`docs/use-cases.md`](docs/use-cases.md).
163
+
164
+ This is a tool for a local-first developer workflow on one machine, driven by an operator who reads the caveats.
165
+
166
+ ## Documentation
167
+
168
+ - [`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).
169
+ - [`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.
170
+ - [`docs/forgejo-setup.md`](docs/forgejo-setup.md) — how the Forgejo review surface, tokens, and `review` remote are bootstrapped.
171
+ - [`docs/operator-setup.md`](docs/operator-setup.md) — one-time Graphify skill installation for codex, claude, and qwen/opencode.
172
+ - [`docs/readme-rewrite-benchmark.md`](docs/readme-rewrite-benchmark.md) — how comparable developer-tool READMEs are structured, and the decisions behind this one.
173
+ - [`AGENTS.md`](AGENTS.md) — hard rules, restricted actions, and verification entrypoints.
174
+ - `docs/adr/` — architecture decision records, including ADR 0044 (distribution model).
175
+
176
+ ## Development
177
+
178
+ ```sh
179
+ npm test # FORCE_COLOR=0 node --test test/*.test.js
180
+ ```
181
+
182
+ The test suite is the verification gate this repo declares in `workflow.config.json`. Run it before integrating any change. Contributions follow the same mission lifecycle the tool itself runs: branch, worktree, checkpoints, a second review, and a passing gate before integration.
183
+
184
+ If you are developing Parallix itself from a checkout, the repo-root dispatcher is:
185
+
186
+ ```sh
187
+ node index.js <command>
188
+ ```
189
+
190
+ ## License
191
+
192
+ Copyright (C) 2026 Magnus Ekdahl.
193
+
194
+ Parallix is free software: you can redistribute it and/or modify it under the terms of the **GNU Affero General Public License** as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See [`LICENSE`](LICENSE) for the full text.
195
+
196
+ The AGPL covers Parallix itself and any modified or network-hosted fork of it. Running `px` as a tool inside your own repository does **not** make your project a derivative work — your code remains entirely yours under whatever terms you choose.
@@ -0,0 +1,25 @@
1
+ {
2
+ "_comment": "Per-step agent eligibility policy. Modify to change which agents are eligible for each workflow step.",
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
+ "steps": {
5
+ "draft": {
6
+ "eligible": ["codex", "qwen", "mistral"],
7
+ "selection": "random"
8
+ },
9
+ "active": {
10
+ "eligible": ["codex", "claude", "qwen", "mistral"],
11
+ "selection": "random"
12
+ },
13
+ "conflict-resolution": {
14
+ "eligible": ["claude", "codex", "mistral"],
15
+ "selection": "random"
16
+ },
17
+ "review": {
18
+ "eligible": ["codex", "claude", "qwen", "mistral"],
19
+ "selection": "random"
20
+ }
21
+ },
22
+ "overrides": {
23
+ "_comment": "CLI parameters are the preferred override mechanism: use --agent <family> with 'draft', --implementer <family> with 'active', or --implementer/--reviewer with 'review'. The WORKFLOW_AGENT env var remains available as a fallback for backward compatibility."
24
+ }
25
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "_comment": "Example only. The effective operator blocklist is <PARALLIX_HOME>/agents.local.json. On first use, legacy workflow/config, repo-root, and main-worktree files migrate in that order without deletion. Automatic usage-limit blocks are written to PARALLIX_HOME and apply across target repositories. Use `YYYY-MM-DD HH` for `until`.",
3
+ "blocklist": {
4
+ "gemini": { "until": "2026-05-01 12" },
5
+ "claude": { "until": "2026-05-02 09" },
6
+ "glm": { "until": "2026-04-30 18" }
7
+ }
8
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "ready": "refined",
3
+ "approved": "ready-for-integration"
4
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "_comment": "Maps virtual workflow states to your board's actual state names. Remove this _comment key before use.",
3
+
4
+ "_virtual_states": "draft → ready → active → review → approved → done",
5
+
6
+ "_examples": {
7
+ "3-state board (Backlog.md defaults: To Do / In Progress / Done)": {
8
+ "draft": "To Do",
9
+ "ready": "To Do",
10
+ "active": "In Progress",
11
+ "review": "In Progress",
12
+ "approved": "In Progress",
13
+ "done": "Done"
14
+ },
15
+ "4-state board (backlog / in-progress / review / done)": {
16
+ "draft": "backlog",
17
+ "ready": "backlog",
18
+ "active": "in-progress",
19
+ "review": "review",
20
+ "approved": "review",
21
+ "done": "done"
22
+ },
23
+ "Backlog.md defaults (no mapping needed — identity)": {}
24
+ },
25
+
26
+ "_instructions": [
27
+ "1. Copy only the block that matches your board into a new workflow/config/state-map.json.",
28
+ "2. Remove the _comment, _virtual_states, _examples, and _instructions keys.",
29
+ "3. If your board uses the default Backlog.md state names (draft, active, done, etc.), no state-map.json is needed."
30
+ ]
31
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/magnus/parallix/workflow.config.schema.json",
4
+ "title": "Workflow (parallix) optional override config",
5
+ "description": "Optional per-repository override for the workflow runtime. The tool ships code-owned defaults and runs with no config file; create workflow.config.json only to override a default. Every section and field is optional and is merged over the built-in defaults. Run `px config` to print the effective configuration.",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "product": {
10
+ "type": "object",
11
+ "additionalProperties": true,
12
+ "properties": {
13
+ "name": { "type": "string" },
14
+ "targetUser": { "type": "string" }
15
+ }
16
+ },
17
+ "adapters": {
18
+ "type": "object",
19
+ "additionalProperties": true,
20
+ "properties": {
21
+ "tasks": {
22
+ "type": "object",
23
+ "description": "Task tracker and on-disk task storage.",
24
+ "additionalProperties": true,
25
+ "properties": {
26
+ "provider": { "type": "string", "description": "Task tracker provider, e.g. backlog-md." },
27
+ "stateMap": { "type": "string", "description": "Repo-relative path to the virtual-to-actual Backlog state map." },
28
+ "storage": {
29
+ "description": "Task storage directory (string) or an object with tasksDir/completedDir.",
30
+ "oneOf": [
31
+ { "type": "string" },
32
+ {
33
+ "type": "object",
34
+ "additionalProperties": true,
35
+ "properties": {
36
+ "tasksDir": { "type": "string" },
37
+ "completedDir": { "type": "string" }
38
+ }
39
+ }
40
+ ]
41
+ }
42
+ }
43
+ },
44
+ "missions": {
45
+ "type": "object",
46
+ "description": "Mission document layout and branch/worktree conventions.",
47
+ "additionalProperties": true,
48
+ "properties": {
49
+ "baseDir": { "type": "string", "description": "Base directory for mission documents." },
50
+ "branchPrefix": { "type": "string", "description": "Branch name prefix for missions, e.g. mission/." },
51
+ "worktreePattern": { "type": "string", "description": "Worktree path pattern, e.g. ../<repo>-<slug>." },
52
+ "primaryBranch": { "type": "string", "description": "Primary branch override if not auto-detected." }
53
+ }
54
+ },
55
+ "verification": {
56
+ "type": "object",
57
+ "description": "Repository gate command.",
58
+ "additionalProperties": true,
59
+ "properties": {
60
+ "command": { "type": "string", "description": "Gate command; supports {{area}} substitution." },
61
+ "defaultArea": { "type": "string", "description": "Default verification area." }
62
+ }
63
+ },
64
+ "stats": {
65
+ "type": "object",
66
+ "description": "Repository mission statistics data.",
67
+ "additionalProperties": true,
68
+ "properties": {
69
+ "path": { "type": "string", "description": "Repo-relative path to the workflow stats CSV." }
70
+ }
71
+ },
72
+ "review": {
73
+ "type": "object",
74
+ "description": "Review surface. An unset provider keeps the lifecycle running without a mirrored review provider; set provider to 'forgejo' (with baseUrl, remote, repo) to enable Forgejo, or 'none' to run without one.",
75
+ "additionalProperties": true,
76
+ "properties": {
77
+ "provider": { "type": ["string", "null"], "enum": ["forgejo", "none", null] },
78
+ "baseUrl": { "type": "string" },
79
+ "remote": { "type": "string" },
80
+ "repo": { "type": "string" }
81
+ }
82
+ },
83
+ "agents": {
84
+ "type": "object",
85
+ "description": "Agent adapter settings. Agent launcher commands are resolved from PATH and configured via operator-local environment, not this file.",
86
+ "additionalProperties": true,
87
+ "properties": {
88
+ "models": {
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.",
91
+ "additionalProperties": { "type": "string" }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
package/data/.gitkeep ADDED
File without changes
@@ -0,0 +1,114 @@
1
+ # ADR 0031: AI Agent Instruction Boundary and Bounded Command Floor
2
+
3
+ **Status:** Accepted
4
+ **Date:** 2026-03-31
5
+
6
+ ## Context
7
+
8
+ ADR 0023 established the repo's AI SDLC authority stack:
9
+
10
+ - `AGENTS.md` as the repo-wide authority
11
+ - locked `MISSION.md` as the execution contract
12
+ - prompt files under `docs/agent-prompts/` as mode-specific workflow guidance
13
+ - mission branches and worktrees as the execution boundary
14
+
15
+ ADR 0026 then added Backlog as the current-state and recovery surface.
16
+
17
+ That architecture created a new security question: agents now intentionally read large volumes of repo text, Backlog task text, and Forgejo review text. Some of that text is authoritative, but much of it is merely informative and can be stale, misleading, or adversarial.
18
+
19
+ The current repo also exposes an execution-surface asymmetry:
20
+
21
+ - repo policy is explicit about a safe local command floor and hard production boundaries
22
+ - Claude's repo-visible allowlist additionally permits `python -c` and `python3 -c`, which are broader than the explicitly enumerated floor and provide a generic scripting escape hatch if untrusted text is followed too literally
23
+
24
+ The threat-model mission behind this ADR concluded that the main practical risk is not a single "malicious file." It is instruction laundering across mixed-trust text surfaces: PR comments, task descriptions, docs, and checkpoint artifacts being treated as if they could override the mission contract.
25
+
26
+ ## Decision
27
+
28
+ Adopt an explicit instruction-boundary rule for the repo AI SDLC:
29
+
30
+ 1. The only repo-visible instruction-bearing artifacts for execution are:
31
+ - `AGENTS.md`
32
+ - relevant subdirectory `AGENTS.md`
33
+ - the locked `MISSION.md` for the current mission
34
+ - the mode prompt explicitly loaded for the current session
35
+ - direct human instructions in the current session
36
+ 2. Other consumed text is untrusted data unless the human explicitly promotes it into mission scope:
37
+ - Backlog descriptions, notes, and references
38
+ - Forgejo PR descriptions, comments, and review comments
39
+ - general docs, checkpoint artifacts, and code comments
40
+ - tool and MCP output
41
+ 3. Repo-managed command permissions should stay reviewable and as close as practical to the explicitly documented safe local command floor, but the repo may keep broader autonomy affordances when the operator cost of removing them is too high.
42
+ 4. The repo explicitly accepts the residual risk of keeping `python -c` and `python3 -c` in Claude's repo-visible allowlist. This is a conscious autonomy tradeoff, not an accidental gap.
43
+
44
+ ## Consequences
45
+
46
+ ### Positive
47
+
48
+ - The most important trust boundary becomes explicit rather than implied.
49
+ - Prompt injection through PR comments, task notes, and docs is easier to reason about because those surfaces are now formally classified as data.
50
+ - The trust-boundary rule is explicit even when the runtime command surface remains somewhat broader for autonomy reasons.
51
+ - Future workflow docs can be reviewed against a clear question: "is this authoritative instruction, or merely informative text?"
52
+
53
+ ### Negative
54
+
55
+ - Agents still need to read untrusted text to operate, so this does not remove the attack surface.
56
+ - Claude's generic local scripting path remains available, so prompt-injection blast radius is not minimized as aggressively as it could be.
57
+ - Codex/Gemini still depend more on runtime/wrapper controls than repo-visible deny rules, so enforcement symmetry remains imperfect.
58
+
59
+ ## Alternatives Considered
60
+
61
+ ### Keep the current implicit boundary and rely on agent judgment
62
+
63
+ Positive:
64
+
65
+ - No workflow or config churn.
66
+
67
+ Negative:
68
+
69
+ - Leaves instruction laundering under-specified.
70
+ - Makes review of workflow-security changes less objective.
71
+
72
+ ### Ban agents from reading PR comments, Backlog notes, or general docs
73
+
74
+ Positive:
75
+
76
+ - Reduces direct prompt-injection exposure.
77
+
78
+ Negative:
79
+
80
+ - Breaks normal execution and review workflows.
81
+ - Discards information the repo explicitly depends on.
82
+
83
+ ### Remove `python -c` and `python3 -c` from Claude's repo-visible allowlist
84
+
85
+ Positive:
86
+
87
+ - Narrows the most generic local scripting path exposed in repo-visible config.
88
+ - Better aligns Claude's allowlist with the explicit command floor.
89
+
90
+ Negative:
91
+
92
+ - Reduces normal agent autonomy for legitimate repo-local transforms.
93
+ - In this repo/runtime, that operator friction is judged worse than the marginal security gain.
94
+
95
+ ### Keep `python -c` and treat it as an accepted risk
96
+
97
+ Positive:
98
+
99
+ - Preserves maximum local scripting flexibility.
100
+ - Preserves the repo's autonomy-by-default operating model for legitimate local work.
101
+
102
+ Negative:
103
+
104
+ - Leaves a generic arbitrary-execution path in the allowlist that is broader than the documented floor.
105
+ - Increases the blast radius of command suggestion laundering.
106
+
107
+ Decision: chosen.
108
+
109
+ ## Links
110
+
111
+ - [ADR 0023](0023-ai-sdlc-configuration.md)
112
+ - [ADR 0026](0026-ai-task-state-and-agent-recovery-surface.md)
113
+ - [AI agent threat model](../security/ai-agent-threat-model.md)
114
+ - [Mission](../missions/2026/ai-agent-prompt-injection-threat-model-and-mitigation-design/MISSION.md)
@@ -0,0 +1,135 @@
1
+ # ADR 0032: Mission Refinement State and Usage-Budget Signals
2
+
3
+ **Status:** Accepted
4
+ **Date:** 2026-04-03
5
+ **Supersedes:** ADR 0026 in part (mission lifecycle specifics only)
6
+
7
+ ## Context
8
+
9
+ ADR 0026 adopted Backlog.md as the repo's current-state and recovery surface and fixed the first mission lifecycle at:
10
+
11
+ - `backlog`
12
+ - `active`
13
+ - `review`
14
+ - `approved`
15
+ - `done`
16
+
17
+ This ADR is not a duplicate of ADR 0026.
18
+
19
+ - ADR 0026 decided that Backlog.md is the repo's current-state and recovery surface.
20
+ - ADR 0032 decides how mission selection and pre-activation readiness work inside that current-state model.
21
+
22
+ That rollout solved the "what is current right now?" problem, but later workflow use exposed a selection gap:
23
+
24
+ - `backlog` was doing too much work as a state
25
+ - draft stubs, incomplete mission ideas, and genuinely shovel-ready missions were all mixed together
26
+ - the workflow had no explicit place to park a mission that already had a proper `MISSION.md` and passed docs verification, but was not yet chosen for execution
27
+ - mission selection still lacked a lightweight, shared way to express whether a mission fit inside the practical AI usage budget of the current workflow
28
+
29
+ The result was unnecessary ambiguity during pickup decisions. A mission could look well-specified in practice while still reading as generic `backlog`, and agents had no canonical place to record whether the mission should be activated as-is, split first, or deferred because it would likely overrun current AI-session and review budget.
30
+
31
+ ## Decision
32
+
33
+ Adopt a six-state target mission lifecycle for the workflow:
34
+
35
+ - `backlog`
36
+ - `ready`
37
+ - `active`
38
+ - `review`
39
+ - `approved`
40
+ - `done`
41
+
42
+ State meanings:
43
+
44
+ - `backlog`: idea stub, queued mission, or incomplete draft; a proper execution-ready mission contract does not yet exist
45
+ - `ready`: a proper `MISSION.md` exists, follows the repo mission shape, includes `## Refinement Signals`, and passes `./scripts/verify-local.sh docs`; the mission is shovel-ready and waiting for deliberate pickup (backlog.md actual state: `refined`)
46
+ - `active`: execution is underway in the mission worktree
47
+ - `review`: external review is underway and the review surface already exists
48
+ - `approved`: implementation and review are complete; only human/main-checkout merge follow-through remains (backlog.md actual state: `ready-for-integration`)
49
+ - `done`: the mission is integrated or otherwise conclusively closed
50
+
51
+ Also adopt one explicit place for selection metadata:
52
+
53
+ - store refinement metadata in `MISSION.md` under `## Refinement Signals`, immediately after `## Why Now`
54
+ - do not create custom Backlog task fields for this metadata; Backlog status plus notes/references remain the current-state layer
55
+
56
+ `## Refinement Signals` must contain:
57
+
58
+ - `Estimated agent % usage limit`: one of `0-25%`, `25-50%`, `50-75%`, `75-100%`, `100%+`
59
+ - `Confidence`: `High`, `Medium`, or `Low`
60
+ - `Selection note`: `activate as-is`, `split first`, or `defer`, with one short reason
61
+ - `Main drivers`: the 2-4 factors driving the estimate
62
+
63
+ Interpretation rule for `% usage limit`:
64
+
65
+ - it is an approximate share of a meaningful AI-assisted execution budget under the current repo workflow
66
+ - it may reflect scope breadth, trust-tier sensitivity, validation burden, review/handoff overhead, context churn, and cross-surface coupling
67
+ - it is a selection aid, not a delivery promise or pseudo-scientific schedule estimate
68
+
69
+ Default activation guidance:
70
+
71
+ - `0-25%` or `25-50%`: normally safe to activate as-is when confidence is not low
72
+ - `50-75%`: split first unless the mission is unusually high leverage and already sharply bounded
73
+ - `75-100%` or `100%+`: defer or split before activation under normal conditions
74
+ - if confidence is `Low`, keep refining instead of treating the estimate as reliable enough for pickup
75
+
76
+ Current rollout blocker:
77
+
78
+ - the repo config carries `refined`, and first-class `refined` support is now live in the Backlog MCP toolchain.
79
+ - this ADR therefore changes the workflow contract immediately, and the live task-state implementation is fully supported.
80
+
81
+ ## Consequences
82
+
83
+ ### Positive
84
+
85
+ - The workflow now distinguishes "not ready yet" from "ready, but not yet started."
86
+ - Mission comparison becomes more deliberate because shovel-ready candidates can be compared without immediately activating them.
87
+ - The `% usage limit` signal is lightweight enough to aid selection without creating a second planning system.
88
+ - `MISSION.md` remains the detailed execution contract while Backlog stays the current-state surface.
89
+
90
+ ### Negative
91
+
92
+ - The lifecycle gains one more state conceptually, so operators must learn one more transition.
93
+ - Some older workflow docs and historical artifacts will continue to mention the earlier five-state model.
94
+ - `% usage limit` still depends on judgment and may drift if agents stop recording the main drivers behind the estimate.
95
+
96
+ ## Alternatives Considered
97
+
98
+ ### Keep the five-state lifecycle and treat "shovel-ready" as a note inside `backlog`
99
+
100
+ Positive:
101
+
102
+ - No lifecycle change.
103
+ - No Backlog config update required.
104
+
105
+ Negative:
106
+
107
+ - Keeps draft stubs and execution-ready missions mixed together.
108
+ - Makes pickup decisions depend on deeper reading and tribal interpretation.
109
+
110
+ ### Add custom metadata directly to Backlog tasks
111
+
112
+ Positive:
113
+
114
+ - Puts all selection data on the board surface.
115
+
116
+ Negative:
117
+
118
+ - Turns Backlog into a second mission-template system.
119
+ - Pushes schema/tooling churn into the current-state layer instead of keeping detailed reasoning in `MISSION.md`.
120
+
121
+ ### Use numeric scoring or story points instead of usage-limit bands
122
+
123
+ Positive:
124
+
125
+ - Feels more precise for ranking.
126
+
127
+ Negative:
128
+
129
+ - Encourages false precision.
130
+ - Creates higher calibration cost than the workflow can realistically sustain.
131
+
132
+ ## Links
133
+
134
+ - [ADR 0026](0026-ai-task-state-and-agent-recovery-surface.md)
135
+ - [Mission](../missions/2026/task-024-mission-complexity-estimation/MISSION.md)