@nexus-cortex/cli 4.124.32 → 4.124.34

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.
package/.cortex/inventory CHANGED
@@ -41,8 +41,19 @@ W = os.path.abspath(sys.argv[1])
41
41
  SKIP_DIRS = {'.git', 'node_modules', '__pycache__', '.venv', 'venv', '.cortex', '.cache', '.pytest_cache', '.mypy_cache', '.tox', '.npm',
42
42
  '.gradle', '.m2', 'site-packages', 'dist-packages', '.idea', '.vscode', '.addon-tools'}
43
43
  MAX_WALK = 60000
44
- out = []
45
- p = out.append
44
+ # Output is bucketed per section and emitted DECISIVE-FIRST (2026-09-29): the model reads orient through `| head -50/-100` in ~93% of sessions
45
+ # (504/541, .bench/mimo/boot-prompt-audit.py) and cut the inventory in 8/17 cw sessions — so what decides a task (how it is checked, which
46
+ # copy of the code runs, missing deps, services, data outside the workdir) comes before the long per-file listing. Computation order is unchanged.
47
+ SECTIONS, CUR = {}, ['header']
48
+ EMIT = ['header', 'checked', 'python', 'node', 'services', 'outside', 'structure', 'files', 'env']
49
+
50
+
51
+ def sec(name):
52
+ CUR[0] = name
53
+
54
+
55
+ def p(line):
56
+ SECTIONS.setdefault(CUR[0], []).append(line)
46
57
 
47
58
 
48
59
  def rel(x):
@@ -191,6 +202,7 @@ counts = ', '.join(f'{r} {len(v)}' for r, v in sorted(by_role.items(), key=lambd
191
202
  p('by role: ' + counts)
192
203
 
193
204
  # ---------------------------------------------------------------- 1. verification + contracts (PRIORITY — never capped)
205
+ sec('checked')
194
206
  chk = by_role.get('checker/runner', []); con = by_role.get('contract/spec', [])
195
207
  if chk or con:
196
208
  p('-- HOW THIS TASK IS CHECKED (task-shipped checkers/runners and contracts — read these before building) --')
@@ -213,6 +225,7 @@ if chk or con:
213
225
  p(' test dirs: ' + ', '.join(shown) + (f' (+{len(tests)-12} more — find . -type d -name "test*")' if len(tests) > 12 else ''))
214
226
 
215
227
  # ---------------------------------------------------------------- 2. structure: every dir with counts (capped with marker)
228
+ sec('structure')
216
229
  p('-- STRUCTURE (dir: files directly inside) --')
217
230
  dl = sorted(d for d in dirs if d != '.')
218
231
  top = [d for d in dl if d.count('/') <= 1]
@@ -226,6 +239,7 @@ if deep:
226
239
  p(f' ({len(deep)} deeper directories — find . -mindepth 3 -type d)')
227
240
 
228
241
  # ---------------------------------------------------------------- 3. files by role with a peek (priority roles in full, bulk capped)
242
+ sec('files')
229
243
  CAPS = {'source': 40, 'doc': 30, 'data': 40, 'manifest/config': 30, 'test': 20, 'other': 20}
230
244
  ORDER = ['doc', 'manifest/config', 'source', 'data', 'test', 'other']
231
245
  for r in ORDER:
@@ -244,6 +258,7 @@ for r in ORDER:
244
258
  f'list: find . -type f | grep -v -e .git/ -e node_modules (role here = {r})'))
245
259
 
246
260
  # ---------------------------------------------------------------- 4. python: which interpreter, which copy of the code runs, missing deps
261
+ sec('python')
247
262
  def run(cmd, timeout=20):
248
263
  try:
249
264
  r = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout, cwd=W)
@@ -307,6 +322,7 @@ if declared:
307
322
  p(f' all {len(declared)} declared python dependencies are installed')
308
323
 
309
324
  # ---------------------------------------------------------------- 5. node
325
+ sec('node')
310
326
  pj = [f for f, _ in by_role.get('manifest/config', []) if os.path.basename(f) == 'package.json' and f.count('/') <= 2 and 'node_modules' not in f]
311
327
  for f in pj[:3]:
312
328
  try:
@@ -321,6 +337,7 @@ for f in pj[:3]:
321
337
  (f', NOT installed: {", ".join(miss[:20])}' + (' …' if len(miss) > 20 else '') if miss else (', node_modules present' if os.path.isdir(nm) else ', no node_modules')))
322
338
 
323
339
  # ---------------------------------------------------------------- 6. task environment (from the container's own init env; secrets redacted)
340
+ sec('env')
324
341
  BOILER = {'PATH', 'HOME', 'HOSTNAME', 'TERM', 'SHLVL', 'PWD', 'OLDPWD', '_', 'LANG', 'LC_ALL', 'DEBIAN_FRONTEND', 'container', 'GPG_KEY',
325
342
  'PYTHON_VERSION', 'PYTHON_SHA256', 'PYTHON_PIP_VERSION', 'PYTHON_GET_PIP_URL', 'PYTHON_GET_PIP_SHA256', 'PYTHON_SETUPTOOLS_VERSION',
326
343
  'NODE_VERSION', 'YARN_VERSION', 'LS_COLORS', 'SSL_CERT_DIR', 'SSL_CERT_FILE', 'NVIDIA_VISIBLE_DEVICES', 'NVIDIA_DRIVER_CAPABILITIES'}
@@ -349,6 +366,7 @@ if src_note is not None:
349
366
  if len(keep) > 40: p(more(len(keep) - 40, 'variables', 'cat /proc/1/environ | tr "\\0" "\\n"'))
350
367
 
351
368
  # ---------------------------------------------------------------- 7. services + paths outside the workdir
369
+ sec('services')
352
370
  hosts = []
353
371
  try:
354
372
  for l in open('/etc/hosts'):
@@ -372,6 +390,7 @@ if hosts or ports or urlvars:
372
390
  if hosts: p(' other hosts on this network: ' + ', '.join(sorted(set(hosts))[:20]))
373
391
  if ports: p(' listening locally: ' + ', '.join(str(x) for x in sorted(set(ports))[:20]))
374
392
  for u in urlvars[:12]: p(' ' + u)
393
+ sec('outside')
375
394
  outside = []
376
395
  for d in ('/shared', '/data', '/mnt', '/srv', '/workspace', '/input', '/inputs', '/output', '/outputs', '/reference', '/resources', '/task', '/opt/task'):
377
396
  if os.path.isdir(d) and not W.startswith(d) and not d.startswith(W):
@@ -386,5 +405,5 @@ for d in ('/shared', '/data', '/mnt', '/srv', '/workspace', '/input', '/inputs',
386
405
  if n: outside.append(f'{d} ({n}{"+" if capped else ""} files)')
387
406
  if outside:
388
407
  p('-- OUTSIDE THE WORKDIR (task data may live here) -- ' + ', '.join(outside) + ' — list: find <dir> -type f | head -100')
389
- print('\n'.join(out))
408
+ print('\n'.join(line for name in EMIT for line in SECTIONS.get(name, [])))
390
409
  PYINV
package/.cortex/orient CHANGED
@@ -22,8 +22,11 @@ fi
22
22
  # files with a content peek, which copy of the code imports, missing deps, task env, services, data outside the workdir) replaces the
23
23
  # workspace map and the v2 verification section; the tooling / git / baseline / setup lines below still print. Unset = unchanged output.
24
24
  INV=""; if [ "${CORTEX_INVENTORY:-0}" = "1" ]; then for c in "$(dirname "$0")/inventory" "${CORTEX_ROOT:-/nonexistent}/.cortex/inventory"; do [ -f "$c" ] && { INV="$c"; break; }; done; fi
25
+ INV_OUT=""
25
26
  if [ -n "$INV" ]; then
26
- sh "$INV" "$W" 2>/dev/null
27
+ # Captured here, PRINTED after the setup line below (2026-09-29): the model reads orient through `| head -50/-100` in ~93% of sessions,
28
+ # and with the inventory first 8/17 cw sessions lost orient's own short lines (git, the `-- baseline:` revert instruction, setup).
29
+ INV_OUT=$(sh "$INV" "$W" 2>/dev/null)
27
30
  else
28
31
  echo "== WORKSPACE MAP: $W =="
29
32
  ls -1A "$W" 2>/dev/null | head -40
@@ -148,7 +151,22 @@ if [ "${CORTEX_ORIENT_BOOTSTRAP:-0}" = "1" ] && { ! command -v python3 >/dev/nul
148
151
  PM=""; for m in apt-get apk dnf yum pacman zypper brew; do command -v "$m" >/dev/null 2>&1 && { PM="$m"; break; }; done
149
152
  ROOT=$([ "$(id -u 2>/dev/null)" = "0" ] && echo yes || echo no)
150
153
  GUARD=""; [ "$V2" = "1" ] && GUARD=" Install into the system or a venv, never into the task's own source or vendored tree."
154
+ # With the inventory on and a python interpreter present, the inventory has already checked the workspace manifests (requirements/
155
+ # pyproject/package.json) against what is installed. Replace the speculative "may be missing" paragraph with those facts
156
+ # (r-orient-deficiencies-2026-09-29 §3.3: "print only the MISSING ones … keep the generic line otherwise"); keep the install discipline
157
+ # (once, cached, never into the task's source/vendored tree). No manifest, no python, or no inventory = the generic line below, unchanged.
158
+ INV_MF=""; INV_MISS=""
159
+ if [ -n "$INV_OUT" ] && { command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1; }; then
160
+ printf '%s\n' "$INV_OUT" | grep -qE "declared but NOT installed|declared python dependencies are installed|^-- NODE " && INV_MF=1
161
+ printf '%s\n' "$INV_OUT" | grep -qE "declared but NOT installed|^-- NODE .*NOT installed:" && INV_MISS=1
162
+ fi
163
+ if [ -n "$INV_MF" ] && [ -n "$INV_MISS" ]; then
164
+ echo "-- setup: the workspace manifests declare dependencies that are NOT installed (listed in the inventory below; pkg-mgr=${PM:-none}, root=$ROOT). Install what the task needs ONCE and reuse it, with a fast cached installer for the language (uv for Python, bun for JS) — do not re-download a large dependency twice.$GUARD Pin versions, then verify with a real run before finishing."
165
+ elif [ -n "$INV_MF" ]; then
166
+ echo "-- setup: the declared dependencies are installed (see the inventory below). If you still need a package, install it once$( [ "$V2" = "1" ] && echo " into the system or a venv, never into the task's own source or vendored tree" )."
167
+ else
151
168
  echo "-- setup: this box may be missing a tool/language/library the task needs (pkg-mgr=${PM:-none}, root=$ROOT). If so, INSTALL what you need yourself following standard practice (the system package manager, or the language's own installer); install ONCE and reuse it, and prefer a fast cached installer for the language (uv for Python, bun for JS) — do not re-download a large dependency twice.$GUARD Pin versions, then verify with a real run before finishing. An empty box is part of the task, not an error."
169
+ fi
152
170
  fi
153
171
  # orient v2 — VERIFICATION ENTRY POINTS: how this task's correctness is checked, so work is built and verified against the real
154
172
  # criteria, not the agent's own guess (MiMo K=3: in 57/79 failures the agent's own test passed on a wrong solution). Same usage-line
@@ -169,6 +187,8 @@ for f in pytest.ini tox.ini setup.cfg pyproject.toml Makefile package.json; do
169
187
  done
170
188
  TD=$(find . -maxdepth 3 -type d \( -name tests -o -name test \) 2>/dev/null | grep -vE "node_modules|/\.|site-packages" | head -4 | tr '\n' ' ')
171
189
  fi
190
+ # The inventory (captured above) prints AFTER orient's short facts — tooling, git, baseline, setup — so a `| head -N` read keeps them.
191
+ [ -n "$INV" ] && printf '%s\n' "$INV_OUT"
172
192
  if [ -n "$VE$TC$TD" ] && [ -z "$INV" ]; then
173
193
  echo "== VERIFICATION ENTRY POINTS (build to and verify against these — not a test you invent) =="
174
194
  for f in $VE; do
package/.env.defaults CHANGED
@@ -872,6 +872,37 @@ CORTEX_ENDTURN_GATE=true
872
872
  # [LEDGER 2026-09-15 @4.108.21] BUILT + unit-tested (timeBudget.test.ts bands/line/levers; TurnEndGuards.test.ts open-items shapes).
873
873
  #CORTEX_BUDGET_VISIBILITY=
874
874
  #CORTEX_BUDGET_CONTINUE_MIN_REMAINING=
875
+ # CORTEX_TURN_STATUS — HB-TURN-STATUS (DARK, 2026-09-29). TB4.0 early self-finish root-cause (r-tb4-early-finish-rootcause-2026-09-29):
876
+ # 141/162 fails finished with >50% of the budget left; the model's sense of elapsed time ran 6-10x fast and it gave up "out of time"
877
+ # at <1 h of 8 h — the only clock it saw was the R151 WALL BUDGET line, once per 10% band. off (default; unset = byte-identical requests)
878
+ # | auto (on when CORTEX_TURN_DEADLINE_MS > 0 — the bench always sets it) | on (always; elapsed only without a deadline). On EVERY
879
+ # tool-result round (sendMessage + streamMessage, every handleToolCalls path) one line is appended to the TAIL of the round's newest
880
+ # tool_result: <system-reminder>STATUS: elapsed 0h12m of 7h12m (3%), ~7h00m left; context ~84K of 1M tokens (8%); bg: <id> "<cmd>"
881
+ # 4m12s running</system-reminder> (context = last API prompt_tokens + request growth, R132 anchor; bg = the 3 most recent entries of
882
+ # executors' BackgroundProcessRegistry — the Bash run_in_background / BashOutput / KillShell registry). CACHE: persisted in the in-memory
883
+ # history like the band line, so every earlier request is a byte-identical prefix; only the new tail varies. The band line stays.
884
+ # Event: one turn_status row per turn {lines, mode, streaming}.
885
+ # [LEDGER 2026-09-29 @4.124.33] DARK — BUILT + unit-tested (turnStatus.test.ts line/levers/bg/placement; turnStatus.integration.test.ts
886
+ # both loops: STATUS tail on every continuation, prior request prefixes byte-identical, unset/auto-without-deadline = no STATUS). NO bench arm yet.
887
+ #CORTEX_TURN_STATUS=
888
+ # CORTEX_EFFORT_RAMP — HB-EFFORT-RAMP (DARK, 2026-09-30). TB4.0 t4cw traces: the action model hit the 65,536-token output wall right
889
+ # after reading the task (photonic r2 call 3, protein r1 call 6), trying to solve the routing plan / hidden rule in its head before writing
890
+ # code; it only started acting once forced to low. The first N MAIN action calls of a turn (0 = initial request; retry/synthesis calls
891
+ # don't count) run at the ramp level, then the configured effort. off (default) | <level>[:<calls>] (low:8) | on (= low:8). DeepSeek
892
+ # levels are low | high | max (medium = high). Precedence: R153 backoff > effort pulse > ramp > request param > card. Events: effort_ramp
893
+ # {phase start|end}. CAUTION: GLOBAL low was harmful on TB4.0 (e6: 3/29 vs high 10/29) — this lever only covers the opening calls.
894
+ # [LEDGER 2026-09-30 @4.124.34] DARK — BUILT + tested (effortLevers.test.ts; effortLevers.integration.test.ts both loops: calls 0..N-1 at
895
+ # the ramp level, then the configured effort; unset = untouched). NO bench arm yet.
896
+ #CORTEX_EFFORT_RAMP=
897
+ # CORTEX_COMPUTE_NUDGE / _TOKENS / _COOLDOWN / _MAX — HB-COMPUTE-NUDGE (DARK, 2026-09-30). Same traces: steps that DID act often carried
898
+ # 35K-52K reasoning tokens first; photonic r2's productive stretch began when it ran the task's checker. After a round whose response
899
+ # reasoned past _TOKENS (default 16000), one line is appended to the tail of the newest tool_result (the HB-TURN-STATUS carrier — earlier
900
+ # request prefixes stay byte-identical): "COMPUTE, DON'T DELIBERATE: your last step spent ~NK reasoning tokens ... write and run a short
901
+ # script or the task's own checker ...". Cooldown _COOLDOWN rounds (3), cap _MAX per turn (6). off (default) | on. Event compute_nudge.
902
+ # [LEDGER 2026-09-30 @4.124.34] DARK — BUILT + tested (unit + both-loop integration: fires on a heavy step, cooldown respected; unset =
903
+ # never). NO bench arm yet.
904
+ #CORTEX_COMPUTE_NUDGE=
905
+ #CORTEX_COMPUTE_NUDGE_TOKENS=
875
906
  # (no lever) R152 HB-EMPTY-COMPLETION-RETRY (4.108.22, 2026-09-15): during a 27-min DeepSeek incident (1:30-1:57 AM PT) chat/completions
876
907
  # returned bodies that parsed to null; the SDK handed them back, the translation layer dereferenced `.choices`, and the tool loop ended the turn
877
908
  # on the TypeError — 30 sessions across tb21-a21 A/B + tb4-flash-v3 (largest-eigenval died at iteration 1). R150's ladder did not apply (a null
@@ -910,6 +941,12 @@ CORTEX_ENDTURN_GATE=true
910
941
  # from it) and the counter covers the retry call plus TURNS continuations.
911
942
  #CORTEX_REASONING_EXHAUST_BACKOFF=
912
943
  #CORTEX_REASONING_EXHAUST_BACKOFF_TURNS=
944
+ # CORTEX_REASONING_EXHAUST_LADDER — R153c (2026-09-30, DEFAULT CHANGE). The R153 backoff stepped high/max → 'medium', which DeepSeek
945
+ # runs as HIGH (reasoning_effort ladder low | high | max) — the first backoff was a NO-OP on DeepSeek (t4cw photonic r2: wall at high,
946
+ # "medium" wall again, only then low). provider (default): step down the provider's real ladder (DeepSeek high → low, max → high; others
947
+ # unchanged low | medium | high) | legacy: the pre-R153c steps. reasoning_exhaustion events now carry {ladder, provider}.
948
+ # [LEDGER 2026-09-30 @4.124.34] ON (bug fix) — unit-tested (effortLevers.test.ts). NO bench arm.
949
+ #CORTEX_REASONING_EXHAUST_LADDER=
913
950
  # (no lever) R154 HB-IMAGE-REJECTION-HEAL (4.109.0, 2026-09-16): retro-console-soc generated a 128x128 8-bit GRAYSCALE PNG, called
914
951
  # ReadImage, and DeepSeek answered the next continuation with `400 .messages[290].image[0]: You have uploaded an unsupported image`;
915
952
  # the exception escaped after the tool batch, the already-executed guard left the loop, and the R29a synthesis failed on the same block —
@@ -1806,6 +1843,14 @@ CORTEX_ORIENT_BOOTSTRAP=1
1806
1843
  # end with the exact command to list the rest. Python-first, POSIX-sh fallback; fixture 0.37 s. Pair with CORTEX_STEER_INPUTS=full (the
1807
1844
  # default env-report caps of 2000-3000 chars would cut it — with a marker only under full).
1808
1845
  # [LEDGER 2026-09-29 in tree] DARK — built + fixture-tested; not released; efficacy UNMEASURED (TB4.0 f66-shape cell vs f66 control).
1846
+ # [LEDGER 2026-09-29 @4.124.32] released dark; MiMo cw1/cw2 validation launched. Next release: with the inventory on (python present + a
1847
+ # manifest found) orient's bootstrap `-- setup:` paragraph states the inventory's facts instead of "this box may be missing…" — missing
1848
+ # declared deps → install-once line (+ vendored-tree guard under v2); all installed → one short line; no manifest / no python → the
1849
+ # generic line unchanged (r-orient-deficiencies §3.3). Unset inventory = byte-identical (tested).
1850
+ # Next release also REORDERS for the model's own `| head -50/-100` (504/541 sessions): orient prints its short lines (tooling, git,
1851
+ # `-- baseline:`, setup) BEFORE the inventory, and the inventory emits decisive-first (checked → python → node → services → outside →
1852
+ # structure → files → env). Evidence: first 17 cw2 sessions on 4.124.32 — orient cut before its end in 8/17, losing the baseline revert
1853
+ # line (the scope pair's mechanism). Fixture: 0/4 short lines survived head -50 before, 4/4 after; line set unchanged.
1809
1854
  #CORTEX_INVENTORY=
1810
1855
  # CORTEX_STEER_INPUTS — steering-prompt input sizing (2026-09-29, r-steering-input-truncation-2026-09-29): every steering prompt sliced its
1811
1856
  # inputs with NO marker (judge workspace delta cut in 56% of verdicts, lift plan cut for the judge/exit planner in >=62%, the planner saw 2000
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/cli",
3
- "version": "4.124.32",
3
+ "version": "4.124.34",
4
4
  "description": "Nexus Cortex CLI - Terminal interface for multi-provider LLM orchestration",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "prepack": "node ../../scripts/copy-pkg-cortex-scaffold.mjs"
20
20
  },
21
21
  "dependencies": {
22
- "@nexus-cortex/core": "4.124.32",
22
+ "@nexus-cortex/core": "4.124.34",
23
23
  "chalk": "^4.1.2",
24
24
  "cli-spinners": "^2.9.0",
25
25
  "commander": "^11.0.0",