Block A · What a tool call costs the turn

What a call costs the turn

The caller is an agent in a terminal, and the measure for everything in this block is that it gets a call right on the first attempt, and answers a failure, without opening an implementation file. Where a rule does not serve that, the rule is wrong.

Slow calls return a handle

Anything expected to exceed roughly two seconds is asynchronous: a bake, a fetch, a capture and a search. start gives a job, poll gives a stage from a short fixed vocabulary, result blocks only if asked to, and cancel actually stops paying. State is a file under .polyweave/jobs/, so a handle outlives the session that made it, and a poll that finds no live process and no result returns job.worker-gone rather than hanging.

Concurrency belongs to the caller

Four handles is four parallel samples, bounded by one number in the project config. Nothing in the plugin decides how much of your machine a search may use.

Every operation asserts its own output

  • ◆A mesh: at least one face, finite bounds, and no NaN in any vertex.
  • ◆A boolean: a face count that is not zero where both operands had faces.
  • ◆A render: not a single uniform colour, not fully transparent, and the dimensions that were asked for.
  • ◆A download: a byte length matching the declared one, with the sha256 recorded.
  • ◆Expensive assertions — a manifold check on a dense mesh — are opt-in and off by default. The cheap ones above always run, because the alternative is what cost the render that put this block on the roadmap.

Nothing outside the project tree

Working state goes in .polyweave/, which belongs in .gitignore. A cache in a home directory is state a repository cannot review and a colleague cannot reproduce.