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
func LintCodes() []anyLintCodes 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
func LintSeverities() []any { return []any{"error", "warning"} }LintSeverities is the closed set of severities a diagnostic carries.
#Check
func Check() map[string]anyCheck 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
func SpellCorpus() map[string]anySpellCorpus 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
func Quality() map[string]anyQuality 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.
#LayoutDump
func LayoutDump() map[string]anyLayoutDump is the payload of selfdoc layout dump: selfdoc's claim on a repository's tool-state directory, as the fleet check reads it.
The directories are the one place a consumer learns which paths selfdoc owns, which side of the authorship line each sits on, whether the repository commits it, and what it used to be called -- so a description of the layout is generated from this rather than restated per repository.
#LayoutValidate
func LayoutValidate() map[string]anyLayoutValidate is the payload of selfdoc layout validate: whether this repository's tool-state directory is laid out as declared, and every problem found when it is not.