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.

#LayoutDump

Go go
func LayoutDump() map[string]any

LayoutDump 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

Go go
func LayoutValidate() map[string]any

LayoutValidate 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.

More tools from this site

  • claudestream Drive Claude Code from Python: run it as a subprocess and read its output as typed events, with async and sync sessions, sandbox policies, and tools you define in Python
  • claudewheel A TUI Claude Code Launcher that lets you have more than one profile, manage sessions lifecycle, pick the exact CC version, model to use (even older unlisted ones), pick which GitHub account to use, etc.
  • dirstat Fast, single-binary directory statistics CLI: every file under a tree grouped by format, with counts, sizes, and lines of code, as a colored terminal table or as JSON
  • fastware A batteries-included ASGI framework: msgspec JSON, a managed Granian server, dependency injection, SSE, WebSockets, auth, and a test client
  • go-toml-edit Zero-dep TOML editing library for Go with comment preservation
  • howmuchleft The fastest Claude Code statusline: context window, 5-hour, and weekly limit usage as three customizable gradient bars, rendering in about 6 ms
  • orxtra
  • pgdesign
  • predraw Declarative rendering pipeline: describe a scene in JSON and get SVG, PNG and WebP out, with light and dark style tokens, reusable components and text converted to path outlines
  • reposummary Turn a git repository's history into a Markdown journal: pick a time window or revision range and get a readable digest of what changed, optionally narrated by an LLM
  • rlsbl Release orchestration and project scaffolding CLI that bumps versions, validates a structured JSONL changelog, tags only the commit CI verified, and publishes to npm, PyPI, Go and more
  • safegit git wrapper CLI that gives each commit its own temporary index and retries ref updates on conflict, so concurrent agents share one repository
  • saferm Command-line replacement for rm that archives every deletion with a mandatory reason and the context it ran in, so deleted files can be listed, inspected and restored
  • strictcli
  • stricttest An always-on test-isolation floor: a pytest plugin and a Go env-hygiene module that make a test suite structurally unable to reach real credentials, the real HOME, the network, or the development repository.
  • wesktop A Python framework that turns an ASGI web app into a desktop application, serving it from a local Granian server and displaying it in a native OS window via pywebview
Search