@nexus-cortex/cli 4.124.44 → 4.124.46

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/.env.defaults +144 -0
  2. package/package.json +2 -2
package/.env.defaults CHANGED
@@ -1833,6 +1833,150 @@ MENTORSHIP_ACTIVE_DISCOVERY=false
1833
1833
  # send + stream, xAI untouched). Live probe: DeepSeek /anthropic accepted message-level cache_control (200, cache
1834
1834
  # fields 0 — it ignores it). No live Claude probe. evidence: transport map 10-02 (R215/R216/R218).
1835
1835
  #CORTEX_ANTHROPIC_HISTORY_CACHE=
1836
+ # APPEND-ONLY REQUEST HISTORY (prompt-cache restructure, 2026-10-02; .cortex/research/caching-audit-2026-10-02.md +
1837
+ # caching-rationale-2026-10-02.md). All DARK; unset = byte-identical (harness: every flag-off cell == the committed 220-cell matrix).
1838
+ # Measured with the prefix-stability harness (prefixStability.integration.test.ts, PREFIX_EXTRA_ENV / PREFIX_OUT_TAG A/B; reports
1839
+ # .cortex/research/prefix-stability-2026-10-02.<tag>.partial.md). The anchor lift (one intended tools bust at the first tool_result) is
1840
+ # untouched by all of them.
1841
+ # CORTEX_WALL_CACHE_FIX — R221. The HB-WALL-DROP nudge (+ wall summary) is appended to the newest tool_result AFTER that message's
1842
+ # canonical conversion was cached (noteRequestUsage runs while the walled turn is the tail), so the retry carried the nudge and every
1843
+ # later request silently reverted to the stale copy: a second prefix break + the nudge/summary vanished. on: every in-place mutation of a
1844
+ # history message (wall-drop carrier, lift nudge/plan/corpus/ledger, PID1/plateau notes, budget/ladder signals, TURN_STATUS, compute
1845
+ # nudge, R26 empty-turn repair, R154 image stub) drops that message's cached conversion. The wall drop itself is unchanged.
1846
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + harness-proven: send c1/c2/c3 on anthropic, xai-messages(server-tools off), chat-deepseek
1847
+ # went `1→2 tail; 2→3 F1` → `1→2 tail` only (the single intended break at the retry remains); nudge-on-wire N..... → NNNNNN, wall
1848
+ # summary persists. Flag off unchanged. Unit: appendOnlyHistory.test.ts, wallGuard.test.ts 11/11, wallGuard.integration 6/6 (+4 skip).
1849
+ #CORTEX_WALL_CACHE_FIX=
1850
+ # CORTEX_PERSIST_INJECTED — R223. The first request of a user turn sends injected content (repo-state note, deferred-tool announcement,
1851
+ # MCP / slash-command notes); history stored the raw text, so every continuation re-rendered that message WITHOUT the notes (one prefix
1852
+ # split per user turn + the notes vanished). on: the exact injected bytes are remembered per message uuid and re-sent on every request;
1853
+ # session storage, display, title and every text reader keep the raw content (no system-reminder/harness-note text persisted).
1854
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + harness-proven: scenario f (2 user turns) on anthropic, xai-messages(server-tools off),
1855
+ # chat-openai, chat-deepseek, gemini x2, hf-space, send + stream: `0→1 lift+F3; 6→7 F3` → `0→1 lift` (harness-note now on every request
1856
+ # 0-8). Responses rows unchanged (chaining hides it). Flag off unchanged.
1857
+ #CORTEX_PERSIST_INJECTED=
1858
+ # CORTEX_APPEND_ONLY_TOOLS — R222. With deferred loading (R43, kept) the filter re-ran on every continuation in allTools order: a newly
1859
+ # discovered/used tool was inserted mid-array and the 15-slot recent list evicted. on: the tools array only grows — new tools appended in
1860
+ # first-enable order, never evicted or reordered within the orchestrator's lifetime.
1861
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + harness-measured: scenario b SearchTools discovery `+8 tools (inserted mid-array at 11)`
1862
+ # → `(appended)`, no reorder; eviction not exercised by the harness (unit-tested). NOT a cache win by itself: tools precede system +
1863
+ # messages on every wire, so any growth (17→25) is still a full prefix bust once per discovery (harness still reports `2→3 F2`); the
1864
+ # flag only removes the reorder/eviction churn. A real fix = a static tools array (cost: R43's token win). Flag off unchanged.
1865
+ #CORTEX_APPEND_ONLY_TOOLS=
1866
+ # CORTEX_KEEP_MENTOR_MESSAGES — R227. Mentor/guidance messages (injectGuidance / reactive mentorship) were removed from MID-history at
1867
+ # turn end (cleanupEphemeralMessages), rewriting the next turn's prefix and shifting the Responses slice checkpoint. on: kept (never
1868
+ # persisted to the session file; display strips their system-reminder). Cost: stale guidance stays in context — to be judged in the TUI work.
1869
+ # [LEDGER 2026-10-02 @4.124.45] DARK (default OFF by operator decision) — BUILT + harness-proven: scenario e on all non-Responses rows,
1870
+ # send + stream: `6→7 F9` gone (mentor insight on the wire in requests 2-9 instead of 2-6). Flag off unchanged.
1871
+ #CORTEX_KEEP_MENTOR_MESSAGES=
1872
+ # CORTEX_RESPONSES_SLICE_ALL — R228 (bug fix). The EndTurn gate, wall/empty retries, inaction retries and tools-off synthesis set
1873
+ # previous_response_id but sent the FULL history (contradicting the e85b68834f slicing design), and never moved the slice checkpoint.
1874
+ # on: every chained request sends only the items added since the held response; each of those responses moves the checkpoint (they are
1875
+ # main-chain turns: their reply is pushed into history, so updating lastResponseId is correct — not a branch); a wall on a chained session
1876
+ # is not dropped locally (the server holds it). Fallback: if the provider reports the held response unavailable (not found / expired /
1877
+ # invalid; store off) the chain is dropped and the request is resent ONCE with the full history and NO previous_response_id
1878
+ # (responses_chain_fallback event) — send-loop initial request, continuations, gate, retries, synthesis. Streaming initial/continuation
1879
+ # (streamRequest) have no fallback yet.
1880
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + harness-proven: scenarios a/c1/c3/h on responses-openai, responses-xai, xai default:
1881
+ # send a `4→5 NEW-R; 5→6 NEW-R` → one flag left, c1 `1→2, 2→3, 5→6, 6→7 NEW-R` → one flag left; the remaining flag is a harness
1882
+ # false positive (two gate attempts push byte-identical reminder text; dump shows each request sends exactly one new item). Fallback
1883
+ # unit-tested via isPreviousResponseUnavailable only — no live provider probe. Flag off unchanged.
1884
+ #CORTEX_RESPONSES_SLICE_ALL=
1885
+ # CORTEX_GEMINI_SYSTEM_FIX — R229 HB-GEMINI-SYSTEM (DARK, 2026-10-02; CORRECTNESS). Gemini never received the system
1886
+ # prompt: the non-streaming REST generateContent body had no `system_instruction`; the non-tool requests went through the
1887
+ # @google/generative-ai SDK (v0.2.1, v1 endpoint — no systemInstruction support); the google-sdk (@google/genai) paths set a
1888
+ # TOP-LEVEL `systemInstruction`, which that SDK drops (GenerateContentParameters = {model, contents, config}). on: REST body
1889
+ # carries system_instruction {parts:[{text}]}; non-tool requests with a system prompt use the v1beta REST builders (send +
1890
+ # stream); google-sdk puts it in config.systemInstruction (send + stream). The streaming REST builder always sent it. off: unchanged.
1891
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested (transportCacheFixes.test.ts: 5 Gemini wire shapes, off =
1892
+ # byte-identical) + prefix harness (send a, gemini-generateContent + google-sdk: system prompt none → present on all 7
1893
+ # requests, byte-stable, pair verdicts unchanged). No live Gemini probe. Default-on candidate (correctness).
1894
+ #CORTEX_GEMINI_SYSTEM_FIX=
1895
+ # CORTEX_STABLE_TOOL_ORDER — R230 HB-STABLE-TOOL-ORDER (DARK, 2026-10-02). xAI cards with ENABLE_SERVER_SIDE_TOOLS=true run
1896
+ # hybrid server+client tools on /v1/responses; the first request of every user turn put the server tools FIRST while the
1897
+ # continuations used the original order → the tools array (prefix head) was reordered twice per user turn. on: the caller's
1898
+ # original order on every request (adapters/ServerSideToolDetection.ts hybrid branch). off: unchanged.
1899
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested + prefix harness (send e/f/h, xai default→responses: the per-turn
1900
+ # "19→19 tools REORDERED" divergences 2 per cell → 0; the anchor-lift 0→1 bust stays, intended). No live xAI probe.
1901
+ #CORTEX_STABLE_TOOL_ORDER=
1902
+ # CORTEX_OPENAI_CACHE_KEY — R225 HB-OPENAI-CACHE-KEY (DARK, 2026-10-02). OpenAI chat/completions + Responses bodies carry
1903
+ # `prompt_cache_key` = the session id (what xAI Responses already gets) so same-session requests route to the same prompt
1904
+ # cache. OpenAI provider only (other chat/completions providers may reject the field). off: unchanged.
1905
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested + prefix harness (send a: key on 7/7 chat-openai and
1906
+ # responses-openai requests, one value per session; chat-deepseek never; pair verdicts unchanged). No live OpenAI probe.
1907
+ #CORTEX_OPENAI_CACHE_KEY=
1908
+ # CORTEX_ANTHROPIC_AUTO_CACHE — R225 HB-ANTHROPIC-AUTO-CACHE (DARK, 2026-10-02). Anthropic Messages adds the top-level
1909
+ # automatic `cache_control` (breakpoint moves with the conversation) beside the explicit system + last-tool markers — only
1910
+ # while a breakpoint slot is free (cap 4; R218 CORTEX_ANTHROPIC_HISTORY_CACHE markers counted, so with R218 on it is
1911
+ # usually skipped). Needs ANTHROPIC_PROMPT_CACHING. Anthropic provider only — never the xAI Messages branch. off: unchanged.
1912
+ # The legacy `prompt-caching-2024-07-31` beta header is still sent (left as is).
1913
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested + prefix harness (send a/b anthropic: 2 → 3 markers incl.
1914
+ # automatic; with R218 on: 4 max, automatic only on request 0). No live Claude probe.
1915
+ #CORTEX_ANTHROPIC_AUTO_CACHE=
1916
+ # CORTEX_ANTHROPIC_CACHE_TTL — R225 (DARK, 2026-10-02). 1h: every cache_control the harness emits on the Anthropic path
1917
+ # (system, last tool, R218 history, automatic) carries ttl "1h" (uniform, so Anthropic's longer-TTL-first and
1918
+ # automatic-vs-last-marker TTL rules hold). Writes cost 2x instead of 1.25x; worth it only when requests sharing the prefix
1919
+ # start more than 5 minutes apart (long tool runs). unset | 5m = default 5-minute TTL (no ttl field). Anthropic only.
1920
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested + prefix harness (all markers ttl 1h, cap <= 4). No live probe.
1921
+ #CORTEX_ANTHROPIC_CACHE_TTL=
1922
+ # CORTEX_FORCED_CHOICE_FULL_TOOLS — R225 HB-FORCED-CHOICE-FULL-TOOLS (DARK, 2026-10-02). A forced named tool_choice (mentor
1923
+ # AskForAdvice, CORTEX_MENTOR_FORCE) narrowed the tools array to the forced tool, rewriting the tools prefix on the forced
1924
+ # request and again after it. on: the full tools array is kept; the provider's tool_choice does the forcing. CAUTION:
1925
+ # DeepSeek was observed (2026-08-29) to ignore a named choice when the full catalog is present (the reason narrowing exists),
1926
+ # and hf-space has no tool_choice on the Gradio wire, so there the force is lost entirely. off: unchanged.
1927
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested + prefix harness (send d, all transports: the forced pair's first
1928
+ # divergence moves from tools (kept 0%) to tool_choice (Anthropic/xAI-messages kept 97%, chat-deepseek 92%, chat-openai 47%,
1929
+ # Gemini 92-95%; Responses chained 0%); hf-space stable = force lost). No live probe of choice obedience.
1930
+ #CORTEX_FORCED_CHOICE_FULL_TOOLS=
1931
+ # CORTEX_STREAM_USAGE — R224a HB-STREAM-USAGE (DARK, 2026-10-02). Streaming chat/completions never asked for usage, so the
1932
+ # reassembled final message reported zero tokens (TUI/SSE accounting and cache hit rates invisible). on: streaming requests
1933
+ # send stream_options {include_usage: true} and the final message carries the provider's usage object (DeepSeek
1934
+ # prompt_cache_hit_tokens, OpenAI prompt_tokens_details). Non-streaming requests unchanged. off: unchanged.
1935
+ # [LEDGER 2026-10-02 @4.124.45] DARK — BUILT + unit-tested (request shape + usage carried). Live probe: DeepSeek streaming
1936
+ # accepted stream_options (200; usage on the final chunk WITH finish_reason, not a separate choices:[] chunk). The prefix
1937
+ # harness cannot reach the streaming builders.
1938
+ #CORTEX_STREAM_USAGE=
1939
+ # CORTEX_OPENAI_TOOLS_REASONING — HB-OPENAI-TOOLS-REASONING (DARK, 2026-10-02; stack-portability N1). OpenAI reasoning cards never declare
1940
+ # reasoning.toggleable, so the gateway withheld the request/action effort (CORTEX_ACTION_EFFORT was a NOOP on every OpenAI path).
1941
+ # on: the gateway forwards the effort for OpenAI reasoning cards → Responses `reasoning.effort` (+ summary auto). Chat/completions is
1942
+ # UNCHANGED: R19b's drop stays — live probe 2026-10-03, gpt-5.4-nano + gpt-5.6-luna: chat reasoning_effort + function tools = 400
1943
+ # "use /v1/responses"; Responses + tools + reasoning.effort = 200 on both. So an OpenAI effort arm must use OPENAI_API_MODE=responses.
1944
+ # Values pass through verbatim. DeepSeek and every non-OpenAI request byte-identical. off: unchanged.
1945
+ # [LEDGER 2026-10-03 @4.124.46] DARK — BUILT; chat half REMOVED after the live probe (would have 400ed every OpenAI tool call);
1946
+ # Responses half live-verified (accepts effort with tools).
1947
+ #CORTEX_OPENAI_TOOLS_REASONING=
1948
+ # CORTEX_ANTHROPIC_EFFORT — HB-ANTHROPIC-EFFORT (DARK, 2026-10-02; stack-portability N1). Adaptive-thinking families (claude-4.7,
1949
+ # claude-4.8, claude-5, claude-fable-5) got thinking {type:adaptive} only — the action effort never reached the wire; budget
1950
+ # families mapped effort `max` to the 10000 fallback (not in the budget map). on: adaptive families send
1951
+ # `output_config: {effort}` = low|medium|high|xhigh|max (GA field, no beta header; none/unset → omitted = provider default);
1952
+ # budget families map `max` to budget_tokens = min(120000, max_tokens - 1024) (must stay < max_tokens and >= 1024; below
1953
+ # that the legacy 10000 stays). low/medium/high budgets unchanged. Send + stream paths. xAI Messages untouched. An effort
1954
+ # change mid-session invalidates Anthropic's messages cache (same as the existing budget ladder). off: unchanged.
1955
+ # [LEDGER 2026-10-02 @4.124.46] DARK — BUILT + unit-tested (adaptive + budget, send + stream, off = byte-identical) + prefix
1956
+ # harness (send a, ACTION_EFFORT=max: claude-sonnet-5 output_config none → {effort:max} on 6/7 main requests; sonnet-4.6 and
1957
+ # haiku-4.5 budget_tokens 10000 → 62976 (max_tokens 64000) on 6/7; pair verdicts unchanged). No live Claude probe.
1958
+ #CORTEX_ANTHROPIC_EFFORT=
1959
+ # CORTEX_GEMINI_TOOLS_THINKING — HB-GEMINI-TOOLS-THINKING (DARK, 2026-10-02; stack-portability N1). The @google/genai builders
1960
+ # skipped thinkingConfig whenever tools were attached ("cannot coexist", a Gemini 2.0-era observation) and the REST builder only
1961
+ # sent a card-level thinkingLevel, so CORTEX_ACTION_EFFORT never reached Gemini. on: the gateway maps the request/action effort
1962
+ # to generationConfig.thinkingConfig on REST + SDK, with or without tools — Gemini 3.x thinkingLevel (low|medium|high;
1963
+ # xhigh/max → high), 2.5 and older thinkingBudget (low 2048, medium 8192, high 16384, xhigh/max 24576); the request effort
1964
+ # replaces a card-level thinkingLevel. SDK + tools with no effort → thinkingBudget 10000 (the no-tools default). Streaming SDK
1965
+ # adds includeThoughts; non-streaming does not (the message-level adapter would render thought parts as visible text). Visible
1966
+ # reasoning (wall levers) is NOT enabled by this flag. off: unchanged.
1967
+ # [LEDGER 2026-10-02 @4.124.46] DARK — BUILT + unit-tested (REST 3.x level + 2.5 budget, SDK send + stream, off =
1968
+ # byte-identical) + prefix harness (send a, ACTION_EFFORT=max: gemini-3.7-flash REST thinkingLevel "high", gemini-2.5-flash
1969
+ # REST + SDK thinkingBudget 24576 on 6/7 main requests; pair verdicts unchanged). No live Gemini probe of thinking + tools.
1970
+ #CORTEX_GEMINI_TOOLS_THINKING=
1971
+ #
1972
+ # CORTEX_ACTION_EFFORT_FIRST — HB-ACTION-EFFORT-FIRST (DARK, 2026-10-03; found by the effort-gap build). CORTEX_ACTION_EFFORT is filled
1973
+ # into the request params AFTER request 0 of each user turn is built, so request 0 ran at the model card's default effort and requests 1+
1974
+ # at the action effort. DeepSeek: harmless (card 'medium' = 'high' server-side; the anchor-lift bust is on the same boundary). Other
1975
+ # providers: request 0 runs at the wrong effort and the effort flip costs one extra cache break per user turn (Anthropic output_config,
1976
+ # Gemini thinkingConfig, OpenAI reasoning_effort are all prefix-relevant). on = request 0 also gets CORTEX_ACTION_EFFORT (a ramp or an
1977
+ # explicit request param still wins). off = unchanged (byte-identical).
1978
+ # [LEDGER 2026-10-03 @4.124.46] DARK — BUILT (unit tests; turn it on in every non-DeepSeek cross-provider arm).
1979
+ #CORTEX_ACTION_EFFORT_FIRST=
1836
1980
 
1837
1981
  # Prompt-mass composition (BASH_PLUS_SPEC P6): full (default) | minimal (only
1838
1982
  # the core system prompt; guides/CLAUDE.md/memory dropped) | defer (minimal on
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/cli",
3
- "version": "4.124.44",
3
+ "version": "4.124.46",
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.44",
22
+ "@nexus-cortex/core": "4.124.46",
23
23
  "chalk": "^4.1.2",
24
24
  "cli-spinners": "^2.9.0",
25
25
  "commander": "^11.0.0",