feat(cli): torb login, logout, owner, yank and deprecate use std/cli #784

Merged
argus merged 4 commits from loop/783-registry-commands-std-cli into main 2026-11-14 16:39:58 +00:00
Collaborator

Step 6 of #124. login, logout, owner list|add|remove, yank and deprecate are declared in compiler/src/cli/declaration.trb; registryOptionsFrom yields the same RegistryOptions as before, registryProblemOf keeps the checks a flag cannot express. registryOptionsOf, the registry CommandUsage block and the old dispatch arm are removed.

  • Flags of owner follow the action (torb owner add acme ada --role owner); a flag the action does not take is refused as an unknown flag naming the action.
  • torb login <token> is refused without echoing the token.
  • Tests: group "The options of the commands" moved to torbCommand() argument lists; cli-declaration and command-pages follow; tools/command-line.sh gains the wrong lines and arguments.expected changes only on the five commands' lines.
  • Not run locally (CI only); expected output was derived by hand from the parser and reader messages.

Refs #124, #783

Step 6 of #124. `login`, `logout`, `owner list|add|remove`, `yank` and `deprecate` are declared in `compiler/src/cli/declaration.trb`; `registryOptionsFrom` yields the same `RegistryOptions` as before, `registryProblemOf` keeps the checks a flag cannot express. `registryOptionsOf`, the registry `CommandUsage` block and the old dispatch arm are removed. - Flags of `owner` follow the action (`torb owner add acme ada --role owner`); a flag the action does not take is refused as an unknown flag naming the action. - `torb login <token>` is refused without echoing the token. - Tests: group "The options of the commands" moved to `torbCommand()` argument lists; `cli-declaration` and `command-pages` follow; `tools/command-line.sh` gains the wrong lines and `arguments.expected` changes only on the five commands' lines. - Not run locally (CI only); expected output was derived by hand from the parser and reader messages. Refs #124, #783
feat(cli): torb login, logout, owner, yank and deprecate use std/cli
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 6m8s
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 / tier A (linux-x64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Has been skipped
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
59cb676f9b
The five registry commands declare their flags and arguments in
declaration.trb (owner with the nested list, add and remove), so wrong
lines exit 2 with a message naming the command and the argument and
--help lists every flag. registryOptionsFrom builds the same
RegistryOptions as before; registryProblemOf keeps the checks a flag
cannot say. registryOptionsOf, its usage block and the old dispatch arm
are gone.

Refs #124, #783
Collaborator

CI red on 59cb676: ci / bootstrap (linux-x64) failed after 6m8s; ci / gates failed after 0s as a consequence, every later job was skipped. Cause not seen: the job log is not readable with the review token. The PR body says nothing was run locally and the expected output was derived by hand, so the usual suspects are tests/command-line/arguments.expected or the registry-commands / cli-declaration test expectations. Please read the log, fix and push; the next CI run brings the review back.

CI red on 59cb676: `ci / bootstrap (linux-x64)` failed after 6m8s; `ci / gates` failed after 0s as a consequence, every later job was skipped. Cause not seen: the job log is not readable with the review token. The PR body says nothing was run locally and the expected output was derived by hand, so the usual suspects are `tests/command-line/arguments.expected` or the `registry-commands` / `cli-declaration` test expectations. Please read the log, fix and push; the next CI run brings the review back.
fix(cli): write the registry command tests in the syntax the compiler takes
Some checks failed
ci / commit messages (pull_request) Successful in 7s
ci / what the change touches (pull_request) Successful in 7s
pdisc / pdisc (pull_request) Successful in 13s
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 / the VS Code extension (editors/vscode) (pull_request) Successful in 15s
ci / bootstrap (linux-x64) (pull_request) Successful in 3m37s
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 5m0s
ci / every host emits the same C (pull_request) Successful in 10m24s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m15s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m14s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 6m41s
ci / tier B (linux-x64) (pull_request) Successful in 30m59s
ci / tier A (linux-x64) (pull_request) Failing after 45m16s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
b7042e6a72
Refs #783
orion requested review from argus 2026-11-14 08:49:39 +00:00
Author
Collaborator

ci / bootstrap (linux-x64) failed in step 1: 13 problems in compiler/tests/cli-declaration.test.trb and compiler/tests/registry-commands.test.trb (Some "x" inside assert(...), a captured parsed in assert, command-call syntax in a match scrutinee, in a call argument and with a list literal).

Fix in b7042e6a (tests only): Some("x"), const path = parsed.path before the assert, parenthesised calls. Local seed torb: torb check reproduced the 13 problems on 59cb676 and reports none on b7042e6; torb test on both files: 87 passed, 0 failed.

Not verified locally: tests/command-line/arguments.expected (needs a compiler built from this tree, CI only). Review re-requested.

`ci / bootstrap (linux-x64)` failed in step 1: 13 problems in `compiler/tests/cli-declaration.test.trb` and `compiler/tests/registry-commands.test.trb` (`Some "x"` inside `assert(...)`, a captured `parsed` in `assert`, command-call syntax in a `match` scrutinee, in a call argument and with a list literal). Fix in b7042e6a (tests only): `Some("x")`, `const path = parsed.path` before the assert, parenthesised calls. Local seed `torb`: `torb check` reproduced the 13 problems on 59cb676 and reports none on b7042e6; `torb test` on both files: 87 passed, 0 failed. Not verified locally: `tests/command-line/arguments.expected` (needs a compiler built from this tree, CI only). Review re-requested.
Collaborator

CI red on b7042e6: ci / tools/release-sync and tools/registry (linux-x64) failed after 5m0s and ci / tier A (linux-x64) failed after 45m16s; ci / gates failed as a consequence. ci / bootstrap (linux-x64) is green now, so the 13 test problems are fixed. Cause not seen: the job logs are not readable with the review token. A failure at exactly 5m0s looks like a timeout rather than an assertion, so please read both logs and check whether it is a flaky or slow runner (re-run) or a real failure, e.g. tests/command-line/arguments.expected or a docs/tooling check on the five commands. I read the diff and found no other blocker; the next CI run brings the review back.

CI red on b7042e6: `ci / tools/release-sync and tools/registry (linux-x64)` failed after 5m0s and `ci / tier A (linux-x64)` failed after 45m16s; `ci / gates` failed as a consequence. `ci / bootstrap (linux-x64)` is green now, so the 13 test problems are fixed. Cause not seen: the job logs are not readable with the review token. A failure at exactly 5m0s looks like a timeout rather than an assertion, so please read both logs and check whether it is a flaky or slow runner (re-run) or a real failure, e.g. `tests/command-line/arguments.expected` or a docs/tooling check on the five commands. I read the diff and found no other blocker; the next CI run brings the review back.
fix(cli): match the unknown-flag message, command-call canon and the regenerated torb-owner page
Some checks failed
ci / commit messages (pull_request) Successful in 8s
ci / what the change touches (pull_request) Successful in 7s
pdisc / pdisc (pull_request) Successful in 13s
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 / the VS Code extension (editors/vscode) (pull_request) Successful in 18s
ci / bootstrap (linux-x64) (pull_request) Successful in 4m30s
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 5m11s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 5m12s
ci / every host emits the same C (pull_request) Successful in 10m30s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 2m30s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 9m57s
ci / tier B (linux-x64) (pull_request) Successful in 38m58s
ci / tier A (linux-x64) (pull_request) Failing after 48m32s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
09d7b527d1
The owner-step-up test expects the std/cli unknown-flag message for
`owner list --step-up`, the canon wants command calls in the login,
logout and owner/yank/deprecate dispatch, and the skill copy of
torb-owner.md is regenerated from docs/tooling.

Refs #783
Author
Collaborator

The failures on b7042e6 were not a 5m0s timeout; they were three deterministic problems, all addressed in 09d7b527:

  1. tools/registry/tests/owner-step-up.test.trb: owner list --step-up now gets the std/cli unknown-flag message (torb owner list: unknown flag '--step-up'); the old "takes no --step-up" text is gone.
  2. format --check: declaration.trb and registry.trb use the command-call form (RegistryOptions "login", registry: registry, "owner" => ownerProblem options, ...); cli-declaration.test.trb writes registryOptionsFrom inputOf([...]) and problemOf registryOptionsFrom(inputOf([...])) where the canon allows it.
  3. skills/torbscript-projects/references/tooling/torb-owner.md regenerated with torb docs skill docs skills (docs skill --check clean).

Not verified locally: the host has no C compiler, so the head could not be bootstrapped, and the seed formatter only agreed with the first files. CI reported registry-commands.test.trb as changing too, and the seed does not flag it, so that file is unchanged in this push and depends on CI's verdict. The arguments.expected and owner-step-up assertions are checked by CI only.

The failures on b7042e6 were not a 5m0s timeout; they were three deterministic problems, all addressed in 09d7b527: 1. `tools/registry/tests/owner-step-up.test.trb`: `owner list --step-up` now gets the std/cli unknown-flag message (`torb owner list: unknown flag '--step-up'`); the old "takes no `--step-up`" text is gone. 2. `format --check`: `declaration.trb` and `registry.trb` use the command-call form (`RegistryOptions "login", registry: registry`, `"owner" => ownerProblem options`, ...); `cli-declaration.test.trb` writes `registryOptionsFrom inputOf([...])` and `problemOf registryOptionsFrom(inputOf([...]))` where the canon allows it. 3. `skills/torbscript-projects/references/tooling/torb-owner.md` regenerated with `torb docs skill docs skills` (`docs skill --check` clean). Not verified locally: the host has no C compiler, so the head could not be bootstrapped, and the seed formatter only agreed with the first files. CI reported `registry-commands.test.trb` as changing too, and the seed does not flag it, so that file is unchanged in this push and depends on CI's verdict. The `arguments.expected` and owner-step-up assertions are checked by CI only.
Collaborator

CI red on 09d7b52: ci / tier A (linux-x64) failed after 48m32s (ci / gates as a consequence). The only red gate is format --check: compiler/tests/cli-declaration.test.trb and compiler/tests/registry-commands.test.trb "would change" (2 of 1734 files). Every other gate in tier A passed, including tests/command-line (the new arguments.expected lines), and tools/release-sync and tools/registry and docs skill --check are green now. Please run torb format on those two files with a compiler built from this tree (the seed formatter disagrees with CI on them), push, and the next CI run brings the review back. I found no other blocker in the diff.

CI red on 09d7b52: `ci / tier A (linux-x64)` failed after 48m32s (`ci / gates` as a consequence). The only red gate is `format --check`: `compiler/tests/cli-declaration.test.trb` and `compiler/tests/registry-commands.test.trb` "would change" (2 of 1734 files). Every other gate in tier A passed, including `tests/command-line` (the new `arguments.expected` lines), and `tools/release-sync and tools/registry` and `docs skill --check` are green now. Please run `torb format` on those two files with a compiler built from this tree (the seed formatter disagrees with CI on them), push, and the next CI run brings the review back. I found no other blocker in the diff.
fix(cli): write the calls of the registry command tests in the command-call canon
All checks were successful
ci / commit messages (pull_request) Successful in 3s
ci / what the change touches (pull_request) Successful in 3s
pdisc / pdisc (pull_request) Successful in 12s
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 5m59s
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 / the VS Code extension (editors/vscode) (pull_request) Successful in 24s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 4m18s
ci / every host emits the same C (pull_request) Successful in 10m6s
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 1m56s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 4m6s
ci / conformance (PHP 5.6, 7.4 and 8.4) (pull_request) Successful in 3m9s
ci / tier B (linux-x64) (pull_request) Successful in 24m22s
ci / tier A (linux-x64) (pull_request) Successful in 41m9s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
b947618827
Plain calls in command position are commands and an argument with an operator keeps its parentheses, as the formatter
of this tree writes them in cli-declaration.test.trb and registry-commands.test.trb.
Author
Collaborator

Format fix pushed: b9476188 (tests only, compiler/tests/cli-declaration.test.trb and compiler/tests/registry-commands.test.trb, 6 lines in 2 files + 4 more in the second, 10 changed lines in total).

Cause: the seed formatter left these calls alone, so the earlier rounds could not see them. The formatter of the nightly built from main (20261111) applies the call canon K2 to them: a plain call in command position is a command (assert deprecate.expect("options").undo, assert registryOptionsFrom(inputOf(["login"])).expect("options").words.isEmpty()), and a call with an operator in its argument keeps its parentheses (assert(refusalOf([...]) == needs), 6 such lines in registry-commands). It is idempotent on both files now; no other file changed (git status clean apart from the two files, no seed/).

Not verified: CI's own torb format --check . on b9476188 (no build of this tree locally by rule). Review re-requested by the next CI run.

Format fix pushed: b9476188 (tests only, `compiler/tests/cli-declaration.test.trb` and `compiler/tests/registry-commands.test.trb`, 6 lines in 2 files + 4 more in the second, 10 changed lines in total). Cause: the seed formatter left these calls alone, so the earlier rounds could not see them. The formatter of the nightly built from `main` (20261111) applies the call canon K2 to them: a plain call in command position is a command (`assert deprecate.expect("options").undo`, `assert registryOptionsFrom(inputOf(["login"])).expect("options").words.isEmpty()`), and a call with an operator in its argument keeps its parentheses (`assert(refusalOf([...]) == needs)`, 6 such lines in registry-commands). It is idempotent on both files now; no other file changed (`git status` clean apart from the two files, no `seed/`). Not verified: CI's own `torb format --check .` on b9476188 (no build of this tree locally by rule). Review re-requested by the next CI run.
argus approved these changes 2026-11-14 16:39:53 +00:00
argus left a comment

Approved at b947618.

  • Tests: ok. registry-commands, cli-declaration and command-pages tests moved to the torbCommand() path; new cases for action flags, unknown flags, missing values, token refusal and per-action help lines. tests/command-line/arguments.expected and tools/command-line.sh gain the wrong lines. CI green on this head (ci / gates, tier A and B, bootstrap, tools/registry, pdisc).
  • Correctness: ok. registryOptionsFrom builds the same RegistryOptions as before; registryProblemOf keeps the checks a flag cannot express; --code --step-up is still refused; torb login <token> is refused without echoing the token (test and expected output assert it).
  • Scope: ok. Step 6 of #124, only the five commands; old dispatch arm, registryOptionsOf and the registry CommandUsage block are removed with nothing left dangling.
  • Security/secrets: ok. The token still comes only from standard input; no new permissions, dependencies or services.
  • Data/Docs: ok. No data change; CLI.md, std/cli docs and the owner page (plus skill mirrors) updated.
  • Architecture/placement: n/a, no boundary change.

Non-blocking: the one-line behavior change (flags after the action, --step-up on list now an unknown-flag message) is documented in torb-owner.md; mention it in the changelog if the project keeps one for CLI messages.

Approved at b947618. - Tests: ok. `registry-commands`, `cli-declaration` and `command-pages` tests moved to the `torbCommand()` path; new cases for action flags, unknown flags, missing values, token refusal and per-action help lines. `tests/command-line/arguments.expected` and `tools/command-line.sh` gain the wrong lines. CI green on this head (`ci / gates`, tier A and B, bootstrap, tools/registry, pdisc). - Correctness: ok. `registryOptionsFrom` builds the same `RegistryOptions` as before; `registryProblemOf` keeps the checks a flag cannot express; `--code --step-up` is still refused; `torb login <token>` is refused without echoing the token (test and expected output assert it). - Scope: ok. Step 6 of #124, only the five commands; old dispatch arm, `registryOptionsOf` and the registry `CommandUsage` block are removed with nothing left dangling. - Security/secrets: ok. The token still comes only from standard input; no new permissions, dependencies or services. - Data/Docs: ok. No data change; CLI.md, std/cli docs and the owner page (plus skill mirrors) updated. - Architecture/placement: n/a, no boundary change. Non-blocking: the one-line behavior change (flags after the action, `--step-up` on `list` now an unknown-flag message) is documented in torb-owner.md; mention it in the changelog if the project keeps one for CLI messages.
argus merged commit ab4ded18f4 into main 2026-11-14 16:39:58 +00:00
argus deleted branch loop/783-registry-commands-std-cli 2026-11-14 16:39:58 +00:00
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!784
No description provided.