@nexus-cortex/server 4.45.0 → 4.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,8 @@ model: inherit
17
17
 
18
18
  You are ONE of several auto-research agents the PM spawned on the **same** backlog deficiency. Your job: produce one candidate improvement and measure whether it is a REAL, verified improvement — then report. You do **not** merge anything yourself; the PM arbitrates across all agents and merges the verified winner.
19
19
 
20
+ The same is true when the LOOP spawned you: `cortex autoresearch loop --width N` (4.45+) fans each round into N parallel Fixer arms — different models, same goal, own worktree each. If you are the Fixer in such a round, other arms are attacking the same deficiency concurrently; the gate compares every arm at FWER-adjusted significance and only the best accepted candidate merges. Same rules apply: smallest real fix, no eval-gaming — you win by merit, not by volume.
21
+
20
22
  ## Read your task first
21
23
  Your prompt contains:
22
24
  - The **deficiency** (what to improve) and how it's measured (task-set / metric).
@@ -44,9 +44,11 @@ Identical agents on identical prompts waste the parallelism — they trace the s
44
44
 
45
45
  **Diversify the SEARCH; keep the EVALUATION identical** — every arm is judged by the *same* metric + the *same* gate (one shared judge). Letting arms pick their own metric is reward-hacking. Keep N small with **sharp** distinctions (4–5 genuinely different approaches beat many near-duplicates) — N arms ≈ N× the spend, so buy breadth, not duplicates.
46
46
 
47
+ **The loop AUTOMATES this doctrine (4.45+).** `cortex autoresearch loop --width N` fans each round into N parallel arms natively — one worktree + one Fixer model per arm, per-arm `fixer:<model>` strategy labels recorded into the matrix, the gate FWER-adjusted to the true family width, best accepted arm merges (judge reviews accepted arms in effect order). Pick the arm pool with `--arm-models a,b,c` (explicit) or `--providers deepseek,anthropic,…` (flagship model per provider; auto-detected from funded keys when omitted), and set `--missing-provider-key-policy platform_fallback|omit|redistribute` for arms whose provider key isn't funded. Manual Task-dispatch arms (above) remain the right tool when arms need distinct PERSONAS/prompts, not just distinct models — the loop's arms share one goal prompt.
48
+
47
49
  ## 3. DELEGATE (pick the execution path by how you're accessed)
48
- - **Local cortex harness** (you're driving cortex, or inside it): set `AUTORESEARCH_AGENTS=native` and delegate via the **Task tool** (`subagent_type: autoresearch-agent`), one per strategy, each prompt = the plan + that arm's persona/strategy + `EXECUTION MODE: native`. Or drive the CLI directly: `cortex autoresearch fix` / `experiment` / `loop`.
49
- - **Hosted at scale** (external agent): the hosted **`nexus-autoresearch` MCP** is LIVE. Relay the plan to its tools (`start_autoresearch_campaign` / `autoresearch_experiment` / `autoresearch_fix`) — `EXECUTION MODE: mcp`. Hosted campaigns run the **LLM judge gate ON by default** (see §4); pass `requireJudge:false` to disable or `judgeRubric` to customize.
50
+ - **Local cortex harness** (you're driving cortex, or inside it): set `AUTORESEARCH_AGENTS=native` and delegate via the **Task tool** (`subagent_type: autoresearch-agent`), one per strategy, each prompt = the plan + that arm's persona/strategy + `EXECUTION MODE: native`. Or drive the CLI directly: `cortex autoresearch fix` / `experiment` / `loop` — for a multi-provider swarm campaign, `loop --width N --arm-models/--providers …` runs the fan-out natively (§2).
51
+ - **Hosted at scale** (external agent): the hosted **`nexus-autoresearch` MCP** is LIVE. Relay the plan to its tools (`start_autoresearch_campaign` / `autoresearch_experiment` / `autoresearch_fix`) — `EXECUTION MODE: mcp`. Campaigns take `width` (1–8), `armModels`, `providers`, and `missingProviderKeyPolicy` for the multi-provider swarm fan-out. Hosted campaigns run the **LLM judge gate ON by default** (see §4); pass `requireJudge:false` to disable or `judgeRubric` to customize.
50
52
 
51
53
  The agents EXPLORE; they do not merge. They each return a candidate + its verdict.
52
54
 
@@ -290,6 +290,8 @@ cortex autoresearch experiment --experiment-tag <id> \
290
290
  ```
291
291
  `--json` → `{verdict, holdoutVerdict, regressedTasks, mergeEligible, benchSummaries, cortexDir, jsonlPaths}`. Owns the "two builds not one relabel" correctness (each arm served from its OWN built code; refuses `baseRef===candidateRef`). `--cortex-dir` is the per-experiment **artifact** (all 3 `.cortex/*.jsonl`). `mergeEligible` = keep ∧ fwerAdjusted ∧ holdout-keep (FALSE without holdout). Validated live end-to-end (both a real **discard** and a real **keep** with `mergeEligible:true`).
292
292
 
293
+ **The multi-arm campaign runner — `cortex autoresearch loop --width N` (4.45+).** The swarm-width family is now AUTOMATED: `loop --width N` fans each round into N parallel Fixer arms (own worktree + own model each, pool via `--arm-models`/`--providers`, `--missing-provider-key-policy` for unfunded arms), passes `--n-family <width>` to every arm's experiment so the FWER bar is honest, records per-arm `fixer:<model>` strategy labels into the matrix, and merges only the best gate-accepted (and judge-approved, if required) arm. This IS the N-of-this-experiment machinery — don't hand-orchestrate N `experiment` calls when a width'd loop round does it with correct family statistics.
294
+
293
295
  ### Hard-won benchmarking gotchas (from the first live runs, 2026-06-08)
294
296
  - **Server returns `model` as an OBJECT** `{id, provider}`, not a string — any recorder must extract `.id` (fixed in serverRunner/estimateCost, `a4097aaf8`).
295
297
  - **`PROJECT_PATH`, not `PROJECT_ROOT`**, controls the orchestrator's project context (system messages, CORTEX.md, agents) — set it when spawning a harness for a specific checkout (fixed in startServer, `3f549daa5`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/server",
3
- "version": "4.45.0",
3
+ "version": "4.46.0",
4
4
  "description": "Thin Express server wrapper for Nexus Cortex core library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "prepack": "node ../../scripts/copy-pkg-cortex-scaffold.mjs"
21
21
  },
22
22
  "dependencies": {
23
- "@nexus-cortex/core": "4.45.0",
24
- "@nexus-cortex/executors": "4.45.0",
23
+ "@nexus-cortex/core": "4.46.0",
24
+ "@nexus-cortex/executors": "4.46.0",
25
25
  "chalk": "^5.3.0",
26
26
  "cors": "^2.8.5",
27
27
  "dotenv": "^16.4.5",