Skip to content

INFERENCE-INIT-06: Move the cut with --depth

–depth N groups contracts at exactly N directories deep, warning about files stranded above a depth-2+ cut.

Builds on: INFERENCE-INIT-04: Emit a corpus meta-config with –meta

A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.

Terminal window
markdown-contract init ./docs --meta --depth 2
# groups one contract per directory at depth 2, e.g.
# contracts/api-v1.contract.yaml (api/v1/**/*.md)
# contracts/web-v1.contract.yaml (web/v1/**/*.md)
# files between the root and the cut are stranded and reported:
# warning: stranded: api/overview.md sits above the --depth 2 cut and is
# covered by no contract; use a shallower --depth to include it
  • InferOptions.depth
  • inferMeta ancestorAt grouping
  • full-path slug naming (nameForDir)
  • stranded-file warnings