Documentation
¶
Overview ¶
Package statpages renders the generated stat pages under live/ (#2092): the gauntlet board, the readiness tiers, the claims table, the IAM reference, the fork surface and the substrate matrix, as plain GitHub-flavoured markdown.
This reverses #1055's "generators emit data only" for these pages, by the maintainer's ruling of 2026-10-19. The Hugo site and its site/data/*.json copies were retired at the cutover; the site links these pages.
Every page is hand-written text around one or more spans between `<!-- <tool>:begin <name> -->` and `<!-- <tool>:end <name> -->` markers, the style toggles-gen and tagverbs-gen use. A render replaces only what is between the markers, so the text around them survives.
Every render here is a pure function of committed files: no git, no network, no clock. That is what lets live/statpages_test.go re-render every span in memory and compare it with the tree. Three of the inputs are derived summaries a generator writes beside its artifact (the board, readiness and fork-surface summaries); they lived under site/data/ until the Hugo site was retired (#2092), and the constants below are the one place that names them.
`go run ./tools/gauntlet render` refreshes every page (WriteAll). Each other generator's -render mode refreshes its own page after writing its data, so a re-measured artifact and its page move together.
Index ¶
- Constants
- Variables
- func ClaimedRelease(root string) (string, error)
- func GoTestEvidenceRel(test string) string
- func ProductScenarioCounts(p ProductScenarioProof, rec *ProductScenarioRecord, claimed string) (ok bool, why string)
- func ProductScenarioEvidenceRel(p ProductScenarioProof) string
- func ProductScenarioLine(root string, p ProductScenarioProof, claimed string) (string, error)
- func ProductScenarioProofProblems(p ProductScenarioProof) []string
- func ProductScenarioRecordProblems(p ProductScenarioProof, r ProductScenarioRecord) []string
- func Render(root string, p Page) (string, error)
- func Write(root string, p Page) (bool, error)
- func WriteAll(root string) ([]string, error)
- type GoTestRecord
- type Page
- type ProductScenarioProof
- type ProductScenarioRecord
Constants ¶
const ( GauntletArtifactRel = "live/gauntlet.json" GauntletBoardRel = "live/gauntlet-board.json" ReadinessSiteRel = "live/readiness-summary.json" ForkSurfaceSiteRel = "live/fork-surface-summary.json" ClaimsRel = "live/smoke/claims.json" IAMReferenceRel = "live/iam-reference.json" SubstratesRel = "live/substrates.json" )
Input paths, relative to the repository root.
const GoTestEvidenceDir = "live/smoke/evidence/go-test"
GoTestEvidenceDir holds the dated runs of the claims' Go test proofs, one file per test, written only by `go run ./tools/gotest-record`.
const HistoryDir = "live/history"
HistoryDir is choudoufu's release ledger, one vX.Y.Z.json per release (`go run ./tools/gauntlet snapshot vX.Y.Z`).
const ProductScenarioEvidenceDir = "live/smoke/evidence/product-scenario"
ProductScenarioEvidenceDir holds the cited rows, one file per proof, each a copy of the row from the product's committed row file.
const ProductScenarioKind = "product-scenario"
ProductScenarioKind is the proof's "kind" in claims.json.
const RefreshCommand = "go run ./tools/gauntlet render"
RefreshCommand is the one command that re-renders every page.
Variables ¶
var ( Board = Page{ Path: "live/BOARD.md", Tool: "board-gen", Command: "go run ./tools/gauntlet render", Inputs: []string{GauntletBoardRel, GauntletArtifactRel}, // contains filtered or unexported fields } Readiness = Page{ Path: "live/READINESS.md", Tool: "readiness-gen", Command: "go run ./tools/readiness-gen -render", Inputs: []string{ReadinessSiteRel}, // contains filtered or unexported fields } Claims = Page{ Path: "live/CLAIMS.md", Tool: "claims-gen", Command: "go run ./tools/gauntlet render", Inputs: []string{ClaimsRel, GauntletArtifactRel, "live/smoke/evidence/*.json", GoTestEvidenceDir + "/*.json", ProductScenarioEvidenceDir + "/*.json", HistoryDir + "/*.json"}, // contains filtered or unexported fields } IAMReference = Page{ Path: "live/IAM-REFERENCE.md", Tool: "iamref-gen", Command: "go run ./tools/iamref-gen -render", Inputs: []string{IAMReferenceRel}, // contains filtered or unexported fields } ForkSurface = Page{ Path: "live/FORK-SURFACE.md", Tool: "forkdiff-gen", Command: "go run ./tools/forkdiff-gen -render", Inputs: []string{ForkSurfaceSiteRel}, // contains filtered or unexported fields } Substrates = Page{ Path: "live/SUBSTRATES.md", Tool: "substrates-gen", Command: "go run ./tools/substrates-gen -render", Inputs: []string{SubstratesRel}, // contains filtered or unexported fields } )
Board, Readiness, Claims, IAMReference, ForkSurface and Substrates are the pages; Pages lists them in that order.
var ProductScenarioFields = []string{"repo", "scenario", "claim", "commit", "date", "engine_version"}
ProductScenarioFields are the six fields a product-scenario proof must carry, in the order the three engines' claims list them.
Functions ¶
func ClaimedRelease ¶ added in v0.32.0
ClaimedRelease is the release the claims are about: the newest vX.Y.Z that live/history records, the in-tree ledger of choudoufu's releases, spelled X.Y.Z as engine_version is.
func GoTestEvidenceRel ¶ added in v0.32.0
GoTestEvidenceRel is where a Go test proof's run is recorded. A subtest's slash becomes "--", so every test is one file name.
func ProductScenarioCounts ¶ added in v0.32.0
func ProductScenarioCounts(p ProductScenarioProof, rec *ProductScenarioRecord, claimed string) (ok bool, why string)
ProductScenarioCounts reports whether a proof counts toward its cell given the claimed release: only when its kept row is there and the engine version it ran is the claimed one. A row at v0.28.0 never proves a claim about v0.31.0; it is reported with the version it last ran, and the check that counts it never fails. why says what is missing when it does not count.
func ProductScenarioEvidenceRel ¶ added in v0.32.0
func ProductScenarioEvidenceRel(p ProductScenarioProof) string
ProductScenarioEvidenceRel is where a proof's row is kept: one file per (repo, scenario, claim), slashes turned into "--".
func ProductScenarioLine ¶ added in v0.32.0
func ProductScenarioLine(root string, p ProductScenarioProof, claimed string) (string, error)
ProductScenarioLine is one product-scenario proof as a CLAIMS.md line.
func ProductScenarioProofProblems ¶ added in v0.32.0
func ProductScenarioProofProblems(p ProductScenarioProof) []string
ProductScenarioProofProblems is the shape rule for one proof: all six fields, each in its spelling. A full sha, a YYYY-MM-DD date and a release spelled X.Y.Z with no "v" (plunge's and sql-yodeler's spelling), so a row can be found again and its version compared.
func ProductScenarioRecordProblems ¶ added in v0.32.0
func ProductScenarioRecordProblems(p ProductScenarioProof, r ProductScenarioRecord) []string
ProductScenarioRecordProblems checks a kept row against the proof that cites it: the row says what the proof says, ran choudoufu, and reads pass on the plain run and caught on the BREAK=1 run. A row at another engine version than the proof names is a misquote and is reported here; a proof whose version is not the claimed one is a separate matter (ProductScenarioCounts).
func Render ¶
Render returns the page as it should read: the committed file with every span re-rendered from the committed inputs. It writes nothing.
Types ¶
type GoTestRecord ¶ added in v0.32.0
type GoTestRecord struct {
Test string `json:"test"`
Package string `json:"package"`
Status string `json:"status"`
Commit string `json:"commit"`
Date string `json:"date"`
CIRun string `json:"ci_run,omitempty"`
Log string `json:"log,omitempty"`
}
GoTestRecord is one recorded run of a Go test proof (GitHub issue #2288). A test that runs in CI's fast tier is recorded from a CI run at a commit (CIRun); a test behind an environment gate is recorded from a maintainer's run, whose `go test -v` log is kept beside it (Log).
func ReadGoTestRecord ¶ added in v0.32.0
func ReadGoTestRecord(root, test string) (*GoTestRecord, error)
ReadGoTestRecord reads a Go test proof's recorded run, or nil when none is on record yet: such a proof is waiting for its first recorded run.
type Page ¶
type Page struct {
// Path is the page, relative to the repository root.
Path string
// Tool is the marker vocabulary: `<!-- Tool:begin name -->`.
Tool string
// Command regenerates the data this page is drawn from and then the
// page itself. RefreshCommand re-renders the page from data already
// committed.
Command string
// Inputs are the committed files the spans are rendered from.
Inputs []string
// contains filtered or unexported fields
}
Page is one generated markdown file.
type ProductScenarioProof ¶ added in v0.32.0
type ProductScenarioProof struct {
Repo string `json:"repo"`
Scenario string `json:"scenario"`
Claim string `json:"claim"`
Commit string `json:"commit"`
Date string `json:"date"`
EngineVersion string `json:"engine_version"`
}
ProductScenarioProof is a proof that cites one recorded row of a CI product's scenario run (GitHub issue #2299, ruling C on INTENTIUS/chant#4586). The product (terragucci, plywood, sql-yodeler) runs the scenario on the shared e2e harness against a released choudoufu binary, with a plain run that must pass and a BREAK=1 run that must be caught, and commits one row for it. The proof names that row: the product's repository, the scenario id, the product's claim id, the product commit the row ran at, the date of the run and the choudoufu version it ran.
In claims.json the proof is one flat object, {"kind": "product-scenario", "repo", "scenario", "claim", "commit", "date", "engine_version", "note"}, the same kind and keys plunge's and sql-yodeler's claims use (INTENTIUS/plunge#57, INTENTIUS/sql-yodeler#301). Its "scenario" is the product's scenario id, never a choudoufu scenario path, which is why the decoders read it through DecodeProductScenario rather than as a field of the scenario proof.
A product row is an extra proof beside the engine's own (ruling E). It never replaces an engine scenario: the engine's BREAK arms rebuild the engine from source, which a product running a released binary cannot do.
func DecodeProductScenario ¶ added in v0.32.0
func DecodeProductScenario(raw []byte) (*ProductScenarioProof, error)
DecodeProductScenario reads one claims.json proof object. It returns nil for a proof with no kind (a scenario, steps of one, a stage or a Go test), the cited row for kind product-scenario, and an error for any other kind.
type ProductScenarioRecord ¶ added in v0.32.0
type ProductScenarioRecord struct {
Repo string `json:"repo"`
RowFile string `json:"row_file"`
Scenario string `json:"scenario"`
Claim string `json:"claim"`
Product string `json:"product"`
Commit string `json:"commit"`
Date string `json:"date"`
EngineBinary string `json:"engine_binary"`
EngineVersion string `json:"engine_version"`
FlociDigest string `json:"floci_digest"`
Plain string `json:"plain"`
Break string `json:"break"`
}
ProductScenarioRecord is one product row as choudoufu keeps it: the row's own fields (the row shape of INTENTIUS/chant#4587: product, product commit, engine binary and version, floci digest, date, plain and break verdicts), plus the scenario and claim it belongs to and RowFile, the path of the committed row file in the product repository the row was copied from.
func ReadProductScenarioRecord ¶ added in v0.32.0
func ReadProductScenarioRecord(root string, p ProductScenarioProof) (*ProductScenarioRecord, error)
ReadProductScenarioRecord reads a proof's kept row, or nil when none is kept yet. A kept row that does not say what its proof says is an error.
func (ProductScenarioRecord) RowURL ¶ added in v0.32.0
func (r ProductScenarioRecord) RowURL() string
RowURL is the row file at the commit the row ran, on GitHub.