prism validate
Validate a PRISM document for structural and semantic correctness.
Synopsis
prism validate <file>
prism validate --schema <file>
prism validate --schema --type <schema-type> <file>
Description
Validates a PRISM document by checking:
- JSON syntax
- Required fields presence
- Valid constant values (domains, stages, categories, metric types)
- SLO operator validity
- Threshold consistency
- Maturity level ranges (1-5)
With --schema, also validates the document against the JSON Schema.
Arguments
| Argument | Description |
|---|---|
file |
Path to the PRISM JSON document |
Flags
| Flag | Default | Description |
|---|---|---|
--schema |
false |
Also validate against JSON Schema |
--type |
maturity-plan |
Schema type: maturity-plan, maturity-state, maturity-model |
Examples
Validate a Document
Success output:
Validate with JSON Schema
Success output:
Validate a Maturity State File
Validation Errors
If the document has errors:
✗ prism.json has 2 validation errors:
- metrics[0].domain: invalid domain "sec" (valid: security, operations)
- metrics[2].stage: invalid stage "deployment" (valid: design, build, test, runtime, response)
JSON Schema Errors
If JSON Schema validation fails:
JSON Schema validation errors:
- /metrics/0/domain: value must be one of: security, operations, quality
- /metadata/version: missing required property
Validation Rules
Required Fields
Each metric must have:
idornamedomainstagecategorymetricType
Valid Constants
| Field | Valid Values |
|---|---|
domain |
security, operations |
stage |
design, build, test, runtime, response |
category |
prevention, detection, response, reliability, efficiency, quality |
metricType |
coverage, rate, latency, ratio, count, distribution, score |
trendDirection |
higher_better, lower_better, target_value |
slo.operator |
gte, lte, gt, lt, eq |
Maturity Levels
currentLevelmust be between 1 and 5targetLevelmust be between 1 and 5targetLevelshould be >=currentLevel(warning)
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Document is valid |
| 1 | Validation errors found |
| 2 | File not found or unreadable |