Documentation
¶
Overview ¶
Package coveragematrix reads the CLI coverage matrix, internal/api/coverage-matrix.txt (hadron-cli#1334, #66): every Query and Mutation field hadron-server exposes, mapped to the command that reaches it, the issue that tracks the gap, or an exclusion with its reason (cor:api:240:02).
scripts/unboundops writes the file and checks it against the schema and the code; a test in internal/cmd checks that every named command and flag exists. This package is only the shared grammar, so both sides read the same lines the same way.
Index ¶
Constants ¶
const Path = "internal/api/coverage-matrix.txt"
Path is where the matrix lives, relative to the repository root.
Variables ¶
var ExclusionClasses = map[string]string{
"internal": "an internal or capability-tool plane, not a user surface",
"host-protocol": "a host-poller or service-to-service protocol",
"deprecated": "deprecated, with a named replacement",
"not-a-capability": "not a user capability",
"graphical": "a graphical capability that does not work well in a terminal (the reason names what is graphical)",
}
ExclusionClasses are the only reasons cor:api:240:02 leaves room for. "Not built yet" and "rarely used" are not among them: those are gaps.
var Sections = []string{"Query", "Mutation", "Arguments", "Filters"}
Sections, in file order. Query and Mutation list every root field; Arguments lists what a reached operation leaves out; Filters lists every field of a reached list query's filter input.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Section string
Key string // "agents", "Query.agents(filter.ownedByMe)"
Kind Kind
Command string // Command, Flag: the command path without "hadron"
Flags []string // Flag: "--owned-by-me", or a positional "[query]"
Issue int // Gap
Class string // Excluded
Reason string // Excluded: why; Gap: an optional note
Line int
}
Entry is one line of the matrix.
func Parse ¶
Parse reads the matrix. A malformed line is an error naming its line: the grammar is strict so a typo cannot read as a disposition.
func (Entry) Disposition ¶
Disposition renders the entry's right-hand side, the inverse of Parse.
type Kind ¶
type Kind string
Kind is a line's disposition.
const ( // Command: a command reaches it ("command agent ls"). Command Kind = "command" // Flag: a flag sets a filter field ("flag agent list --owned-by-me"); a // field several flags set names each ("flag scope list --owner-org // --owner-app"), and a positional argument is named as the command's Use // line spells it ("flag user search [query]"). Flag Kind = "flag" // Gap: not reached yet; the issue tracks it ("gap #1340"). Gap Kind = "gap" // Excluded: deliberately not in the CLI ("excluded internal: <reason>"). Excluded Kind = "excluded" // Unclassified is what the generator writes for a field nobody has // decided yet. The check refuses it. Unclassified Kind = "UNCLASSIFIED" )