TOOL_PARSE_CORPUS

TOOL_PARSE_CORPUS is an agent for coding agents from burin-labs/harn. It costs 0 tokens per session (2,436 once invoked), scanned A, original, Apache-2.0.

A collection of executable test fixtures for a text tool-call parser, migrated from Rust unit tests. Each fixture records the expected output of the previously built parser.

In plain words
What is it for?
Use it to check that a new parser matches the old one, test different tool-call inputs, and detect unintended parsing changes.
Why use it?
It preserves the parser's observed behavior during a rewrite. Any changed expected output signals a behavior change that needs justification.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/burin-labs/harn/tool_parse_corpus
Clone the repo
git clone --depth 1 https://github.com/burin-labs/harn

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for TOOL_PARSE_CORPUS

README.md
[![agentmods](https://agentmods.dev/badge/agents/burin-labs/harn/tool_parse_corpus.svg)](https://agentmods.dev/agents/burin-labs/harn/tool_parse_corpus)
Your own site
<a href="https://agentmods.dev/agents/burin-labs/harn/tool_parse_corpus"><img src="https://agentmods.dev/badge/agents/burin-labs/harn/tool_parse_corpus.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,436 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02436
Opus 5 $0.00000 $0.01218
Sonnet 5 $0.00000 $0.00487
Haiku 4.5 $0.00000 $0.00244

Measured 4d ago against content hash 0e816c349083, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

TOOL_PARSE_CORPUS scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

conformance/tests/agents/TOOL_PARSE_CORPUS.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

The tool_parse_* conformance corpus

The behavioral corpus for the text tool-call parser, migrated from ~4900 lines of Rust unit tests into executable conformance fixtures for the harn#5142 parse re-platform. Every baseline was generated from the observed stdout of the built binary, never from reasoning and never from the Rust assertions, so the corpus pins what the parser does rather than what anyone believes it does.

The port's contract is: make these pass unchanged. A diff in any .expected here is a behavior change and needs an argument, per conformance/README.md.

Layout

_tool_parse_probe.harn is a helper module, not a test — it has no baseline file, so the runner skips it the same way it skips _common.harn and the modules/*_lib.harn helpers. It owns the four registries the Rust corpus used (sample_registry, corpus_registry, echo_registry, native_registry) and the printers every fixture reports through.

Keep the registries' parameter types intact when editing them. They are not decoration: chat-template markup parses a parameter value as JSON when the schema is non-string and keeps it verbatim when the schema is a string, so content: {type: "string"} versus ops: {type: "list"} is the difference between two fixtures passing and failing.

What the common record prints, and what it does not

report prints, per case: call count, per-call name plus a key-sorted json_stringify of the arguments, every parse error and protocol violation in full, the stray-recovery count, prose, user_response, and done_marker.

Three observable facts are deliberately excluded from that record and live in dedicated fixtures instead, because they are expected to move independently of dialect behavior. Keeping them out means a port that re-cuts one of them diffs one file rather than all twenty-six.

Excluded fact Fixture Why it is separate
dropped fragment granularity tool_parse_drops Whole-unit fragments instead of line slices are fine. The invariant is that something is recorded, not where the cuts fall.
canonical_text tool_parse_canonical_replay Long, and orthogonal to whether a call parsed.
Synthetic call ids tool_parse_turn_unique_ids The counter is process-global. The Rust test asserts tc_0/tc_1; run under the full suite the same input yields tc_265/tc_266. Pinning literals would pin fixture execution order, so that fixture asserts the contract — consecutive within a turn, no reuse across turns — instead.

Read the full file on GitHub · 154 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 154 lines · 0 tokens per session scan A 0e816c349083

Subscribe to this mod's changes

TOOL_PARSE_CORPUS is an agent published in the GitHub repository burin-labs/harn (20 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,436 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.