validate
validate checks a security assessment file against the schema
record sends it under, and reports every problem in one
run.
ingrain validate [--assessment <path>] [--json]Defaults to the assessment ingrain assessment mint last recorded for this branch;
--assessment <path> names a different file.
What it reports
Section titled “What it reports”An untouched skeleton exits 0: the review has yet to write the file, and validate
says so.
Otherwise every problem carries a severity, and only one of them stops a sync:
- error — must be fixed. Either a value outside its allowed set, or a field the current stage owes and has not written. The report groups the two separately.
- warning — the file syncs, with something lost or suspect.
- information — nothing to fix. An accepted driver whose verification has not reached it yet.
Each problem names the entry, the field, the allowed values, and the section whose field card documents it — the comment seeded under each heading in the file you already have open.
The anchoring rule
Section titled “The anchoring rule”Every ## Implementation guidance entry names at least one driver — a threat it
closes (Threats) or an org rule it implements (Rule refs). Either may be —, but
not both; an entry naming neither is an error here and at the platform.
Naming a rule and no threat is fine.
Phase blocks
Section titled “Phase blocks”A ## Threats entry groups its fields under #### gen, #### score, #### usergate
and #### test — one marker per stage of the review. The review writes them; you rarely
need to touch them by hand.
If validate reports a problem here, it is one of these, and each names the entry:
- A verification field sits outside
#### test— move it under that marker. Left where it is, a later stage of the review overwrites it. - An unrecognised marker, such as
#### tset— correct it to one of the four. - A repeated marker, or a marker in a section that has none — keep one of each, and
only on
## Threats.
An assessment with no markers at all is valid.
Cross-section checks
Section titled “Cross-section checks”Some checks span sections:
- Every
## Org rulesentry carries a gate decision —selectedorexcluded. - Every
Rule refsid names a selected rule. - Every
## Rule adherenceentry names a selected rule. - No duplicate adherence entries — one verdict per rule.
- A selected rule with no verdict yet is information: a half-run Testing pass syncs as it stands. A selected rule nothing implements is legal — Testing judges it anyway.
Affected paths
Section titled “Affected paths”## Affected paths declares the folders the change is expected to touch. It scopes
the rules search and attributes the analysis to part of the codebase, so a problem here
costs precision rather than correctness — every one is a warning, and none stops a
sync.
Reported, and dropped from the scoping:
- An absolute path (
/srv/app/services,C:\work\repo) — it names a place on your machine, not in the repository. - A
.or..segment. - The repository root (
.,/) — legal, but it narrows nothing.
Also reported: a major triage that declares no paths at all, since the rules search
then could not be narrowed to the change.
A folder already covered by a shallower one is folded away — declaring both
backend and backend/services/sync records only backend.
Rule ids
Section titled “Rule ids”Rule ids resolve against the assessment’s own ## Org rules section — the same file,
a few headings up.
An id must be written in full. validate still resolves a shortened copy, but reports
it as an error: the platform matches ids exactly, so a shortened copy matches nothing
in your ruleset. The message names the correction — copy the id whole from ## Org rules.
An id matching no ## Org rules entry is an error — the sync refuses it too.
--json
Section titled “--json”Machine output goes to stdout, human output to stderr, so --json pipes
cleanly.
{ "state": "invalid", "ok": false, "problems": [ { "severity": "error", "kind": "malformed", "where": "T01", "field": "Impact", "message": "Impact must be one of: critical | high | medium | low — got \"catastrophic\"", "card": "## Threats" } ]}state is skeleton, ready or invalid; ok is false only for invalid.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Valid, or an untouched skeleton. Warnings and information do not fail it. |
1 | The file has problems that must be fixed before it can sync. |
2 | Bad arguments — no assessment to check, or a file that is not there. |
Schema versions
Section titled “Schema versions”The assessment declares its own format under ## Task as Schema version.
| Declared version | Behaviour |
|---|---|
absent or below 2 | Refused — the file predates the fields the syncs require. The fix is to upgrade the plugin and re-run the review, which regenerates the file. An assessment in the old table layout is refused with its own upgrade message at any version — the remedy is the same. |
2 | The current schema. Every field the syncs require is expected, and a missing one is reported rather than substituted. Full rule ids are guaranteed, so a shortened one is an error. |
above 2 | Accepted, with unrecognised fields ignored — a newer skill must never break an older CLI. |