Inputs

Input normalization and deterministic hashing.

View .md

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

idextensionsparserstatusroundTripOutputnotes
json.jsonJSON.parsesupportedstable-jsonJSON is the canonical machine output contract., Input object keys are sorted during canonicalization before hashing.
yaml.yaml, .ymlpackages/metro-core/src/input/files.js parseSimpleYamlsupported-subsetstable-jsonThe 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

idcommandtargetTypevalidatornormalizedValuenextLocalEvidencesources
shapemetro input normalize --shape <shape> --file <input.json|yaml> [--json]Workflow shapevalidateShapeInputThe original structured input canonicalized with sorted object keys.metro validate --shape <shape> --file <input.json|yaml> --jsondocs/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-requestmetro input normalize --api <endpoint-id> --file <input.json|yaml> [--json]Reviewed expert API endpoint IDvalidateApiEndpointRequestThe endpoint request envelope with body, query, path, evidence, and metadata keys canonicalized.metro api validate <endpoint-id> --file <request.json|yaml> --jsondocs/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> --json
  • node bin/metro.js input normalize --api contracts.create --file <contracts-create.yaml> --json
  • npm --prefix metronome-cli run test:golden
  • node docs/metronome-cli/site/verify-site.js

sources

  • docs/metronome-cli/one-goal.md
  • docs/metronome-cli/CLI_ARCHITECTURE.md
  • docs/metronome-cli/VALIDATION_AND_GUARDRAILS.md
  • packages/metro-core/src/input/files.js
  • packages/metro-core/src/input/normalize.js
  • packages/metro-core/src/api-catalog/validation.js

Agent notes

  • Prefer --json when scripting parsers; use --markdown when 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.

On this page