MCP Research Contract (Hyperagent Pack)
This document defines additive MCP tool contracts intended for self-improving research loops.
MCP Research Contract (Hyperagent Pack)
This document defines additive MCP tool contracts intended for self-improving research loops.
Stability note (v1.3.3 release line)
The following fields are considered stable in the v1.2.7+ research pack surface (current RUNTIME_VERSION 1.3.3):
ainl_validate(...).diagnostics[].llm_repair_hintainl_ir_diff(...).diff.changed_nodes[]as a list of{label_id, node_id, changes}ainl_fitness_report(...).metrics.fitness_scoreainl_fitness_report(...).metrics.fitness_components.weights
Future versions may add fields but should not remove or rename these without a versioned migration note.
Tools
-
ainl_validate(code, strict=True)- Returns:
ok,errors,warnings,diagnostics[] - Contract: each diagnostic includes
llm_repair_hint.
- Returns:
-
ainl_ir_diff(file1, file2, strict=True)- Returns:
ok,diff diffkeys:added_nodes,removed_nodes,changed_nodes,added_edges,removed_edges,rewired_edges,human_summary.- Contract:
changed_nodesincludes payload-leveldatadeltas when node op shape is unchanged but node data changed.
- Returns:
-
ainl_fitness_report(file, runs=5, strict=True)- Returns:
ok,metrics,sample_runs,last_error metricskeys:latency_ms,step_count,adapter_callsmemory_deltas(trace-derived frame-key proxy)operation_histogramtoken_use_estimatereliability_scorefitness_scorein[0,1]fitness_componentswith explicit component values andweights
- Returns:
Scoring stability guidance
- Treat
fitness_components.weightsas the live source of truth. - Consumers should not hard-code weight constants without checking the payload.
- Rank by
fitness_score; use component breakdown for tie-breaks and debugging.
