@ai-content-space/loopx 0.1.0 → 0.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 (43) hide show
  1. package/README.md +26 -26
  2. package/package.json +6 -2
  3. package/plugins/loopx/.codex-plugin/plugin.json +6 -6
  4. package/plugins/loopx/scripts/plugin-install.test.mjs +25 -8
  5. package/plugins/loopx/skills/autopilot/SKILL.md +90 -0
  6. package/plugins/loopx/skills/build/SKILL.md +118 -0
  7. package/plugins/loopx/skills/clarify/SKILL.md +219 -0
  8. package/plugins/loopx/skills/plan/SKILL.md +238 -0
  9. package/plugins/loopx/skills/{loopx-review → review}/SKILL.md +9 -4
  10. package/skills/ai-slop-cleaner/SKILL.md +114 -0
  11. package/skills/autopilot/SKILL.md +90 -0
  12. package/skills/autoresearch/SKILL.md +68 -0
  13. package/skills/build/SKILL.md +118 -0
  14. package/skills/clarify/SKILL.md +219 -0
  15. package/skills/deep-interview/SKILL.md +461 -0
  16. package/skills/deepsearch/SKILL.md +38 -0
  17. package/skills/plan/SKILL.md +238 -0
  18. package/skills/ralph/SKILL.md +271 -0
  19. package/skills/ralplan/SKILL.md +49 -0
  20. package/skills/{loopx-review → review}/SKILL.md +9 -4
  21. package/src/autopilot-runtime.mjs +152 -0
  22. package/src/build-runtime.mjs +146 -0
  23. package/src/cli.mjs +43 -7
  24. package/src/codex-exec-runtime.mjs +97 -0
  25. package/src/install-discovery.mjs +7 -7
  26. package/src/plan-runtime.mjs +456 -0
  27. package/src/runtime-maintenance.mjs +36 -8
  28. package/src/workflow.mjs +825 -123
  29. package/templates/architecture.md +3 -3
  30. package/templates/development-plan.md +1 -1
  31. package/templates/execution-record.md +1 -1
  32. package/templates/plan.md +4 -4
  33. package/templates/review-report.md +1 -1
  34. package/templates/spec.md +38 -2
  35. package/templates/test-plan.md +1 -1
  36. package/plugins/loopx/skills/loopx-autopilot/SKILL.md +0 -30
  37. package/plugins/loopx/skills/loopx-build/SKILL.md +0 -25
  38. package/plugins/loopx/skills/loopx-clarify/SKILL.md +0 -25
  39. package/plugins/loopx/skills/loopx-plan/SKILL.md +0 -25
  40. package/skills/loopx-autopilot/SKILL.md +0 -30
  41. package/skills/loopx-build/SKILL.md +0 -25
  42. package/skills/loopx-clarify/SKILL.md +0 -25
  43. package/skills/loopx-plan/SKILL.md +0 -25
@@ -0,0 +1,238 @@
1
+ ---
2
+ name: plan
3
+ description: Consensus-first loopx planning skill with Planner, Architect, and Critic review.
4
+ argument-hint: "[--interactive] [--deliberate] [--direct <spec-path>] <clarified task or spec path>"
5
+ ---
6
+
7
+ # loopx Plan
8
+
9
+ <Purpose>
10
+ `plan` is loopx's canonical planning gate. It turns an approved clarify result or execution-ready spec into a reviewed plan package before build or autopilot starts.
11
+
12
+ By default, `plan` includes the full consensus review loop formerly documented under `ralplan`: Planner -> Architect -> Critic. Planner creates the plan, Architect reviews it, Critic gates it, and the plan iterates until approved or the iteration cap is reached.
13
+ </Purpose>
14
+
15
+ <Use_When>
16
+ - A clarify spec exists and needs a concrete execution package.
17
+ - The user asks for `plan`, `ralplan`, consensus planning, PRD, test spec, implementation plan, or architecture review.
18
+ - The request is clear enough to plan, but execution should not start before architecture and verification shape are reviewed.
19
+ - The downstream path may be `build`, `autopilot`, or another execution lane, but still needs a stable plan artifact first.
20
+ </Use_When>
21
+
22
+ <Do_Not_Use_When>
23
+ - Requirements are still vague enough that intent, non-goals, or decision boundaries are unresolved. Use `clarify` first.
24
+ - The user explicitly asks to implement a concrete small change immediately and no planning gate is needed.
25
+ - A current approved plan package already exists and the next action is execution.
26
+ </Do_Not_Use_When>
27
+
28
+ <Core_Principles>
29
+ - Default planning is consensus-first, not lightweight-by-default.
30
+ - Treat the clarify spec as source of truth; do not re-interview unless the spec is incomplete or contradictory.
31
+ - Keep planning artifact-bound: produce PRD, architecture, development plan, and test plan outputs.
32
+ - Separate planning approval from execution approval.
33
+ - Do not start implementation from `plan`.
34
+ - Prefer a smaller executable plan over a broad plan that cannot be verified.
35
+ - Preserve non-goals, decision boundaries, and residual-risk warnings from clarify.
36
+ </Core_Principles>
37
+
38
+ <Inputs>
39
+ Accepted inputs:
40
+
41
+ - an approved loopx clarify workflow slug
42
+ - `.loopx/specs/clarify-*.md`
43
+ - `.omx/specs/deep-interview-*.md`
44
+ - a direct task description when enough context is already present
45
+ - `--direct <spec-path>` to force a specific requirements artifact
46
+
47
+ If no requirements artifact is provided, derive a task slug and run pre-context intake before planning.
48
+ </Inputs>
49
+
50
+ <Flags>
51
+ - `--interactive`: ask the user at draft review and final approval boundaries.
52
+ - `--deliberate`: force high-rigor planning. Add pre-mortem and expanded test planning.
53
+ - `--direct <spec-path>`: use the given artifact as the planning source of truth.
54
+
55
+ `ralplan` is a compatibility alias for this default consensus behavior. It should not maintain a separate planning contract.
56
+ </Flags>
57
+
58
+ <Pre_Context_Intake>
59
+ Before planning:
60
+
61
+ 1. Derive a task slug.
62
+ 2. Reuse the latest relevant `.omx/context/{slug}-*.md` snapshot when available.
63
+ 3. If none exists, create `.omx/context/{slug}-{timestamp}.md` with:
64
+ - task statement
65
+ - desired outcome
66
+ - source requirements artifact
67
+ - known facts / evidence
68
+ - constraints
69
+ - non-goals
70
+ - decision boundaries
71
+ - unknowns / open questions
72
+ - likely codebase touchpoints
73
+ 4. For brownfield tasks, inspect relevant repo files before finalizing the plan.
74
+ 5. If ambiguity is still high, route back to `clarify` instead of inventing missing requirements.
75
+ 6. If planning depends on unfamiliar SDKs, external APIs, or version-sensitive framework behavior, use official documentation or a researcher lane before final approval.
76
+ </Pre_Context_Intake>
77
+
78
+ <Consensus_Workflow>
79
+ ## Step 1. Planner Draft
80
+
81
+ Planner creates the initial plan package and a compact RALPLAN-DR summary:
82
+
83
+ - Principles: 3-5 guiding constraints
84
+ - Decision Drivers: top 3 forces shaping the plan
85
+ - Viable Options: at least 2 options with bounded pros / cons
86
+ - Rejected Options: explicit invalidation when only one option remains viable
87
+ - Plan Package:
88
+ - PRD / requirements translation
89
+ - architecture approach
90
+ - development plan
91
+ - test plan
92
+ - acceptance criteria
93
+ - risk register
94
+
95
+ In `--deliberate` mode, also include:
96
+
97
+ - pre-mortem with 3 plausible failure scenarios
98
+ - expanded test plan covering unit, integration, e2e, and observability where applicable
99
+
100
+ ## Step 2. Draft User Review (`--interactive` only)
101
+
102
+ If interactive mode is enabled, present the draft plus the DR summary and ask whether to:
103
+
104
+ - proceed to Architect review
105
+ - request changes
106
+ - reject / stop
107
+
108
+ Without `--interactive`, proceed automatically to Architect review.
109
+
110
+ ## Step 3. Architect Review
111
+
112
+ Architect reviews the plan for soundness. This step must finish before Critic starts.
113
+
114
+ Architect must provide:
115
+
116
+ - strongest steelman objection to the plan
117
+ - at least one real tradeoff tension
118
+ - architecture risks and mitigations
119
+ - synthesis or recommended revision when the objection is valid
120
+ - deliberate-mode principle-violation checks when applicable
121
+
122
+ ## Step 4. Critic Gate
123
+
124
+ Critic runs only after Architect review completes.
125
+
126
+ Critic evaluates:
127
+
128
+ - principle-option consistency
129
+ - fairness of alternatives
130
+ - clarity of risk mitigation
131
+ - testable acceptance criteria
132
+ - concrete verification steps
133
+ - explicit non-goals and decision boundaries
134
+ - in deliberate mode: pre-mortem and expanded test plan quality
135
+
136
+ Critic verdicts:
137
+
138
+ - `APPROVE`
139
+ - `ITERATE`
140
+ - `REJECT`
141
+
142
+ ## Step 5. Closed Re-Review Loop
143
+
144
+ If Critic returns `ITERATE` or `REJECT`, run a full closed loop:
145
+
146
+ 1. collect Architect + Critic feedback
147
+ 2. revise the plan with Planner
148
+ 3. return to Architect review
149
+ 4. return to Critic gate
150
+ 5. repeat until `APPROVE` or 5 iterations
151
+
152
+ Do not patch only the Critic complaint in isolation if the Architect objection implies a deeper plan change.
153
+
154
+ ## Step 6. Final Plan Package
155
+
156
+ On approval, write canonical planning artifacts:
157
+
158
+ - `.loopx/workflows/<slug>/plan.md`
159
+ - `.loopx/workflows/<slug>/architecture.md`
160
+ - `.loopx/workflows/<slug>/development-plan.md`
161
+ - `.loopx/workflows/<slug>/test-plan.md`
162
+ - `.loopx/plans/prd-<slug>.md`
163
+ - `.loopx/plans/test-spec-<slug>.md`
164
+
165
+ The final plan must include:
166
+
167
+ - ADR: Decision, Drivers, Alternatives considered, Why chosen, Consequences, Follow-ups
168
+ - concrete implementation steps sized to the actual task
169
+ - available execution lanes and recommended lane
170
+ - test and verification commands
171
+ - residual risks and assumptions
172
+ - explicit build/autopilot handoff guidance
173
+
174
+ ## Step 7. Execution Bridge
175
+
176
+ `plan` stops at an approved plan package.
177
+
178
+ In `--interactive` mode, ask for the next lane:
179
+
180
+ - approve for `build`
181
+ - approve for `autopilot`
182
+ - request plan changes
183
+ - stop
184
+
185
+ Without `--interactive`, report the approved plan and recommended next command, but do not launch execution.
186
+ </Consensus_Workflow>
187
+
188
+ <Runtime_State_Machine>
189
+ `plan` must keep the planning gate machine-checkable. Runtime state should track:
190
+
191
+ - `plan_current_iteration`: starts at `1`
192
+ - `plan_max_iterations`: default `5`
193
+ - `plan_consensus_mode`: `true` by default
194
+ - `plan_deliberate_mode`: `true|false`
195
+ - `plan_principles_resolved`: `true` after principles are explicit
196
+ - `plan_options_reviewed`: `true` after alternatives are fairly compared
197
+ - `plan_architect_review_status`: `not-started|complete|changes-requested`
198
+ - `plan_critic_verdict`: `none|approve|iterate|reject`
199
+ - `plan_package_status`: `missing|partial|complete`
200
+ - `plan_acceptance_criteria_testable`: `true|false`
201
+ - `plan_verification_steps_resolved`: `true|false`
202
+ - `requested_transition`: remains explicit before build/autopilot
203
+
204
+ The plan gate is blocked until:
205
+
206
+ - plan package artifacts exist
207
+ - Architect review is complete
208
+ - Critic verdict is `approve`
209
+ - acceptance criteria are testable
210
+ - verification steps are concrete
211
+ - user approval exists for any execution transition
212
+ </Runtime_State_Machine>
213
+
214
+ <Must_Not_Decide_Automatically>
215
+ - Do not skip Architect review.
216
+ - Do not run Architect and Critic in parallel; Critic depends on Architect.
217
+ - Do not launch build/autopilot without explicit approval.
218
+ - Do not widen scope beyond clarify non-goals because a broader redesign seems cleaner.
219
+ - Do not erase residual-risk warnings inherited from clarify.
220
+ - Do not treat a plan as approved when Critic returns `ITERATE` or `REJECT`.
221
+ </Must_Not_Decide_Automatically>
222
+
223
+ <Output_Contract>
224
+ Primary outputs:
225
+
226
+ - approved plan package under `.loopx/workflows/<slug>/`
227
+ - canonical PRD and test spec under `.loopx/plans/`
228
+ - consensus review summary with Planner / Architect / Critic evidence
229
+ - next-step recommendation
230
+
231
+ Status output must clearly state:
232
+
233
+ - current iteration
234
+ - Architect review status
235
+ - Critic verdict
236
+ - missing plan gates, if any
237
+ - whether execution is approved
238
+ </Output_Contract>
@@ -1,8 +1,13 @@
1
- # LoopX Review
1
+ ---
2
+ name: review
3
+ description: Repo-local acceptance surface for loopx.
4
+ ---
5
+
6
+ # loopx Review
2
7
 
3
8
  ## Purpose
4
9
 
5
- Repo-local acceptance surface for LoopX. Use it to evaluate the execution package from `loopx-build` and return an explicit go / no-go result.
10
+ Repo-local acceptance surface for loopx. Use it to evaluate the execution package from `build` and return an explicit go / no-go result.
6
11
 
7
12
  ## Expected Outputs
8
13
 
@@ -13,7 +18,7 @@ Repo-local acceptance surface for LoopX. Use it to evaluate the execution packag
13
18
  ## Decision Boundary
14
19
 
15
20
  - Use this only after build has produced execution and verification evidence for a specific run.
16
- - Stop here if review evidence is incomplete. `loopx-review` remains an independent gate and does not auto-complete the workflow.
21
+ - Stop here if review evidence is incomplete. `review` remains an independent gate and does not auto-complete the workflow.
17
22
 
18
23
  ## Must Not Decide Automatically
19
24
 
@@ -22,4 +27,4 @@ Repo-local acceptance surface for LoopX. Use it to evaluate the execution packag
22
27
 
23
28
  ## Notes
24
29
 
25
- - Review consumes structured outputs from the active LoopX run. It should reject thin or placeholder-only evidence.
30
+ - Review consumes structured outputs from the active loopx run. It should reject thin or placeholder-only evidence.
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: ai-slop-cleaner
3
+ description: Run an anti-slop cleanup/refactor/deslop workflow
4
+ ---
5
+
6
+ # AI Slop Cleaner Skill
7
+
8
+ Reduce AI-generated slop with a regression-tests-first, smell-by-smell cleanup workflow that preserves behavior and raises signal quality.
9
+
10
+ ## When to Use
11
+
12
+ Use this skill when:
13
+ - A code path works but feels bloated, noisy, repetitive, or over-abstracted
14
+ - A user asks to “cleanup”, “refactor”, or “deslop” AI-generated output
15
+ - Follow-up implementation left duplicate code, dead code, weak boundaries, missing tests, or unnecessary wrapper layers
16
+ - You need a disciplined cleanup workflow without broad rewrites
17
+
18
+ ## GPT-5.4 Guidance Alignment
19
+
20
+ - Keep outputs concise and evidence-dense unless risk or the user requests more detail.
21
+ - Treat newer user instructions as local workflow updates without discarding earlier non-conflicting constraints.
22
+ - Keep using inspection, tests, diagnostics, and verification until the cleanup is grounded.
23
+ - Proceed automatically through clear, reversible cleanup steps; ask only when a choice materially changes scope or behavior.
24
+
25
+ ## Scoped File Lists and Ralph Workflow
26
+
27
+ - This skill can accept a **file list scope** instead of a whole feature area.
28
+ - When the caller provides a changed-files list (for example, Ralph session-owned edits), keep the cleanup strictly bounded to those files.
29
+ - In the **Ralph workflow**, the mandatory deslop pass should run this skill on Ralph's changed files only, in standard mode unless the caller explicitly requests otherwise.
30
+
31
+ ## Procedure
32
+
33
+ 1. **Lock behavior with regression tests first**
34
+ - Identify the behavior that must not change
35
+ - Add or run targeted regression tests before editing cleanup candidates
36
+ - If behavior is currently untested, create the narrowest test coverage needed first
37
+
38
+ 2. **Create a cleanup plan before code**
39
+ - List the specific smells to remove
40
+ - Bound the pass to the requested files/scope
41
+ - If a file list scope is provided, keep the pass restricted to that changed-files list
42
+ - Order fixes from safest/highest-signal to riskiest
43
+ - Do not start coding until the cleanup plan is explicit
44
+
45
+ 3. **Categorize issues before editing**
46
+ - **Duplication** — repeated logic, copy-paste branches, redundant helpers
47
+ - **Dead code** — unused code, unreachable branches, stale flags, debug leftovers
48
+ - **Needless abstraction** — pass-through wrappers, speculative indirection, single-use helper layers
49
+ - **Boundary violations** — hidden coupling, leaky responsibilities, wrong-layer imports or side effects
50
+ - **Missing tests** — behavior not locked, weak regression coverage, gaps around edge cases
51
+
52
+ 4. **Execute passes one smell at a time**
53
+ - **Pass 1: Dead code deletion**
54
+ - **Pass 2: Duplicate removal**
55
+ - **Pass 3: Naming/error handling cleanup**
56
+ - **Pass 4: Test reinforcement**
57
+ - Re-run targeted verification after each pass
58
+ - Avoid bundling unrelated refactors into the same edit set
59
+
60
+ 5. **Run quality gates**
61
+ - Regression tests stay green
62
+ - Lint passes
63
+ - Typecheck passes
64
+ - Relevant unit/integration tests pass
65
+ - Static/security scan passes when available
66
+ - Diff stays minimal and scoped
67
+ - No new abstractions or dependencies unless explicitly required
68
+
69
+ 6. **Finish with an evidence-dense report**
70
+ - Changed files
71
+ - Simplifications made
72
+ - Tests/diagnostics/build checks run
73
+ - Remaining risks
74
+ - Residual follow-ups or consciously deferred cleanup
75
+
76
+ ## Output Format
77
+
78
+ ```text
79
+ AI SLOP CLEANUP REPORT
80
+ ======================
81
+
82
+ Scope: [files or feature area]
83
+ Behavior Lock: [targeted regression tests added/run]
84
+ Cleanup Plan: [bounded smells and order]
85
+
86
+ Passes Completed:
87
+ 1. Pass 1: Dead code deletion - [concise fix]
88
+ 2. Pass 2: Duplicate removal - [concise fix]
89
+ 3. Pass 3: Naming/error handling cleanup - [concise fix]
90
+ 4. Pass 4: Test reinforcement - [concise fix]
91
+
92
+ Quality Gates:
93
+ - Regression tests: PASS/FAIL
94
+ - Lint: PASS/FAIL
95
+ - Typecheck: PASS/FAIL
96
+ - Tests: PASS/FAIL
97
+ - Static/security scan: PASS/FAIL or N/A
98
+
99
+ Changed Files:
100
+ - [path] - [simplification]
101
+
102
+ Remaining Risks:
103
+ - [none or short deferred item]
104
+ ```
105
+
106
+ ## Scenario Examples
107
+
108
+ **Good:** The user says `continue` after tests already lock behavior and the next smell pass is clear. Continue with the next bounded cleanup pass.
109
+
110
+ **Good:** The user narrows the scope to a specific file after planning. Keep the regression-tests-first workflow, but apply the new scope locally.
111
+
112
+ **Bad:** Start rewriting architecture before protecting behavior with tests.
113
+
114
+ **Bad:** Collapse multiple smell categories into one large refactor with no intermediate verification.
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: autopilot
3
+ description: Richer internal-phase loopx autonomous orchestration over the public clarify/plan/build/review flow.
4
+ argument-hint: "<workflow slug>"
5
+ ---
6
+
7
+ # loopx Autopilot
8
+
9
+ <Purpose>
10
+ `autopilot` is loopx's autonomous orchestration surface. It upgrades the current bounded composition model by adding richer internal phases while keeping loopx's public stage model authoritative.
11
+
12
+ Externally, the user still reasons about:
13
+
14
+ - `clarify`
15
+ - `plan`
16
+ - `build`
17
+ - `review`
18
+
19
+ Internally, `autopilot` may orchestrate richer phases such as expansion, planning, execution, QA, and validation.
20
+ </Purpose>
21
+
22
+ <Use_When>
23
+ - One owner wants loopx to run end-to-end with internal autonomous orchestration.
24
+ - A clarified or workflow-local spec already exists, or the workflow is ready to begin from loopx stages.
25
+ - The task benefits from richer internal planning/execution/QA/validation behavior without exposing a more complex public stage surface.
26
+ </Use_When>
27
+
28
+ <Do_Not_Use_When>
29
+ - The user wants manual control over each stage gate.
30
+ - The task should stop after planning or execution rather than run end-to-end.
31
+ - Requirements are too ambiguous for bounded autonomous orchestration.
32
+ </Do_Not_Use_When>
33
+
34
+ <Core_Principles>
35
+ - loopx public stage truth remains authoritative.
36
+ - Richer internal phases are allowed, but they stay internal.
37
+ - Internal stage approvals may be auto-consumed and must be recorded as control events.
38
+ - Canonical loopx artifacts remain the source of truth; `run.json` is an orchestration ledger.
39
+ - Reuse strengthened loopx stage runtimes rather than re-implementing contradictory truths.
40
+ </Core_Principles>
41
+
42
+ <Internal_Phases>
43
+ Suggested internal phase model:
44
+
45
+ - `expansion`
46
+ - `planning`
47
+ - `execution`
48
+ - `qa`
49
+ - `validation`
50
+
51
+ Phase-to-stage alignment:
52
+
53
+ - `expansion` -> clarified-spec reuse or clarify preparation
54
+ - `planning` -> loopx `plan`
55
+ - `execution` + `qa` -> loopx `build`
56
+ - `validation` -> pre-review validation plus loopx `review`
57
+ </Internal_Phases>
58
+
59
+ <Control_Plane>
60
+ - one autopilot invocation authorizes one bounded autopilot run
61
+ - autopilot may internally consume stage approvals for:
62
+ - `clarify -> plan`
63
+ - `plan -> build`
64
+ - `build -> review`
65
+ - `review -> done`
66
+ - these decisions must be recorded as internal control events
67
+ </Control_Plane>
68
+
69
+ <Artifact_Contract>
70
+ Canonical stage artifacts remain authoritative:
71
+
72
+ - clarify spec artifacts
73
+ - `.loopx/plans/prd-<slug>.md`
74
+ - `.loopx/plans/test-spec-<slug>.md`
75
+ - canonical build `execution-record.md`
76
+ - canonical review `review-report.md`
77
+
78
+ Autopilot also writes an orchestration ledger:
79
+
80
+ - `.loopx/autopilot/<slug>/run.json`
81
+
82
+ `run.json` may include internal phase progression, blockers, and control events, but it must not replace canonical stage artifacts as the source of truth.
83
+ </Artifact_Contract>
84
+
85
+ <Must_Not_Decide_Automatically>
86
+ - do not create a new public stage family
87
+ - do not bypass loopx canonical artifacts
88
+ - do not fork a second workflow truth that contradicts loopx stages
89
+ - do not literally port the parent autopilot where it conflicts with loopx runtime contracts
90
+ </Must_Not_Decide_Automatically>
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: autoresearch
3
+ description: Stateful validator-gated research loop with native-hook persistence
4
+ ---
5
+
6
+ # Autoresearch
7
+
8
+ Autoresearch is the skill-first replacement for the deprecated `omx autoresearch` command.
9
+ It keeps the useful measured-research loop, but it now runs as a native-hook stateful workflow instead of a direct CLI or tmux launch surface.
10
+
11
+ ## Use when
12
+ - You want a Ralph-ish persistent research loop
13
+ - The task should keep nudging until explicit validation evidence exists
14
+ - You want init-time choice between script validation and prompt+architect validation
15
+
16
+ ## Do not use when
17
+ - You want the old `omx autoresearch` command surface (hard-deprecated)
18
+ - You want detached tmux or split-pane launch parity
19
+ - You have not decided the validation regime yet
20
+
21
+ ## Core contract
22
+ 1. **Init chooses validation mode.** Pick exactly one:
23
+ - `mission-validator-script`
24
+ - `prompt-architect-artifact`
25
+ 2. **Persist mode state** in `.omx/state/.../autoresearch-state.json` including:
26
+ - `validation_mode`
27
+ - `completion_artifact_path`
28
+ - `mission_validator_command` **or** `validator_prompt`
29
+ - optional `output_artifact_path`
30
+ 3. **Completion is artifact-gated.** The loop does not stop because the model says “done”, because a stop hook fired once, or because several turns were no-ops.
31
+ 4. **Direct CLI launch is gone.** Use `$deep-interview --autoresearch` for intake and `$autoresearch` for execution.
32
+
33
+ ## Completion artifact contract
34
+
35
+ ### `mission-validator-script`
36
+ The completion artifact must exist and record a passing validator result, for example:
37
+
38
+ ```json
39
+ {
40
+ "status": "passed",
41
+ "passed": true,
42
+ "summary": "metric improved beyond baseline"
43
+ }
44
+ ```
45
+
46
+ ### `prompt-architect-artifact`
47
+ The completion artifact must include both an architect approval verdict and an output artifact path, for example:
48
+
49
+ ```json
50
+ {
51
+ "validator_prompt": "Review the research output against the mission.",
52
+ "architect_review": { "verdict": "approved" },
53
+ "output_artifact_path": ".omx/specs/autoresearch-demo/report.md"
54
+ }
55
+ ```
56
+
57
+ ## Recommended flow
58
+ 1. Run `$deep-interview --autoresearch` to clarify mission + evaluator.
59
+ 2. Materialize `.omx/specs/autoresearch-{slug}/mission.md`, `sandbox.md`, and `result.json`.
60
+ 3. Start `$autoresearch` with the chosen validation mode stored in mode state.
61
+ 4. Let stop-hook / auto-nudge continue until the completion artifact satisfies the chosen validation mode.
62
+ 5. Finish only after the validator artifact is complete.
63
+
64
+ ## Migration note
65
+ - `omx autoresearch` is hard-deprecated.
66
+ - No direct CLI launch.
67
+ - No tmux split-pane launch.
68
+ - No noop-count completion gate.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: build
3
+ description: Ralph-style loopx execution runtime under the public build stage.
4
+ argument-hint: "[--no-deslop] <approved workflow slug>"
5
+ ---
6
+
7
+ # loopx Build
8
+
9
+ <Purpose>
10
+ `build` is loopx's canonical execution lane. It executes an approved plan with Ralph-style rigor while keeping the public loopx stage surface unchanged.
11
+
12
+ By default, `build` is not a one-shot draft writer. It is a persistence loop with internal parallel lanes, fresh verification, architect gating, deslop, and regression re-verification before `review` can start.
13
+ </Purpose>
14
+
15
+ <Use_When>
16
+ - `plan -> build` has already been explicitly approved.
17
+ - Canonical plan artifacts already exist and execution should now proceed.
18
+ - The task needs execution persistence, verification evidence, and explicit pre-review quality gates.
19
+ </Use_When>
20
+
21
+ <Do_Not_Use_When>
22
+ - Requirements or planning are still incomplete.
23
+ - The user wants to skip execution and only review or inspect the plan.
24
+ - A valid build run is already review-ready and the next action is `review`.
25
+ </Do_Not_Use_When>
26
+
27
+ <Core_Principles>
28
+ - Public surface stays `build`; internal strength can still match Ralph-style execution.
29
+ - Execution may parallelize internally without exposing a public `team` stage.
30
+ - `build` does not replace `review`.
31
+ - `execution-record.md` remains the sole canonical execution and verification artifact.
32
+ - Fresh evidence is required before review handoff.
33
+ - Deslop and regression re-verification are part of the default build path.
34
+ </Core_Principles>
35
+
36
+ <Preconditions>
37
+ `build` starts only when all of the following are true:
38
+
39
+ - approved `plan -> build` transition exists
40
+ - `.loopx/plans/prd-<slug>.md` exists
41
+ - `.loopx/plans/test-spec-<slug>.md` exists
42
+ - workflow-local planning artifacts required by the execution lane exist
43
+ </Preconditions>
44
+
45
+ <Execution_Model>
46
+ `build` should behave like a Ralph-style execution runtime:
47
+
48
+ 1. Initialize or resume build iteration state.
49
+ 2. Run internal execution / evidence / verification lanes in parallel.
50
+ 3. Aggregate lane results into canonical `execution-record.md`.
51
+ 4. Run fresh verification and read actual output.
52
+ 5. Run architect verification as a hard pre-review gate.
53
+ 6. Run deslop on build-owned changes.
54
+ 7. Re-run regression verification after deslop.
55
+ 8. Stop only when review handoff gates are satisfied or a real blocker remains.
56
+
57
+ `build` may persist support artifacts for runtime inspection, but they must not replace `execution-record.md`.
58
+ </Execution_Model>
59
+
60
+ <Runtime_State_Machine>
61
+ `build` should track at minimum:
62
+
63
+ - `build_run_id`
64
+ - `build_current_iteration`
65
+ - `build_max_iterations` (default `10`)
66
+ - `build_parallel_mode`
67
+ - `build_lane_statuses`
68
+ - `build_verification_status`
69
+ - `build_architect_verification_status`
70
+ - `build_deslop_status`
71
+ - `build_regression_status`
72
+ - `build_blockers`
73
+ - `build_progress_artifact_paths`
74
+ - `build_support_evidence_paths`
75
+ - `execution_record_status`
76
+
77
+ `build -> review` is blocked until:
78
+
79
+ - all internal lanes are complete
80
+ - fresh verification passes
81
+ - architect verification is approved
82
+ - deslop is complete, unless explicitly skipped
83
+ - post-deslop regression passes
84
+ - `execution-record.md` is complete
85
+ </Runtime_State_Machine>
86
+
87
+ <Artifact_Contract>
88
+ Canonical artifact:
89
+
90
+ - `execution-record.md`
91
+
92
+ Support artifacts may exist for:
93
+
94
+ - iteration progress
95
+ - lane evidence summaries
96
+ - architect gate summaries
97
+ - deslop summaries
98
+ - regression summaries
99
+
100
+ These support artifacts are runtime aids only. They must not become new canonical review inputs.
101
+ </Artifact_Contract>
102
+
103
+ <Review_Boundary>
104
+ - build-internal architect verification is an execution-quality gate
105
+ - review remains the final independent stage
106
+ - review continues to own provenance checks, evidence completeness checks, completion/rollback decisions, and code-review
107
+ </Review_Boundary>
108
+
109
+ <Flags>
110
+ - `--no-deslop`: skip the deslop pass and the post-deslop regression loop, while still requiring the latest successful pre-deslop verification evidence
111
+ </Flags>
112
+
113
+ <Must_Not_Decide_Automatically>
114
+ - do not self-approve review
115
+ - do not mark the workflow complete
116
+ - do not replace `execution-record.md` with support artifacts
117
+ - do not widen execution into public `team`, `ultrawork`, or `ralph` command surfaces
118
+ </Must_Not_Decide_Automatically>