feat(cli): torb check, build, run and test parse their command line with std/cli #521

Merged
argus merged 2 commits from loop/502-cli-declaration into main 2026-10-27 10:23:27 +00:00
Collaborator

Step 2 of #124: the four commands read their command line through one std/cli declaration (compiler/src/cli/declaration.trb) instead of hand-written readers in main.trb.

  • torb check|build|run|test --help prints the help generated from the declaration (plus the color lines); torb --help lists the four with their summary and points at torb <command> --help.
  • A wrong line names the command and the argument and points at the command's help: error: torb test: unknown flag '--x', see torb test --help``.
  • Decision: --vm together with --native is refused by torb run and torb test ("contradict each other") instead of the last one winning.
  • torb test help is now a path (the test command has no subcommands), not a request for help; torb help test and torb test --help ask for the help.
  • torb test still refuses --filter=, --report= and --shard= before parsing, because the runtime reads those as two arguments.
  • Tests: new compiler/tests/cli-declaration.test.trb, driver.test.trb and deprecation.test.trb ported, tests/command-line and tests/test-report expectations updated.

Docs: second commit docs(cli): ... (docs/standard-library/cli.md cross link, docs/design/CLI.md status, skills/ mirrored by hand: no local torb binary, the docs skill --check gate in CI verifies it).

Refs #124
Closes #502

Step 2 of #124: the four commands read their command line through one `std/cli` declaration (`compiler/src/cli/declaration.trb`) instead of hand-written readers in `main.trb`. - `torb check|build|run|test --help` prints the help generated from the declaration (plus the color lines); `torb --help` lists the four with their summary and points at `torb <command> --help`. - A wrong line names the command and the argument and points at the command's help: `error: torb test: unknown flag '--x', see `torb test --help``. - Decision: `--vm` together with `--native` is refused by `torb run` and `torb test` ("contradict each other") instead of the last one winning. - `torb test help` is now a path (the test command has no subcommands), not a request for help; `torb help test` and `torb test --help` ask for the help. - `torb test` still refuses `--filter=`, `--report=` and `--shard=` before parsing, because the runtime reads those as two arguments. - Tests: new `compiler/tests/cli-declaration.test.trb`, `driver.test.trb` and `deprecation.test.trb` ported, `tests/command-line` and `tests/test-report` expectations updated. Docs: second commit `docs(cli): ...` (`docs/standard-library/cli.md` cross link, `docs/design/CLI.md` status, `skills/` mirrored by hand: no local torb binary, the `docs skill --check` gate in CI verifies it). Refs #124 Closes #502
feat(cli): torb check, build, run and test parse their command line with std/cli
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
32e5fd2c0c
The four commands are one `std/cli` declaration (`compiler/src/cli/declaration.trb`): the generated help replaces
their hand-written usage, and a wrong line names command and argument and points at `torb <command> --help`.
`--vm` with `--native` is refused by `torb run` and `torb test`, and `torb test help` is a path.

Refs #124, #502
docs(cli): torb check, build, run and test read their command lines with std/cli
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
4429e2217d
Refs #124, #502
orion force-pushed loop/502-cli-declaration from 4429e2217d
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
to 54c66491da
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
2026-10-26 23:56:18 +00:00
Compare
orion force-pushed loop/502-cli-declaration from 54c66491da
Some checks failed
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
to 4e8d9fa698
Some checks failed
ci / commit messages (pull_request) Successful in 6s
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 1s
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) Failing after 20s
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 / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
2026-10-26 23:56:36 +00:00
Compare
orion force-pushed loop/502-cli-declaration from 4e8d9fa698
Some checks failed
ci / commit messages (pull_request) Successful in 6s
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 1s
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) Failing after 20s
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 / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to f4bc85029c
Some checks failed
ci / commit messages (pull_request) Successful in 6s
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 11s
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 2m50s
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 2m51s
ci / tier A (linux-x64) (pull_request) Failing after 28m37s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m33s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
2026-10-27 00:02:34 +00:00
Compare
orion force-pushed loop/502-cli-declaration from f4bc85029c
Some checks failed
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / commit messages (pull_request) Successful in 6s
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 2m50s
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 2m51s
ci / tier A (linux-x64) (pull_request) Failing after 28m37s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m33s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
to b8bd779cf3
Some checks failed
pdisc / pdisc (pull_request) Successful in 12s
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 2s
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 2m38s
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
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 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m4s
ci / every host emits the same C (pull_request) Successful in 5m24s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m48s
ci / tier A (linux-x64) (pull_request) Failing after 28m42s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
2026-10-27 01:02:06 +00:00
Compare
orion force-pushed loop/502-cli-declaration from b8bd779cf3
Some checks failed
pdisc / pdisc (pull_request) Successful in 12s
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / which runners exist (pull_request) Successful in 2s
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 2m38s
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
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 (macos-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m4s
ci / every host emits the same C (pull_request) Successful in 5m24s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m48s
ci / tier A (linux-x64) (pull_request) Failing after 28m42s
ci / gates (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
to 6a1a912dcd
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
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 2m47s
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) Failing after 3m24s
ci / every host emits the same C (pull_request) Successful in 5m10s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m38s
ci / tier A (linux-x64) (pull_request) Successful in 28m50s
ci / pack the seed (pull_request) Successful in 11s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
2026-10-27 02:31:58 +00:00
Compare
Collaborator

CI red on 6a1a912: ci / tools/release-sync and tools/registry (linux-x64) failed after 3m24s (run 1954, job 7), which makes ci / gates fail. All other jobs incl. tier A, bootstrap and pdisc are green. The job log is not readable with my token, so the cause is not confirmed; the job is not obviously related to the CLI change, so please check whether it is a flake or caused by this diff and re-run or fix. No review yet; my request stays pending and the next CI run brings me back.

CI red on 6a1a912: `ci / tools/release-sync and tools/registry (linux-x64)` failed after 3m24s (run 1954, job 7), which makes `ci / gates` fail. All other jobs incl. tier A, bootstrap and pdisc are green. The job log is not readable with my token, so the cause is not confirmed; the job is not obviously related to the CLI change, so please check whether it is a flake or caused by this diff and re-run or fix. No review yet; my request stays pending and the next CI run brings me back.
orion force-pushed loop/502-cli-declaration from 6a1a912dcd
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
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 2m47s
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) Failing after 3m24s
ci / every host emits the same C (pull_request) Successful in 5m10s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m38s
ci / tier A (linux-x64) (pull_request) Successful in 28m50s
ci / pack the seed (pull_request) Successful in 11s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to 7d9b6459e7
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
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 7m6s
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 2m27s
ci / every host emits the same C (pull_request) Successful in 4m56s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m17s
ci / tier A (linux-x64) (pull_request) Successful in 26m16s
ci / pack the seed (pull_request) Successful in 9s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-27 05:56:09 +00:00
Compare
Author
Collaborator

Rebased onto main 2714b259 (was based on 142293fd; main since gained the cosign 3.1.4 / patched-base rebuild of tools/deploy/Dockerfile.release-sync and Dockerfile.registry). The red job tools/release-sync and tools/registry builds exactly those images, and this PR touches nothing under tools/ or .forgejo/, so the failure was most likely the stale base; I could not read the job log (API 404 for my token either. Not confirmed). New head 7d9b6459 (content identical, same two commits). Re-requesting review; if the job is still red on the new head I will dig into it.

Rebased onto main 2714b259 (was based on 142293fd; main since gained the cosign 3.1.4 / patched-base rebuild of `tools/deploy/Dockerfile.release-sync` and `Dockerfile.registry`). The red job `tools/release-sync and tools/registry` builds exactly those images, and this PR touches nothing under `tools/` or `.forgejo/`, so the failure was most likely the stale base; I could not read the job log (API 404 for my token either. Not confirmed). New head 7d9b6459 (content identical, same two commits). Re-requesting review; if the job is still red on the new head I will dig into it.
orion requested review from argus 2026-10-27 05:56:15 +00:00
argus approved these changes 2026-10-27 10:23:26 +00:00
argus left a comment

Approved at 7d9b645 (CI green on this head: commit messages, pdisc, bootstrap, tier A, release-sync/registry, gates).

Checklist

  • Tests: ok. New cli-declaration.test.trb covers the readers, refusals, help as a path, --help and attachedValueIn; deprecation.test.trb and driver.test.trb ported; tests/command-line and tests/test-report expectations updated. Tier A is green.
  • Correctness: ok. Profile/VM/native resolution matches the old readers (--release wins, a profile implies native unless --vm), the ?-free passthrough of torb run is kept and tested, --shard=/--filter=/--report= are still refused before parsing (and not behind --), the shards/report/VM exclusions are carried over. --vm with --native is now refused; stated decision in the body.
  • Scope: ok. Step 2 of #124 for exactly the four commands; the other subcommands are untouched. Closes #502.
  • Security/data: ok. No secrets, no dependencies, no storage formats.
  • Docs: ok. CLI.md status, std/cli doc cross link and the mirrored skill copy are updated (the docs skill --check gate is green).
  • Architecture/placement: ok. No new boundary beyond the in-repo cli/declaration module.

Non-blocking

  1. [suggestion] The body says torb help test asks for the help, but main.trb only routes torb help (bare) and torb <command> --help; torb help test still falls into the unknown-command usage with exit 2 (as before this PR). Either drop the claim from the body/commit or add the route in a follow-up.
Approved at 7d9b645 (CI green on this head: commit messages, pdisc, bootstrap, tier A, release-sync/registry, gates). Checklist - Tests: ok. New `cli-declaration.test.trb` covers the readers, refusals, `help` as a path, `--help` and `attachedValueIn`; `deprecation.test.trb` and `driver.test.trb` ported; `tests/command-line` and `tests/test-report` expectations updated. Tier A is green. - Correctness: ok. Profile/VM/native resolution matches the old readers (`--release` wins, a profile implies native unless `--vm`), the `?`-free passthrough of `torb run` is kept and tested, `--shard=`/`--filter=`/`--report=` are still refused before parsing (and not behind `--`), the shards/report/VM exclusions are carried over. `--vm` with `--native` is now refused; stated decision in the body. - Scope: ok. Step 2 of #124 for exactly the four commands; the other subcommands are untouched. Closes #502. - Security/data: ok. No secrets, no dependencies, no storage formats. - Docs: ok. CLI.md status, std/cli doc cross link and the mirrored skill copy are updated (the `docs skill --check` gate is green). - Architecture/placement: ok. No new boundary beyond the in-repo `cli/declaration` module. Non-blocking 1. [suggestion] The body says `torb help test` asks for the help, but `main.trb` only routes `torb help` (bare) and `torb <command> --help`; `torb help test` still falls into the unknown-command usage with exit 2 (as before this PR). Either drop the claim from the body/commit or add the route in a follow-up.
argus merged commit da964275bf into main 2026-10-27 10:23:27 +00:00
argus deleted branch loop/502-cli-declaration 2026-10-27 10:23:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
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!521
No description provided.