@nexus-cortex/core 4.87.1 → 4.88.1

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 (48) hide show
  1. package/.env.example +655 -0
  2. package/dist/adapters/ChatCompletionsAPIAdapter.d.ts.map +1 -1
  3. package/dist/adapters/ChatCompletionsAPIAdapter.js +10 -7
  4. package/dist/adapters/ChatCompletionsAPIAdapter.js.map +1 -1
  5. package/dist/config/SettingsLoader.d.ts.map +1 -1
  6. package/dist/config/SettingsLoader.js +11 -0
  7. package/dist/config/SettingsLoader.js.map +1 -1
  8. package/dist/config/effectiveConfig.d.ts +35 -0
  9. package/dist/config/effectiveConfig.d.ts.map +1 -0
  10. package/dist/config/effectiveConfig.js +104 -0
  11. package/dist/config/effectiveConfig.js.map +1 -0
  12. package/dist/config/index.d.ts +1 -0
  13. package/dist/config/index.d.ts.map +1 -1
  14. package/dist/config/index.js +1 -0
  15. package/dist/config/index.js.map +1 -1
  16. package/dist/middleware/HelperModelMiddleware.d.ts +14 -0
  17. package/dist/middleware/HelperModelMiddleware.d.ts.map +1 -1
  18. package/dist/middleware/HelperModelMiddleware.js +23 -0
  19. package/dist/middleware/HelperModelMiddleware.js.map +1 -1
  20. package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.d.ts.map +1 -1
  21. package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.js +13 -1
  22. package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.js.map +1 -1
  23. package/dist/orchestrator/CortexOrchestrator.d.ts.map +1 -1
  24. package/dist/orchestrator/CortexOrchestrator.js +115 -21
  25. package/dist/orchestrator/CortexOrchestrator.js.map +1 -1
  26. package/dist/orchestrator/OrchestratorFactory.d.ts +0 -9
  27. package/dist/orchestrator/OrchestratorFactory.d.ts.map +1 -1
  28. package/dist/orchestrator/OrchestratorFactory.js +21 -0
  29. package/dist/orchestrator/OrchestratorFactory.js.map +1 -1
  30. package/dist/training/DecisionStore.d.ts +8 -0
  31. package/dist/training/DecisionStore.d.ts.map +1 -1
  32. package/dist/training/DecisionStore.js +35 -0
  33. package/dist/training/DecisionStore.js.map +1 -1
  34. package/dist/training/loopLadder.d.ts.map +1 -1
  35. package/dist/training/loopLadder.js +11 -2
  36. package/dist/training/loopLadder.js.map +1 -1
  37. package/dist/training/mentorConsult.d.ts +8 -0
  38. package/dist/training/mentorConsult.d.ts.map +1 -1
  39. package/dist/training/mentorConsult.js +18 -0
  40. package/dist/training/mentorConsult.js.map +1 -1
  41. package/dist/training/thrashDetector.d.ts +23 -1
  42. package/dist/training/thrashDetector.d.ts.map +1 -1
  43. package/dist/training/thrashDetector.js +25 -4
  44. package/dist/training/thrashDetector.js.map +1 -1
  45. package/dist/training/toolOutcome.d.ts.map +1 -1
  46. package/dist/training/toolOutcome.js +35 -6
  47. package/dist/training/toolOutcome.js.map +1 -1
  48. package/package.json +7 -6
package/.env.example ADDED
@@ -0,0 +1,655 @@
1
+ # Nexus Cortex — Complete Environment Configuration Reference
2
+ # Copy to .env and fill in the API keys for the providers you use. Every other value
3
+ # has a proven-optimal default.
4
+ #
5
+ # WARNING: The Settings Configurator (/config) regenerates .env from SettingsSchema.
6
+ # Runtime-only vars (YOLO, SERVER_IDLE_TIMEOUT, WEB_TOOLS_MODEL, etc.) are NOT in the
7
+ # schema — they will be silently dropped unless the SettingsWriter preserves them.
8
+ #
9
+ # Keep this file and .env structurally in sync: same comments + ordering, only the
10
+ # values differ (.env = your real config, this file = template/defaults).
11
+
12
+ # ============================================
13
+ # API KEYS
14
+ # ============================================
15
+ # A model is only available if its provider's key is set. Leave the rest blank.
16
+
17
+ # Claude (Anthropic) — Fable / Opus / Sonnet / Haiku
18
+ ANTHROPIC_API_KEY=
19
+ # OpenAI — GPT / o-series
20
+ OPENAI_API_KEY=
21
+ # Gemini (legacy key; GEMINI_API_KEY takes priority when both are set)
22
+ GOOGLE_API_KEY=
23
+ # Gemini (preferred key; falls back to GOOGLE_API_KEY)
24
+ GEMINI_API_KEY=
25
+ # xAI — Grok
26
+ XAI_API_KEY=
27
+ # DeepSeek (the default model's provider)
28
+ DEEPSEEK_API_KEY=
29
+ # Nvidia (no standalone NVIDIA cards registered yet — currently reached via Cloudflare)
30
+ NVIDIA_API_KEY=
31
+ # Inception Labs (Mercury diffusion models — mercury-2)
32
+ INCEPTION_API_KEY=
33
+ # Cloudflare Workers AI (@cf/* models). Requires CLOUDFLARE_ACCOUNT_ID.
34
+ CLOUDFLARE_API_TOKEN=
35
+ # Cloudflare account id (paired with the token above)
36
+ CLOUDFLARE_ACCOUNT_ID=
37
+ # Alibaba Qwen (DashScope) — qwen-* models
38
+ DASHSCOPE_API_KEY=
39
+ # MiniMax — minimax-* models
40
+ MINIMAX_API_KEY=
41
+ # Moonshot AI (Kimi) — moonshot-* / kimi-* models
42
+ MOONSHOT_API_KEY=
43
+ # Zhipu AI (GLM) — glm-* models
44
+ ZHIPU_API_KEY=
45
+ # ── Hugging Face Inference Providers ─────────────────────────────────────────
46
+ # Run the harness (and/or helper) on a hosted open model with just a token.
47
+ # 1. Set a token below — HF_TOKEN, HUGGINGFACE_API_KEY, and HUGGINGFACE_TOKEN
48
+ # are all accepted (HF_TOKEN is the `hf` CLI / hosting-platform standard).
49
+ # 2. Set HF_MODEL_ID to a SERVED repo id (e.g.
50
+ # openai/gpt-oss-120b — optional :fastest/:cheapest/:provider suffix).
51
+ # 3. Use that same id as DEFAULT_MODEL_ID / HELPER_MODEL_ID (see MODEL CONFIGURATION).
52
+ # HF serverless hosts mostly larger popular models; for small models use a local one.
53
+ HUGGINGFACE_API_KEY=
54
+ HUGGINGFACE_TOKEN=
55
+ HF_MODEL_ID=
56
+ # Optional — match the chosen model's specs (affects compaction). Defaults: 32768 / 4096.
57
+ HF_MODEL_CONTEXT_WINDOW=
58
+ HF_MODEL_MAX_OUTPUT=
59
+
60
+ # ── HuggingFace Gradio Space (self-hosted model, native hf-space transport) ───
61
+ # Serve a model from a HF Gradio Space (free GPU via ZeroGPU on PRO). Deploy the
62
+ # template at scripts/hf-space-template/, then set HF_SPACE_ID and select it with
63
+ # DEFAULT_MODEL_ID=hf-space (or HELPER_MODEL_ID=hf-space). Needs HF_TOKEN.
64
+ HF_SPACE_ID=
65
+ # Optional: custom registry id (default 'hf-space'), specs, reasoning, tool support.
66
+ HF_SPACE_MODEL_ID=
67
+ HF_SPACE_CONTEXT_WINDOW=
68
+ HF_SPACE_MAX_OUTPUT=
69
+ HF_SPACE_REASONING=
70
+ # When the hf-space model is the chosen model, the server auto-resumes the Space
71
+ # on startup and pauses it on shutdown so a paid dedicated GPU never bills while
72
+ # idle. Set to 'false' to leave the Space lifecycle entirely to you.
73
+ HF_SPACE_AUTO_LIFECYCLE=
74
+ # Ready-made per-model Space cards (Qwen3 0.6B/1.7B, Qwen3.5 0.8B/4B, SmolLM3 3B,
75
+ # Phi-4-mini, LFM2.5 350M). Set HF_SPACE_ID_<SLUG> to a Space serving that model
76
+ # (one Space per model, callable in parallel), e.g.:
77
+ # HF_SPACE_ID_QWEN3_0_6B= HF_SPACE_ID_QWEN3_1_7B= HF_SPACE_ID_QWEN3_5_0_8B=
78
+ # HF_SPACE_ID_QWEN3_5_4B= HF_SPACE_ID_SMOLLM3_3B= HF_SPACE_ID_PHI_4_MINI=
79
+ # HF_SPACE_ID_LFM2_5_350M=
80
+ # Or set HF_SPACE_CANDIDATES=true to point ALL of them at the shared HF_SPACE_ID
81
+ # above (serial use; swap the Space's MODEL_ID variable between models). The
82
+ # transport verifies the Space's [MODEL=...] prefix against each card and errors
83
+ # on mismatch, so a card can never silently answer with the wrong model.
84
+ HF_SPACE_CANDIDATES=
85
+
86
+ # ── Local / self-hosted inference ────────────────────────────────────────────
87
+ # Run the harness (and/or helper) on your own OpenAI-compatible server — LM Studio,
88
+ # llama-server, vLLM, Ollama. Select it via DEFAULT_MODEL_ID=local or HELPER_MODEL_ID=local.
89
+ # Run the server with tool parsing ON (e.g. llama-server --jinja, vLLM
90
+ # --enable-auto-tool-choice) so it returns native tool_calls the harness understands.
91
+ # Blank endpoint = LM Studio default (http://localhost:1234/v1/chat/completions).
92
+ LOCAL_MODEL_ENDPOINT=
93
+ LOCAL_MODEL_API_KEY=
94
+ # Optional — match your loaded model's specs (affects compaction). Defaults: 32768 / 4096.
95
+ LOCAL_MODEL_CONTEXT_WINDOW=
96
+ LOCAL_MODEL_MAX_OUTPUT=
97
+ # Set true for a reasoning model that emits a separate reasoning_content field (run it
98
+ # with thinking on). Off by default. Mirrors DeepSeek/CF reasoner handling.
99
+ LOCAL_MODEL_REASONING=
100
+
101
+ # Authentication method for Anthropic: auto (try OAuth first, fall back to API key),
102
+ # oauth (OAuth only), api-key (API key only). Options: auto, oauth, api-key
103
+ ANTHROPIC_AUTH_METHOD=api-key
104
+ # OAuth token override (alternative to ~/.claude/.credentials.json)
105
+ CLAUDE_CODE_OAUTH_TOKEN=
106
+
107
+ # ============================================
108
+ # MODEL CONFIGURATION
109
+ # ============================================
110
+
111
+ # Default model for new sessions (any registry ID or alias — `cortex models list`)
112
+ # Optimal TB2 apprentice tier — pairs with the pro MENTORSHIP_HELPER_MODEL (stronger mentor).
113
+ DEFAULT_MODEL_ID=deepseek-v4-flash
114
+ # Cheaper model for context compaction & mentorship
115
+ HELPER_MODEL_ID=deepseek-v4-flash
116
+
117
+ # Model that backs WebSearch / WebFetch tools. Provider auto-detected from ID prefix.
118
+ # When unset, auto-picks based on available API keys (Gemini > Anthropic > XAI),
119
+ # falling back to DuckDuckGo HTML scrape if no provider key configured.
120
+ #
121
+ # Gemini models (uses @google/genai SDK — googleSearch grounding + urlContext):
122
+ # gemini-2.5-flash — fast, free-tier friendly, good grounding with citations
123
+ # gemini-2.5-flash-lite — cheapest, fewer grounding chunks but still functional
124
+ # gemini-2.5-pro — best grounding quality (most chunks/supports), slower
125
+ # gemini-3.5-flash — latest GA flash, strong agentic grounding, search + url context
126
+ # gemini-3.1-pro-preview — latest pro preview, rich grounding, slowest
127
+ # gemini-3-flash-preview — preview alias for gemini-3.5-flash
128
+ #
129
+ # Other providers (provider-native search APIs with citations):
130
+ # claude-haiku-4-5 — Anthropic web_search server tool (inline source citations)
131
+ # grok-4-fast-non-reasoning — XAI Responses API web_search (URL citations)
132
+ # grok-4.3 — XAI Responses API web_search (reasoning model, URL citations)
133
+ WEB_TOOLS_MODEL=gemini-2.5-flash
134
+
135
+ # ============================================
136
+ # SYSTEM SETTINGS
137
+ # ============================================
138
+
139
+ # Verbose debug logging (system-message assembly, routes). Toggle at runtime via /debug.
140
+ DEBUG=false
141
+ # Allow emoji in CLI output (false = plain text)
142
+ USE_EMOJI=false
143
+ # Project root the tools operate on. Leave EMPTY to use the launch cwd (the cwd
144
+ # model, like Claude Code): cd into your project and run cortex. Only set this for
145
+ # headless setups where the server's cwd is not the project. When set, it becomes
146
+ # canonical and PROJECT_ROOT is derived from it (they can never diverge).
147
+ PROJECT_PATH=
148
+
149
+ # ============================================
150
+ # REACTIVE MENTORSHIP (AI-to-AI self-improvement)
151
+ # ============================================
152
+
153
+ # Master switch for the mentorship system. ON = a stronger MENTORSHIP_HELPER_MODEL mentors
154
+ # the primary model (AskForAdvice hints on thrash). Only meaningful when the primary
155
+ # (DEFAULT_MODEL_ID) is WEAKER than the helper — a same-tier pair adds nothing.
156
+ MENTORSHIP_ENABLED=true
157
+ # Forced-tool_choice backstop (AskForAdvice v2): on HIGH-confidence thrash, FORCE the model to
158
+ # call AskForAdvice for one turn. Voluntary heed is ~0 (0/47 lifted transcripts), so forcing is
159
+ # what actually makes the mentor fire. OFF by default — the v2 forcing path is not yet TB2-validated.
160
+ # 🔴 MASTER GATE for the ENTIRE v2 forced-choice chain. Setting this =true (with MENTORSHIP_ENABLED=true)
161
+ # is the ONLY thing that produces a forced tool_choice, which in turn activates ALL of the v2 provider
162
+ # fixes for that forced turn: DeepSeek thinking-mode disable, tools-array restriction to the forced tool,
163
+ # and parallel_tool_calls off. With this =false, every one of those paths is inert and request behavior
164
+ # is byte-identical to pre-v2 (verified end-to-end 2026-08-29) — the code ships DARK. Flip to true only
165
+ # after the forced-consult efficacy bench confirms it actually breaks the retry-loop.
166
+ CORTEX_MENTOR_FORCE=false
167
+ # Thrash-detector tuning (feeds the forced-consult trigger above; inert while it is off).
168
+ # Windowed density: CORTEX_THRASH_FAILS (default 4) failures within CORTEX_THRASH_WINDOW
169
+ # (default 6) recent calls, after CORTEX_THRASH_MIN_TURNS (default 5) total calls.
170
+ # CUMULATIVE (dilution-immune): real retry-loops interleave successful probes between
171
+ # failing attempts (measured live: 15 fails/108 calls but max 2 per 6-window — the
172
+ # windowed condition alone NEVER fires on them). CORTEX_THRASH_CUM_FAILS (default 12)
173
+ # trips on total session failures instead. NOTE: pass/fail failure-count distributions
174
+ # OVERLAP (the model grinds through 9-18 failures to genuine passes), so this is a
175
+ # SOFT-steering trigger, not a stop signal — tune per deployment.
176
+ #CORTEX_THRASH_FAILS=4
177
+ #CORTEX_THRASH_WINDOW=6
178
+ #CORTEX_THRASH_MIN_TURNS=5
179
+ #CORTEX_THRASH_CUM_FAILS=12
180
+ # AUTO-CONSULT (the DeepSeek-safe retry-loop breaker): on high-confidence thrash the
181
+ # ORCHESTRATOR consults the mentor itself and injects the hint as a system-reminder on
182
+ # the failing tool result — no dependence on the model calling AskForAdvice and no
183
+ # forced tool_choice (which DeepSeek IGNORES whenever the history holds a prior
184
+ # tool_call — provider echo defect, mapped 2026-08-30). Rate-limited by the same
185
+ # per-session consult cap as the tool path. OFF by default — flip after the efficacy bench.
186
+ CORTEX_MENTOR_AUTO=false
187
+ # Ablation-ladder rung 1 (no-LLM mentor): when the auto/voluntary consult reaches a
188
+ # real rung, inject a FIXED self-interrogation template instead of calling the helper
189
+ # model — same trigger/ladder/rate-limit, zero cost. For pricing the mentor's
190
+ # specificity margin (bench arms); not a production default.
191
+ CORTEX_MENTOR_TEMPLATE=false
192
+ # Trigger helper-model review on tool errors (only applies when mentorship is enabled)
193
+ MENTORSHIP_TRIGGER_ON_ERROR=false
194
+ # Minimum error severity to trigger. Options: low, medium, high
195
+ MENTORSHIP_ERROR_THRESHOLD=medium
196
+ # React to @ultrathink / @analyze / @rethink keywords
197
+ MENTORSHIP_KEYWORDS_ENABLED=false
198
+ # Additional trigger keywords (comma-separated, e.g. @help,@stuck)
199
+ MENTORSHIP_CUSTOM_KEYWORDS=
200
+ # Model used for mentorship guidance (overrides HELPER_MODEL_ID).
201
+ # MUST be a STRONGER model than the primary/apprentice model: the mentor gives HINTS the
202
+ # weaker model cannot produce on its own (AskForAdvice), so a same-tier helper adds nothing.
203
+ # Default = deepseek-v4-pro — still SINGLE-PROVIDER (reuses the main DeepSeek key, no 2nd API
204
+ # key needed), just the stronger DeepSeek tier. Pair with DEFAULT_MODEL_ID=deepseek-v4-flash
205
+ # (apprentice) so the mentor is genuinely stronger on the task.
206
+ # (For image/vision background tasks, deepseek-v4-flash-vision-exp is the vision-capable option.)
207
+ MENTORSHIP_HELPER_MODEL=deepseek-v4-pro
208
+ # Periodic mentorship review every N turns
209
+ MENTORSHIP_TURN_BASED_ENABLED=false
210
+ # Turns between periodic reviews (1-50)
211
+ MENTORSHIP_TURN_INTERVAL=10
212
+ # Inject thinking assistance for non-reasoning models
213
+ MENTORSHIP_INTERLEAVED_THINKING=false
214
+ # Detect and alert on repeated failure patterns.
215
+ # ⚠️ PENDING DEPRECATION (backlog def-8ee006743f): superseded by the unified-outcome
216
+ # layer (exact-input prior + family/approach lenses + near-dup breaker + auto-consult).
217
+ # This legacy Phase-2 detector keys on RAW is_error, so it is BLIND to bash exit!=0
218
+ # retry-loops (the #1 class). Do NOT enable or extend it — leave false; slated for removal.
219
+ MENTORSHIP_PATTERN_DETECTION=false
220
+ # Number of similar errors to trigger pattern detection (2-10). (Part of the pending-
221
+ # deprecation MENTORSHIP_PATTERN_DETECTION feature above — no effect while that is false.)
222
+ MENTORSHIP_PATTERN_THRESHOLD=3
223
+ # Post-turn summary + next-action prediction via the helper model
224
+ TURN_SUMMARY_PREDICTION=false
225
+
226
+ # ============================================
227
+ # CONTEXT MANAGEMENT
228
+ # ============================================
229
+
230
+ # Anthropic prompt caching (up to ~90% input-token savings)
231
+ ANTHROPIC_PROMPT_CACHING=true
232
+ # Context selection strategy is derived from the model card per-model
233
+ # (compaction.behavior.compactOlder -> preserve-critical, else sliding-window)
234
+ # and is not env-configurable.
235
+
236
+ # Render prior thinking blocks as visible <prior_reasoning> text on the
237
+ # chat/completions path (recall for resumed reasoning-heavy sessions).
238
+ THINKING_AS_TEXT_FALLBACK=false
239
+
240
+ # ============================================
241
+ # SESSION CONFIGURATION
242
+ # ============================================
243
+
244
+ # Where JSONL session files are written
245
+ SESSION_STORAGE_DIR=.cortex/sessions
246
+ # Auto-inject connected MCP servers' tools into every turn
247
+ MCP_AUTO_INJECT=false
248
+ # Auto-research subagents. off = disabled (PM never told; main context stays clean).
249
+ # native = PM delegates to autoresearch-agent subagents that run experiments with the
250
+ # internal tools. mcp = the subagents route experiment-running to the external
251
+ # configured auto-research MCP server instead (MCP integration ships separately). Options: off, native, mcp
252
+ AUTORESEARCH_AGENTS=off
253
+ # Cap on bytes per injected project doc (CORTEX.md, MEMORY.md, etc.). 0 = unlimited.
254
+ SYSTEM_MESSAGE_DOC_MAX_BYTES=0
255
+ # Archive-prune cap for MEMORY.md: when over cap, older overflow MOVES to a sibling
256
+ # MEMORY.archive.md (never dropped) and MEMORY.md is bounded — fixes unbounded growth
257
+ # + full-file injection without losing memories. 0 = off. ~10000 recommended.
258
+ MEMORY_ARCHIVE_MAX_BYTES=10000
259
+
260
+ # ============================================
261
+ # LOOP CONTROL
262
+ # ============================================
263
+
264
+ # Maximum tool executions per turn
265
+ MAX_TOOL_ITERATIONS=1000
266
+ # Stop the turn after this many consecutive all-error iterations
267
+ MAX_CONSECUTIVE_ERRORS=6
268
+ # Soft per-turn tool-call budget (R29b brake: escalating reminders, hard cap at 2x)
269
+ # 0 disables budget pressure entirely (R64)
270
+ TOOL_BUDGET_SOFT=400
271
+ # Per-tool execution timeout in milliseconds (2 minutes)
272
+ TOOL_TIMEOUT_MS=120000
273
+ # Identical tool calls before loop detection breaks the turn
274
+ MAX_LOOP_REPETITIONS=5
275
+ # Unified outcome ladder (4.70.0): failing near-duplicate approaches escalate
276
+ # remind -> diversify -> graceful break (docs/UNIFIED_OUTCOME_LADDER.md).
277
+ #LOOP_REMIND_AT=2
278
+ #LOOP_DIVERSIFY_AT=4
279
+ #LOOP_BREAK_AT=6
280
+ # Bench/server profiles: wrap bash commands with `set -o pipefail` so
281
+ # `failing-cmd | tail` classifies as a failure instead of masking behind the
282
+ # pipe's exit 0. NEVER default-on (changes user command semantics).
283
+ CORTEX_BASH_PIPEFAIL=true
284
+ # Lift the Bash $() command-substitution block entirely (sandboxed profiles,
285
+ # e.g. bench containers — an OPERATOR decision; the check is a security
286
+ # control). $(( )) arithmetic is never flagged regardless of this setting.
287
+ CORTEX_ALLOW_CMD_SUBSTITUTION=true
288
+ # Inaction guard (ladder's inverse, 4.70.0): one bounded "act first" retry on a
289
+ # long actless first-turn response in a tool-capable request. Default OFF.
290
+ #CORTEX_INACTION_NUDGE=false
291
+ # Response length (chars) above which the inaction guard may fire.
292
+ #CORTEX_INACTION_MIN_CHARS=4000
293
+
294
+ # ============================================
295
+ # PROVIDER TOOLING (server-side tools / API surface)
296
+ # ============================================
297
+
298
+ # Inject server-side tools (web_search, x_search, code_execution) into XAI/OpenAI requests.
299
+ # When true, overrides to the Responses API at request time regardless of XAI_API_MODE.
300
+ # R37/R38 benchmarks: hybrid (true) is 20-26% faster than client-only with equal accuracy.
301
+ ENABLE_SERVER_SIDE_TOOLS=true
302
+ # Default API pattern for XAI models at registration time (ENABLE_SERVER_SIDE_TOOLS=true
303
+ # overrides at request time). Options: messages | responses
304
+ XAI_API_MODE=messages
305
+ # OpenAI request surface. Options: chat/completions | responses (opt into hosted tools)
306
+ OPENAI_API_MODE=
307
+ # Only load essential tools initially; the model discovers the rest via SearchTools.
308
+ # R43 benchmark: 77% input-token reduction on the first turn.
309
+ ENABLE_DEFERRED_TOOL_LOADING=true
310
+ # A′ experiment (deferred-loading arm refinements — default OFF, opt-in per arm):
311
+ # CORTEX_LIFT_NUDGE — at the anchor-lift boundary, append a ONE-LINE system-reminder
312
+ # pointing the model at SearchTools (to reach the tools the deferred filter hides) and,
313
+ # when mentorship is active, AskForAdvice. Turn 1 stays a pristine narrow door; the
314
+ # pointer lands only after the model has acted. No-op when deferred loading is off.
315
+ # GLOBAL BASELINE for models WITHOUT a card opinion (harness serves 17 models / 7 providers).
316
+ # The per-model CARD OVERRIDES this (deepseek-v4-flash ships liftNudge:true; pro/vision leave it
317
+ # to this baseline). Set true to enable the signpost fleet-wide for un-carded models; a card can
318
+ # still opt a specific model out. Precedence: card > this env > default.
319
+ CORTEX_LIFT_NUDGE=false
320
+ # CORTEX_HEADLESS_DROP_ASKUSER — in NON-INTERACTIVE sessions (stateless /v1/messages,
321
+ # headless API, piped oneshot) there is no human to answer AskUserQuestion, so it is a
322
+ # stall trap; drop it at the tool source. Kept in interactive TUIs.
323
+ # GLOBAL BASELINE for un-carded models; the per-model card overrides. Precedence: card > env > default.
324
+ CORTEX_HEADLESS_DROP_ASKUSER=false
325
+ # Programmatic Tool Calling (compose tool calls in a script) — experimental
326
+ ENABLE_PTC=false
327
+ # Allow local code-execution tooling
328
+ ENABLE_LOCAL_CODE_EXECUTION=false
329
+
330
+ # ============================================
331
+ # MODEL ROUTER (auto model selection)
332
+ # ============================================
333
+
334
+ # Auto-select a model based on task type + benchmark history (routes model="auto")
335
+ MODEL_ROUTER_ENABLED=false
336
+ # Routing strategy: auto (classify the prompt) | matrix-only (require explicit task type)
337
+ MODEL_ROUTER_STRATEGY=auto
338
+ # Record turn metrics to .cortex/router-matrix.jsonl (independent of routing being enabled)
339
+ MODEL_ROUTER_RECORD=false
340
+ # Models the router must NEVER auto-select (cost/policy bans), comma-separated.
341
+ # A trailing '*' is a prefix wildcard: 'grok*' excludes EVERY xAI model (present and
342
+ # future) so exploration can never route a sub-agent to a grok model — honors the
343
+ # standing cost constraint.
344
+ MODEL_ROUTER_EXCLUDE=grok*
345
+ # Opt-in explore/exploit (Thompson sampling) for model='auto'. OFF = conservative greedy
346
+ # trust-gated routing. ON = posterior-sample each model and route to the sampled-argmax,
347
+ # so thinly-sampled models get a chance and the matrix stops being self-confirming.
348
+ MODEL_ROUTER_EXPLORATION=false
349
+ # Trust gate for sub-agent model='auto' dispatch (works even when ENABLED=false — passing
350
+ # 'auto' is the orchestrator's explicit per-dispatch opt-in):
351
+ # Min task-classification confidence (0-1) before 'auto' routes; else inherits parent model
352
+ ROUTER_MIN_CONFIDENCE=0.3
353
+ # Min real benchmark samples a task type needs before 'auto' trusts the matrix
354
+ # recommendation; else inherits parent. Met as MODEL_ROUTER_RECORD accumulates data.
355
+ ROUTER_MIN_SAMPLES=3
356
+
357
+ # ============================================
358
+ # END-OF-TURN AUDIT / TRAINING SUBSTRATE (opt-in)
359
+ # ============================================
360
+
361
+ # Mandatory EndTurn pre-delivery self-audit + Stage 2/3 verifiers. Default OFF; ON =
362
+ # graded cortex-channel training records (the tool is hidden when off).
363
+ CORTEX_ENDTURN_GATE=false
364
+ # Stage 4 (4.70.0, requires the gate ON): task-requirements attestation —
365
+ # enumerate each stated requirement with what satisfies it + how it was
366
+ # verified; mutating turns with no checks are challenged. Default OFF.
367
+ #CORTEX_ENDTURN_REQUIREMENTS=false
368
+
369
+ # ============================================
370
+ # DECISION STORE (prior-recall + recording)
371
+ # ============================================
372
+
373
+ # Append each tool decision to <PROJECT_ROOT>/.cortex/decisions.jsonl (default ON)
374
+ CORTEX_RECORD_DECISIONS=true
375
+ # Inject prior decisions as a <system-reminder> before tool use (default ON)
376
+ CORTEX_LOOKUP_PRIOR_DECISIONS=true
377
+ # decisions.jsonl self-rotates at this byte cap (default 2 MB)
378
+ CORTEX_DECISIONS_MAX_BYTES=2097152
379
+ # Per-turn "Repository State" harness-note: git branch, uncommitted changes in the project
380
+ # subtree, recent commits, and a cross-agent staleness warning (files you read that another
381
+ # agent/the user has since changed on disk). Lets two agents share one working tree safely.
382
+ # Default ON; set "false" to disable.
383
+ CORTEX_GIT_CONTEXT=true
384
+
385
+ # ============================================
386
+ # ORCHESTRATOR MODE
387
+ # ============================================
388
+
389
+ # Orchestrator lifecycle: persistent (default) | stateless (clean per request) | server
390
+ CORTEX_MODE=persistent
391
+ # Server URL when CORTEX_MODE=server (HTTP client mode)
392
+ CORTEX_SERVER_URL=http://localhost:4000
393
+
394
+ # ============================================
395
+ # AGENT WORKSPACE
396
+ # ============================================
397
+
398
+ # tmux visual monitoring for parallel agent teams (one live pane per agent)
399
+ AGENT_TMUX_MONITOR=false
400
+
401
+ # ============================================
402
+ # TESTING
403
+ # ============================================
404
+
405
+ # Run real-API smoke tests instead of mocked ones
406
+ ENABLE_SMOKE_TESTS=false
407
+
408
+ # Run the Chromium browser-integration test suite (drives a real browser,
409
+ # downloads http-server via npx — opt-in; default npm test skips it)
410
+ ENABLE_BROWSER_TESTS=false
411
+
412
+ # ============================================
413
+ # DEBUG FLAGS
414
+ # ============================================
415
+
416
+ # Log raw API request/response payloads
417
+ DEBUG_PAYLOAD=false
418
+ # Verbose system-message assembly logging (also enabled by DEBUG=true)
419
+ DEBUG_SYSTEM_MESSAGES=false
420
+ # Show thinking/reasoning content in the CLI. For Anthropic Opus 4.7/4.8 (adaptive
421
+ # thinking) 'true' requests display:'summarized', which BILLS extra output tokens
422
+ # ($25/1M on Opus 4.8); 'false' keeps reasoning omitted (empty thinking blocks, $0).
423
+ # Other providers (XAI/DeepSeek/GPT) stream reasoning for free regardless.
424
+ DEBUG_THINKING=false
425
+
426
+ # ============================================
427
+ # TOOL & PATH OVERRIDES
428
+ # ============================================
429
+
430
+ # Override the Chromium binary used by web/browse tools (auto-detected if unset)
431
+ CHROMIUM_BIN=
432
+ # Alternate Chromium path honored by Playwright
433
+ PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=
434
+ # Override the tmux binary used by visual agent monitoring (auto-detected if unset)
435
+ TMUX_BIN=
436
+ # Google Vertex AI project (only when using Vertex instead of the Gemini API)
437
+ GOOGLE_CLOUD_PROJECT=
438
+ # Extra directories to grant tool access to, OUTSIDE the project root (the --add-dir
439
+ # mechanism — your explicit permission). Path-delimiter separated (':' on Linux/macOS).
440
+ # Example: /data/shared:/opt/reference. Prefer the --add-dir flag for one-offs.
441
+ CORTEX_ADD_DIRS=
442
+
443
+ # ============================================
444
+ # GIT / PR ACCESS CONTROL
445
+ # ============================================
446
+ # Controls the git/PR tools (PRAgent, WorkspaceManager) and the /v1/pr/* server routes.
447
+ # Input-format validation (which blocks shell/argument injection) is ALWAYS on; the
448
+ # allow-lists below are opt-in defense-in-depth.
449
+ #
450
+ # Comma list of repos the tools may touch: exact "owner/repo", "owner/*", or "*".
451
+ # Unset = ALL repos are permitted — the convenient default for single-user/local use.
452
+ # For shared or multi-tenant deployments, RESTRICT this to the repos you trust the tools
453
+ # with, e.g. GIT_ALLOWED_REPOS=me/app,me/*
454
+ GIT_ALLOWED_REPOS=
455
+ # Comma list of allowed actions: review,list,create,post-review,clone,worktree,diff,cleanup,status
456
+ # Unset or * = all actions allowed.
457
+ GIT_ALLOWED_ACTIONS=
458
+ # Token for gh/git. Injected into the subprocess env as GH_TOKEN/GITHUB_TOKEN only —
459
+ # never placed on argv or in a clone URL. Leave unset to use gh's own auth.
460
+ GIT_AUTH_TOKEN=
461
+ # GitHub (Enterprise) host for git/PR tools. Default: github.com
462
+ GIT_HOST=github.com
463
+ # HMAC secret for the /v1/pr/webhook endpoint (GitHub X-Hub-Signature-256).
464
+ # Unset = the webhook is DISABLED (returns 401) rather than accepting unsigned calls.
465
+ GITHUB_WEBHOOK_SECRET=
466
+
467
+ # ============================================
468
+ # SERVER LIFECYCLE (startup / shutdown / resume)
469
+ # ============================================
470
+
471
+ # HTTP server port (falls back to the next free port if taken)
472
+ PORT=4000
473
+ # Startup resume: load the most recent session on boot — e.g. after an idle-shutdown ->
474
+ # wake cycle. For a specific session set RESUME_SESSION_ID instead. Default: fresh session.
475
+ AUTO_RESUME=false
476
+ # Resume a specific session UUID on boot (overrides AUTO_RESUME)
477
+ RESUME_SESSION_ID=
478
+ # Inactivity shutdown: auto-stop after N seconds with no requests.
479
+ # 0 = never (always-on daemon)
480
+ # N>0 = stop after N seconds idle. Pair with a process manager (systemd, pm2) +
481
+ # AUTO_RESUME=true for "sleep when idle, resume on wake" — cost-efficient
482
+ # on-demand use without losing conversation state.
483
+ SERVER_IDLE_TIMEOUT=0
484
+ # Graceful shutdown: max ms to let in-flight connections drain before forcing exit
485
+ # (0 = wait indefinitely). On shutdown the dashboard view server, idle timer, and
486
+ # cleanup intervals are all closed cleanly first.
487
+ SHUTDOWN_GRACE_MS=10000
488
+ # Opt-in: start the sandbox+tmux dashboard (default off; binds an extra port).
489
+ # MASTER SWITCH for the tmux/sandbox web dashboard (the 4001 view server).
490
+ # false = the dashboard NEVER starts (not at boot, not on TmuxSession/CreateArtifact
491
+ # use) and tools return guidance instead of view URLs. Set true to enable; if it
492
+ # fails to start, check for a port conflict on DASHBOARD_PORT (retries 10 ports).
493
+ ENABLE_DASHBOARD=false
494
+ # Dashboard port — honored whether started eagerly (above) or lazily by a tool
495
+ DASHBOARD_PORT=4001
496
+
497
+ # ============================================
498
+ # RUNTIME FLAGS
499
+ # ============================================
500
+
501
+ # Auto-approve ALL tool executions (bypasses the permission system). Use with caution.
502
+ YOLO=false
503
+ # Proactive mentorship discovery (runtime flag)
504
+ MENTORSHIP_ACTIVE_DISCOVERY=false
505
+
506
+ # ============================================
507
+ # SYSTEM PROMPT DELIVERY + COMPOSITION (R63/P6, 2026-08-18)
508
+ # ============================================
509
+ # R63 delivery: static system prompt on chat/completions + Responses paths.
510
+ # DEFAULT ON since 4.66.0 (P6e/P6f/P6g testing complete). The deepseek cards'
511
+ # boot-minimal promptPreset keeps that family cheaper than the promptless era.
512
+ # Set to false to opt out (restores the pre-R63 promptless behavior).
513
+ #CORTEX_DELIVER_SYSTEM_PROMPT=false
514
+
515
+ # Prompt-mass composition (BASH_PLUS_SPEC P6): full (default) | minimal (only
516
+ # the core system prompt; guides/CLAUDE.md/memory dropped) | defer (minimal on
517
+ # turn 1, full corpus appended once at the first tool-result boundary).
518
+ # defer COMPOSES with a card's promptPreset (item 9a): a boot-minimal card
519
+ # keeps its narrow replacement prompt on turn 1 and receives the full corpus
520
+ # (incl. project CORTEX.md/AGENTS.md, read lazily at lift) after first action.
521
+ # Effective on providers only where delivery is ON (see flag above).
522
+ #CORTEX_PROMPT_MASS=minimal
523
+
524
+ # Replace the core SYSTEM_PROMPT.md with a file (e.g. the measured presets in
525
+ # docs/prompts/: boot-prompt.md = P6c winner, orient-prompt.md = runner-up).
526
+ #CORTEX_SYSTEM_PROMPT_FILE=./docs/prompts/boot-prompt.md
527
+
528
+ # ============================================
529
+ # FIRST-TURN TOOL ANCHORING (BASH_PLUS_SPEC P0/P1)
530
+ # ============================================
531
+ # Env override for the model card's anchorProfile (deepseek cards default to
532
+ # bash-edit). Values: lean | bash-only | bash-plus | bash-edit | none.
533
+ CORTEX_TOOL_ANCHOR=bash-edit
534
+ # ── Vision / image-path bridge (item 7) ──
535
+ # Turns an image stays in the request context before being stubbed out.
536
+ # MEASURED: an image ANYWHERE in a vision-exp request disables cache reads for
537
+ # the whole request — evicting after use restores the ~31x cache discount.
538
+ # 'off' keeps images forever.
539
+ #CORTEX_IMAGE_TTL_TURNS=3
540
+ # ReadImage downscales originals above this size to ~800px (provider parity,
541
+ # lossless to the model, ~100x wire cut). 'off' disables.
542
+ #CORTEX_IMAGE_DOWNSCALE_BYTES=2097152
543
+
544
+ # Anchor FRAME (4.70.0): true/persist = the anchored tool surface never lifts
545
+ # (stays the only surface all session); false/lifted forces the lift. Unset =
546
+ # the model card's frameProfile, default lifted. Experiment lever.
547
+ #CORTEX_TOOL_ANCHOR_PERSIST=false
548
+ # RL-entry cue line prepended as the first system line (refuted in P1 — do not
549
+ # ship; kept as an experiment lever).
550
+ #CORTEX_ANCHOR_CUE=
551
+ # Session-wide tool profile (independent of first-turn anchoring).
552
+ #CORTEX_TOOL_PROFILE=full
553
+ # Dedicated-tool steering in ShellTool (redirects bare `cat FILE`/`sed -i`/
554
+ # literal `echo > f`/bare `grep` to Read/Edit/Write/Grep with a guidance
555
+ # error). 'off' disables ALL such redirects — for bash-focused models
556
+ # (narrow-door program: modern + trained small models handle shell idioms
557
+ # natively and work best when bash is not second-guessed). Default: on.
558
+ #CORTEX_TOOL_REDIRECTS=on
559
+
560
+ # ============================================
561
+ # CANON STORE (cross-harness session rail)
562
+ # ============================================
563
+ #CANON_REPO=
564
+ #CANON_STORE=
565
+ #CANON_AUTO_SYNC=false
566
+ # SCOPED sync (sync-only stores, e.g. containers capturing their own sessions):
567
+ # 'auto' = materialize only the legs whose harness roots exist on THIS machine;
568
+ # or an explicit comma list of harness labels. Unset = full surface (repl
569
+ # default — translate/graph need everything and REFUSE scoped stores).
570
+ #CANON_SYNC_SCOPE=
571
+ # Force a FULL (non-partial) store clone — auto-clones default to
572
+ # --filter=blob:none (history metadata only; ~halves a multi-GB store).
573
+ #CANON_FULL_CLONE=false
574
+ # `canon archive` age threshold: sessions whose last commit is older than this
575
+ # many days move to archive/YYYY-MM (remote keeps all; local worktree stays flat).
576
+ #CANON_ARCHIVE_DAYS=30
577
+ #CANON_AUTO_SYNC_DEBOUNCE_MS=30000
578
+
579
+ # ============================================
580
+ # MISC
581
+ # ============================================
582
+ #CORTEX_UPDATE_POLICY=notify
583
+
584
+ # ============================================
585
+ # RUNTIME / CONNECTIVITY (documented by the R65 env-docs check)
586
+ # ============================================
587
+ # Route ALL provider calls through a proxy base (hosted-container mode).
588
+ #CORTEX_PROXY_BASE_URL=
589
+ # Server the CLI talks to (defaults to http://localhost:4000).
590
+ #CORTEX_URL=
591
+ # Explicit path to the server entry for auto-start.
592
+ #CORTEX_SERVER_PATH=
593
+ # Project root override for autoresearch/backlog tooling.
594
+ #CORTEX_ROOT=
595
+ # Verbose harness debug logging (coarser than DEBUG).
596
+ #CORTEX_DEBUG=false
597
+ # Auto-approve tool permissions in headless runs (YOLO-equivalent; use with care).
598
+ #CORTEX_HEADLESS_APPROVE=false
599
+ # Auto-connect configured MCP servers at session start.
600
+ #CORTEX_MCP_AUTOCONNECT=false
601
+ # Sub-agent sampling temperature override.
602
+ #CORTEX_SUBAGENT_TEMPERATURE=
603
+ # Fetch timeouts (ms) for bench runners / client HTTP.
604
+ #CORTEX_BENCH_FETCH_TIMEOUT_MS=
605
+ CORTEX_CLIENT_FETCH_TIMEOUT_MS=3600000
606
+ # P0 compliance gate: allows sk-ant-oat01 subscription tokens on the raw
607
+ # Messages path ONLY with Anthropic program approval. Leave unset otherwise.
608
+ #CORTEX_SUBSCRIPTION_AUTH_APPROVED=false
609
+ # Canon: redirect canon CLI log output to a file.
610
+ #CANON_LOG_FILE=
611
+ # Bench-runner stamps (usually set per-invocation by cortex autoresearch bench,
612
+ # not in .env): holdout-split marker, benchmark source label, experiment tag.
613
+ #CORTEX_BENCH_HOLDOUT=false
614
+ #CORTEX_BENCH_SOURCE=cortex-bench
615
+ #CORTEX_EXPERIMENT_TAG=
616
+
617
+ # Item 10 — helper-curated doctrine freshness (session-start / defer-lift boundary).
618
+ # When true, a staged mechanical CORTEX.md refresh (written by the orient script on
619
+ # drift) is curated by the HELPER model in a side context and applied atomically
620
+ # (with .prev rollback) BEFORE doctrine is delivered — synchronous, bounded,
621
+ # fail-open to the previous doc on timeout. The MAIN model never sees the diff.
622
+ #CORTEX_DOCTRINE_CURATION=true
623
+ # Curation wait bound (ms) and output size budget (bytes).
624
+ #CORTEX_DOCTRINE_CURATION_TIMEOUT_MS=25000
625
+ #CORTEX_DOCTRINE_MAX_BYTES=16384
626
+
627
+ # Item 12 — task-integrity guard (anti-reward-hacking; TB2.1 bench + serving profiles).
628
+ # Appends one static line to the system prompt (survives boot-minimal, prefix-stable):
629
+ # outputs must derive from executed work — never retrieved/recited solutions.
630
+ CORTEX_TASK_INTEGRITY=true
631
+ # Poll guard (busy-wait class): one nudge after N consecutive identical SUCCEEDING
632
+ # calls (run3 deficiency finding). Default off; arm in bench/serving profiles.
633
+ CORTEX_POLL_GUARD=true
634
+ #POLL_REMIND_AT=4
635
+ # EndTurn Stage-5 integrity verifier (item 12 layer 4): mechanical checks at the
636
+ # gate — web-content transplant + solution-shaped queries (AUDIT-ONLY events when
637
+ # a sources attestation is present: justify-don't-block) + mandatory show-your-work
638
+ # `sources` attestation whenever web tools were used this turn (the one rejecting
639
+ # check; bounded nudges, fallback-accept).
640
+ CORTEX_ENDTURN_INTEGRITY=true
641
+ # Item 13b — surrender guard: one "execute your plan" nudge when a tool-using turn
642
+ # ends by ENUMERATING remaining steps instead of doing them (the honest-premature-
643
+ # surrender class). Default off; bench/serving profiles arm it.
644
+ CORTEX_SURRENDER_NUDGE=true
645
+ # Item 14b — windowed near-dup breaker: outcome-agnostic sliding-window counter over
646
+ # the normalized approach hash (catches varied-param polling invisible to the exact
647
+ # tracker AND the poll guard — observed x65 near-identical calls, max 4 consecutive).
648
+ # N-in-window → one diversify nudge; 2N → break. Default off; bench/serving arm it.
649
+ CORTEX_NEARDUP_BREAKER=true
650
+ #NEARDUP_WINDOW=30
651
+ #NEARDUP_NUDGE_AT=12
652
+
653
+
654
+ # --- OPTIMAL LIFT CONFIG (appended) ---
655
+ CORTEX_IDLE_TIMEOUT=120
@@ -1 +1 @@
1
- {"version":3,"file":"ChatCompletionsAPIAdapter.d.ts","sourceRoot":"","sources":["../../src/adapters/ChatCompletionsAPIAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,sCAAsC;IACtC,IAAI,EAAE,UAAU,CAAC;IAEjB,0BAA0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