Skip to content
internal/payloadschemas
On this page

The declared JSON Schemas of selfdoc's machine-mode payloads, validated where the envelope is written, so a deviating document fails the run instead.

#internal/payloadschemas

#internal/payloadschemas

Package payloadschemas declares the JSON Schemas of selfdoc's machine-mode payloads.

strictcli's machine mode (--json) writes one document to stdout -- the envelope -- and a command's machine output is the envelope's "payload" member. Every such command declares that payload's schema at registration time, and the framework validates the value against the declaration where it writes the envelope: a deviating document fails the run instead of reaching a consumer.

The declarations are built through strictcli's own schema builders, which produce exactly the literal an author could have written by hand and pass the identical registration-time validation over the framework's closed keyword subset. --dump-schema publishes them verbatim, which makes each one the single artifact a consumer generates against.

#LintCodes

Go go
func LintCodes() []any

LintCodes is the sorted set of lint codes selfdoc check can emit, derived from the shipped registry rather than restated here.

Deriving it is the whole point: internal/lints's embedded document is the single place a code is declared, so registering one cannot leave the published contract behind.

#LintSeverities

Go go
func LintSeverities() []any { return []any{"error", "warning"} }

LintSeverities is the closed set of severities a diagnostic carries.

#Check

Go go
func Check() map[string]any

Check is the payload of selfdoc check: one directive result per directive found, the coverage block (null when the project has no source to cover), every lint the run kept after suppression, and the exit code the command will terminate with.

#SpellCorpus

Go go
func SpellCorpus() map[string]any

SpellCorpus is the payload of selfdoc spell-corpus: the sweep's inputs (which accept list, and how many terms and words it holds), one entry per project visited, and the corpus-wide flagged total. "error" is set instead of results for a project that could not be read.

#Quality

Go go
func Quality() map[string]any

Quality is the payload of selfdoc quality: one project's score.

doc_ratio is null when there is no source to divide by, and next_step is null at tier 5 where nothing is left to do. The selfdoc block carries only has_selfdoc for a project that has no readable selfdoc.json.

Search