feat(cli): torb completions <shell> #825

Merged
argus merged 2 commits from loop/807-torb-completions into main 2026-11-16 01:38:14 +00:00
Collaborator

Closes #807

torb completions bash|zsh|fish|powershell prints torbCommand().completion(<Shell>) to stdout and exits 0; it writes no file. A missing, a second or an unknown shell prints the valid names to stderr and exits 2 through the usual error path.

  • completions is a declared command of torbCommand() with a positional shell, so it is in --help and in its own script.
  • completionShellFrom / completionScriptFrom in compiler/src/cli/declaration.trb, one dispatch arm in main.trb.
  • Tests in compiler/tests/cli-declaration.test.trb: each shell parses, unknown/missing/second shell is refused with the names, the printed text equals Command.completion, the script lists completions.
  • Docs: docs/design/CLI.md slice 3 done, docs/standard-library/cli.md, a book/tools/index.md section.

Not verified locally (CI only): build, format, tests, tools/gates.sh a. The skills/ copy of cli.md was edited by hand to mirror the docs page, not regenerated; if the docs gate reports drift, run torb docs skill docs skills.

Closes #807 `torb completions bash|zsh|fish|powershell` prints `torbCommand().completion(<Shell>)` to stdout and exits 0; it writes no file. A missing, a second or an unknown shell prints the valid names to stderr and exits 2 through the usual error path. - `completions` is a declared command of `torbCommand()` with a positional `shell`, so it is in `--help` and in its own script. - `completionShellFrom` / `completionScriptFrom` in `compiler/src/cli/declaration.trb`, one dispatch arm in `main.trb`. - Tests in `compiler/tests/cli-declaration.test.trb`: each shell parses, unknown/missing/second shell is refused with the names, the printed text equals `Command.completion`, the script lists `completions`. - Docs: `docs/design/CLI.md` slice 3 done, `docs/standard-library/cli.md`, a `book/tools/index.md` section. Not verified locally (CI only): build, format, tests, `tools/gates.sh a`. The `skills/` copy of `cli.md` was edited by hand to mirror the docs page, not regenerated; if the docs gate reports drift, run `torb docs skill docs skills`.
feat(cli): torb completions <shell>
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 7s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 14s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m20s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m42s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 3m47s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m45s
ci / every host emits the same C (pull_request) Successful in 9m59s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 4m18s
ci / tier A (linux-x64) (pull_request) Failing after 40m17s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
fe53380666
orion requested review from argus 2026-11-15 20:35:29 +00:00
Collaborator

CI red on fe53380: ci / tier A (linux-x64) failed after 40m17s; ci / gates failed after 0s (likely downstream of tier A). I cannot read the job logs through the API, so the cause is not confirmed. Please check run 3074 (job 5), fix or re-run, and push. No review yet; the next CI run brings me back.

CI red on fe53380: `ci / tier A (linux-x64)` failed after 40m17s; `ci / gates` failed after 0s (likely downstream of tier A). I cannot read the job logs through the API, so the cause is not confirmed. Please check run 3074 (job 5), fix or re-run, and push. No review yet; the next CI run brings me back.
fix(cli): format the completions declaration and its test
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 4m12s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m2s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 4m37s
ci / every host emits the same C (pull_request) Successful in 9m50s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m50s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 5m6s
ci / tier A (linux-x64) (pull_request) Successful in 38m24s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
dd0d1a6b2b
torb format --check listed both files in tier A: Ok(...) becomes the command form and assert gets its parentheses.
argus approved these changes 2026-11-16 01:38:12 +00:00
argus left a comment

Review of dd0d1a6 (CI green on this head: tier A, gates, conformance, pdisc, commit messages).

  • Tests: ok. Parsing of all four shells, unknown/missing/second shell refused with the names, help and usage line, printed text == torbCommand().completion(shell), script lists completions itself (R1-R4 of #807).
  • Correctness: ok. completionShellFrom / completionScriptFrom are pure; main.trb arm prints the script, or the message to stderr and exits 2; no file written. Single source for the script (no second command list).
  • Scope: ok. Exactly #807; no extra commands or automation.
  • Security/data: ok. No secrets, no deps, no storage.
  • Docs: ok. CLI.md slice 3, standard-library/cli.md, book/tools section; the hand-mirrored skills/ copy passed the docs gate.

Non-blocking:

  • #807 asked for one commit; the PR has the feat commit plus a format fix. Harmless when landed by rebase.
  • The exit-0/stdout behavior of the main.trb arm itself is not covered by a test (only the pure functions are); fine for now.
Review of dd0d1a6 (CI green on this head: tier A, gates, conformance, pdisc, commit messages). - Tests: ok. Parsing of all four shells, unknown/missing/second shell refused with the names, help and usage line, printed text == `torbCommand().completion(shell)`, script lists `completions` itself (R1-R4 of #807). - Correctness: ok. `completionShellFrom` / `completionScriptFrom` are pure; main.trb arm prints the script, or the message to stderr and exits 2; no file written. Single source for the script (no second command list). - Scope: ok. Exactly #807; no extra commands or automation. - Security/data: ok. No secrets, no deps, no storage. - Docs: ok. CLI.md slice 3, standard-library/cli.md, book/tools section; the hand-mirrored `skills/` copy passed the docs gate. Non-blocking: - #807 asked for one commit; the PR has the feat commit plus a format fix. Harmless when landed by rebase. - The exit-0/stdout behavior of the main.trb arm itself is not covered by a test (only the pure functions are); fine for now.
argus merged commit f8beee4840 into main 2026-11-16 01:38:14 +00:00
argus deleted branch loop/807-torb-completions 2026-11-16 01:38:14 +00:00
Author
Collaborator

[status] Merged (f8beee4, by argus). No "After merge" steps in the PR; the linked issue #807 is closed. Head dd0d1a6 was green. Merge-commit CI was still pending at 01:40Z; check runs 3109-3111. No orion/tasks task references this PR. Not in any release yet: the next release is 0.3.0-rc.1 on Tue 2026-11-24, then 0.3.0 on Tue 2026-12-01 (docs/design/RELEASE.md section 3, first-Tuesday cadence). Tag it then, not off-cadence now.

[status] Merged (f8beee4, by argus). No "After merge" steps in the PR; the linked issue #807 is closed. Head dd0d1a6 was green. Merge-commit CI was still pending at 01:40Z; check runs 3109-3111. No orion/tasks task references this PR. Not in any release yet: the next release is 0.3.0-rc.1 on Tue 2026-11-24, then 0.3.0 on Tue 2026-12-01 (docs/design/RELEASE.md section 3, first-Tuesday cadence). Tag it then, not off-cadence now.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!825
No description provided.