Part F of the plan to make it easier for LLMs to generate correct green-tea apps. An agent that inspects an app should read its graph instead of guessing it.
New commands:
matcha routes lists every route with its transport and chain.
matcha tokens lists every token, who provides it and who needs it, handlers included.
--json on explain, routes and tokens: prints exactly one JSON document on stdout. A refused query (an unknown pattern) prints {"error":{code,message,registered}} on stderr and exits 1.
One query layer:src/introspect.rs holds a Query enum whose variants map one-to-one to future MCP tools. Each query returns a single JSON envelope, and cmd_graph.rs only renders it. A future matcha mcp would be a thin layer on top, with no second implementation.
Existing output unchanged:graph, explain (text) and openapi print exactly what they printed before.
New dependency:serde_json 1.0.154 (dtolnay, published 2026-10-11).
Verified:
cargo test passes, with new unit tests for the envelope, the structured refusal, and the text layout of explain and tokens.
clippy and fmt are clean.
starter-smoke.sh node passes.
On a real starter: routes, tokens, explain and --json, including the error case.
Part F of the plan to make it easier for LLMs to generate correct green-tea apps. An agent that inspects an app should read its graph instead of guessing it.
- **New commands:**
- `matcha routes` lists every route with its transport and chain.
- `matcha tokens` lists every token, who provides it and who needs it, handlers included.
- **`--json` on `explain`, `routes` and `tokens`:** prints exactly one JSON document on stdout. A refused query (an unknown pattern) prints `{"error":{code,message,registered}}` on stderr and exits 1.
- **One query layer:** `src/introspect.rs` holds a `Query` enum whose variants map one-to-one to future MCP tools. Each query returns a single JSON envelope, and `cmd_graph.rs` only renders it. A future `matcha mcp` would be a thin layer on top, with no second implementation.
- **Existing output unchanged:** `graph`, `explain` (text) and `openapi` print exactly what they printed before.
- **New dependency:** `serde_json` 1.0.154 (dtolnay, published 2026-10-11).
**Verified:**
- `cargo test` passes, with new unit tests for the envelope, the structured refusal, and the text layout of `explain` and `tokens`.
- `clippy` and `fmt` are clean.
- `starter-smoke.sh node` passes.
- On a real starter: `routes`, `tokens`, `explain` and `--json`, including the error case.
Agents that inspect a green-tea app should read its graph instead of
guessing it.
- Add `matcha routes`: every route with its transport and chain.
- Add `matcha tokens`: every token, who provides it and who needs it,
handlers included.
- explain, routes and tokens take --json. It prints one JSON document
on stdout; a refused query prints a structured error on stderr and
exits 1.
All introspection now goes through src/introspect.rs. Each Query
variant runs one script that prints a single JSON envelope, and the
CLI renders the data as text unless --json is given. Text output is
unchanged. A future `matcha mcp` serves the same queries as tools
without a second implementation, which is why the formatting moved
from the generated script into Rust.
Adds serde_json (dtolnay, 1.0.154).
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
matcha tokens listed req as '— (nothing provides it)'. An agent reading
that would write a provider for req. A needed token with no producing
node must come from the request (req, params, body, …): app.ready() has
already validated the graph, so a truly missing token would have failed
it. Mark those source: "request" in the JSON and 'the request (built
in)' in the text.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part F of the plan to make it easier for LLMs to generate correct green-tea apps. An agent that inspects an app should read its graph instead of guessing it.
matcha routeslists every route with its transport and chain.matcha tokenslists every token, who provides it and who needs it, handlers included.--jsononexplain,routesandtokens: prints exactly one JSON document on stdout. A refused query (an unknown pattern) prints{"error":{code,message,registered}}on stderr and exits 1.src/introspect.rsholds aQueryenum whose variants map one-to-one to future MCP tools. Each query returns a single JSON envelope, andcmd_graph.rsonly renders it. A futurematcha mcpwould be a thin layer on top, with no second implementation.graph,explain(text) andopenapiprint exactly what they printed before.serde_json1.0.154 (dtolnay, published 2026-10-11).Verified:
cargo testpasses, with new unit tests for the envelope, the structured refusal, and the text layout ofexplainandtokens.clippyandfmtare clean.starter-smoke.sh nodepasses.routes,tokens,explainand--json, including the error case.