Skip to content

docs(command-docs): generate the common option table and per-action option tables - #4824

Merged
thymikee merged 1 commit into
mainfrom
t3/command-docs-generator-v2
Nov 20, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/command-docs-generator-v2

Conversation

@thymikee

@thymikee thymikee commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes what the pilot (#4809) showed, so generated blocks can roll out to every command.

  • ## Common options is a new generated region (<!-- generated:common-options -->). It lists each option that 5 or more public CLI commands allow and that no command overrides text for, computed from the registry against one named threshold constant. A command block drops those rows and prints one Also accepts line naming them. agent-device help output is unchanged; the generator only reads data that already exists.
  • A command with flagsByAction renders one options table per action under a bold label, so record contact-sheet --out no longer reads as available to record start.
  • Two or more generated blocks under one heading are covered by a test, including that regenerating them is stable.
  • Pilot cleanup: the Keyboard example block and two Clipboard example lines that repeated the usage line are gone; the Scroll --settle bullet no longer restates a generated row. No fact was dropped.

Before / after

Scroll options table:

-| `--settle` | After the action, wait for the UI to go quiet and return the settled diff vs the pre-action tree in the same response (best-effort; never fails the action) |
-| `--settle-quiet <ms>` | Settle: quiet window the UI must hold to count as settled (default 500ms; … keeps the asked window |
-| `--timeout <ms>` | Boot/Open/Prepare: startup budget … With --settle: the settle-wait deadline (default 10s) |
+Also accepts: [common options](#common-options): `--settle`, `--settle-quiet <ms>`, `--timeout <ms>`.

Validation

Head 2531d93. Ran locally: generate:command-docs, check:command-docs (27 tests), the tests under src/commands/schema (114), test/repo-guards (166), check:doc-prose, check:doc-links after pnpm --dir website build, check:gate-manifest, check:fallow, check:quick, format. The change is generator, test, and docs only, so runtime and device tests do not apply. CI validates the rest. No waivers or allowlists were added.

Flags in Common options: --settle, --settle-quiet <ms>, --timeout <ms>, --depth, -d <depth>, --scope, -s <scope>, --raw, --out <path>.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

… tables

The pilot showed three things the generator could not express. Shared flags made
every per-command table noisy, a command whose first positional selects an action
printed one table for options only some actions read, and two blocks under one
heading had no test.

`generated:common-options` documents each option at least COMMON_OPTION_MIN_COMMANDS
public commands allow, computed from the registry and skipped where any command
overrides its text. A command block omits those options and prints one
`Also accepts` line naming them. `flagsByAction` renders one table per action. The
Keyboard and Clipboard example blocks and one Scroll bullet that only restated the
usage line or a generated row are gone.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.46 MB 6.46 MB 0 B
Package (unpacked) 6.46 MB 6.46 MB 0 B
Package (download) 1.97 MB 1.97 MB 0 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 23.0 ms 34.3 ms +11.3 ms
CLI --help 44.8 ms 49.4 ms +4.6 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 2531d93

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (c9cce06b24a3).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 2531d93. All checks pass, including the command-docs gate over the changed generator and page, and there are no conflicts.

Not blocking, take or leave:

  • The override rule is applied twice in scripts/command-docs/generate.ts: selectCommonFlagKeys already drops every overridden key, so the override branches in buildCommandFacts never run, and the test that feeds them uses input production cannot produce.
  • The per-action table path has no test against the real registry, for example buildCommandFacts for record asserting --out sits only under contact-sheet.
  • tableFor casts a fake schema and recomputes the common keys for every block; computing them once in renderPage would be simpler.

Not verified here: the generator was not run at head; the command-docs check covers that the committed page matches the generated one.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 20, 2026
@thymikee
thymikee merged commit 8900cd8 into main Nov 20, 2026
24 of 25 checks passed
@thymikee
thymikee deleted the t3/command-docs-generator-v2 branch November 20, 2026 17:11
thymikee added a commit that referenced this pull request Nov 20, 2026
…nts-main

* origin/main:
  refactor(contracts): bind only the interactor families an owner implements (#4821)
  refactor(gestures): move gesture algorithms out of contracts into @agent-device/gestures (#4823)
  docs(command-docs): add the shared option table and per-action option tables (#4824)
  docs(agents): hold a review to the PR's invariant and stop at a third round (#4835)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant