facts

command
v1.4.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Purpose: project the committed fact sources (.github/VERSION, .github/command-registry.json, .github/openapi.json) into the public facts document (contract:cli.public-facts v1). Inputs: the three files' bytes. Outputs: model.Facts and its canonical JSON (2-space indent, trailing newline). Constraints: a pure function of its inputs; no clock, no environment.

Command facts writes and checks the public facts artifact (.github/facts.json, contract:cli.public-facts v1) and fills the README facts blocks.

Purpose: one small, versioned projection of .github/VERSION, .github/command-registry.json and (when present) .github/openapi.json that sites and sweeps read, so a public number cannot disagree with `nself help --json`.

Inputs: -root (repository root, default "."), -check, -readme <file>. Outputs: default writes <root>/.github/facts.json; `-readme F` also rewrites the facts blocks of F. With -check nothing is written: exit 0 current, 1 a file is stale (the message names it), 2 a source is unreadable or invalid.

Constraints: deterministic, no timestamps. With -check -readme, both facts.json and the README blocks are verified. A README without facts blocks is a no-op.

Purpose: fill and verify the `<!-- BEGIN GENERATED:facts:<key> -->` blocks of a README from the facts document. Inputs: README text and model.Facts. Outputs: the filled text. Constraints: a README with no facts blocks is returned unchanged. A block whose marker sits alone on its line is a block (content on its own lines); otherwise it is inline (content between the markers on the same line). Unknown keys, a missing END marker and a nested BEGIN are errors. Other GENERATED blocks are ignored.

Directories

Path Synopsis
Package model holds the public facts document (contract:cli.public-facts v1) and its exported constants.
Package model holds the public facts document (contract:cli.public-facts v1) and its exported constants.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL