neurouter 0.2.0 → 0.3.0

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/README.md CHANGED
@@ -44,6 +44,55 @@ pass `--models gpt-6-luna,claude-sonnet-5-5,gemini-3.5-flash-lite` to compare th
44
44
  its provider (`provider:model` forces one). Keys can also be stored, encrypted, in the console
45
45
  (Settings › Models).
46
46
 
47
+ Token figures in eval reports are comparable across providers: tokens of an attempt = uncached input +
48
+ cached input + output (reasoning included), summed over its turns; "tokens per multi-step task" is the
49
+ mean of that over the multi-step attempts. Cached input (OpenAI `cached_tokens`, Anthropic
50
+ `cache_read_input_tokens`, Gemini `total_cached_tokens`) is also reported on its own, and Anthropic cache
51
+ writes are counted as input. `--transcripts <file>` writes every attempt untrimmed (`--transcript-max-chars`
52
+ to cap each item).
53
+
54
+ Checks are outcome-based (0.2.2): expected values are computed at run time by running each task's reference
55
+ calls on the same mock data, only the arguments the prompt asks for are checked, answers are compared by
56
+ meaning (booleans, numbers, minor units, dates, ids), and call budgets are soft (over budget is reported as
57
+ efficiency, not failure). A suite is accepted only when every task's reference solution passes its own
58
+ checks (calibration; `--calibrate-with <model>` adds a model pass that flags disagreements for review).
59
+ `--max-run-tokens` caps a run's spend. Details, score definitions and the 0.2.1 suite converter
60
+ (`--migrate-suite`) and offline re-grade (`--regrade`): [packages/evals/README.md](packages/evals/README.md).
61
+
62
+ ## Agent contract
63
+
64
+ Tool results follow one of two contracts, chosen per session:
65
+
66
+ - **Contract 2** (default for servers created from this release on): every `tools/call` result is one envelope,
67
+ `{"ok","data","page","truncated","error","state"}` (plus an optional `hint`), as the only text item and as
68
+ `structuredContent`. `data` is the API's payload unchanged; `page` says `count`/`total`/`has_more` on list tools,
69
+ with `next_cursor`: pass it as `cursor` to the same tool with the same other arguments for the next page, whatever
70
+ the upstream's paging style (cursor tokens, page/per_page, offset/limit, `starting_after`, `Link` headers) and
71
+ for the rest of a list Neurouter cut. Cursors are signed, bound to the tool, arguments and credential, and last
72
+ 1 hour. Every tool takes `fields` (dot paths, per item on lists; the overlay `include` is the default set) and
73
+ list tools take `limit` (the upstream page size); names the upstream already uses get an `nr_` prefix.
74
+ `truncated` names the object fields Neurouter clipped and the `fields` call that returns them; `error` has a code, a short message,
75
+ every invalid field with its allowed values, `retry` and `next` (the exact call to make next); `state` carries the
76
+ environment, write mode, task and call counter (and identical-result streaks). Unknown tools answer with an
77
+ envelope (`unknown_tool` + closest names), not a JSON-RPC error. In `run_script`, tool functions return plain data
78
+ and raise `LookupError`/`ValueError`/`PermissionError`/… whose message is the error object;
79
+ `ops.pages(fn="ns.list_x", args={…}, max_items=500)` returns the items of every page.
80
+ There is no task framing: Neurouter infers tasks per credential, client and MCP session (10-minute idle gap),
81
+ counts `state.call`/`streak` in the task row (the same on every instance), and shows `state.left` when a
82
+ rate limit is down to 20%. One ops tool is listed, `neurouter_report(kind: done|blocked|unmet_need|tool_problem|
83
+ decision, text)`; the v1 names still answer. Write tools take `dry_run: true` (the plan: target, effect,
84
+ `reversible`). Outside prod a destructive call first answers `confirmation_required` with the plan and the same
85
+ call carrying `confirm: "ct_…"` (5 minutes, single use, bound to the arguments and the credential); scripts with
86
+ destructive calls do the same per plan. In prod your user approves through elicitation; tokens are not accepted.
87
+ - **Contract 1**: the 0.2.x shapes. Servers created before contract 2 keep it until switched.
88
+
89
+ A client picks a version with the capability `experimental["dev.neurouter/contract"] = {"versions":[2,1]}` or the
90
+ header `X-Neurouter-Contract: 2`; otherwise `exposure.contract` (server, or per environment in `neurouter.yaml`)
91
+ decides. `NEUROUTER_NEW_SERVER_CONTRACT` (default `2`) sets the contract of new servers. `exposure.outputSchema`
92
+ is `envelope` (default: the shared envelope schema with an open `data`), `none`, or `typed` (the shaped upstream
93
+ schema as `data`, validated before sending; a tool whose response does not match is re-listed without it and
94
+ reported in the inbox).
95
+
47
96
  ## Development
48
97
 
49
98
  | Command | What |