@nexus-cortex/server 4.124.25 → 4.124.27

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 (2) hide show
  1. package/.cortex/orient +87 -2
  2. package/package.json +3 -3
package/.cortex/orient CHANGED
@@ -7,6 +7,16 @@
7
7
  W="$(pwd)"
8
8
  echo "== WORKSPACE MAP: $W =="
9
9
  ls -1A "$W" 2>/dev/null | head -40
10
+ # orient v2 ships DARK (2026-09-27): every v2 section runs only with CORTEX_ORIENT_V2=1; unset = the v1 output byte-for-byte.
11
+ V2="${CORTEX_ORIENT_V2:-0}"
12
+ # orient v2 (2026-09-27, MiMo: the whole library lived under vendor/ and the map showed one level): one more level for the top
13
+ # directories (skipping caches/vendored deps of the toolchain), capped so the map stays small.
14
+ [ "$V2" = "1" ] && for d in $(ls -1A "$W" 2>/dev/null | head -40); do
15
+ [ -d "$W/$d" ] || continue
16
+ case "$d" in .git|node_modules|__pycache__|.venv|venv|.cache|.cortex|.addon-tools|dist|build|target) continue;; esac
17
+ n=$(ls -1A "$W/$d" 2>/dev/null | wc -l | tr -d ' ')
18
+ echo " $d/ ($n): $(ls -1A "$W/$d" 2>/dev/null | head -8 | tr '\n' ' ')"
19
+ done | head -8
10
20
  PROJECT=""
11
21
  CMDS=""
12
22
  if [ -f package.json ]; then
@@ -38,15 +48,85 @@ for b in file xxd strings ps pgrep free pdftotext tesseract gcc make git curl; d
38
48
  if command -v "$b" >/dev/null 2>&1; then HAVE="$HAVE $b"; else MISS="$MISS $b"; fi
39
49
  done
40
50
  echo "-- tooling:${TI:- (no python/node on PATH)} | have:${HAVE:- none} | missing:${MISS:- none}"
51
+ # orient v2: the baseline the judge's workspace delta is computed against — know it before editing.
52
+ if [ "$V2" != "1" ]; then :
53
+ elif command -v git >/dev/null 2>&1 && git -C "$W" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
54
+ CH=$(git -C "$W" status --porcelain 2>/dev/null | wc -l | tr -d ' ')
55
+ if git -C "$W" rev-parse --verify -q HEAD >/dev/null 2>&1; then
56
+ echo "-- git: $(git -C "$W" rev-parse --abbrev-ref HEAD 2>/dev/null) @ $(git -C "$W" log -1 --format=%h 2>/dev/null), $CH changed file(s) — \`git diff\` shows your edits"
57
+ else
58
+ echo "-- git: repository with no commits yet ($CH untracked/changed path(s)) — commit a baseline before editing to diff your work"
59
+ fi
60
+ else
61
+ echo "-- git: not a repository (no baseline to diff your edits against)"
62
+ fi
63
+ # Workspace baseline (CORTEX_ORIENT_BASELINE=1, dark, 2026-09-27): MiMo tb64 lost ~10-14% of tasks per run to the grader's
64
+ # protected-file guard (a file outside the task's repair set was modified, usually vendored library code) and the workspaces are not git
65
+ # repos, so nothing could show the agent what it had changed. Record a checksum list ONCE (never overwritten, so a re-run of orient keeps
66
+ # the start state) and ship `.cortex/changed`, which lists modified / added / deleted files against it. POSIX cksum; capped.
67
+ if [ "${CORTEX_ORIENT_BASELINE:-0}" = "1" ]; then
68
+ mkdir -p "$W/.cortex" 2>/dev/null
69
+ cat > "$W/.cortex/changed" 2>/dev/null <<'CHANGED'
70
+ #!/bin/sh
71
+ # Lists files modified / added / deleted since orient recorded .cortex/baseline.cksum (the task's start state).
72
+ cd "$(dirname "$0")/.." || exit 0
73
+ B=.cortex/baseline.cksum
74
+ [ -f "$B" ] || { echo "no baseline recorded (.cortex/baseline.cksum missing)"; exit 0; }
75
+ T=$(mktemp 2>/dev/null || echo /tmp/cortex-now.$$)
76
+ find . \( -path ./.git -o -path ./.cortex -o -name node_modules -o -name __pycache__ -o -name .venv -o -name venv -o -name .cache -o -name .pytest_cache -o -name .mypy_cache \) -prune -o -type f -size -20M -print 2>/dev/null | head -20000 | tr '\n' '\0' | xargs -0 cksum 2>/dev/null > "$T"
77
+ awk 'function k( f) { f=$0; sub(/^[0-9]+[ \t]+[0-9]+[ \t]+/, "", f); return f }
78
+ NR==FNR { b[k()]=$1" "$2; next } { n[k()]=$1" "$2 } END {
79
+ for (f in n) { if (!(f in b)) print "added " f; else if (b[f] != n[f]) print "modified " f }
80
+ for (f in b) if (!(f in n)) print "deleted " f }' "$B" "$T" | sort -k2
81
+ rm -f "$T"
82
+ CHANGED
83
+ if [ ! -f "$W/.cortex/baseline.cksum" ]; then
84
+ ( cd "$W" && find . \( -path ./.git -o -path ./.cortex -o -name node_modules -o -name __pycache__ -o -name .venv -o -name venv -o -name .cache -o -name .pytest_cache -o -name .mypy_cache \) -prune -o -type f -size -20M -print 2>/dev/null | head -20000 | tr '\n' '\0' | xargs -0 cksum 2>/dev/null > .cortex/baseline.cksum )
85
+ fi
86
+ BN=$(wc -l < "$W/.cortex/baseline.cksum" 2>/dev/null | tr -d ' ')
87
+ echo "-- baseline: ${BN:-0} files recorded at start; \`sh .cortex/changed\` lists files you modified/added/deleted. Before finishing, run it and revert every change the task did not require."
88
+ fi
41
89
  # Bare-box hint (2026-09-03, operator-simplified): a task container may ship WITHOUT the language, compiler,
42
90
  # package or library the objective needs — on purpose (the agent phase is bare; internet is usually allowed).
43
91
  # State the FACTS (package manager present, whether we are root) and ONE principled directive — no command
44
92
  # cookbook: the model bootstraps correctly on its own (pro solved a bare-box torch task with only this line).
45
93
  # Prescribing exact incantations is prompt mass that misdirects; observation + intent is enough.
94
+ # The directive exists because some bench task containers ship WITHOUT the dependencies the task needs (operator, 09-27): they must be
95
+ # installed efficiently — once, cached, never duplicated. Trigger unchanged from v1 (no interpreter OR no C compiler). orient v2 adds a
96
+ # guard instead of suppressing the line: the MiMo doctrine mine found 21 sessions pip-installing into the task's frozen vendor trees.
46
97
  if [ "${CORTEX_ORIENT_BOOTSTRAP:-0}" = "1" ] && { ! command -v python3 >/dev/null 2>&1 && ! command -v python >/dev/null 2>&1 || ! command -v cc >/dev/null 2>&1; }; then
47
98
  PM=""; for m in apt-get apk dnf yum pacman zypper brew; do command -v "$m" >/dev/null 2>&1 && { PM="$m"; break; }; done
48
99
  ROOT=$([ "$(id -u 2>/dev/null)" = "0" ] && echo yes || echo no)
49
- 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. Pin versions, then verify with a real run before finishing. An empty box is part of the task, not an error."
100
+ GUARD=""; [ "$V2" = "1" ] && GUARD=" Install into the system or a venv, never into the task's own source or vendored tree."
101
+ 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."
102
+ fi
103
+ # orient v2 — VERIFICATION ENTRY POINTS: how this task's correctness is checked, so work is built and verified against the real
104
+ # 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
105
+ # logic as the judge/planner env report (R193), plus probe/test scripts, test config and test directories. Read-only, capped.
106
+ VE=""; TC=""; TD=""
107
+ if [ "$V2" = "1" ]; then
108
+ VE=$(find . -maxdepth 3 \( -iname "*check*" -o -iname "*verif*" -o -iname "*validat*" -o -iname "*grade*" -o -iname "*probe*" -o -name "test_*.py" -o -name "*_test.py" -o -iname "run_tests*" \) \( -name "*.py" -o -name "*.sh" \) 2>/dev/null | grep -vE "node_modules|/\.|site-packages|/vendor/.*/tests?/" | head -6)
109
+ TC=""
110
+ for f in pytest.ini tox.ini setup.cfg pyproject.toml Makefile package.json; do
111
+ [ -f "$f" ] || continue
112
+ case "$f" in
113
+ pytest.ini|tox.ini) TC="$TC $f";;
114
+ setup.cfg) grep -q "tool:pytest" "$f" 2>/dev/null && TC="$TC setup.cfg[tool:pytest]";;
115
+ pyproject.toml) grep -q "tool.pytest" "$f" 2>/dev/null && TC="$TC pyproject.toml[tool.pytest]";;
116
+ Makefile) grep -qE "^(test|check)[a-z_-]*:" "$f" 2>/dev/null && TC="$TC make:$(grep -oE '^(test|check)[a-z_-]*' "$f" | head -3 | tr '\n' ',' | sed 's/,$//')";;
117
+ package.json) grep -q '"test"' "$f" 2>/dev/null && TC="$TC npm-test";;
118
+ esac
119
+ done
120
+ TD=$(find . -maxdepth 3 -type d \( -name tests -o -name test \) 2>/dev/null | grep -vE "node_modules|/\.|site-packages" | head -4 | tr '\n' ' ')
121
+ fi
122
+ if [ -n "$VE$TC$TD" ]; then
123
+ echo "== VERIFICATION ENTRY POINTS (build to and verify against these — not a test you invent) =="
124
+ for f in $VE; do
125
+ echo " $f"
126
+ { grep -n -m3 -iE "usage|^ *Run:|add_argument|sys\.argv|getopts" "$f" 2>/dev/null; } | head -3 | cut -c1-150 | sed 's/^/ /'
127
+ done
128
+ [ -n "$TC" ] && echo " test config:$TC"
129
+ [ -n "$TD" ] && echo " test dirs: $TD"
50
130
  fi
51
131
  if [ -f README.md ]; then
52
132
  echo "-- README head --"
@@ -55,7 +135,7 @@ fi
55
135
  # Capability index — harness-owned steering (item 9b): the skills shipped with
56
136
  # the install, reachable through plain bash reads (works under any tool frame).
57
137
  SK="${CORTEX_ROOT:-$HOME}/.cortex/skills"
58
- if [ -d "$SK" ]; then
138
+ if [ -d "$SK" ] && [ "$V2" != "1" ]; then
59
139
  echo "== CAPABILITY GUIDES (load one with: cat <path>/SKILL.md) =="
60
140
  for d in "$SK"/*/; do
61
141
  [ -d "$d" ] || continue
@@ -64,6 +144,11 @@ if [ -d "$SK" ]; then
64
144
  case "$desc" in ">"|"|"|"") desc="guide";; esac
65
145
  echo " $SK/$n — $desc"
66
146
  done | head -14
147
+ elif [ -d "$SK" ]; then
148
+ # orient v2: one line (was 12 full paths + descriptions ≈ half the output, mostly irrelevant to the task at hand).
149
+ NAMES=$(for d in "$SK"/*/; do [ -d "$d" ] && basename "$d"; done | tr '\n' ' ')
150
+ echo "== CAPABILITY GUIDES: $NAMES(read one: cat $SK/<name>/SKILL.md)"
151
+ [ -f "$SK/verify-work/SKILL.md" ] && echo " before finishing, verify-work: cat $SK/verify-work/SKILL.md"
67
152
  fi
68
153
  echo "note: when your tool list is limited, additional tools may be discoverable via the SearchTools tool."
69
154
  # Mechanical CORTEX.md (items 9c + 10): machine-authored sections live between
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/server",
3
- "version": "4.124.25",
3
+ "version": "4.124.27",
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.25",
24
- "@nexus-cortex/executors": "4.124.25",
23
+ "@nexus-cortex/core": "4.124.27",
24
+ "@nexus-cortex/executors": "4.124.27",
25
25
  "chalk": "^5.3.0",
26
26
  "cors": "^2.8.5",
27
27
  "dotenv": "^16.4.5",