Skip to content

gen-docs: mark which commands and flags are "basic", for the portal's CLI⇄GUI parity gate #1574

Open

Description

@scttfrdmn

Why: the rebuilt portal (#683, PR #690) has a CLI⇄GUI parity gate.

  • web/portal/parity/cli-gui-matrix.json maps each basic CLI command and flag to its GUI controls.
  • The gate checks every row's command and flags against the generated reference in docs/gen/spawn/.
  • What it can't check is which commands are basic. That list is the matrix itself, so deleting a row, or adding a new basic command here, goes unnoticed. The owner wants the parity to hold both ways.

Ask: make cmd/gendocs.go emit a machine-readable disclosure level for every command and flag.

Consumer: the portal gate then fails when a basic CLI entry has no matrix row (tracked on #683). sync-cli-docs must carry the sidecar file.

Not a 1.0 behaviour change: docs/metadata only. Stays 0.x.

Activity

  1. added this to the Hardening milestone on Nov 10, 2026
  2. added
    enhancement
    on Nov 10, 2026
  3. scttfrdmn commented on Nov 13, 2026

    @scttfrdmn
    ContributorAuthor

    Proposed sidecar format, coordinated across all three CLIs: lagotto ships it first in spore-host/lagotto#311 (lagotto#297). Please use the same shape here, so one portal gate can read all three.

    • File: docs-gen/_levels.json, which syncs to docs/gen/<cli>/_levels.json. The sync currently drops non-.md files; Nothing tracks deployed Lambda runtime versions: two are already stale (provided.al2, python3.11) and a runtime reaching EOL would be silent #716 tracks that.
    • Format: {"$format": "spore.host/cli-levels/v1", "<cli> <command path>": {"level": "basic"|"advanced", "flags": {"--flag": "basic"|"advanced"}}}
      • Keys are full command paths, as the matrix's cli field spells them. Keys that start with $ are metadata.
      • The root entry (the bare CLI name) carries the persistent/global flags, the same set as _global-flags.md.
      • Every other entry lists its non-hidden local flags, the same set its markdown table shows. An empty flags is {}.
      • Keys are sorted and the output is pretty-printed.
    • Source: the cobra annotation spore.host/level, on Command.Annotations or on a flag via Flags().SetAnnotation. An unannotated flag is advanced. Every command must be annotated (a test enforces it).
    • Errors: gen-docs fails on an unknown level, and on a basic flag under an advanced command.
    • Implementation: lagotto's generator (cmd/levels.go) mirrors libs/docgen's walk and is self-contained. It can move into libs/docgen once spawn and truffle agree on the format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions