{"uid":"cap_L5zMOUJzLQka8W0QrXPta","slug":"rust-macro-rules-token-tree-repetition-binding-expansion-verifier-f98ee189","name":"Rust macro_rules Token-Tree Repetition Binding Expansion Verifier","description":"Match ordered bounded macro_rules token-tree arms and reconstruct the complete hygienically tagged structural transcription.. Compare the complete typed result SHA256.","url":"https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-15/rust185-macro-rules-token-tree-repetition-binding-expansion?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"artifact":{"type":"object","$defs":{"a":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_.-]*$","maxLength":48,"minLength":1},"b":{"type":"object","required":["kind","id","delimiter","children"],"properties":{"id":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"kind":{"const":"group"},"children":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/c"},"delimiter":{"enum":["paren","brace","bracket"]}},"additionalProperties":false},"c":{"type":"array","items":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"maxItems":64},"d":{"type":"object","required":["kind","id","category","text"],"properties":{"id":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"kind":{"const":"literal"},"text":{"type":"string","maxLength":128,"minLength":1},"category":{"enum":["ident","literal","punct"]}},"additionalProperties":false},"e":{"type":"object","required":["kind","id","body","operator","separator"],"properties":{"id":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"body":{"type":"array","items":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"maxItems":32},"kind":{"const":"repeat"},"operator":{"enum":["*","+","?"]},"separator":{"type":["object","null"],"required":["category","text"],"properties":{"text":{"type":"string","maxLength":128,"minLength":1},"category":{"enum":["ident","literal","punct"]}},"additionalProperties":false}},"additionalProperties":false}},"required":["rustMacro"],"properties":{"rustMacro":{"type":"object","required":["data","claim"],"properties":{"data":{"type":"object","required":["tokens","input","matcher_nodes","template_nodes","arms"],"properties":{"arms":{"type":"array","items":{"type":"object","required":["matcher","template"],"properties":{"matcher":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/c"},"template":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/c"}},"additionalProperties":false},"maxItems":8,"minItems":1},"input":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/c"},"tokens":{"type":"array","items":{"anyOf":[{"type":"object","required":["kind","id","category","text"],"properties":{"id":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"kind":{"const":"token"},"text":{"type":"string","maxLength":128,"minLength":1},"category":{"enum":["ident","literal","punct"]}},"additionalProperties":false},{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/b"}]},"maxItems":128},"matcher_nodes":{"type":"array","items":{"anyOf":[{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/d"},{"type":"object","required":["kind","id","name","fragment"],"properties":{"id":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"kind":{"const":"capture"},"name":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"fragment":{"enum":["tt","ident","literal"]}},"additionalProperties":false},{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/b"},{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/e"}]},"maxItems":128},"template_nodes":{"type":"array","items":{"anyOf":[{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/d"},{"type":"object","required":["kind","id","name"],"properties":{"id":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"},"kind":{"const":"variable"},"name":{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/a"}},"additionalProperties":false},{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/b"},{"$ref":"#/properties/input/properties/body/properties/artifact/%24defs/e"}]},"maxItems":128}},"additionalProperties":false},"claim":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$","maxLength":64,"minLength":64}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_YfMBnKOki9DSBNnQEtOn5","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Matches ordered bounded macro_rules token-tree arms, reconstructs the hygienically tagged structural transcription, and verifies the result against a claimed SHA256 hash.","exampleAgentPrompt":"I have a Rust macro_rules definition with token-tree arms including repeat nodes using the '+' operator — can you match the arms in order, reconstruct the full hygienically tagged structural transcription, and confirm it matches the SHA256 hash I'm claiming?","exampleUseCases":[{"title":"Verify macro expansion correctness in CI","prompt":"I'm running automated checks on our Rust codebase — can you take these macro_rules arms with their matcher and template token trees, expand the repetition bindings, reconstruct the hygienically tagged transcription, and tell me if the SHA256 of the result matches the hash we recorded?"},{"title":"Audit hygiene tagging of macro output","prompt":"I need to confirm that the hygiene tagging on this macro_rules token-tree expansion is correct — please match these ordered arms, reconstruct the full structural transcription with hygiene labels, and verify it against our claimed SHA256 digest."},{"title":"Validate macro separator handling in token repetitions","prompt":"Can you check whether this macro_rules arm that uses a comma separator with the '*' repeat operator produces the correct bounded token-tree expansion? Reconstruct the transcription and compare its SHA256 against the hash I'm providing."}],"resultDescription":"The endpoint returns the fully reconstructed hygienically tagged structural transcription of the matched macro_rules token-tree arms along with a verification status indicating whether the SHA256 of the transcription matches the claimed hash. It includes typed node outputs for groups, literals, and repetitions.","failureModes":["Arm matching failure when token-tree arms are not ordered correctly or no arm matches the input","Hygiene tagging mismatch causing transcription reconstruction to differ from expected","SHA256 verification failure when the reconstructed transcription does not match the claimed hash","Schema validation error if node IDs violate the naming pattern or required fields are missing","Repetition body exceeds maxItems (32) or children array exceeds maxItems (64)","Invalid separator or operator enum value causing rejection"],"whenToPreferThis":"Use this endpoint when you need to verify that a Rust macro_rules token-tree expansion — including repetition bindings with operators like *, +, or ? — is correctly reconstructed with proper hygiene tagging and that its SHA256 matches a known-good value. It is specifically suited for Rust compiler tooling, macro correctness audits, and CI pipelines that need deterministic, cryptographically verifiable macro expansion results rather than general-purpose code analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-04T06:41:19.946Z","isFirstParty":false,"canonicalSlug":"rust-macro-rules-token-tree-repetition-binding-expansion-verifier-f98ee189"}