- Status: proposed
- Date: 2026-02-15
Recent live traces showed a recurring failure class:
- A Tool can return structurally valid data (
Outcome.ok) that is semantically low value for caller intent. - A Tool can be asked to perform work across capability boundaries it does not own (for example, HTTP transport plus extraction semantics).
- Current runtime contract enforcement (ADR 0014) validates
deliverableshape, but does not yet evaluate whether output satisfied the spirit of the contract. - The Tool Builder receives weak signals ("execution failed" or noisy successes) instead of clear decomposition signals.
The project tenets require:
- Agent-first mental model.
- Tolerant interfaces by default.
- Runtime ergonomics and clarity before premature constraints.
- Ubiquitous language aligned to Agent thinking.
In that language:
- Tool Builders forge and compose Tools.
- Tools execute and evolve themselves, or declare they are the wrong boundary.
- Workers execute directly.
The missing primitive is referral semantics: a Tool that can say "this request crosses my capability boundary" in a typed, actionable way.
Introduce first-class Tool boundary referral and cohesion telemetry, with a dual-lane evolution model:
- inline correction lane for immediate call safety and truthful outcomes;
- out-of-band evolution lane for contract/tool boundary refinement over time.
Add canonical typed outcomes for Tool self-evaluation:
wrong_tool_boundary- Meaning: the Tool can execute part of the request, but the requested outcome crosses capability boundaries it should not own.
low_utility- Meaning: output is structurally valid but semantically weak for caller intent.
These are not crashes; they are referrals with intent metadata.
When returning wrong_tool_boundary, include metadata fields:
boundary_axes(for example:["transport", "extraction"])observed_task_shapesuggested_split(optional concise suggestion)evidence(optional short explanation)
This preserves tolerant interfaces while making boundary mismatch machine-actionable.
For Tool-depth execution prompts, add a self-evaluation nudge:
- Did I satisfy the letter of
deliverable? - Did I satisfy the spirit/usefulness of caller intent?
- If not, should I return typed referral (
wrong_tool_boundary) instead of low-quality success?
This is guidance, not hard prohibition.
Persist per tool/method telemetry signals:
- failure signatures and counts (
execution,contract_violation,wrong_tool_boundary,low_utility, etc.) - repair attempts and outcomes
- boundary-axis clustering statistics
- rolling cohesion warning signal when failures cluster across distinct axes
Telemetry is observational infrastructure; it does not perform autonomous redesign.
Extend prompt-time known-tools metadata with concise health signals:
- canonical methods
- recent boundary/usefulness failures
- cohesion warning summary
The Tool Builder uses this signal to:
- refine contract acceptance criteria,
- split or recompose tools when boundary mismatch repeats,
- retain existing interfaces when health is strong.
Inline behavior on active calls:
- enforce deliverable boundary checks (ADR 0014);
- allow Tool self-referral (
wrong_tool_boundary) and usefulness signaling (low_utility); - perform immediate repair/retry only for implementation failures that block the current call;
- avoid heavy architectural reasoning in-line when deterministic completion is possible.
Inline lane goal: correct now, fail typed, keep caller flow coherent.
Out-of-band behavior over accumulated traces:
- evaluate repeated low-utility and boundary signals;
- cluster failures by boundary axes and compute cohesion warnings;
- surface actionable evolution suggestions to Tool Builder (split/recompose/tighten acceptance);
- schedule re-forge/refinement outside latency-sensitive user calls.
Out-of-band lane goal: evolve durable tool architecture from evidence without overloading hot-path calls.
Capture user_correction as first-class telemetry with deterministic temporal/task-shape detection as the primary v1 signal:
- same-session repeated ask in a short recency window;
- near-identical capability/task-shape pattern as the immediately prior ask;
- no intervening task-shape shift.
This provides NLP-independent evidence that the previous answer was not useful for the intended task.
Secondary phrase heuristics (for example "this is wrong", "looks like a menu", "try again") can enrich detection, but do not replace deterministic re-ask signaling.
user_correction should be weighted stronger than model self-assessment when scoring low_utility.
Runtime responsibilities:
- classify outcomes,
- persist telemetry,
- surface signals in both inline and out-of-band lanes.
Tool Builder responsibilities:
- decide whether to refine implementation,
- tighten contract semantics,
- split or recompose tool boundaries.
Runtime must not auto-split tools in v1.
In scope:
- new typed outcome semantics (
wrong_tool_boundary,low_utility); - metadata schema for boundary referral;
- telemetry persistence and prompt injection for cohesion signals;
- Tool-depth prompt nudge for spirit-of-contract self-evaluation;
- user-correction telemetry capture and scoring;
- dual-lane (inline + out-of-band) repair/evolution policy wiring based on typed outcomes.
Out of scope:
- runtime-autonomous tool decomposition;
- hardcoded domain heuristics for specific websites/data sources;
- mandatory universal split patterns (for example forcing
http_client+html_parserin all cases).
- turns ambiguous failures into explicit architectural signals;
- improves Tool Builder decision quality with evidence instead of guesswork;
- preserves emergence: runtime observes, agents decide;
- reduces persistence of low-value but shape-valid artifacts;
- aligns with Tool Builder/Tool/Worker ubiquitous language;
- prevents hot-path latency from ballooning due to constant deep self-evaluation.
- more telemetry state and prompt tokens;
- potential overuse of
wrong_tool_boundaryif nudge is too aggressive; - cohesion scoring thresholds require tuning to avoid false positives;
- requires an asynchronous evaluation loop and operational visibility for out-of-band evolution;
- re-ask detection thresholds require tuning to avoid misclassifying topical follow-ups as corrections.
- Keep only execution/contract errors
- Rejected: conflates crash, mismatch, and referral semantics.
- Add many new contract fields for robustness
- Rejected: schema growth is not the bottleneck; contract quality and failure feedback loop are.
- Runtime auto-splits tools on repeated failures
- Rejected: violates agent-first architecture decisions.
- Hardcode robust fetch/extract primitives in runtime
- Rejected for this phase: conflicts with emergent tool evolution goal.
- Perform all evaluation inline only
- Rejected: adds avoidable latency/cognitive load to normal calls and slows deterministic tasks.
- Add
wrong_tool_boundaryandlow_utilityto outcome taxonomy. - Normalize referral metadata shape.
- Add tests for coercion/logging/serialization of these outcomes.
- Persist boundary/usefulness signals in artifacts and registry metadata.
- Track axis clustering and rolling cohesion warning.
- Capture deterministic
user_correctionevents from short-window same-topic re-asks. - Optionally enrich with bounded phrase heuristics for calibration.
- Add tests for persistence and backward compatibility.
- Add Tool-depth spirit-of-contract self-evaluation nudge, scoped to plausibly low-utility tasks.
- Add inline classification policy:
execution/contract_violation-> immediate correction path;wrong_tool_boundary/low_utility-> typed referral and continue.
- Add acceptance tests showing typed referral behavior without hard crashes.
- Inject tool health/cohesion summary in
<known_tools>. - Route repeated boundary signals to Tool Builder contract refinement paths.
- Bias repair/evolution policy:
- implementation failures -> repair implementation;
- boundary/usefulness failures -> recommend contract/tool decomposition.
- Weight repeated
user_correctionsignals as high-confidence evidence forlow_utility. - Add trace-based acceptance tests for repeated-boundary scenario and delayed evolution.
wrong_tool_boundaryis referral semantics, not a silent escape hatch.- Tool must include short evidence metadata when emitting boundary referral.
- Tool Builder remains responsible for final decomposition decisions.
- Runtime surface should remain minimal and explainable.
- Inline lane must prefer fast correction/referral over deep architectural rewrites.
- User-correction signals should influence evolution policy, not force immediate hardcoded behavior changes.
- Correction detection should default to deterministic temporal/task-shape matching before language heuristics.
- Axis vocabulary governance:
- fixed enum in v1, or agent-defined axes with normalization?
- v1 direction: agent-defined axes with lightweight runtime normalization.
- Cohesion warning thresholds:
- count-based, recency-weighted, or blended?
- Should repeated
low_utilityat Tool depth count as adaptive failure for artifact selection?- v1 direction: yes, count repeated
low_utilityas adaptive failure.
- v1 direction: yes, count repeated
- How much health detail can be injected in
<known_tools>before prompt budget tradeoffs outweigh value?