Skip to main content
Glama
Infinite Code Next

Infinite Code Next

by Kawai-Senpai

experiment

Run reproducible code trials to compare changes against a baseline, capture metrics and verdicts, and preserve the evidence as persistent memory.

Instructions

Measure ideas instead of arguing them: a tree of experiments with real runs.

WHEN TO USE: when a question can only be settled by running code - is this faster, more accurate, smaller, more stable - and the answer should outlive the session. Not for ordinary edits; use agit to checkpoint those. AFTER THIS: conclude() every result you judged, so it becomes a memory with its evidence attached.

Think of recipes. The baseline is the recipe you have and the one way you taste it (the command). Each experiment copies a recipe and changes one thing. You always taste the same way, you never scribble on a recipe you already tasted, and the next round starts from the winner.

The lab lives in .icn-lab/ (gitignored), fully separate from agit and from the user's .git. It enforces the rules rather than suggesting them:

  • One command for every experiment, fixed once anything is measured. Vary code and config on a child, never the command or env vars.

  • An experiment freezes once a run answers it. commit then refuses; put the next idea on a child. A crash answered nothing, so the node stays editable, but two unanswered failures in a row need force=True.

  • A run executes the committed snapshot in its own folder, never the editable checkout, and refuses while the checkout has uncommitted edits. Report results by printing lines like ICN_METRIC loss=0.4312.

Grow the tree downward: siblings are the co-equal options of ONE decision; the next decision goes under that round's winner. tree() warns about a flat fan (everything under the root) and a noodle (a chain of one-child links).

Actions: init create the lab. Snapshots the working tree as the baseline. Needs command. title defaults to 'baseline'. tree every experiment with its state, verdict, latest run and metrics, the focal node, and tree-shape warnings. create new experiment. Needs title; hypothesis is what you expect. parent defaults to the focal node (latest winner, else the baseline). checkout a folder with the experiment's code, to edit. Returns path. commit commit that folder onto the experiment. Refused when frozen. diff the experiment's change against its parent, or against. run launch a detached run of the committed code. Survives this server exiting. timeout_seconds bounds it. status one run (run=) or one experiment (exp=) in detail. log a run's output. tail bytes from the end, or from offset. wait block up to wait_seconds (max 600) until a run finishes. Returns on the FIRST finish so you can judge it and refill. cancel stop a run and everything it started. runs recent runs, all or for one experiment. conclude judge a finished run: verdict win | loss | inconclusive | void. win, loss and inconclusive freeze the experiment and write an ICN memory (decision, failed_attempt, rationale) carrying the run's commit, command, exit code, metrics and the change against the parent. win also promotes it. void says the run answered nothing (needs note) and unfreezes. promote make a measured experiment the parent for the next round. apply bring a measured experiment's code into the working tree: the whole lineage from the baseline, applied only if those files still match the baseline. The memories describing that lineage are re-verified against the new code, and any other memory the change put under review is listed. set_command change the command. Only before anything is measured.

It ties into the rest of ICN: a conclusion links to its parent's conclusion (LED_TO), so investigate(action='why') tells the story of how the code got here; caused_by= links it to what motivated it, such as a paper(action='remember') memory; workspace(action='open') lists finished runs still waiting for a verdict.

Read a run's log before concluding: status alone is not evidence.

Args: action: one of the actions above. exp: experiment id or slug. run: run id. title: for init and create. hypothesis: for init and create - the expected effect, in a sentence. parent: for create - experiment id or slug to branch from. command: for init and set_command. message: for commit. against: for diff - compare with this experiment instead of the parent. verdict: for conclude. note: for conclude - what the result means, in your own words. timeout_seconds: for run. 0 means no limit. wait_seconds: for wait. tail: for log - bytes to return. offset: for log - start byte instead of the tail. force: for run - launch past the consecutive-failure cap. limit: for runs. caused_by: for conclude - memory ids that motivated this experiment, e.g. the paper memory that suggested it. Same shape as record(). root: repository path. Defaults to the server's working directory.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "experiment"
  }
}

Input Schema

NameRequiredDescriptionDefault
expNo
runNo
noteNo
rootNo
tailNo
forceNo
limitNo
titleNo
actionNotree
offsetNo
parentNo
againstNo
commandNo
messageNo
verdictNo
caused_byNo
hypothesisNo
wait_secondsNo
timeout_secondsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations supplied, the description carries the full burden and meets it: it discloses storage location (.icn-lab/, gitignored, separate from .git), mutation side effects (commit freezes on an answered run, conclude writes an ICN memory, win promotes, apply modifies the working tree), preconditions (run refuses on uncommitted edits), and isolation semantics (runs execute the committed snapshot, not the checkout). It also discloses failure-cap behavior and the force override, which is exactly the kind of constraint an agent cannot infer.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then usage, then a scannable action list and Args block, so structure is strong for a 16-action dispatcher. The 'Think of recipes' paragraph is largely restated by the enforcement bullets that follow it, which is mild redundancy in an already long description, but it does convey the command-invariance rule before the formal rules do.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The complexity is high (16 actions, 19 params, stateful lab, cross-tool memory integration), yet the description covers the invariants, the tree-shape warnings from tree(), the metric-printing contract (`ICN_METRIC loss=0.4312`), and the ICN linkage via LED_TO and caused_by. Return values need not be described since an output schema exists.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and the Args block documents all 19 parameters with per-action scoping ('timeout_seconds: for run. 0 means no limit', 'tail: for log - bytes to return', 'root: repository path. Defaults to the server's working directory'). It also supplies enums absent from the schema (verdict win|loss|inconclusive|void) and a hard bound ('wait_seconds (max 600)').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource framing ('Measure ideas instead of arguing them: a tree of experiments with real runs') and then enumerates every action with a one-line definition. It explicitly separates itself from siblings ('Not for ordinary edits; use agit to checkpoint those'), so an agent can route correctly without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Contains an explicit WHEN TO USE clause with a concrete selection test ('when a question can only be settled by running code - is this faster, more accurate, smaller, more stable'), an explicit exclusion, a named alternative (agit), and an AFTER THIS follow-up directing to conclude(). It also prescribes ordering ('Read a run's log before concluding').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.