@nexus-cortex/server 4.124.32 → 4.124.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/server",
3
- "version": "4.124.32",
3
+ "version": "4.124.33",
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.124.32",
24
- "@nexus-cortex/executors": "4.124.32",
23
+ "@nexus-cortex/core": "4.124.33",
24
+ "@nexus-cortex/executors": "4.124.33",
25
25
  "chalk": "^5.3.0",
26
26
  "cors": "^2.8.5",
27
27
  "dotenv": "^16.4.5",