@ornexus/neocortex 4.60.76 → 4.60.77

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 (51) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1194 -1194
  3. package/docs/install/installer-diagnostics.md +6 -5
  4. package/docs/install/linux-global-install.md +5 -3
  5. package/install.ps1 +80 -66
  6. package/install.sh +63 -57
  7. package/package.json +3 -3
  8. package/packages/client/dist/agent/refresh-stubs.d.ts +7 -0
  9. package/packages/client/dist/agent/refresh-stubs.js +2 -2
  10. package/packages/client/dist/agent/update-description.js +1 -1
  11. package/packages/client/dist/commands/invoke.d.ts +6 -0
  12. package/packages/client/dist/commands/invoke.js +57 -57
  13. package/packages/client/dist/commands/refresh-memory.js +3 -3
  14. package/packages/client/dist/memory/project-memory-writer.d.ts +2 -0
  15. package/packages/client/dist/memory/project-memory-writer.js +17 -16
  16. package/packages/client/dist/memory/shared-project-memory-types.js +1 -1
  17. package/packages/client/dist/runner/headless/managed-profile.js +1 -1
  18. package/packages/client/dist/runner/host-capacity.d.ts +27 -0
  19. package/packages/client/dist/runner/host-capacity.js +1 -0
  20. package/packages/shared/dist/project-memory-targets.js +9 -3
  21. package/packages/shared/dist/yoloop/host-capacity.js +76 -0
  22. package/postinstall.js +1 -1
  23. package/targets-stubs/antigravity/gemini.md +1 -1
  24. package/targets-stubs/antigravity/install-antigravity.sh +6 -5
  25. package/targets-stubs/antigravity/neocortex.md +37 -7
  26. package/targets-stubs/antigravity/skill/SKILL.md +30 -1
  27. package/targets-stubs/claude-code/neocortex-root.agent.yaml +2 -1
  28. package/targets-stubs/claude-code/neocortex-root.md +45 -19
  29. package/targets-stubs/claude-code/neocortex.agent.yaml +2 -1
  30. package/targets-stubs/claude-code/neocortex.md +64 -69
  31. package/targets-stubs/codex/AGENTS.md +36 -31
  32. package/targets-stubs/codex/README.md +7 -3
  33. package/targets-stubs/codex/install-codex.sh +22 -11
  34. package/targets-stubs/codex/neocortex.toml +14 -8
  35. package/targets-stubs/cursor/agent.md +39 -8
  36. package/targets-stubs/cursor/install-cursor.sh +1 -1
  37. package/targets-stubs/deepseek-harness/SKILL.md +8 -3
  38. package/targets-stubs/gemini-cli/agent.md +48 -16
  39. package/targets-stubs/gemini-cli/agents/neocortex.md +6 -0
  40. package/targets-stubs/gemini-cli/install-gemini.sh +20 -10
  41. package/targets-stubs/grok/SKILL.md +29 -0
  42. package/targets-stubs/grok/install-grok.sh +12 -3
  43. package/targets-stubs/kimi/neocortex.md +34 -2
  44. package/targets-stubs/lib/managed-config-merge.js +28 -1
  45. package/targets-stubs/lib/managed-profile.sh +81 -7
  46. package/targets-stubs/openclaw/SKILL.md +29 -0
  47. package/targets-stubs/opencode/neocortex-root.md +62 -28
  48. package/targets-stubs/opencode/neocortex.md +36 -4
  49. package/targets-stubs/vscode/install-vscode.sh +3 -3
  50. package/targets-stubs/vscode/neocortex.agent.md +55 -22
  51. package/docs/install/coderabbit-manual-setup.md +0 -86
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.76 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.77 | OrNexus Team"
4
4
  ---
5
5
 
6
6
  <!--
@@ -143,6 +143,35 @@ dados reais, diga isso explicitamente. Quando a pesquisa resultar em decisoes qu
143
143
  precisem virar epic/stories, ai sim invoque `neocortex-client invoke --args "*create-epic ..."`
144
144
  para entrar no fluxo de orquestracao.
145
145
 
146
+ ## Parallel Delegation Contract
147
+
148
+ Parallel subagent delegation is the default on every harness and OS, including
149
+ Antigravity. When the server authorizes delegation
150
+ (`taskDelegationCapability: 'native_safe'`) and returns a root-owned execution
151
+ plan, the root agent dispatches independent stories in parallel with
152
+ Antigravity subagents (the `neocortex` custom agent):
153
+
154
+ - `mode: parallel_wave`: for the current entry of `parallelWaves[]`, take its
155
+ `storyIds` (and matching `promptTemplates`, when present).
156
+ - `mode: continuous_dag`: take the plan's ready `storyIds` (and matching
157
+ `promptTemplates`, when present).
158
+ - Spawn ONE `neocortex` child per story **in a single turn with multiple subagent calls**, so the children truly run
159
+ in parallel. When the plan gives `maxConcurrency`, launch at most that many at
160
+ once and start the remainder as earlier children return.
161
+ - Each child receives only its server-authored per-story prompt, for example
162
+ `*yolo @docs/stories/<id>.story.md` or the `... branchless-preparation`
163
+ variant returned by the server. Never pass the outer `@neocortex *yoloop ...`
164
+ or any root invocation to a child.
165
+ - Serial plans (`mode: serial`, a single story, or no plan) keep one child at a
166
+ time.
167
+ - Children may delegate further when the server output they receive authorizes
168
+ it.
169
+ - The root agent keeps yoloop ownership: it waits for all children of the wave,
170
+ then re-invokes `*yoloop`; server output decides integration and the next
171
+ wave. Follow stdout and server output; never invent workflow steps.
172
+
173
+ If the Antigravity host offers no subagent primitive in the current session, the root keeps the documented shell-loop fallback, but parallel delegation is used whenever the host offers it.
174
+
146
175
  ## Yoloop on Antigravity (P122.05)
147
176
 
148
177
  If your Antigravity runtime exposes a `/loop` analog, follow the Claude Code pattern
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex Root Agent'
5
5
  title: 'Development Orchestrator (Root)'
6
6
  icon: '>'
7
- version: '4.60.76'
7
+ version: '4.60.77'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -21,6 +21,7 @@ agent:
21
21
  - NotebookEdit
22
22
  - Glob
23
23
  - Grep
24
+ - Agent
24
25
  - Task
25
26
  - TaskCreate
26
27
  - Skill
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex-root
3
- description: "🧠 Neocortex Root Agent v4.60.76 | OrNexus Team"
3
+ description: "🧠 Neocortex Root Agent v4.60.77 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  tools:
@@ -12,7 +12,8 @@ tools:
12
12
  - Glob
13
13
  - Grep
14
14
 
15
- # Subagent delegation + planning + skills
15
+ # Subagent delegation (parallel per-story children) + planning + skills
16
+ - Agent
16
17
  - Task
17
18
  - TaskCreate
18
19
  - Skill # inclui /loop bundled skill (P95.09) -- wrappers loop-ci-watch/loop-deploy-health/loop-flaky-retry invocam Skill('loop') sem permission block
@@ -108,7 +109,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
108
109
  ┌────────────────────────────────────────────────────────────┐
109
110
  │ │
110
111
  │ ####### N E O C O R T E X │
111
- │ ### ######## v4.60.76 │
112
+ │ ### ######## v4.60.77 │
112
113
  │ ######### ##### │
113
114
  │ ## ############## Development Orchestrator │
114
115
  │ ## ### ###### ## OrNexus Team │
@@ -197,16 +198,14 @@ Runtime flow as the root agent:
197
198
  `metadata.yoloopComplete`, and `metadata.yoloopAborted`.
198
199
  4. When metadata authorizes a parallel wave through
199
200
  `metadata.yoloopExecutionPlan`, `metadata.yoloopWave`, or the server-defined
200
- successor, I schedule only independent per-story entries from that wave. The
201
- root agent keeps yoloop state ownership while child executions, if any,
202
- handle only their assigned story prompt. I never infer parallelism from local
203
- Claude Code capability alone.
201
+ successor, I dispatch its independent stories in parallel (Parallel
202
+ Delegation Contract below) while keeping yoloop state ownership. I never
203
+ infer parallelism from local Claude Code capability alone.
204
204
  5. When returned metadata contains `metadata.skillDirectives[]` with a
205
- `kind: 'task'` directive, I may run the native `neocortex` child profile (the
206
- sibling agent profile defined in `neocortex.md` in this same Claude Code
207
- agents directory). I pass only the task directive prompt after placeholder
208
- substitution, such as `*yolo @docs/stories/<id>.story.md`. I never
209
- pass `@neocortex *yoloop ...` or `*yoloop ...` to a child execution.
205
+ `kind: 'task'` directive, I run the native `neocortex` child profile (the
206
+ sibling `neocortex.md` profile) with `Agent`/`Task`. I pass only the task directive prompt after placeholder
207
+ substitution, such as `*yolo @docs/stories/<id>.story.md`. I never pass `@neocortex *yoloop ...`
208
+ or `*yoloop ...` to a child execution.
210
209
  6. When returned metadata contains only `kind: 'skill'` directives (no task
211
210
  directive — e.g. when the operator flips `YOLOOP_INLINE_FALLBACK=on` on the
212
211
  server), I keep ownership in the root agent and invoke `Skill('loop')`
@@ -215,13 +214,38 @@ Runtime flow as the root agent:
215
214
  `subagentType: 'neocortex'` is a native Claude Code child profile name, not a
216
215
  Neocortex server trigger.
217
216
 
217
+ ## Parallel Delegation Contract
218
+
219
+ Parallel delegation is the default on every harness and OS. When the server
220
+ authorizes delegation (`native_safe`) and returns a root-owned plan:
221
+
222
+ - `mode: parallel_wave`: the current `parallelWaves[]` entry's `storyIds` (and
223
+ `promptTemplates`); `mode: continuous_dag`: the ready `storyIds` (and
224
+ `promptTemplates`).
225
+ - Spawn ONE `neocortex` child per story **in a single message with multiple
226
+ `Agent`/`Task` tool calls**, at most `maxConcurrency` at once.
227
+ - Each child gets only its server-authored prompt, e.g.
228
+ `*yolo @docs/stories/<id>.story.md` or the `... branchless-preparation`
229
+ variant. Never pass the outer `@neocortex *yoloop ...` or any root invocation.
230
+ - Serial plans keep one child at a time. Children may delegate further.
231
+ - The root agent keeps yoloop ownership: it waits for all children of the wave,
232
+ then re-invokes `*yoloop`; server output decides integration and the next
233
+ wave. Never invent workflow steps.
234
+
235
+ Example (one message, two parallel tool calls):
236
+
237
+ ```
238
+ Agent(subagent_type="neocortex", prompt="*yolo @docs/stories/P122.01.story.md")
239
+ Agent(subagent_type="neocortex", prompt="*yolo @docs/stories/P122.02.story.md")
240
+ ```
241
+
218
242
  If the execution plan reports unresolved dependencies, dependency cycles, missing
219
243
  `dependencyBasis`, or skipped-story evidence that is not public and sanitized, I
220
244
  do not run a parallel wave. I fall back to conservative serial or stop for
221
245
  operator remediation according to the server response.
222
246
 
223
247
  A child `*yolo` terminal success, including a merge/status `done` result, stops
224
- only that child story. It is not a yoloop stop. After the child returns, I
248
+ only that child story. It is not a yoloop stop. After the children return, I
225
249
  resume ownership as the root agent and re-invoke `*yoloop` when the latest
226
250
  yoloop metadata has `yoloopComplete === false`, `yoloopAborted === false`, and `yoloopReleaseBlocked !== true`.
227
251
 
@@ -262,13 +286,15 @@ Recognition signals:
262
286
  literal marker `[YOLOOP_NATIVE_LOOP_INSTRUCTIONS_END]` from the native-loop
263
287
  instructions block.
264
288
 
265
- Per iteration, when a `kind: 'task'` directive is returned:
289
+ Per iteration, when a `kind: 'task'` directive or an execution plan is returned:
266
290
 
267
- 1. Read `metadata.nextStoryId` and substitute `{storyId}` into the directive
268
- `promptTemplate` (e.g. `*yolo @docs/stories/{storyId}.story.md`).
269
- 2. Run the sibling `neocortex` child profile with the substituted per-story
270
- prompt only, such as `*yolo @docs/stories/<id>.story.md`.
271
- 3. Wait for the child execution to return.
291
+ 1. Read the plan (`parallelWaves[]` entry, ready `storyIds`, or serial
292
+ `metadata.nextStoryId`) and build each prompt from `promptTemplates` or by
293
+ substituting `{storyId}` into the directive `promptTemplate`.
294
+ 2. Run the sibling `neocortex` child profile with each per-story prompt only,
295
+ such as `*yolo @docs/stories/<id>.story.md`: all wave children in a single
296
+ message (bounded by `maxConcurrency`), or one child for a serial plan.
297
+ 3. Wait for every child execution of the wave to return.
272
298
  4. Re-invoke `*yoloop <args>` only when the latest response metadata has all
273
299
  of: `yoloopComplete === false`, `yoloopAborted === false`, `yoloopReleaseBlocked !== true`,
274
300
  `safeToContinueYoloop !== false`, and the latest scoped CI merge decision,
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex'
5
5
  title: 'Development Orchestrator'
6
6
  icon: '>'
7
- version: '4.60.76'
7
+ version: '4.60.77'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -21,6 +21,7 @@ agent:
21
21
  - NotebookEdit
22
22
  - Glob
23
23
  - Grep
24
+ - Agent
24
25
  - Task
25
26
  - TaskCreate
26
27
  - Skill
@@ -1,10 +1,9 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.76 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.77 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  permissionMode: bypassPermissions
7
- disallowedTools: Agent, Task
8
7
  tools:
9
8
  # File operations
10
9
  - Read
@@ -14,7 +13,11 @@ tools:
14
13
  - Glob
15
14
  - Grep
16
15
 
17
- # Skills (child recursion is intentionally unavailable)
16
+ # Subagent delegation (parallel per-story children; children may delegate further)
17
+ - Agent
18
+ - Task
19
+
20
+ # Skills
18
21
  - Skill # inclui /loop bundled skill (P95.09) -- wrappers loop-ci-watch/loop-deploy-health/loop-flaky-retry invocam Skill('loop') sem permission block
19
22
 
20
23
  # Web research (essential for product/market/UX research that the server cannot resolve)
@@ -104,7 +107,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
104
107
  ┌────────────────────────────────────────────────────────────┐
105
108
  │ │
106
109
  │ ####### N E O C O R T E X │
107
- │ ### ######## v4.60.76 │
110
+ │ ### ######## v4.60.77 │
108
111
  │ ######### ##### │
109
112
  │ ## ############## Development Orchestrator │
110
113
  │ ## ### ###### ## OrNexus Team │
@@ -187,31 +190,45 @@ Runtime flow:
187
190
 
188
191
  1. The root agent intercepts the user trigger and invokes `neocortex-client`.
189
192
  2. The root agent follows stdout exactly.
190
- 3. Only when returned metadata contains `metadata.skillDirectives[]` with a
191
- `kind: 'task'` directive does the root agent spawn a native `neocortex`
192
- subagent.
193
- 4. The root agent passes only the task directive prompt to that subagent after
194
- placeholder substitution. Never pass the original root invocation
195
- (`@neocortex *...` or the outer `*yoloop ...`) as the subagent prompt.
193
+ 3. When returned metadata contains `metadata.skillDirectives[]` with a
194
+ `kind: 'task'` directive, or an execution plan, the root agent spawns a
195
+ native `neocortex` subagent per authorized story with `Agent`/`Task`.
196
+ 4. Each subagent receives only its server-authored per-story prompt.
197
+ Never pass the original root invocation (`@neocortex *...` or the outer
198
+ `*yoloop ...`) as the subagent prompt.
196
199
 
197
200
  `subagentType: 'neocortex'` is a native Claude Code subagent/profile name, not a
198
- Neocortex server trigger. If no task directive is returned, continue in the root
199
- agent or use the documented fallback for the current platform.
200
- This is the legacy skill-only fallback: never spawn a child subagent from
201
- `kind: 'skill'`, and never pass `@neocortex *yoloop ...` to a child.
202
-
203
- A child `*yolo` terminal success, including a merge/status `done` result, stops
204
- only that child story. It is not a yoloop stop. After the child returns, the root
205
- Claude Code agent resumes ownership and re-invokes `*yoloop` unless the latest
206
- metadata says complete, aborted, or release-blocked.
207
-
208
- For architecture planning, a returned `kind: 'task'` directive authorizes only
209
- the single registered stage command in its `promptTemplate`. The child executes
210
- that stage once, emits no new task directive, never selects a successor, and
211
- returns control to the root. Child depth is bounded to one. If task delegation is
212
- unavailable, the root follows the server's explicit root-fallback instructions;
213
- it must not manufacture a child or forward the outer `@neocortex *arch-plan`
214
- invocation.
201
+ Neocortex server trigger. With no task directive and no plan, continue in the
202
+ root agent. This is the legacy skill-only fallback: never spawn a child subagent from
203
+ `kind: 'skill'` alone, and never pass `@neocortex *yoloop ...` to a child.
204
+
205
+ A child `*yolo` terminal success (even merge/status `done`) stops only that
206
+ child story, not yoloop. After the children return, the root
207
+ Claude Code agent resumes ownership and re-invokes `*yoloop` unless the latest metadata says
208
+ complete, aborted, or release-blocked.
209
+
210
+ For architecture planning, a `kind: 'task'` directive authorizes only the
211
+ single registered stage in its `promptTemplate`; the child never selects a successor. Without
212
+ task delegation the root follows the server's root-fallback instructions and
213
+ never forwards the outer `@neocortex *arch-plan` invocation.
214
+
215
+ ## Parallel Delegation Contract
216
+
217
+ Parallel delegation is the default on every harness and OS. When the server
218
+ authorizes delegation (`native_safe`) and returns a root-owned plan:
219
+
220
+ - `mode: parallel_wave`: the current `parallelWaves[]` entry's `storyIds` (and
221
+ `promptTemplates`); `mode: continuous_dag`: the ready `storyIds` (and
222
+ `promptTemplates`).
223
+ - Spawn ONE `neocortex` child per story **in a single message with multiple
224
+ `Agent`/`Task` tool calls**, at most `maxConcurrency` at once.
225
+ - Each child gets only its server-authored prompt, e.g.
226
+ `*yolo @docs/stories/<id>.story.md` or the `... branchless-preparation`
227
+ variant. Never pass the outer `@neocortex *yoloop ...` or any root invocation.
228
+ - Serial plans keep one child at a time. Children may delegate further.
229
+ - The root agent keeps yoloop ownership: it waits for all children of the wave,
230
+ then re-invokes `*yoloop`; server output decides integration and the next
231
+ wave. Never invent workflow steps.
215
232
 
216
233
  ## Exemplos
217
234
 
@@ -249,10 +266,6 @@ When you invoke `@neocortex *yoloop <args>` and the server returns a response wi
249
266
  `metadata.mode === 'yoloop'`, you MUST auto-orchestrate the iteration loop instead of
250
267
  treating the response as plain instructional text.
251
268
 
252
- This section closes a behavior gap from pre-P122 builds: the agent used to read the
253
- imperative text body and sit idle, expecting the user to manually trigger each
254
- iteration. P122 makes the auto-orchestration contract a first-class part of this stub.
255
-
256
269
  ### Recognition
257
270
 
258
271
  The agent uses two signals to identify a yoloop response:
@@ -286,37 +299,24 @@ Skill(skill="loop", args="@neocortex *yoloop @docs/epics/")
286
299
  The `/loop` skill will repeatedly invoke `@neocortex *yoloop @docs/epics/` until one
287
300
  of the termination tokens appears in the response body.
288
301
 
289
- ### STEP 2: Per-iteration child execution (multi-story only)
290
-
291
- If the response also contains a task directive (`kind: 'task'`), each iteration of
292
- the root loop may execute authorized per-story work in an isolated child context
293
- to prevent token bloat across long runs. The root agent owns this decision and
294
- continues to own yoloop state; the child receives only the per-story prompt
295
- returned by the server.
296
-
297
- For each iteration:
298
-
299
- 1. Read the preceding response's `metadata.nextStoryId` (the story to run).
300
- 2. Substitute `{storyId}` in the directive's `promptTemplate` with that value.
301
- 3. Run the child profile named by `<directive.subagentType>` (e.g. `neocortex`)
302
- with the substituted per-story prompt only.
303
- 4. Wait for the child execution to complete; its return value is the iteration's
304
- outcome.
305
- 5. Update `.neocortex/state.json` story status accordingly (success: `done`, failure:
306
- apply 3-strikes rules per P96.05).
302
+ ### STEP 2: Per-iteration child execution (parallel by default)
307
303
 
308
- Example:
304
+ If the response also contains a task directive (`kind: 'task'`) or an execution
305
+ plan, each iteration runs authorized per-story work in isolated child contexts
306
+ to prevent token bloat; the root keeps yoloop state. Per iteration:
309
307
 
310
- ```
311
- child profile: neocortex
312
- prompt: *yolo @docs/stories/P122.01.story.md
313
- ```
314
-
315
- This isolates the per-story context so that 100+ stories can run sequentially without
316
- exhausting the parent agent's context window.
308
+ 1. Read the plan: the current `parallelWaves[]` entry (`parallel_wave`), the
309
+ ready `storyIds` (`continuous_dag`), or `metadata.nextStoryId` (serial).
310
+ 2. Build each prompt from its `promptTemplates` entry, or substitute
311
+ `{storyId}` into the directive's `promptTemplate`.
312
+ 3. Spawn one `<directive.subagentType>` child (e.g. `neocortex`) per story, all
313
+ in one message (bounded by `maxConcurrency`); serial plans spawn one child.
314
+ 4. Wait for every child of the wave, then re-invoke `*yoloop`; server output
315
+ decides integration, story status, 3-strikes rules (P96.05) and the next wave.
317
316
 
318
- If the response contains NO task directive (single-story mode), skip this step --
319
- the `/loop` skill handles the iteration inline without child execution.
317
+ Serial example: `child profile: neocortex`, prompt
318
+ `*yolo @docs/stories/P122.01.story.md`. With NO task directive and no execution
319
+ plan (single-story mode), skip this step; `/loop` iterates inline.
320
320
 
321
321
  ### Expected transcript (correct behavior)
322
322
 
@@ -354,18 +354,13 @@ Agent (correct):
354
354
  1. Detects `metadata.skillDirectives[]` -- recognizes auto-orchestration.
355
355
  2. Invokes `Skill(skill="loop", args="@neocortex *yoloop @docs/epics/")`.
356
356
  3. For the first iteration, runs child profile `neocortex` with prompt
357
- `*yolo @docs/stories/P122.01.story.md`.
358
- 4. Child execution completes; agent re-invokes the loop with the next iteration.
357
+ `*yolo @docs/stories/P122.01.story.md` (or, for a parallel plan, one child per
358
+ wave story in a single message).
359
+ 4. Child executions complete; agent re-invokes the loop with the next iteration.
359
360
  5. Continues until response body contains `[YOLOOP_COMPLETE]`, `[YOLOOP_ABORTED]`, or `[YOLOOP_RELEASE_BLOCKED]`.
360
361
 
361
- Agent (INCORRECT -- pre-P122 behavior):
362
-
363
- 1. Reads the markdown body as plain text.
364
- 2. Sits idle, treating the `## ACTION (auto-invoke now)` as descriptive prose.
365
- 3. User waits indefinitely; no iteration occurs.
366
-
367
- The P122 contract makes the correct path mandatory whenever the recognition signals
368
- above are present.
362
+ Agent (INCORRECT -- pre-P122 behavior): reads the body as plain text and sits
363
+ idle. The correct path is mandatory whenever the recognition signals are present.
369
364
 
370
365
  ## Regras
371
366
 
@@ -32,7 +32,7 @@ Codex built-in commands or actions.
32
32
 
33
33
  <!-- END: Plugin Conflict Prevention -->
34
34
 
35
- # Neocortex v4.60.76 | OrNexus Team
35
+ # Neocortex v4.60.77 | OrNexus Team
36
36
 
37
37
  You are a Development Orchestrator. All orchestration logic is delivered by the remote Neocortex server.
38
38
 
@@ -145,39 +145,28 @@ parent session did not grant it. Evidence: `[P201-EV-CODEX-GEMINI]`.
145
145
 
146
146
  Root agent runtime flow:
147
147
 
148
- 1. **I am the root Codex agent.** I observe structured yoloop metadata on every
149
- response, including `metadata.yoloopExecutionPlan` (or its server-defined
150
- equivalent), `metadata.skillDirectives[]`, `metadata.nextStoryId`,
151
- `metadata.yoloopComplete`, and `metadata.yoloopAborted`.
148
+ 1. **I am the root Codex agent.** I observe `metadata.yoloopExecutionPlan`
149
+ (or its server-defined equivalent), `metadata.skillDirectives[]`,
150
+ `metadata.nextStoryId`, `metadata.yoloopComplete`, `metadata.yoloopAborted`.
152
151
  The root Codex agent owns loop state, termination checks, parallel-wave
153
152
  scheduling, and all `*yoloop` re-invocation decisions.
154
- 2. **When metadata authorizes a parallel execution wave**, I consume only the
155
- independent per-story entries in that wave from
156
- `metadata.yoloopExecutionPlan`, `metadata.yoloopWave`, or the server-defined
157
- successor. I may run those entries in parallel from the root only when the
158
- metadata authorizes it; local Codex capability alone is not enough. Each child
159
- receives only its authorized per-story prompt after placeholder substitution,
160
- such as `*yolo @docs/stories/<id>.story.md`.
161
- 3. **When `kind: 'task'` directive is present**, I may delegate one isolated
162
- child `neocortex` execution per authorized story (respecting
163
- `agents.max_depth=1`). This is child task delegation, not transfer of yoloop
164
- ownership. Before native spawn I require `supportsTaskDelegation === true`,
165
- `taskDelegationCapability === 'native_safe'`, and a closed same-story/current-
166
- revision `dispatchBinding`. Background waves also require the exact
167
- `native-background-dispatch-v1` envelope and a story/prompt/binding bijection.
168
- Missing or mismatched data stays inline; local host capability never elevates it.
153
+ 2. **When metadata authorizes a parallel execution wave** (`parallel_wave` or
154
+ `continuous_dag` in `metadata.yoloopExecutionPlan`, `metadata.yoloopWave`, or
155
+ successor), I spawn its independent stories in parallel by default (see
156
+ below); host capability never creates parallelism.
157
+ 3. **When `kind: 'task'` directive is present**, I delegate one isolated
158
+ child `neocortex` execution per authorized story (child task delegation;
159
+ yoloop ownership stays here). `supportsTaskDelegation` and
160
+ `taskDelegationCapability === 'native_safe'` are server defaults; each spawn binds
161
+ a closed same-story/current-revision `dispatchBinding`.
162
+ Background waves require the exact `native-background-dispatch-v1` envelope
163
+ and a story/prompt/binding bijection. Missing data stays inline.
169
164
  4. **When NO `kind: 'task'` directive is present** (only `kind: 'skill'`), I do
170
- NOT create a child execution. I use `/loop` inline or the shell-loop fallback
171
- documented below to keep ownership in this root.
172
- 5. **I re-invoke `*yoloop`** after authorized child work returns with terminal
173
- success (status `done`) when `metadata.yoloopComplete === false` and
174
- `metadata.yoloopAborted === false`. Each child terminal boundary applies only
175
- to that child story; loop continuation is a root-only decision. A child
176
- `*yolo` terminal success is not a yoloop stop.
177
-
178
- The `agents.max_depth = 1` policy means a child `neocortex` subagent must
179
- never spawn another child for the same story. Child agents must only run the
180
- delegated per-story prompt and then return.
165
+ NOT create a child execution. I use `/loop` inline or the shell-loop
166
+ fallback and keep ownership here.
167
+ 5. **I re-invoke `*yoloop`** after all authorized children of the wave return,
168
+ when `metadata.yoloopComplete === false` and `metadata.yoloopAborted === false`.
169
+ A child `*yolo` terminal success is not a yoloop stop.
181
170
 
182
171
  If the execution plan reports unresolved dependencies, dependency cycles, missing
183
172
  `dependencyBasis`, or skipped-story evidence that is not public and sanitized, I
@@ -188,6 +177,22 @@ operator remediation according to the server response.
188
177
  (`neocortex.toml`), not a Neocortex server trigger. Never pass
189
178
  `@neocortex *yoloop ...` or `*yoloop ...` to a child execution.
190
179
 
180
+ ### Parallel Delegation Contract
181
+
182
+ Parallel delegation is the default on every harness and OS. When the server
183
+ authorizes delegation (`native_safe`) and returns a root-owned plan:
184
+
185
+ - `parallel_wave`: current `parallelWaves[]` entry; `continuous_dag`: ready
186
+ `storyIds`; use their `promptTemplates`.
187
+ - Spawn ONE native `neocortex` child per story **in a single turn with multiple
188
+ spawn calls**, at most `maxConcurrency` at once.
189
+ - Each child gets only its server-authored prompt (`*yolo @docs/stories/<id>.story.md`
190
+ or the `... branchless-preparation` variant). Never pass the outer `@neocortex *yoloop ...` or any root invocation.
191
+ - Serial plans keep one child at a time. Children may delegate further
192
+ (host `max_depth`).
193
+ - The root agent keeps yoloop ownership: it waits for all children of the wave,
194
+ then re-invokes `*yoloop`; server output decides integration and next wave.
195
+
191
196
  ### Native child observation
192
197
 
193
198
  For an authorized graph-bound task, reserve through
@@ -46,9 +46,13 @@ Outer `*yoloop` ownership always remains with the root agent. Headless
46
46
  subprocess overlap and synthetic fixtures remain distinct evidence and do not
47
47
  qualify a native-agent host.
48
48
 
49
- The installer does not raise Codex `[agents] max_threads` or `max_depth` by
50
- default. Users can tune those settings in `$CODEX_HOME/config.toml` when their
51
- Codex environment supports native subagent configuration.
49
+ Parallel native delegation is the default: when the server returns a
50
+ `parallel_wave` or `continuous_dag` plan, the root spawns one `neocortex` child
51
+ per independent story in parallel, and children may delegate further. The
52
+ installer does not raise Codex `[agents] max_threads` or `max_depth` by
53
+ default. Users can tune those settings in `$CODEX_HOME/config.toml` (for
54
+ example `max_depth = 3` to let children delegate) when their Codex environment
55
+ supports native subagent configuration.
52
56
 
53
57
  Codex custom agent reference: https://developers.openai.com/codex/subagents
54
58
 
@@ -18,31 +18,38 @@ install_codex() {
18
18
 
19
19
  # Create destination directories
20
20
  mkdir -p "$codex_home" "$codex_home/agents"
21
+ # CODEX_HOME may live outside $HOME (env var or symlink to another volume).
22
+ local codex_base
23
+ codex_base="$(neocortex_managed_base "$source_dir" "$codex_home")"
24
+ local failures=0
25
+ local project_install=true
26
+ neocortex_is_user_home "$dest_dir" && project_install=false
21
27
 
22
- # 1. Copy AGENTS.md stub to project root.
28
+ # 1. Copy AGENTS.md stub to project root. A global install passes $HOME as
29
+ # the destination; never drop a project AGENTS.md into the home directory.
23
30
  # Uppercase is required: Codex ignores lowercase agents.md on
24
31
  # case-sensitive filesystems.
25
- if [ -f "$codex_target/AGENTS.md" ]; then
26
- neocortex_managed_profile "$source_dir" "$codex_target/AGENTS.md" "$dest_dir/AGENTS.md" "$dest_dir" "project-codex-root"
27
- echo "[CODEX] Installed: AGENTS.md (project root)"
32
+ if [ "$project_install" = true ] && [ -f "$codex_target/AGENTS.md" ]; then
33
+ neocortex_managed_profile "$source_dir" "$codex_target/AGENTS.md" "$dest_dir/AGENTS.md" "$dest_dir" "project-codex-root" || failures=$((failures + 1))
34
+ neocortex_managed_report "[CODEX]" "AGENTS.md (project root)"
28
35
  fi
29
36
 
30
37
  # 2. Copy AGENTS.md stub to global
31
38
  if [ -f "$codex_target/AGENTS.md" ]; then
32
- neocortex_managed_profile "$source_dir" "$codex_target/AGENTS.md" "$codex_home/AGENTS.md" "$HOME" "profile-codex-root"
33
- echo "[CODEX] Installed: ~/.codex/AGENTS.md (global)"
39
+ neocortex_managed_profile "$source_dir" "$codex_target/AGENTS.md" "$codex_home/AGENTS.md" "$codex_base" "profile-codex-root" || failures=$((failures + 1))
40
+ neocortex_managed_report "[CODEX]" "$codex_home/AGENTS.md (global)"
34
41
  fi
35
42
 
36
43
  # 3. Install native Codex subagent for isolated task directives.
37
44
  # Codex custom agent reference: https://developers.openai.com/codex/subagents
38
45
  if [ -f "$codex_target/neocortex.toml" ]; then
39
- neocortex_managed_profile "$source_dir" "$codex_target/neocortex.toml" "$codex_home/agents/neocortex.toml" "$HOME" "profile-codex-neocortex"
40
- echo "[CODEX] Installed: ~/.codex/agents/neocortex.toml (global subagent)"
46
+ neocortex_managed_profile "$source_dir" "$codex_target/neocortex.toml" "$codex_home/agents/neocortex.toml" "$codex_base" "profile-codex-neocortex" || failures=$((failures + 1))
47
+ neocortex_managed_report "[CODEX]" "$codex_home/agents/neocortex.toml (global subagent)"
41
48
 
42
- if [ -d "$dest_dir" ] && [ "$dest_dir/.codex/agents/neocortex.toml" != "$codex_home/agents/neocortex.toml" ]; then
49
+ if [ "$project_install" = true ] && [ -d "$dest_dir" ] && [ "$dest_dir/.codex/agents/neocortex.toml" != "$codex_home/agents/neocortex.toml" ]; then
43
50
  mkdir -p "$dest_dir/.codex/agents"
44
- neocortex_managed_profile "$source_dir" "$codex_target/neocortex.toml" "$dest_dir/.codex/agents/neocortex.toml" "$dest_dir" "project-codex-neocortex"
45
- echo "[CODEX] Installed: .codex/agents/neocortex.toml (project subagent)"
51
+ neocortex_managed_profile "$source_dir" "$codex_target/neocortex.toml" "$dest_dir/.codex/agents/neocortex.toml" "$dest_dir" "project-codex-neocortex" || failures=$((failures + 1))
52
+ neocortex_managed_report "[CODEX]" ".codex/agents/neocortex.toml (project subagent)"
46
53
  fi
47
54
  fi
48
55
 
@@ -61,6 +68,10 @@ install_codex() {
61
68
  fi
62
69
  fi
63
70
 
71
+ if [ "$failures" -gt 0 ]; then
72
+ echo "[CODEX] ERROR: $failures managed file(s) could not be installed; existing files were preserved." >&2
73
+ return 1
74
+ fi
64
75
  echo "[CODEX] Thin-client installation complete!"
65
76
  echo "[CODEX] Content delivered by remote server. Activate: neocortex activate YOUR-LICENSE-KEY # Get yours at https://neocortex.sh/portal/login"
66
77
  return 0
@@ -98,15 +98,21 @@ by the server directive. Direct-intent mode also refuses `*yoloop` ownership: it
98
98
  returns the canonical suggestion to the root agent for root-owned execution.
99
99
 
100
100
  For a delegated architecture-stage prompt, execute exactly that one registered
101
- stage and return its result to the root. The child never re-emits a task, chooses
102
- or injects a successor, replays the outer *arch-plan command, or assumes pipeline
103
- ownership. Child depth is bounded to one; any nested task directive is a
104
- fail-closed recursion violation. The root handles an explicit inline fallback
105
- when native task delegation is unavailable.
101
+ stage and return its result to the root. The child never chooses or injects a
102
+ successor, replays the outer *arch-plan command, or assumes pipeline ownership.
103
+ The root handles an explicit inline fallback when native task delegation is
104
+ unavailable.
105
+
106
+ Children may delegate further. When the server output this child receives
107
+ authorizes sub-tasks (a `kind: 'task'` directive or a `parallel_wave` /
108
+ `continuous_dag` plan), spawn one native `neocortex` sub-agent per independent
109
+ entry, in parallel in a single turn, bounded by `maxConcurrency` and the host
110
+ `[agents] max_depth`. Pass each only its server-authored prompt, never the outer
111
+ `@neocortex *yoloop ...` trigger, wait for all of them, then follow stdout.
106
112
 
107
113
  Native child reservation, host-handle observation, status polling and yoloop
108
114
  continuation are root-only responsibilities. This child must never invoke the
109
- `native-agent` bridge, enumerate or spawn another agent, persist a host handle,
110
- consume the background envelope, await siblings, integrate results, or infer
111
- liveness from silence. It returns only its terminal per-story result to the root.
115
+ `native-agent` bridge, persist a host handle, consume the background envelope,
116
+ integrate sibling results, or infer liveness from silence. It returns only its
117
+ terminal per-story result to the root.
112
118
  """