Inputs
Input normalization and deterministic hashing.
How metro reads JSON and YAML input: the adapters, the normalized output, round-trip guarantees and the secret scan.
Source
Generated from metro docs input-reference --markdown in metrocli/metro @146bf3e. Source schemaVersion: metro.docs.input-reference.v1.
- schemaVersion:
metro.docs.input-reference.v1 - apiAccess:
none
Summary
{
"structuredInputFormatLabel": "JSON/YAML",
"supportedExtensionCount": 3,
"normalizationModes": [
"shape",
"api-request"
],
"outputSchemaVersion": "metro.input.normalize.v1",
"liveApiAccess": "none"
}supportedFormats
| id | extensions | parser | status | roundTripOutput | notes |
|---|---|---|---|---|---|
| json | .json | JSON.parse | supported | stable-json | JSON is the canonical machine output contract., Input object keys are sorted during canonicalization before hashing. |
| yaml | .yaml, .yml | packages/metro-core/src/input/files.js parseSimpleYaml | supported-subset | stable-json | The local YAML adapter supports the reviewed fixture subset: mappings, sequences, scalars, and JSON-style inline flow values., Advanced YAML features such as anchors, tags, and multi-document streams are intentionally unsupported until a reviewed input contract needs them. |
normalizationModes
| id | command | targetType | validator | normalizedValue | nextLocalEvidence | sources |
|---|---|---|---|---|---|---|
| shape | metro input normalize --shape <shape> --file <input.json|yaml> [--json] | Workflow shape | validateShapeInput | The original structured input canonicalized with sorted object keys. | metro validate --shape <shape> --file <input.json|yaml> --json | docs/metronome-cli/one-goal.md, docs/metronome-cli/SHAPE_CATALOG.md, packages/metro-core/src/input/normalize.js, packages/metro-core/src/validators/index.js |
| api-request | metro input normalize --api <endpoint-id> --file <input.json|yaml> [--json] | Reviewed expert API endpoint ID | validateApiEndpointRequest | The endpoint request envelope with body, query, path, evidence, and metadata keys canonicalized. | metro api validate <endpoint-id> --file <request.json|yaml> --json | docs/metronome-cli/one-goal.md, docs/metronome-cli/CLI_ARCHITECTURE.md, packages/metro-core/src/input/normalize.js, packages/metro-core/src/api-catalog/validation.js |
proofCommands
node bin/metro.js input normalize --shape pro-annual --file <pro-annual.yaml> --jsonnode bin/metro.js input normalize --api contracts.create --file <contracts-create.yaml> --jsonnpm --prefix metronome-cli run test:goldennode docs/metronome-cli/site/verify-site.js
sources
docs/metronome-cli/one-goal.mddocs/metronome-cli/CLI_ARCHITECTURE.mddocs/metronome-cli/VALIDATION_AND_GUARDRAILS.mdpackages/metro-core/src/input/files.jspackages/metro-core/src/input/normalize.jspackages/metro-core/src/api-catalog/validation.js
Agent notes
- Prefer
--jsonwhen scripting parsers; use--markdownwhen loading context into an agent. - Never treat HTML as the source of truth, regenerate from
metro docs <ref> --markdown. - Live reads/writes still require tenant flags + confirmation tokens.