@dirtydishes/skills 0.1.5 → 0.1.6

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 (26) hide show
  1. package/README.md +12 -5
  2. package/package.json +1 -1
  3. package/skills/dirtyloops/SKILL.md +9 -5
  4. package/skills/dirtyloops/examples/README.md +2 -2
  5. package/skills/dirtyloops/examples/orchestrator-callback/README.md +3 -3
  6. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/IMPLEMENT.md +8 -6
  7. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/closeout-selector-subagent.md +2 -2
  8. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/implementation-thread.md +7 -5
  9. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/review-thread.md +7 -5
  10. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/run-loop.md +5 -4
  11. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/prompts/selector-subagent.md +2 -2
  12. package/skills/dirtyloops/examples/orchestrator-callback/docs/implementation/example-stream/turn-docs/01-foundation.md +3 -3
  13. package/skills/dirtyloops/plan.html +8 -3
  14. package/skills/dirtyloops/references/beads.md +10 -5
  15. package/skills/dirtyloops/references/create-loop.md +10 -6
  16. package/skills/dirtyloops/references/help.md +16 -2
  17. package/skills/dirtyloops/references/run-loop.md +6 -4
  18. package/skills/dirtyloops/references/update-loop.md +88 -0
  19. package/skills/dirtyloops/references/workflows/orchestrator-callback.md +6 -4
  20. package/skills/dirtyloops/templates/common/IMPLEMENT.md.template +2 -1
  21. package/skills/dirtyloops/templates/common/run-loop.md.template +3 -1
  22. package/skills/dirtyloops/templates/workflows/orchestrator-callback/closeout-selector-subagent-prompt.md.template +2 -2
  23. package/skills/dirtyloops/templates/workflows/orchestrator-callback/implementation-thread-prompt.md.template +7 -5
  24. package/skills/dirtyloops/templates/workflows/orchestrator-callback/review-thread-prompt.md.template +7 -5
  25. package/skills/dirtyloops/templates/workflows/orchestrator-callback/run-loop-addendum.md.template +6 -4
  26. package/skills/dirtyloops/templates/workflows/orchestrator-callback/selector-subagent-prompt.md.template +2 -2
package/README.md CHANGED
@@ -45,6 +45,8 @@ The catalog distinguishes three dependency classes:
45
45
 
46
46
  `dirtyloops` currently requires the external `bd` tool, requires `thermo-nuclear-code-quality-review`, and recommends `impeccable`. Required and recommended skills are updated to the latest version when they are packaged in `@dirtydishes/skills@latest`. If a dependency is not packaged yet, `doctor` reports whether it is already installed locally and exits nonzero when a required dependency is missing.
47
47
 
48
+ The installer command `npx @dirtydishes/skills@latest update dirtyloops` updates the installed skill package only. To refresh loop artifacts that were already generated inside a project, invoke the skill branch `dirtyloops update <workflow>` inside that project.
49
+
48
50
  For local development from this checkout:
49
51
 
50
52
  ```bash
@@ -65,6 +67,7 @@ Use it when a project needs durable implementation control instead of one-off ch
65
67
 
66
68
  - `dirtyloops help` - Explain the available commands, workflows, examples, and expected artifacts.
67
69
  - `dirtyloops create <workflow>` - Compile a finalized plan into Beads loop metadata and a generated loop scaffold.
70
+ - `dirtyloops update <workflow>` - Refresh an existing loop's generated runtime artifacts and loop contract metadata to the current dirtyloops contract without recreating the loop.
68
71
  - `dirtyloops run <workflow>` - Execute ready phases until the epic is complete, blocked, interrupted, or review/CI is unresolved.
69
72
  - `dirtyloops run <workflow> --once` - Execute only the next ready phase, close it out, and stop.
70
73
  - `dirtyloops inspect <workflow>` - Summarize loop state without mutating files, Beads, branches, PRs, or threads.
@@ -83,6 +86,8 @@ The normal flow is two-stage:
83
86
 
84
87
  `create` is the plan compiler. `run` is the execution loop. Keep those separate so the generated artifacts become the durable source of truth before implementation begins.
85
88
 
89
+ Use `dirtyloops update <workflow>` on already-created loops after installing a newer dirtyloops skill. It updates generated runtime prompts, schemas, `IMPLEMENT.md`, and Beads loop metadata contract fields, while preserving phase docs, turn docs, code, branch/PR state, issue status, dependencies, `loop-state.md` history, and storyboard files unless you explicitly ask for a wider migration. For `orchestrator-callback`, it strips persisted callback targets back to `RUNTIME_ORCHESTRATOR_THREAD_ID` and upgrades stale generated child defaults to `reasoning: xhigh`.
90
+
86
91
  #### Generated Artifacts
87
92
 
88
93
  A created loop writes a project-local execution surface under `docs/implementation/<stream-slug>/`:
@@ -110,11 +115,11 @@ The skill package itself mirrors that shape:
110
115
  #### Workflows
111
116
 
112
117
  - `single-thread-subagent` - One visible coordinator thread owns loop state while per-phase mass subagent swarms handle selection, scouting, slice planning, implementation assistance, review, and CI.
113
- - `orchestrator-callback` - One orchestrator thread delegates phase gates to selector subagents, creates separate implementation and review threads, and receives callbacks to a concrete orchestrator thread id when workers/reviewers are done or blocked.
118
+ - `orchestrator-callback` - One orchestrator thread delegates phase gates to selector subagents, creates separate implementation and review threads, and receives callbacks to a runtime-bound concrete orchestrator thread id when workers/reviewers are done or blocked.
114
119
 
115
120
  Choose `single-thread-subagent` when you want one visible coordinator thread, less thread management, and a CLI-friendly loop. The main coordinator owns the branch, integration, PR state, Beads updates, and closeout. Every phase uses selector, scout, slice-plan, implementation-helper, reviewer, and CI swarms; subagents inspect, split phases into slices, prepare implementation guidance or patches, review, verify CI, and report, but they do not advance loop state. Fewer agents require an explicit tiny-phase reason in the turn doc before implementation.
116
121
 
117
- Choose `orchestrator-callback` when you want the original multi-thread flow. The orchestrator launches a selector subagent before the first worker, creates implementation threads with a concrete callback target id, waits for implementation callbacks, creates review threads with the same callback target id, waits for review and CI callbacks, launches a closeout-selector subagent between phases, updates Beads, and then advances only to the selected next phase. Implementation threads are swarm-first for non-trivial phases: they run scout, slice-plan, and implementation-helper swarms, synthesize a coherent slice plan, integrate helper output, and only then open the PR.
122
+ Choose `orchestrator-callback` when you want the original multi-thread flow. The orchestrator launches a selector subagent before the first worker, resolves the runtime callback target for the current run, creates implementation threads with that callback target, waits for implementation callbacks, creates review threads with the same callback target, waits for review and CI callbacks, launches a closeout-selector subagent between phases, updates Beads, and then advances only to the selected next phase. Implementation threads are swarm-first for non-trivial phases: they run scout, slice-plan, and implementation-helper swarms, synthesize a coherent slice plan, integrate helper output, and only then open the PR.
118
123
 
119
124
  #### Authority Rules
120
125
 
@@ -134,7 +139,9 @@ The `dirtyloops` skill is strict about ownership:
134
139
 
135
140
  For `orchestrator-callback`, only the orchestrator creates implementation and review threads. It must create them in the intended Codex project worktree using first-class thread environment control; launching a generic thread and telling it to `cd` into the worktree is a workflow violation. Worker and reviewer prompts include expected repo root/worktree plus branch/ref for verification, and a child that starts in the wrong environment blocks and calls back instead of self-relocating. The orchestrator must launch a selector subagent before the first worker and a closeout-selector subagent after each review callback before stopping or continuing. Implementation threads do not create review threads, review threads do not create follow-up implementation threads, selector subagents never implement, closeout-selector subagents never mutate Beads, and reviewer subagents never close Beads issues.
136
141
 
137
- Every `orchestrator-callback` child thread must launch with explicit actor settings: `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor. This applies to selector, implementation, review, and closeout-selector threads. Current UI settings, recent Codex thread defaults, parent/orchestrator settings, `fast`, and `xhigh` are not valid launch defaults unless the actor metadata names them.
142
+ Every `orchestrator-callback` child thread must launch with explicit actor settings: `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor. This applies to selector, implementation, review, and closeout-selector threads. Current UI settings, recent Codex thread defaults, parent/orchestrator settings, `fast`, and `high` are not valid launch defaults unless the actor metadata names them.
143
+
144
+ The orchestrator callback target is bound at run time, not at loop creation. `dirtyloops create` leaves `RUNTIME_ORCHESTRATOR_THREAD_ID` as a placeholder in generated artifacts and must not bake in the creator thread id. `dirtyloops run` resolves the actual thread id for the thread orchestrating that run, or uses an explicit callback target supplied for that run, then substitutes it into worker/reviewer prompts before launch. If the prompt still contains the placeholder, a prior-run id, a child thread id, or generic text like `this thread`, the child thread must not be launched.
138
145
 
139
146
  For `orchestrator-callback`, implementation threads must not do broad solo implementation. For non-trivial phases, they run 8-20 scout agents, 8-16 slice-plan agents, and 8-16 implementation-helper agents before broad edits. The implementation thread synthesizes reports into the existing turn doc, integrates helper output coherently, owns gates and PR state, and includes a `swarm_summary` in the implementation callback. If a phase is tiny enough to use fewer agents, the reason is recorded in the turn doc and callback.
140
147
 
@@ -142,9 +149,9 @@ For `single-thread-subagent`, the coordinator must run per-phase selector/scout/
142
149
 
143
150
  #### Callback Contracts
144
151
 
145
- Implementation threads call back exactly once when the PR is ready, the task is complete but PR creation is blocked, or the phase is genuinely blocked. The callback includes the concrete orchestrator thread id, source thread id, Beads issue id, status, branch, PR, commits, turn doc, local gates, changed files, `swarm_summary`, blockers, and context to keep.
152
+ Implementation threads call back exactly once when the PR is ready, the task is complete but PR creation is blocked, or the phase is genuinely blocked. The callback includes the concrete runtime orchestrator thread id, source thread id, Beads issue id, status, branch, PR, commits, turn doc, local gates, changed files, `swarm_summary`, blockers, and context to keep.
146
153
 
147
- Review threads call back exactly once after review and CI are resolved. The callback includes the concrete orchestrator thread id, source thread id, Beads issue id, status, PR, CI state, review skill, repairs, remaining findings, turn doc, and context to keep.
154
+ Review threads call back exactly once after review and CI are resolved. The callback includes the concrete runtime orchestrator thread id, source thread id, Beads issue id, status, PR, CI state, review skill, repairs, remaining findings, turn doc, and context to keep.
148
155
 
149
156
  Prefer callback-driven coordination over polling. After launching a worker or reviewer, the orchestrator waits for the single callback; it does not repeatedly read, monitor, summarize, or status-check the child thread. For long-running worker or reviewer threads, use a lightweight heartbeat around 30 minutes only when the callback is overdue or liveness is uncertain. Do not launch callback threads whose actual prompt text says only `current orchestrator thread`, `this thread`, or another generic callback target.
150
157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dirtydishes/skills",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Installer and catalog for dirtydishes agent skills.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: dirtyloops
3
- description: Create, run, inspect, close, and explain Beads-canonical Codex implementation loops.
4
- argument-hint: "help|create|run|inspect|closeout, optional workflow"
3
+ description: Create, update, run, inspect, close, and explain Beads-canonical Codex implementation loops.
4
+ argument-hint: "help|create|update|run|inspect|closeout, optional workflow"
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
@@ -13,6 +13,7 @@ A dirtyloop is a Beads-canonical Codex implementation loop: phase docs, one Mark
13
13
 
14
14
  1. Parse the branch from the user's request.
15
15
  - `create`: turn a finalized plan into Beads issues, typed loop metadata, implementation docs, templates, and a run prompt.
16
+ - `update`: refresh an existing loop's contract metadata and generated runtime artifacts to the current dirtyloops contract without recreating the loop.
16
17
  - `run`: execute the loop until the epic is complete, blocked, interrupted, or `run once` is requested.
17
18
  - `inspect`: summarize the current loop state without changing it.
18
19
  - `closeout`: verify completion and generate the post-run storyboard.
@@ -23,7 +24,7 @@ A dirtyloop is a Beads-canonical Codex implementation loop: phase docs, one Mark
23
24
  2. Select the workflow.
24
25
  - Skip this step for `help`.
25
26
  - `single-thread-subagent`: one coordinator thread uses mass subagent swarms for selection, scouting, slice planning, implementation assistance, review, and CI; no separate Codex worker/reviewer threads.
26
- - `orchestrator-callback`: an orchestrator thread delegates phase gates to selector subagents, creates implementation threads, then review threads; workers and reviewers call back to a concrete orchestrator thread id.
27
+ - `orchestrator-callback`: an orchestrator thread delegates phase gates to selector subagents, creates implementation threads, then review threads; workers and reviewers call back to the runtime-bound concrete orchestrator thread id.
27
28
  - Choose `orchestrator-callback` when the user mentions original loop flow, new threads, callbacks, worker threads, implementation threads, or review threads.
28
29
  - Choose `single-thread-subagent` when the user mentions single thread, CLI-friendly, or keeping all orchestration in one thread.
29
30
  - If the workflow is ambiguous for `create` or `run`, ask one concise question.
@@ -33,6 +34,7 @@ A dirtyloop is a Beads-canonical Codex implementation loop: phase docs, one Mark
33
34
  - For `help`, read only `references/help.md`, then answer without mutating files, Beads, branches, PRs, or threads.
34
35
  - For all non-help branches, read `references/common.md`, `references/beads.md`, `references/swarms.md`, `references/review-ci.md`, and `references/turn-docs.md`.
35
36
  - For `create`, read `references/create-loop.md`.
37
+ - For `update`, read `references/update-loop.md`.
36
38
  - For `run`, read `references/run-loop.md`.
37
39
  - For `inspect`, read `references/inspect-loop.md`.
38
40
  - For `closeout`, read `references/storyboard.md`.
@@ -53,15 +55,17 @@ A dirtyloop is a Beads-canonical Codex implementation loop: phase docs, one Mark
53
55
  - Beads records typed dirtyloop metadata: workflow, run policy, branch/PR policy, quality gates, callback policy, actor-specific thread defaults, and swarm policy.
54
56
  - Phase docs are execution context linked from Beads.
55
57
  - Generated docs, prompts, examples, and callback payloads use repo-relative paths. Do not include user-specific home directories or usernames in generated loop artifacts.
58
+ - `dirtyloops update` is conservative: it may update loop contract metadata and generated runtime artifacts, but it must not rewrite phase docs, turn docs, implementation code, branches, PRs, issue status, issue dependencies, or storyboard history unless the user explicitly asks for that wider mutation.
56
59
  - Use one Markdown turn doc per phase.
57
60
  - Reviewers update the existing phase turn doc; they do not create a separate review doc.
58
61
  - Reviewer agents must use `thermo-nuclear-code-quality-review`.
59
62
  - Reviewer and CI verification agents own CI.
60
63
  - `dirtyloops run` continues phase-by-phase by default. Stop only when the epic is complete, blocked, interrupted, review/CI is unresolved, or the user explicitly asked for `run once` / `--once`.
61
64
  - For `orchestrator-callback`, the orchestrator must spawn a selector subagent before the first worker and a closeout-selector subagent after each review callback before continuing or stopping. The orchestrator validates their reports and remains the only actor that mutates Beads, updates loop state, creates implementation/review threads, or advances the loop.
62
- - Orchestrator-callback prompts and callback payloads must carry the concrete orchestrator thread id. Do not launch a worker or reviewer if the actual instruction text says only `current orchestrator thread`, `this thread`, or another generic target.
65
+ - Orchestrator-callback callback targets are runtime-bound. `create` must not persist, print, or bake in the thread id of the agent that created the loop; generated artifacts keep a runtime callback-target placeholder. `run` must resolve the actual thread id for the thread orchestrating this run before any worker/reviewer launch.
66
+ - Orchestrator-callback prompts and callback payloads must carry the concrete runtime orchestrator thread id after binding. Do not launch a worker or reviewer if the actual instruction text still contains a placeholder or says only `current orchestrator thread`, `this thread`, or another generic target.
63
67
  - Orchestrator-callback is callback-wait, not active monitoring. After launching a worker or reviewer, the orchestrator must not repeatedly read, monitor, or summarize the child thread while waiting for its single callback. Use only a sparse fallback heartbeat when the callback is overdue or liveness is uncertain.
64
- - Every orchestrator-callback child thread defaults to `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads loop metadata explicitly overrides that actor. This applies to selector, implementation, review, and closeout-selector threads. Do not launch child threads with inherited `fast`, `xhigh`, current UI, or orchestrator-thread settings.
68
+ - Every orchestrator-callback child thread defaults to `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads loop metadata explicitly overrides that actor. This applies to selector, implementation, review, and closeout-selector threads. Do not launch child threads with inherited `fast`, `high`, current UI, or orchestrator-thread settings.
65
69
  - Orchestrator-callback implementation threads are swarm-first for non-trivial phases: they must run massive bounded scout, slice-plan, and implementation-helper swarms before broad edits, synthesize one coherent slice plan, integrate helper output, and include `swarm_summary` in the implementation callback.
66
70
  - For `single-thread-subagent`, the coordinator orchestrates, synthesizes, integrates, owns branch/PR/Beads state, and closes out. Each phase must launch per-phase selector, scout, slice-plan, implementation-helper, review, and CI swarms unless the phase is explicitly tiny and the reason is recorded in the turn doc. Direct coordinator implementation is for integration, glue, conflict resolution, and final repair work.
67
71
  - Use large bounded subagent swarms: per-phase for `single-thread-subagent`, swarm-first inside non-trivial `orchestrator-callback` implementation threads, 8+ by default for scout, slice-plan, implementation-helper, and review work, and up to 20 when the phase warrants it.
@@ -3,6 +3,6 @@
3
3
  These examples show the shape `$dirtyloops create` should produce.
4
4
 
5
5
  - `single-thread-subagent/` shows one visible coordinator thread with mass subagent swarms, slice planning, implementation helpers, review, and CI verification.
6
- - `orchestrator-callback/` shows the original thread-callback loop: orchestrator thread, selector and closeout-selector subagents, implementation threads, review threads, concrete callback targets, and callback payloads.
6
+ - `orchestrator-callback/` shows the original thread-callback loop: orchestrator thread, selector and closeout-selector subagents, implementation threads, review threads, runtime-bound callback targets, and callback payloads.
7
7
 
8
- Treat these as shape examples, not content to copy verbatim. New loops should fill in repo-specific Beads ids, phase docs, gates, branch policy, callback target ids, actor-specific thread defaults, swarm policy, and prompt wording.
8
+ Treat these as shape examples, not content to copy verbatim. New loops should fill in repo-specific Beads ids, phase docs, gates, branch policy, runtime callback placeholders, actor-specific thread defaults, swarm policy, and prompt wording.
@@ -7,14 +7,14 @@ Topology:
7
7
  ```text
8
8
  orchestrator thread
9
9
  -> selector subagent chooses first ready phase
10
- -> implementation thread with exact callback target
10
+ -> implementation thread with runtime-bound exact callback target
11
11
  -> scout/slice-plan/implementation-helper swarms
12
12
  -> worker integrates one coherent PR
13
13
  -> implementation callback when PR-ready
14
- -> review thread with exact callback target
14
+ -> review thread with runtime-bound exact callback target
15
15
  -> review callback when review + CI resolved
16
16
  -> closeout-selector subagent verifies closeout and next phase
17
17
  -> orchestrator applies closeout and continues or stops
18
18
  ```
19
19
 
20
- Beads is canonical. The docs are execution context. Implementation and review callbacks echo the concrete orchestrator thread id and source thread id. Review and CI update the existing phase turn doc.
20
+ Beads is canonical. The docs are execution context. Implementation and review callbacks echo the runtime-bound concrete orchestrator thread id and source thread id. Review and CI update the existing phase turn doc.
@@ -26,17 +26,17 @@ Only the orchestrator creates implementation and review threads. It creates them
26
26
  Selector subagents:
27
27
 
28
28
  - run before the first implementation thread
29
- - launch with `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the selector actor
29
+ - launch with `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the selector actor
30
30
  - read Beads, `IMPLEMENT.md`, `loop-state.md`, and linked phase docs
31
31
  - return a `swarm-report` with mission `selector`
32
32
  - never implement, mutate Beads, edit files, or create threads
33
33
 
34
34
  Implementation threads:
35
35
 
36
- - receive the full phase doc, Beads issue id, branch policy, quality gates, and orchestrator thread id
36
+ - receive the full phase doc, Beads issue id, branch policy, quality gates, and runtime-bound orchestrator thread id
37
37
  - start in the intended repo/worktree environment before prompt execution
38
38
  - verify repo root, worktree, and branch/ref before edits; block and call back if the launch environment is wrong
39
- - launch with `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the implementation actor
39
+ - launch with `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the implementation actor
40
40
  - have prompt text that names the exact orchestrator thread id as callback target
41
41
  - run 8-20 scout agents, 8-16 slice-plan agents, and 8-16 implementation-helper agents for non-trivial phases
42
42
  - synthesize swarm reports into one coherent slice plan before broad edits
@@ -51,7 +51,7 @@ Review threads:
51
51
  - use `thermo-nuclear-code-quality-review`
52
52
  - start in the intended repo/worktree environment before prompt execution
53
53
  - verify repo root, worktree, and branch/ref before review or repair; block and call back if the launch environment is wrong
54
- - launch with `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the review actor
54
+ - launch with `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the review actor
55
55
  - have prompt text that names the exact orchestrator thread id as callback target
56
56
  - may use reviewer and CI verification subagents
57
57
  - own CI, repairs, reruns, and evidence
@@ -61,7 +61,7 @@ Review threads:
61
61
  Closeout-selector subagents:
62
62
 
63
63
  - run after each review callback and before the orchestrator closes, stops, or launches another worker
64
- - launch with `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the closeout-selector actor
64
+ - launch with `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides the closeout-selector actor
65
65
  - check the review callback, PR/CI evidence, existing turn doc, Beads dependencies, and `loop-state.md`
66
66
  - recommend exact closeout actions and at most one next phase
67
67
  - return a `swarm-report` with mission `closeout-selector`
@@ -71,7 +71,9 @@ The orchestrator validates selector reports, owns Beads closeout, and launches o
71
71
 
72
72
  After launching implementation or review threads, the orchestrator waits for the single callback. It does not repeatedly read, monitor, summarize, or status-check the child thread unless a sparse fallback heartbeat is needed for an overdue callback or liveness recovery.
73
73
 
74
- No `orchestrator-callback` child thread inherits current UI settings, recent Codex thread defaults, or parent/orchestrator speed/reasoning. `fast` speed and `xhigh` reasoning are allowed only when Beads metadata explicitly names that value for the actor being launched.
74
+ The orchestrator callback target is resolved when the loop is run. Generated artifacts may contain `RUNTIME_ORCHESTRATOR_THREAD_ID`, but the orchestrator must replace it with the actual callback target for the thread orchestrating this run before launching implementation or review threads.
75
+
76
+ No `orchestrator-callback` child thread inherits current UI settings, recent Codex thread defaults, or parent/orchestrator speed/reasoning. `fast` speed and `high` reasoning are allowed only when Beads metadata explicitly names that value for the actor being launched.
75
77
 
76
78
  ## Phase Ledger
77
79
 
@@ -9,10 +9,10 @@ Mission: verify the just-reviewed phase can be closed out, then recommend stop o
9
9
  Launch defaults:
10
10
 
11
11
  - speed: `standard`
12
- - reasoning: `high`
12
+ - reasoning: `xhigh`
13
13
  - inherit_orchestrator_thread_settings: `false`
14
14
 
15
- Do not run this closeout-selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the closeout-selector actor.
15
+ Do not run this closeout-selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the closeout-selector actor.
16
16
 
17
17
  Read:
18
18
 
@@ -4,9 +4,11 @@ You are the implementation thread for Beads issue `example-epic.1`.
4
4
 
5
5
  Callback target:
6
6
 
7
- `THREAD_ORCHESTRATOR_ID`
7
+ `RUNTIME_ORCHESTRATOR_THREAD_ID`
8
8
 
9
- Send your final callback to exact orchestrator thread id `THREAD_ORCHESTRATOR_ID`. Do not rely on `current orchestrator thread`, `this thread`, or implicit wrapper metadata.
9
+ This must be replaced by the runtime callback target before launch. If it is still `RUNTIME_ORCHESTRATOR_THREAD_ID`, a loop-creation thread id, or any non-concrete value, stop and report a launch preflight failure.
10
+
11
+ After replacement, send your final callback to exact orchestrator thread id `RUNTIME_ORCHESTRATOR_THREAD_ID`. Do not rely on `current orchestrator thread`, `this thread`, or implicit wrapper metadata.
10
12
 
11
13
  ## Inputs
12
14
 
@@ -16,8 +18,8 @@ Send your final callback to exact orchestrator thread id `THREAD_ORCHESTRATOR_ID
16
18
  - Turn doc: `docs/implementation/example-stream/turn-docs/01-foundation.md`
17
19
  - Expected repo/worktree and branch/ref: create or use `example-stream/01-foundation`
18
20
  - Launch environment: this thread must already be bound to the intended Codex project worktree before this prompt runs
19
- - Launch defaults: speed `standard`, reasoning `high`, inherit_orchestrator_thread_settings `false`
20
- - Do not run this worker with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the implementation actor
21
+ - Launch defaults: speed `standard`, reasoning `xhigh`, inherit_orchestrator_thread_settings `false`
22
+ - Do not run this worker with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the implementation actor
21
23
 
22
24
  ## Rules
23
25
 
@@ -38,5 +40,5 @@ Send your final callback to exact orchestrator thread id `THREAD_ORCHESTRATOR_ID
38
40
  - Open or update the PR.
39
41
  - Do not create the review thread.
40
42
  - Call back exactly once to the orchestrator when PR-ready or blocked.
41
- - The callback payload must include `orchestrator_thread_id: "THREAD_ORCHESTRATOR_ID"` and your `source_thread_id`.
43
+ - The callback payload must include `orchestrator_thread_id: "RUNTIME_ORCHESTRATOR_THREAD_ID"` and your `source_thread_id`.
42
44
  - The callback payload must include `swarm_summary` with scout, slice-plan, implementation-helper, slice, synthesis, and under-default rationale fields.
@@ -4,9 +4,11 @@ You are the review thread for Beads issue `example-epic.1`.
4
4
 
5
5
  Callback target:
6
6
 
7
- `THREAD_ORCHESTRATOR_ID`
7
+ `RUNTIME_ORCHESTRATOR_THREAD_ID`
8
8
 
9
- Send your final callback to exact orchestrator thread id `THREAD_ORCHESTRATOR_ID`. Do not rely on `current orchestrator thread`, `this thread`, or implicit wrapper metadata.
9
+ This must be replaced by the runtime callback target before launch. If it is still `RUNTIME_ORCHESTRATOR_THREAD_ID`, a loop-creation thread id, or any non-concrete value, stop and report a launch preflight failure.
10
+
11
+ After replacement, send your final callback to exact orchestrator thread id `RUNTIME_ORCHESTRATOR_THREAD_ID`. Do not rely on `current orchestrator thread`, `this thread`, or implicit wrapper metadata.
10
12
 
11
13
  ## Mandatory Skill
12
14
 
@@ -22,8 +24,8 @@ Use:
22
24
  - PR: `#123`
23
25
  - Required gates: `bun test`, `bun run typecheck`
24
26
  - Launch environment: this thread must already be bound to the intended Codex project worktree before this prompt runs
25
- - Launch defaults: speed `standard`, reasoning `high`, inherit_orchestrator_thread_settings `false`
26
- - Do not run this reviewer with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the review actor
27
+ - Launch defaults: speed `standard`, reasoning `xhigh`, inherit_orchestrator_thread_settings `false`
28
+ - Do not run this reviewer with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the review actor
27
29
 
28
30
  ## Rules
29
31
 
@@ -36,4 +38,4 @@ Use:
36
38
  - Update the existing Markdown turn doc.
37
39
  - Do not create follow-up implementation threads.
38
40
  - Call back exactly once when review and CI are resolved.
39
- - The callback payload must include `orchestrator_thread_id: "THREAD_ORCHESTRATOR_ID"` and your `source_thread_id`.
41
+ - The callback payload must include `orchestrator_thread_id: "RUNTIME_ORCHESTRATOR_THREAD_ID"` and your `source_thread_id`.
@@ -17,9 +17,10 @@ Start from:
17
17
  - Continue phase-by-phase until the epic is complete, blocked, interrupted, or review/CI is unresolved.
18
18
  - Only the orchestrator creates implementation and review threads.
19
19
  - Implementation and review threads must be created in the intended Codex project worktree using first-class thread environment control. Do not launch a generic thread and ask it to `cd` into the worktree.
20
- - Selector, implementation, review, and closeout-selector threads launch with explicit actor settings: `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor.
21
- - Do not inherit current UI settings, recent Codex thread defaults, parent/orchestrator settings, `fast`, or `xhigh` unless Beads metadata explicitly names that value for the actor being launched.
22
- - Worker and reviewer prompt text must include the exact orchestrator thread id `THREAD_ORCHESTRATOR_ID` as callback target.
20
+ - Selector, implementation, review, and closeout-selector threads launch with explicit actor settings: `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor.
21
+ - Do not inherit current UI settings, recent Codex thread defaults, parent/orchestrator settings, `fast`, or `high` unless Beads metadata explicitly names that value for the actor being launched.
22
+ - Resolve the runtime callback target for this run, then replace `RUNTIME_ORCHESTRATOR_THREAD_ID` before launching worker or reviewer threads.
23
+ - Worker and reviewer prompt text must include the resolved exact orchestrator thread id as callback target. Do not launch if the placeholder remains.
23
24
  - Worker and reviewer prompt text lists the expected repo root/worktree and branch/ref for verification only. A child that starts in the wrong environment blocks and calls back instead of self-relocating.
24
25
  - After launching a worker or reviewer, wait for its single callback; do not repeatedly read, monitor, summarize, or status-check the child thread.
25
26
  - Implementation threads are swarm-first for non-trivial phases: 8-20 scout agents, 8-16 slice-plan agents, and 8-16 implementation-helper agents before broad edits.
@@ -38,4 +39,4 @@ Start from:
38
39
 
39
40
  ## Start Prompt
40
41
 
41
- Run the Example Stream dirtyloop with workflow `orchestrator-callback`. Use Beads epic `example-epic` as canonical. Read `docs/implementation/example-stream/IMPLEMENT.md` and `docs/implementation/example-stream/loop-state.md`, launch a selector subagent with `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` to select one next ready Beads child issue, create an implementation thread in the intended Codex project worktree with those same explicit defaults, the full linked phase doc, exact callback target `THREAD_ORCHESTRATOR_ID` in the prompt text, and expected repo root/worktree plus branch/ref for verification. The implementation thread must block and call back if its launch environment is wrong; it must not self-relocate with `cd`. The implementation thread must run 8-20 scout agents, 8-16 slice-plan agents, and 8-16 implementation-helper agents for non-trivial phases, synthesize their reports into one coherent slice plan, integrate helper output, and include `swarm_summary` in its callback. Wait for an implementation callback that echoes `orchestrator_thread_id` and includes `source_thread_id` without repeatedly reading or monitoring the worker thread. Create a review thread in the intended Codex project worktree with those same explicit defaults that uses `thermo-nuclear-code-quality-review`, verifies repo root/worktree plus branch/ref before review or repair, owns CI, and blocks with callback if its launch environment is wrong. After the review callback reports concrete CI state and echoes the same callback target, launch a closeout-selector subagent with those same explicit defaults to verify closeout and select stop or at most one next phase. Do not inherit current UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the actor being launched. Apply Beads and loop-state updates only from the orchestrator. Do not let worker threads create review threads. Continue to the next selected phase unless the epic is complete, blocked, interrupted, or review/CI is unresolved.
42
+ Run the Example Stream dirtyloop with workflow `orchestrator-callback`. Use Beads epic `example-epic` as canonical. Read `docs/implementation/example-stream/IMPLEMENT.md` and `docs/implementation/example-stream/loop-state.md`, resolve the runtime callback target for the thread orchestrating this run, launch a selector subagent with `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` to select one next ready Beads child issue, create an implementation thread in the intended Codex project worktree with those same explicit defaults, the full linked phase doc, the resolved callback target substituted wherever `RUNTIME_ORCHESTRATOR_THREAD_ID` appears in the prompt text, and expected repo root/worktree plus branch/ref for verification. The implementation thread must block and call back if its launch environment is wrong; it must not self-relocate with `cd`. The implementation thread must run 8-20 scout agents, 8-16 slice-plan agents, and 8-16 implementation-helper agents for non-trivial phases, synthesize their reports into one coherent slice plan, integrate helper output, and include `swarm_summary` in its callback. Wait for an implementation callback that echoes `orchestrator_thread_id` and includes `source_thread_id` without repeatedly reading or monitoring the worker thread. Create a review thread in the intended Codex project worktree with those same explicit defaults that uses `thermo-nuclear-code-quality-review`, has the same resolved callback target substituted into the prompt text, verifies repo root/worktree plus branch/ref before review or repair, owns CI, and blocks with callback if its launch environment is wrong. After the review callback reports concrete CI state and echoes the same callback target, launch a closeout-selector subagent with those same explicit defaults to verify closeout and select stop or at most one next phase. Do not inherit current UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the actor being launched. Apply Beads and loop-state updates only from the orchestrator. Do not let worker threads create review threads. Continue to the next selected phase unless the epic is complete, blocked, interrupted, or review/CI is unresolved.
@@ -9,10 +9,10 @@ Mission: select at most one next ready Beads phase for the orchestrator.
9
9
  Launch defaults:
10
10
 
11
11
  - speed: `standard`
12
- - reasoning: `high`
12
+ - reasoning: `xhigh`
13
13
  - inherit_orchestrator_thread_settings: `false`
14
14
 
15
- Do not run this selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the selector actor.
15
+ Do not run this selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the selector actor.
16
16
 
17
17
  Read:
18
18
 
@@ -12,7 +12,7 @@ Selected by selector subagent `THREAD_SELECTOR_ID` after `bd ready` showed `exam
12
12
 
13
13
  ## Implementation Log
14
14
 
15
- - Implementation thread `THREAD_IMPLEMENTATION_ID` created with orchestrator callback target `THREAD_ORCHESTRATOR_ID`.
15
+ - Implementation thread `THREAD_IMPLEMENTATION_ID` created with orchestrator callback target `RUNTIME_ORCHESTRATOR_THREAD_ID`.
16
16
  - Worker launched 12 scout agents, 8 slice-plan agents, and 10 implementation-helper agents.
17
17
  - Worker synthesized swarm reports into five file-group slices, integrated helper output, and resolved final test wiring in the main worker thread.
18
18
  - Worker created branch `example-stream/01-foundation`.
@@ -23,7 +23,7 @@ Selected by selector subagent `THREAD_SELECTOR_ID` after `bd ready` showed `exam
23
23
  ```json
24
24
  {
25
25
  "type": "implementation-callback",
26
- "orchestrator_thread_id": "THREAD_ORCHESTRATOR_ID",
26
+ "orchestrator_thread_id": "RUNTIME_ORCHESTRATOR_THREAD_ID",
27
27
  "source_thread_id": "THREAD_IMPLEMENTATION_ID",
28
28
  "phase_issue_id": "example-epic.1",
29
29
  "status": "pr-ready",
@@ -70,7 +70,7 @@ Evidence:
70
70
  ```json
71
71
  {
72
72
  "type": "review-callback",
73
- "orchestrator_thread_id": "THREAD_ORCHESTRATOR_ID",
73
+ "orchestrator_thread_id": "RUNTIME_ORCHESTRATOR_THREAD_ID",
74
74
  "source_thread_id": "THREAD_REVIEW_ID",
75
75
  "phase_issue_id": "example-epic.1",
76
76
  "status": "repaired",
@@ -418,6 +418,10 @@
418
418
  <h3><code>$dirtyloops create</code></h3>
419
419
  <p>Turns the finalized plan into a Beads epic, child phase issues, typed loop metadata, implementation docs, workflow prompts, schemas, loop state, and a paste-ready run prompt.</p>
420
420
  </article>
421
+ <article class="panel">
422
+ <h3><code>$dirtyloops update</code></h3>
423
+ <p>Refreshes an already-created loop's generated runtime prompts, schemas, contract docs, and Beads loop metadata without recreating phase docs, turn docs, implementation state, or PR history.</p>
424
+ </article>
421
425
  <article class="panel">
422
426
  <h3><code>$dirtyloops run</code></h3>
423
427
  <p>Reads Beads, executes ready phases through the selected workflow, updates the existing turn docs and Beads, then continues until complete, blocked, interrupted, unresolved, or <code>--once</code>.</p>
@@ -457,7 +461,7 @@
457
461
 
458
462
  <article class="workflow-card callback">
459
463
  <h3>orchestrator-callback</h3>
460
- <p>The original loop shape. A main orchestrator delegates phase gates to selector subagents, creates child threads with explicit standard speed, high reasoning, and no inherited settings, requires swarm-first implementation workers, waits without monitoring, then advances after validated callbacks and closeout reports.</p>
464
+ <p>The original loop shape. A main orchestrator delegates phase gates to selector subagents, binds the callback target at run time, creates child threads with explicit standard speed, xhigh reasoning, and no inherited settings, requires swarm-first implementation workers, waits without monitoring, then advances after validated callbacks and closeout reports.</p>
461
465
  <div class="flow">
462
466
  <div class="node callback">
463
467
  <b>1</b>
@@ -500,7 +504,7 @@
500
504
  <tr>
501
505
  <td>Implementation</td>
502
506
  <td>Mass subagents split and assist; coordinator integrates glue, conflicts, and final repairs.</td>
503
- <td>Implementation thread created by orchestrator in the intended Codex project worktree with exact callback target and standard defaults.</td>
507
+ <td>Implementation thread created by orchestrator in the intended Codex project worktree with runtime-bound callback target and standard defaults.</td>
504
508
  </tr>
505
509
  <tr>
506
510
  <td>Review</td>
@@ -580,7 +584,8 @@ Repo: .
580
584
  Stream slug: example-stream
581
585
  Epic title: Example stream migration
582
586
  Run policy: until complete; use --once only for one-shot operation
583
- Thread defaults: selector/implementation/review/closeout-selector speed standard, reasoning high, no inherit
587
+ Thread defaults: selector/implementation/review/closeout-selector speed standard, reasoning xhigh, no inherit
588
+ Callback target: runtime-bound; never captured from loop creation
584
589
  Quality gates: bun test, bun run typecheck, targeted browser QA
585
590
  Branch/PR policy: one active implementation PR at a time</code></pre>
586
591
  </section>
@@ -52,15 +52,15 @@ Epic metadata must include:
52
52
  "branch_pr_policy": "...",
53
53
  "quality_gates": ["..."],
54
54
  "thread_defaults": {
55
- "selector": { "speed": "standard", "reasoning": "high", "inherit_orchestrator_thread_settings": false },
56
- "implementation": { "speed": "standard", "reasoning": "high", "inherit_orchestrator_thread_settings": false },
57
- "review": { "speed": "standard", "reasoning": "high", "inherit_orchestrator_thread_settings": false },
58
- "closeout_selector": { "speed": "standard", "reasoning": "high", "inherit_orchestrator_thread_settings": false }
55
+ "selector": { "speed": "standard", "reasoning": "xhigh", "inherit_orchestrator_thread_settings": false },
56
+ "implementation": { "speed": "standard", "reasoning": "xhigh", "inherit_orchestrator_thread_settings": false },
57
+ "review": { "speed": "standard", "reasoning": "xhigh", "inherit_orchestrator_thread_settings": false },
58
+ "closeout_selector": { "speed": "standard", "reasoning": "xhigh", "inherit_orchestrator_thread_settings": false }
59
59
  }
60
60
  }
61
61
  ```
62
62
 
63
- Thread defaults are actor-specific. Do not use `inherit`, current UI settings, the parent/orchestrator thread setting, or recent Codex thread defaults as the source of child-thread speed or reasoning. `fast` speed and `xhigh` reasoning are allowed only when the loop metadata explicitly names that value for that actor.
63
+ Thread defaults are actor-specific. Do not use `inherit`, current UI settings, the parent/orchestrator thread setting, or recent Codex thread defaults as the source of child-thread speed or reasoning. `fast` speed and `high` reasoning are allowed only when the loop metadata explicitly names that value for that actor.
64
64
 
65
65
  For `orchestrator-callback`, add:
66
66
 
@@ -68,6 +68,9 @@ For `orchestrator-callback`, add:
68
68
  {
69
69
  "callback_policy": {
70
70
  "requires_concrete_orchestrator_thread_id": true,
71
+ "orchestrator_thread_id_binding": "runtime",
72
+ "callback_target_placeholder": "RUNTIME_ORCHESTRATOR_THREAD_ID",
73
+ "forbid_creation_thread_id_as_callback_target": true,
71
74
  "requires_source_thread_id": true,
72
75
  "wait_mode": "callback-wait",
73
76
  "active_child_thread_monitoring": false,
@@ -92,6 +95,8 @@ For `orchestrator-callback`, add:
92
95
  }
93
96
  ```
94
97
 
98
+ The concrete orchestrator thread id is not Beads state created by `dirtyloops create`. It is a runtime preflight value for `dirtyloops run`. Generated docs may store the placeholder and binding policy, but they must not store the loop-creation thread id as the future callback target.
99
+
95
100
  For `single-thread-subagent`, add:
96
101
 
97
102
  ```json
@@ -27,7 +27,8 @@ Ask only for missing decisions. Prefer these defaults when the user has not spec
27
27
 
28
28
  - run policy: continue until epic complete, blocked, interrupted, or review/CI unresolved
29
29
  - one-shot mode: off unless the user says `run once` or `--once`
30
- - orchestrator-callback child threads: `speed: standard`, `reasoning: high`, `inherit_orchestrator_thread_settings: false`
30
+ - orchestrator-callback child threads: `speed: standard`, `reasoning: xhigh`, `inherit_orchestrator_thread_settings: false`
31
+ - orchestrator-callback callback target: runtime-bound; generated artifacts keep `RUNTIME_ORCHESTRATOR_THREAD_ID` as a placeholder until `dirtyloops run`
31
32
  - orchestrator-callback wait policy: callback-wait, no active child-thread monitoring, 30 minute sparse fallback heartbeat only when overdue or liveness is uncertain
32
33
  - orchestrator-callback selector policy: selector subagent before the first worker, closeout-selector subagent between phases
33
34
  - orchestrator-callback implementation swarm policy: swarm-first for non-trivial phases with 8-20 scouts, 8-16 slice-plan agents, and 8-16 implementation-helper agents
@@ -48,9 +49,11 @@ Ask only for missing decisions. Prefer these defaults when the user has not spec
48
49
 
49
50
  3. Normalize loop metadata.
50
51
  - Record workflow, run policy, branch/PR policy, quality gates, and actor-specific thread defaults.
51
- - For `orchestrator-callback`, record thread defaults for selector, implementation, review, and closeout-selector actors. Default each actor to `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless the user explicitly chose an actor-specific override.
52
- - For `orchestrator-callback`, do not let child threads inherit current UI settings, recent Codex thread defaults, or orchestrator-thread speed/reasoning. `fast` speed and `xhigh` reasoning require explicit Beads metadata for that actor.
53
- - For `orchestrator-callback`, record callback policy: concrete orchestrator thread id required in prompts and callback payloads, source thread id required in callback payloads, callback-wait behavior, no active child-thread monitoring, heartbeat interval, and fallback-only polling.
52
+ - For `orchestrator-callback`, record thread defaults for selector, implementation, review, and closeout-selector actors. Default each actor to `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless the user explicitly chose an actor-specific override.
53
+ - For `orchestrator-callback`, do not let child threads inherit current UI settings, recent Codex thread defaults, or orchestrator-thread speed/reasoning. `fast` speed and `high` reasoning require explicit Beads metadata for that actor.
54
+ - For `orchestrator-callback`, record callback policy without recording a concrete orchestrator thread id. The callback target is bound at `dirtyloops run` time to the thread orchestrating that run, or to an explicit user-supplied callback target for that run.
55
+ - For `orchestrator-callback`, generated docs and prompts must use the placeholder `RUNTIME_ORCHESTRATOR_THREAD_ID` until runtime binding. Never use the loop-creation thread id, a child thread id, `source_thread_id`, or any previous-run id as the callback target.
56
+ - For `orchestrator-callback`, record that concrete runtime orchestrator thread id is required in worker/reviewer prompts and callback payloads, source thread id is required in callback payloads, and callback-wait behavior uses no active child-thread monitoring, a heartbeat interval, and fallback-only polling.
54
57
  - For `orchestrator-callback`, record selector policy: initial selector subagent required, between-phase closeout-selector subagent required, selector reports use `swarm-report`, and only the orchestrator mutates Beads or advances the loop.
55
58
  - For `orchestrator-callback`, record implementation swarm policy: non-trivial phases require 8-20 scout agents, 8-16 slice-plan agents, 8-16 implementation-helper agents, pre-edit slice-plan synthesis, coherent lead-worker integration, and implementation callback `swarm_summary`.
56
59
  - For `single-thread-subagent`, record swarm policy: per-phase mass-subagent mode, selector/scout/slice-plan/implementation-helper/review/CI swarm sizes, mandatory slice plan before implementation, tiny-phase exception rationale, and coordinator-direct-implementation limits.
@@ -77,7 +80,8 @@ Ask only for missing decisions. Prefer these defaults when the user has not spec
77
80
  - Save it as `docs/implementation/<stream>/prompts/run-loop.md`.
78
81
  - Include the selected workflow name.
79
82
  - Include Beads epic id, run policy, phase-doc location, turn-doc rules, review skill, CI ownership, actor-specific thread defaults, selector gates, implementation swarm policy, callback/slice preflight rules, and storyboard requirements.
80
- - Completion criterion: the user can paste the generated prompt into Codex to start the loop.
83
+ - For `orchestrator-callback`, the generated run prompt must tell the runner to replace `RUNTIME_ORCHESTRATOR_THREAD_ID` with the actual thread id for the thread running the loop before launching any worker or reviewer.
84
+ - Completion criterion: the user can paste the generated prompt into Codex to start the loop, and no generated artifact contains a concrete callback target captured from loop creation.
81
85
 
82
86
  ## Output Contract
83
87
 
@@ -87,7 +91,7 @@ End with:
87
91
  - Beads epic id
88
92
  - Beads phase issue ids
89
93
  - generated run prompt path
90
- - exact customized run prompt
94
+ - exact customized run prompt, with runtime callback target placeholder when using `orchestrator-callback`
91
95
  - any blockers or degraded Beads operations
92
96
 
93
97
  Do not start the implementation loop unless the user explicitly asks.
@@ -6,7 +6,7 @@ Do not mutate files, Beads, branches, PRs, or threads while answering help.
6
6
 
7
7
  ## What dirtyloops Does
8
8
 
9
- `$dirtyloops` turns a finalized plan into a Beads-canonical implementation loop and can then run, inspect, or close that loop.
9
+ `$dirtyloops` turns a finalized plan into a Beads-canonical implementation loop and can then update, run, inspect, or close that loop.
10
10
 
11
11
  Every dirtyloop uses:
12
12
 
@@ -84,6 +84,16 @@ Stream: docs/implementation/smart-flow-alerts/
84
84
  Beads epic: islandflow-ghce
85
85
  ```
86
86
 
87
+ ### `$dirtyloops update <workflow>`
88
+
89
+ Refresh an existing loop to the current dirtyloops contract without recreating it.
90
+
91
+ Use this after the installed dirtyloops skill changes and you already have loop artifacts under `docs/implementation/<stream>/`.
92
+
93
+ `update` may repair generated runtime prompts, schemas, `IMPLEMENT.md`, and Beads loop metadata contract fields. It must not rewrite phase docs, turn docs, code, branch/PR state, issue status, issue dependencies, `loop-state.md` history, or storyboard files unless you explicitly ask.
94
+
95
+ For `orchestrator-callback`, update strips persisted callback targets back to `RUNTIME_ORCHESTRATOR_THREAD_ID`, changes stale generated child defaults to `reasoning: xhigh`, and preserves historical callback ids only in turn docs.
96
+
87
97
  ### `$dirtyloops inspect`
88
98
 
89
99
  Read Beads and loop docs without mutation. Use this when resuming a loop or checking whether it is blocked.
@@ -128,7 +138,11 @@ orchestrator thread
128
138
  -> orchestrator applies closeout and continues or stops
129
139
  ```
130
140
 
131
- Only the orchestrator creates implementation and review threads. It must create them in the intended Codex project worktree using first-class thread environment control; launching a generic thread and telling it to `cd` into the worktree is a workflow violation. Worker threads do not create review threads. Worker and reviewer prompts must contain the concrete orchestrator thread id as callback target and must list expected repo root/worktree plus branch/ref for verification. A child that starts in the wrong environment blocks and calls back instead of self-relocating. Phase selection is delegated: initial selection uses a selector subagent, and between-phase closeout/selection uses a closeout-selector subagent. Selector, implementation, review, and closeout-selector threads launch with explicit actor settings: `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor. Current UI, recent thread, parent/orchestrator, `fast`, and `xhigh` settings do not count as defaults. After launching a worker or reviewer, the orchestrator waits for its single callback instead of repeatedly reading or monitoring the child thread.
141
+ Only the orchestrator creates implementation and review threads. It must create them in the intended Codex project worktree using first-class thread environment control; launching a generic thread and telling it to `cd` into the worktree is a workflow violation. Worker threads do not create review threads. Worker and reviewer prompts must list expected repo root/worktree plus branch/ref for verification. A child that starts in the wrong environment blocks and calls back instead of self-relocating.
142
+
143
+ The callback target is bound at run time. `dirtyloops create` leaves `RUNTIME_ORCHESTRATOR_THREAD_ID` as a placeholder; `dirtyloops run` replaces it with the concrete thread id for the thread orchestrating that run, or an explicit callback target supplied for that run. Do not launch if the worker/reviewer prompt still contains a placeholder, the loop-creation thread id, a prior-run id, a child thread id, or generic text like `current orchestrator thread` or `this thread`.
144
+
145
+ Phase selection is delegated: initial selection uses a selector subagent, and between-phase closeout/selection uses a closeout-selector subagent. Selector, implementation, review, and closeout-selector threads launch with explicit actor settings: `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor. Current UI, recent thread, parent/orchestrator, `fast`, and `high` settings do not count as defaults. After launching a worker or reviewer, the orchestrator waits for its single callback instead of repeatedly reading or monitoring the child thread.
132
146
 
133
147
  Implementation threads are swarm-first for non-trivial phases. They run 8-20 scout agents, 8-16 slice-plan agents, and 8-16 implementation-helper agents before broad edits, synthesize the reports into one slice plan, integrate helper output coherently, and include `swarm_summary` in the implementation callback. Fewer agents require an explicit tiny-phase reason in the turn doc and callback.
134
148
 
@@ -17,15 +17,17 @@ Use this branch to execute an existing dirtyloop. Continue phase-by-phase by def
17
17
  - Completion criterion: selected scope, dependencies, gates, and workflow are known.
18
18
 
19
19
  3. Validate launch preflight.
20
- - For `orchestrator-callback`, require a concrete orchestrator thread id before launching workers/reviewers. The actual worker/reviewer prompt text must name that exact id as the callback target and must not rely on phrases like `current orchestrator thread`, `this thread`, or `source thread wrapper`.
20
+ - For `orchestrator-callback`, resolve the runtime orchestrator thread id before launching workers/reviewers. It must be the thread id for the thread orchestrating this `dirtyloops run`, or an explicit user-supplied callback target for this run.
21
+ - For `orchestrator-callback`, never reuse a callback target captured during `dirtyloops create`, a previous run, a child thread id, or `source_thread_id`. If the runtime orchestrator thread id is unavailable, ask for the exact callback target thread id and stop before launch until it is supplied.
22
+ - For `orchestrator-callback`, replace `RUNTIME_ORCHESTRATOR_THREAD_ID` in worker/reviewer prompt text before launch. The actual worker/reviewer prompt text must name the resolved concrete id as the callback target and must not contain unresolved placeholders such as `RUNTIME_ORCHESTRATOR_THREAD_ID` or `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`, or phrases like `current orchestrator thread`, `this thread`, or `source thread wrapper`.
21
23
  - For `orchestrator-callback`, require the orchestrator to bind each implementation/review thread to the intended Codex project worktree at thread creation time. Use the Codex project/worktree launch target or equivalent first-class thread environment control; do not launch a generic thread and tell it to `cd` into the worktree.
22
24
  - For `orchestrator-callback`, worker/reviewer prompts must list the expected repo root/worktree and branch/ref as verification inputs only. The child thread must verify `pwd`, `git rev-parse --show-toplevel`, and current branch/ref before edits or review. If the launch environment is wrong, the child must send a blocked callback; it must not self-relocate with `cd` as setup or recovery.
23
25
  - For `orchestrator-callback`, stop as blocked before launch when the orchestrator cannot create the child thread in the intended worktree environment. Do not rely on shell cwd, prompt discipline, or a hidden wrapper to repair a wrong thread environment after launch.
24
26
  - For `orchestrator-callback`, require callback-wait behavior: after launch, do not repeatedly read or monitor the child thread while waiting for the single callback. Sparse fallback heartbeat is allowed only when the callback is overdue or liveness is uncertain.
25
- - For `orchestrator-callback`, require explicit launch defaults for every child actor before launch: selector, implementation, review, and closeout-selector. Defaults are `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides that actor.
26
- - For `orchestrator-callback`, reject inherited launch settings. Do not use current UI settings, recent Codex thread defaults, parent/orchestrator settings, `fast`, or `xhigh` unless Beads metadata explicitly names that value for the actor being launched.
27
+ - For `orchestrator-callback`, require explicit launch defaults for every child actor before launch: selector, implementation, review, and closeout-selector. Defaults are `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata overrides that actor.
28
+ - For `orchestrator-callback`, reject inherited launch settings. Do not use current UI settings, recent Codex thread defaults, parent/orchestrator settings, `fast`, or `high` unless Beads metadata explicitly names that value for the actor being launched.
27
29
  - For `single-thread-subagent`, require per-phase selector, scout, slice-plan, implementation-helper, review, and CI swarms before implementation and closeout. The coordinator may perform integration and final repairs, but it must not do most discovery or implementation itself.
28
- - Completion criterion: the workflow can start without relying on inherited thread settings, vague callback targets, shell cwd repair, wrong thread environments, or solo coordinator implementation.
30
+ - Completion criterion: the workflow can start without relying on creation-time callback ids, unresolved callback placeholders, inherited thread settings, vague callback targets, shell cwd repair, wrong thread environments, or solo coordinator implementation.
29
31
 
30
32
  4. Run the selected workflow.
31
33
  - Follow the selected workflow reference.
@@ -0,0 +1,88 @@
1
+ # Update Loop
2
+
3
+ Use this branch when refreshing an existing dirtyloop to the current dirtyloops contract.
4
+
5
+ `update` is not `create`. It repairs generated loop scaffolding that can drift as the skill evolves. It must preserve implementation history and Beads execution state.
6
+
7
+ ## Inputs
8
+
9
+ Required:
10
+
11
+ - repo root
12
+ - loop root, usually `docs/implementation/<stream>`
13
+ - workflow, inferred from Beads metadata, `IMPLEMENT.md`, or `prompts/run-loop.md`
14
+ - Beads epic id
15
+
16
+ If the loop root or workflow cannot be inferred safely, ask one concise question before writing files.
17
+
18
+ ## Mutation Scope
19
+
20
+ Allowed:
21
+
22
+ - update Beads loop metadata contract fields only: callback policy, actor-specific thread defaults, dirtyloop version, schema paths, and workflow runtime policy
23
+ - update generated runtime artifacts: `prompts/run-loop.md`, workflow prompt files under `prompts/`, and `schemas/*.json`
24
+ - update generated loop contract docs: `IMPLEMENT.md` and any explicitly generated prompt README in the loop root
25
+
26
+ Forbidden unless the user explicitly asks:
27
+
28
+ - phase docs such as `01-*.md`
29
+ - `turn-docs/`
30
+ - implementation code
31
+ - branch, commit, push, or PR state
32
+ - Beads issue status, dependencies, ordering, blockers, or closeout state
33
+ - `loop-state.md` status fields, current phase, current PR, blockers, or history
34
+ - storyboard files
35
+
36
+ ## Contract Repairs
37
+
38
+ For `orchestrator-callback` loops:
39
+
40
+ - Replace old child actor defaults with `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false`.
41
+ - Treat old `reasoning: high` values as stale generated defaults unless Beads metadata or loop docs clearly say the user explicitly chose `high` for that actor.
42
+ - Update callback policy to runtime binding: `orchestrator_thread_id_binding: "runtime"`, `callback_target_placeholder: "RUNTIME_ORCHESTRATOR_THREAD_ID"`, and `forbid_creation_thread_id_as_callback_target: true`.
43
+ - Remove any persisted concrete callback target from generated prompt files and replace it with `RUNTIME_ORCHESTRATOR_THREAD_ID`.
44
+ - Do not preserve a concrete callback target just because it already exists in `prompts/run-loop.md`, `prompts/implementation-thread.md`, or `prompts/review-thread.md`.
45
+ - Preserve historical concrete callback ids in `turn-docs/`; they are execution history, not reusable launch prompts.
46
+ - Reject old placeholder names such as `THREAD_ORCHESTRATOR_ID` and `{{ORCHESTRATOR_THREAD_ID}}`; replace them with `RUNTIME_ORCHESTRATOR_THREAD_ID` or `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}` as appropriate.
47
+ - Ensure worker and reviewer prompts fail closed when the runtime placeholder remains unresolved at launch.
48
+
49
+ For all workflows:
50
+
51
+ - Preserve repo-specific Beads ids, phase docs, quality gates, branch/PR policy, stream names, and intentional custom prompt text.
52
+ - Prefer surgical edits when full regeneration would erase repo-specific context.
53
+ - Copy schema files from the current dirtyloops skill when present.
54
+
55
+ ## Steps
56
+
57
+ 1. Inspect the existing loop.
58
+ - Read Beads epic metadata, `IMPLEMENT.md`, `prompts/run-loop.md`, and `loop-state.md`.
59
+ - For `orchestrator-callback`, read implementation, review, selector, and closeout-selector prompt files if present.
60
+ - Completion criterion: workflow, epic id, loop root, generated artifact inventory, and stale contract fields are known.
61
+
62
+ 2. Plan the refresh.
63
+ - Separate generated runtime artifacts from phase docs, turn docs, Beads execution state, and implementation code.
64
+ - Decide which files or Beads metadata fields need contract repair.
65
+ - Completion criterion: every intended mutation is in the allowed scope, or the user has explicitly approved a wider mutation.
66
+
67
+ 3. Apply contract updates.
68
+ - Update stale actor defaults and callback policy in Beads loop metadata where supported.
69
+ - Update generated prompt files and `IMPLEMENT.md` with the current runtime callback and thread-default rules.
70
+ - Copy current schemas into the loop `schemas/` directory when the loop has one.
71
+ - Completion criterion: already-generated runtime artifacts now enforce the current dirtyloops contract without recreating the loop.
72
+
73
+ 4. Validate drift is gone.
74
+ - Search updated runtime artifacts for stale defaults: `reasoning: high`, `"reasoning": "high"`, `THREAD_ORCHESTRATOR_ID`, and `{{ORCHESTRATOR_THREAD_ID}}`.
75
+ - Search updated prompt files for concrete callback targets that should have been placeholders.
76
+ - Validate JSON schemas with a structured parser such as `jq empty` when available.
77
+ - Check the worktree diff and confirm forbidden files were not changed.
78
+ - Completion criterion: stale generated contract text is gone from allowed runtime artifacts, schemas parse, and no forbidden file class was modified.
79
+
80
+ ## Output Contract
81
+
82
+ End with:
83
+
84
+ - loop root updated
85
+ - Beads metadata fields changed, or why Beads metadata was not mutated
86
+ - runtime artifacts changed
87
+ - validation commands and results
88
+ - any stale generated contract that remains and why
@@ -30,7 +30,7 @@ The orchestrator owns:
30
30
  - implementation thread creation
31
31
  - review thread creation
32
32
  - child thread environment binding to the intended Codex project worktree
33
- - concrete callback target, callback preflight, callback-wait, and sparse fallback heartbeat
33
+ - runtime callback target binding, callback preflight, callback-wait, and sparse fallback heartbeat
34
34
  - phase closeout
35
35
  - launching the next selected phase
36
36
  - stream closeout and storyboard generation
@@ -92,9 +92,11 @@ The review thread owns:
92
92
  - After every review callback, the orchestrator must launch a closeout-selector subagent before closing the phase, stopping, or launching another implementation thread.
93
93
  - After launching a worker or reviewer, the orchestrator waits for the single callback. It does not repeatedly read, monitor, summarize, or status-check the child thread.
94
94
  - A fallback heartbeat is allowed only when the callback is overdue or liveness is uncertain; do not use heartbeat as routine polling.
95
- - Selector, implementation, review, and closeout-selector threads default to `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata explicitly overrides that actor.
96
- - Before launch, the orchestrator must verify the actual child-thread launch settings or prompt text spell out the actor's speed, reasoning, and non-inheritance. Current UI settings, recent Codex defaults, parent/orchestrator settings, `fast`, and `xhigh` do not count as valid defaults unless the Beads metadata explicitly names them for that actor.
97
- - Before launch, the orchestrator must verify the actual worker/reviewer prompt text includes the exact orchestrator thread id as callback target. Do not launch if the prompt relies on generic wording such as `current orchestrator thread`, `this thread`, or a hidden wrapper.
95
+ - The callback target is bound at run time. Do not use the thread id from `dirtyloops create`, a prior run, a child thread, or `source_thread_id` as the orchestrator callback target.
96
+ - Selector, implementation, review, and closeout-selector threads default to `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads metadata explicitly overrides that actor.
97
+ - Before launch, the orchestrator must verify the actual child-thread launch settings or prompt text spell out the actor's speed, reasoning, and non-inheritance. Current UI settings, recent Codex defaults, parent/orchestrator settings, `fast`, and `high` do not count as valid defaults unless the Beads metadata explicitly names them for that actor.
98
+ - Before launch, the orchestrator must replace `RUNTIME_ORCHESTRATOR_THREAD_ID` with the concrete thread id for the thread orchestrating this run, or an explicit user-supplied callback target for this run.
99
+ - Before launch, the orchestrator must verify the actual worker/reviewer prompt text includes that exact runtime callback target. Do not launch if the prompt still contains a placeholder or relies on generic wording such as `current orchestrator thread`, `this thread`, or a hidden wrapper.
98
100
 
99
101
  ## Selector Reports
100
102
 
@@ -30,7 +30,8 @@ This stream is driven by Beads. These docs are execution context and resume aids
30
30
  - File Beads follow-ups instead of widening the selected phase.
31
31
  - Update Beads first, then update `loop-state.md`.
32
32
  - Use the workflow's required subagent swarms.
33
- - Orchestrator-callback child threads default to `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false` unless Beads loop metadata explicitly overrides that actor.
33
+ - Orchestrator-callback child threads default to `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false` unless Beads loop metadata explicitly overrides that actor.
34
+ - Orchestrator-callback callback targets are bound at run time. Generated artifacts may contain `RUNTIME_ORCHESTRATOR_THREAD_ID`; the orchestrator must replace it with the actual callback target for the thread running the loop before launching workers or reviewers.
34
35
  - Orchestrator-callback implementation/review threads must be created in the intended Codex project worktree. A child that starts in the wrong repo/worktree blocks and calls back instead of self-relocating.
35
36
 
36
37
  ## Review And CI
@@ -23,7 +23,9 @@ Start from:
23
23
  - Use the workflow's required large bounded subagent swarms.
24
24
  - Reviewer agents must use `thermo-nuclear-code-quality-review`.
25
25
  - Reviewer and CI verification agents own CI.
26
- - Orchestrator-callback child threads must launch with explicit actor defaults: `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor.
26
+ - Orchestrator-callback child threads must launch with explicit actor defaults: `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor.
27
+ - Orchestrator-callback callback targets are bound at run time. Before launching workers or reviewers, replace `RUNTIME_ORCHESTRATOR_THREAD_ID` with the actual thread id for the thread orchestrating this run, or with an explicit user-supplied callback target for this run.
28
+ - Do not use the thread id from `dirtyloops create`, a prior run, a child thread, or `source_thread_id` as the callback target.
27
29
  - Orchestrator-callback implementation/review threads must be created in the intended Codex project worktree using first-class thread environment control. Worker/reviewer prompts verify repo/worktree and branch/ref; they do not repair a wrong launch environment with shell cwd changes.
28
30
  - Do not inherit child-thread speed or reasoning from the current UI, recent Codex thread defaults, or the orchestrator thread.
29
31
  - Update the existing Markdown turn doc.
@@ -9,10 +9,10 @@ Mission: verify the just-reviewed phase can be closed out, then recommend stop o
9
9
  Launch defaults:
10
10
 
11
11
  - speed: `standard`
12
- - reasoning: `high`
12
+ - reasoning: `xhigh`
13
13
  - inherit_orchestrator_thread_settings: `false`
14
14
 
15
- Do not run this closeout-selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the closeout-selector actor.
15
+ Do not run this closeout-selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the closeout-selector actor.
16
16
 
17
17
  Read:
18
18
 
@@ -4,9 +4,11 @@ You are the implementation thread for Beads issue `{{PHASE_ISSUE_ID}}`.
4
4
 
5
5
  Callback target:
6
6
 
7
- `{{ORCHESTRATOR_THREAD_ID}}`
7
+ `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`
8
8
 
9
- You must send your final callback to the exact orchestrator thread id `{{ORCHESTRATOR_THREAD_ID}}`. Do not interpret this as `current orchestrator thread`, `this thread`, or any implicit wrapper metadata.
9
+ This must be the runtime callback target for the thread orchestrating this run. If it is still the literal placeholder `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`, a loop-creation thread id, or any non-concrete value, stop and report a launch preflight failure.
10
+
11
+ After runtime substitution, you must send your final callback to the exact orchestrator thread id `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`. Do not interpret this as `current orchestrator thread`, `this thread`, or any implicit wrapper metadata.
10
12
 
11
13
  ## Inputs
12
14
 
@@ -16,8 +18,8 @@ You must send your final callback to the exact orchestrator thread id `{{ORCHEST
16
18
  - Turn doc: `{{TURN_DOC}}`
17
19
  - Expected repo/worktree and branch/ref: `{{BRANCH_WORKTREE_INSTRUCTIONS}}`
18
20
  - Launch environment: this thread must already be bound to the intended Codex project worktree before this prompt runs
19
- - Launch defaults: speed `standard`, reasoning `high`, inherit_orchestrator_thread_settings `false`, unless Beads metadata explicitly overrides the implementation actor
20
- - Do not run this worker with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the implementation actor
21
+ - Launch defaults: speed `standard`, reasoning `xhigh`, inherit_orchestrator_thread_settings `false`, unless Beads metadata explicitly overrides the implementation actor
22
+ - Do not run this worker with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the implementation actor
21
23
 
22
24
  ## Rules
23
25
 
@@ -38,7 +40,7 @@ You must send your final callback to the exact orchestrator thread id `{{ORCHEST
38
40
  - Open or update the PR.
39
41
  - Do not create the review thread.
40
42
  - Call back exactly once to the orchestrator.
41
- - The callback payload must include `orchestrator_thread_id: "{{ORCHESTRATOR_THREAD_ID}}"` and your `source_thread_id`.
43
+ - The callback payload must include `orchestrator_thread_id: "{{RUNTIME_ORCHESTRATOR_THREAD_ID}}"` and your `source_thread_id`.
42
44
  - The callback payload must include `swarm_summary` with scout, slice-plan, implementation-helper, slice, synthesis, and under-default rationale fields.
43
45
 
44
46
  ## Callback States
@@ -4,9 +4,11 @@ You are the review thread for Beads issue `{{PHASE_ISSUE_ID}}`.
4
4
 
5
5
  Callback target:
6
6
 
7
- `{{ORCHESTRATOR_THREAD_ID}}`
7
+ `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`
8
8
 
9
- You must send your final callback to the exact orchestrator thread id `{{ORCHESTRATOR_THREAD_ID}}`. Do not interpret this as `current orchestrator thread`, `this thread`, or any implicit wrapper metadata.
9
+ This must be the runtime callback target for the thread orchestrating this run. If it is still the literal placeholder `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`, a loop-creation thread id, or any non-concrete value, stop and report a launch preflight failure.
10
+
11
+ After runtime substitution, you must send your final callback to the exact orchestrator thread id `{{RUNTIME_ORCHESTRATOR_THREAD_ID}}`. Do not interpret this as `current orchestrator thread`, `this thread`, or any implicit wrapper metadata.
10
12
 
11
13
  ## Mandatory Skill
12
14
 
@@ -23,8 +25,8 @@ Use:
23
25
  - Branch/commit: `{{BRANCH_OR_COMMIT}}`
24
26
  - Required gates: `{{QUALITY_GATES}}`
25
27
  - Launch environment: this thread must already be bound to the intended Codex project worktree before this prompt runs
26
- - Launch defaults: speed `standard`, reasoning `high`, inherit_orchestrator_thread_settings `false`, unless Beads metadata explicitly overrides the review actor
27
- - Do not run this reviewer with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the review actor
28
+ - Launch defaults: speed `standard`, reasoning `xhigh`, inherit_orchestrator_thread_settings `false`, unless Beads metadata explicitly overrides the review actor
29
+ - Do not run this reviewer with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the review actor
28
30
 
29
31
  ## Rules
30
32
 
@@ -37,6 +39,6 @@ Use:
37
39
  - Update the existing Markdown turn doc.
38
40
  - Do not create follow-up implementation threads.
39
41
  - Call back exactly once when review and CI are resolved.
40
- - The callback payload must include `orchestrator_thread_id: "{{ORCHESTRATOR_THREAD_ID}}"` and your `source_thread_id`.
42
+ - The callback payload must include `orchestrator_thread_id: "{{RUNTIME_ORCHESTRATOR_THREAD_ID}}"` and your `source_thread_id`.
41
43
 
42
44
  Use the review callback schema from `schemas/review-callback.schema.json`.
@@ -7,10 +7,12 @@ This loop uses a main orchestrator thread plus separate implementation and revie
7
7
  - Before the first worker, the orchestrator launches a selector subagent to choose exactly one next ready Beads phase.
8
8
  - After every review callback, the orchestrator launches a closeout-selector subagent before closing the phase, stopping, or launching another worker.
9
9
  - Selector and closeout-selector subagents return `swarm-report` payloads with mission `selector` or `closeout-selector`; they do not mutate Beads, edit files, implement, review, repair, create threads, or advance the loop.
10
- - Selector, implementation, review, and closeout-selector threads launch with explicit actor defaults: `speed: standard`, `reasoning: high`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor.
11
- - Do not inherit current UI settings, recent Codex defaults, or orchestrator-thread speed/reasoning. `fast` speed and `xhigh` reasoning require explicit Beads metadata for the actor being launched.
12
- - The orchestrator passes its concrete thread id as the callback target.
13
- - Before launching a worker or reviewer, verify the actual prompt text includes that exact thread id and does not rely on generic wording like `current orchestrator thread` or `this thread`.
10
+ - Selector, implementation, review, and closeout-selector threads launch with explicit actor defaults: `speed: standard`, `reasoning: xhigh`, and `inherit_orchestrator_thread_settings: false`, unless Beads metadata overrides that actor.
11
+ - Do not inherit current UI settings, recent Codex defaults, or orchestrator-thread speed/reasoning. `fast` speed and `high` reasoning require explicit Beads metadata for the actor being launched.
12
+ - Before launching a worker or reviewer, resolve the runtime callback target: the actual thread id for the thread orchestrating this run, or an explicit user-supplied callback target for this run.
13
+ - Do not use the thread id from `dirtyloops create`, a prior run, a child thread, or `source_thread_id` as the callback target.
14
+ - Replace `RUNTIME_ORCHESTRATOR_THREAD_ID` in the worker/reviewer prompt before launch.
15
+ - Before launching a worker or reviewer, verify the actual prompt text includes the resolved exact thread id and does not contain `RUNTIME_ORCHESTRATOR_THREAD_ID` or rely on generic wording like `current orchestrator thread` or `this thread`.
14
16
  - Before launching a worker or reviewer, verify the child thread launch target is the intended project worktree. Prompt text may include expected repo root/worktree and branch/ref for verification only; it must not use `cd` as setup or recovery.
15
17
  - After launching a worker or reviewer, wait for its single callback. Do not repeatedly read, monitor, summarize, or status-check the child thread while waiting.
16
18
  - Use a sparse fallback heartbeat around 30 minutes only when the callback is overdue or liveness is uncertain; do not use heartbeat as routine polling.
@@ -9,10 +9,10 @@ Mission: select at most one next ready Beads phase for the orchestrator.
9
9
  Launch defaults:
10
10
 
11
11
  - speed: `standard`
12
- - reasoning: `high`
12
+ - reasoning: `xhigh`
13
13
  - inherit_orchestrator_thread_settings: `false`
14
14
 
15
- Do not run this selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `xhigh` settings unless Beads metadata explicitly overrides the selector actor.
15
+ Do not run this selector with inherited UI, recent thread, parent/orchestrator, `fast`, or `high` settings unless Beads metadata explicitly overrides the selector actor.
16
16
 
17
17
  Read:
18
18