Add checks file support#178
Conversation
|
Adversarial review findings:
Open question: should Review scope: reviewed the PR diff against |
Introduce a separate YAML checks file format for project-specific structural
thresholds. The new `motel check --checks <file-or-url>` flag loads static
limits and sampled percentile limits without requiring assertions to live in
the topology file itself, which keeps imported topologies reusable across
regeneration.
The checks file supports:
- `max_depth`, `max_fan_out`, and `max_spans` for static structural limits
- `p50_*`, `p95_*`, and `p99_*` thresholds for `depth`, `fan_out`, and `spans`
- local files and HTTP/HTTPS URLs, matching the topology source loading model
Move threshold application into `synth.Check` so package callers get the same
behavior as the CLI when passing `CheckOptions{Assertions: ...}`. CLI flags
remain explicit overrides for matching values from the checks source.
Add percentile assertion results as first-class `CheckResult` entries and keep
their supporting distributions attached so command output can explain which
sampled values caused a percentile assertion to fail.
Document the new flag in both the Markdown reference and man page, including
URL support. Add tests for checks-file parsing and validation, URL loading,
CLI pass/fail behavior, CLI override precedence, package-level static
assertion limits, and scenario-aware percentile assertion reporting.
Fixes #72
9ea6da2 to
030de49
Compare
Summary
motel check --checksValidation
go test ./pkg/synthgo test ./cmd/motelmake testmake lintmake buildFixes #72