/** * The grouped h2a command map, rendered by `h2a explain`. * * WHY THIS EXISTS * --------------- * The CORE `runCli(["--help"])` lists its verbs flat, and the RUNTIME ENTRYPOINT * adds 46 more top-level commands of its own. Neither list tells a human which * command answers their question. This module covers BOTH sets of verbs in one * grouped map and renders one line per group and one line per verb. * * Precision about which surface renders what, because two things print help and * only one of them is regrouped in place: * * - The RUNTIME ENTRYPOINT'S `--help` renders the intention headings directly * (see `packages/h2a-runtime/src/cli-help-groups.ts`). * - The CORE `--help` deliberately stays a flat usage reference and points at * `h2a explain`. It is hand-maintained and already omits 13 frozen verbs, so * regrouping it would tidy the wrong artifact. * - `h2a explain` — this module — is the only surface that shows BOTH. * * Two groups here are therefore `explain`-ONLY: `WORK` and `SPECIALIST` contain * no runtime commands, so they never appear in the runtime help. They exist * because the core contract's verbs land in them. * * SOURCE OF THE VOCABULARY * ------------------------ * `docs/cli-help-grouping-vocabulary.md` — in this repo, committed alongside this * file. It vendors the load-bearing passages VERBATIM from an unpublished internal * design study (STUDY rung — proposal only) which is on no git ref, so no reader * can fetch it. Excerpt 3 there is the sentence the five daily words come from: * * > `h2a --help` should render these as a short "Start / Observe / Coordinate / * > Work / Set up" guide, then link to namespaces. * * Those five words are `START`, `OBSERVE`, `COORDINATE`, `WORK`, `SET_UP` below. * The remaining groups trace to the same vendored excerpts, except the two * buckets that are not operator intentions at all: * * - `SPECIALIST` — excerpts 2 and 5 ("`h2a ` exposes a specialist * contract without pretending h2a owns that domain's internals"). * - `SESSION_RECOVERY` — excerpt 4 (`session recover`, and the third of the three * loops: process/session supervision). * - `TRANSPORT` — excerpt 5, last table row: quarantined transport/bridge * compatibility. * - `LLM_LOCAL` — a labelled bucket, **not** an intention. See excerpt 6 and the * comment on the group itself. * - `UNCLASSIFIED` — the fallback, carrying no semantics at all. See its comment. * * WHAT THIS IS NOT * ---------------- * Not a routing table. `bin-routing.ts` keeps its FALLBACK rule (any first word * that is not h2a-native goes to the runtime); an allowlist was explicitly * rejected by double consensus because "l'allowlist plafonne + dérive". This map * is documentation: the core verbs are DERIVED from the frozen contract so they * cannot drift, and the runtime verbs are listed here only so one command can * show a human the whole front door. If a runtime command is added and not * listed here, `h2a explain` under-documents it — nothing breaks, and * `test/cli-command-map.test.js` fails loudly. * * The study's open decisions S1–S6 require sentropic co-validation and are NOT * encoded here: no group promises an ownership boundary, a rename, a * deprecation, or a future command spelling. They are reproduced in full as * excerpt 8 of the vendored file, so a reader can check that claim. */ export type H2ACommandGroupId = "START" | "OBSERVE" | "COORDINATE" | "WORK" | "SET_UP" | "SPECIALIST" | "SESSION_RECOVERY" | "TRANSPORT" | "LLM_LOCAL" | "HELP" | "UNCLASSIFIED"; export interface H2ACommandGroup { readonly id: H2ACommandGroupId; /** Group title. */ readonly heading: string; /** The operator question this group answers, in one line. */ readonly intention: string; } /** The groups, in render order. */ export declare const H2A_COMMAND_GROUPS: readonly H2ACommandGroup[]; export interface H2ACommandMapEntry { readonly verb: string; readonly summary: string; /** `"core"` = frozen CLI contract; `"track"` = Track façade; `"runtime"` = lazy runtime. */ readonly origin: "core" | "track" | "runtime"; } export interface H2ACommandMapSection { readonly group: H2ACommandGroup; readonly entries: readonly H2ACommandMapEntry[]; } /** * Build the map. Core entries are derived from `H2A_CLI_VERB_CONTRACTS` (so the * frozen contract is the single source of truth for them) and the Track façade * verb list; runtime entries come from `RUNTIME_VERBS`. * * A core verb whose first word has no group lands in `UNCLASSIFIED` rather than * vanishing — an undocumented verb is a bug to see, not to hide. That bucket is * deliberately semantics-free: it must never borrow another group's heading, or a * missing entry would render as a confident wrong answer. * * In practice the fallback is unreachable, because "every frozen contract verb is * classified into a group" (`test/cli-command-map.test.js`) fails first. It exists * for the case where that test has been skipped or deleted. */ export declare function buildCommandMap(trackFacadeVerbs: readonly string[]): readonly H2ACommandMapSection[]; /** Runtime command names this map documents, for the drift test. */ export declare const H2A_COMMAND_MAP_RUNTIME_VERBS: readonly string[]; /** Core first words this map classifies, for the completeness test. */ export declare const H2A_COMMAND_MAP_CORE_FIRST_WORDS: readonly string[]; /** * The intention group for a CORE verb's first word, or the semantics-free * fallback when nobody has grouped it. * * Exported so the fallback TARGET is directly testable. Inlining the `??` made * the choice of fallback unobservable: every frozen verb is classified today, so * a mutation swapping the fallback to a semantic bucket changed nothing any test * could see. Now "an unknown first word lands in UNCLASSIFIED" is an assertion. */ export declare function coreGroupForFirstWord(firstWord: string): H2ACommandGroupId; /** * Render the map: one line per group heading, one line per verb. Text output — * the `explain` contract entry declares `outputShape: "text"`. */ export declare function renderCommandMap(trackFacadeVerbs: readonly string[]): string; //# sourceMappingURL=cli-command-map.d.ts.map