feat(cli): torb login, logout, owner, yank and deprecate use std/cli #784
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!784
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/783-registry-commands-std-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Step 6 of #124.
login,logout,owner list|add|remove,yankanddeprecateare declared incompiler/src/cli/declaration.trb;registryOptionsFromyields the sameRegistryOptionsas before,registryProblemOfkeeps the checks a flag cannot express.registryOptionsOf, the registryCommandUsageblock and the old dispatch arm are removed.ownerfollow 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.torbCommand()argument lists;cli-declarationandcommand-pagesfollow;tools/command-line.shgains the wrong lines andarguments.expectedchanges only on the five commands' lines.Refs #124, #783
torb login,logout,owner,yankanddeprecateparse their command line withstd/cli(step 6 of #124) #783CI red on
59cb676:ci / bootstrap (linux-x64)failed after 6m8s;ci / gatesfailed 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 aretests/command-line/arguments.expectedor theregistry-commands/cli-declarationtest expectations. Please read the log, fix and push; the next CI run brings the review back.ci / bootstrap (linux-x64)failed in step 1: 13 problems incompiler/tests/cli-declaration.test.trbandcompiler/tests/registry-commands.test.trb(Some "x"insideassert(...), a capturedparsedinassert, command-call syntax in amatchscrutinee, in a call argument and with a list literal).Fix in
b7042e6a(tests only):Some("x"),const path = parsed.pathbefore the assert, parenthesised calls. Local seedtorb:torb checkreproduced the 13 problems on59cb676and reports none onb7042e6;torb teston 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.torb login,logout,owner,yankanddeprecateparse their command line withstd/cli(step 6 of #124) #783CI red on
b7042e6:ci / tools/release-sync and tools/registry (linux-x64)failed after 5m0s andci / tier A (linux-x64)failed after 45m16s;ci / gatesfailed 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.expectedor 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.The failures on
b7042e6were not a 5m0s timeout; they were three deterministic problems, all addressed in09d7b527:tools/registry/tests/owner-step-up.test.trb:owner list --step-upnow gets the std/cli unknown-flag message (torb owner list: unknown flag '--step-up'); the old "takes no--step-up" text is gone.format --check:declaration.trbandregistry.trbuse the command-call form (RegistryOptions "login", registry: registry,"owner" => ownerProblem options, ...);cli-declaration.test.trbwritesregistryOptionsFrom inputOf([...])andproblemOf registryOptionsFrom(inputOf([...]))where the canon allows it.skills/torbscript-projects/references/tooling/torb-owner.mdregenerated withtorb docs skill docs skills(docs skill --checkclean).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.trbas changing too, and the seed does not flag it, so that file is unchanged in this push and depends on CI's verdict. Thearguments.expectedand owner-step-up assertions are checked by CI only.CI red on
09d7b52:ci / tier A (linux-x64)failed after 48m32s (ci / gatesas a consequence). The only red gate isformat --check:compiler/tests/cli-declaration.test.trbandcompiler/tests/registry-commands.test.trb"would change" (2 of 1734 files). Every other gate in tier A passed, includingtests/command-line(the newarguments.expectedlines), andtools/release-sync and tools/registryanddocs skill --checkare green now. Please runtorb formaton 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.Format fix pushed:
b9476188(tests only,compiler/tests/cli-declaration.test.trbandcompiler/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 statusclean apart from the two files, noseed/).Not verified: CI's own
torb format --check .onb9476188(no build of this tree locally by rule). Review re-requested by the next CI run.torb login,logout,owner,yankanddeprecateparse their command line withstd/cli(step 6 of #124) #783Approved at
b947618.registry-commands,cli-declarationandcommand-pagestests moved to thetorbCommand()path; new cases for action flags, unknown flags, missing values, token refusal and per-action help lines.tests/command-line/arguments.expectedandtools/command-line.shgain the wrong lines. CI green on this head (ci / gates, tier A and B, bootstrap, tools/registry, pdisc).registryOptionsFrombuilds the sameRegistryOptionsas before;registryProblemOfkeeps the checks a flag cannot express;--code --step-upis still refused;torb login <token>is refused without echoing the token (test and expected output assert it).registryOptionsOfand the registryCommandUsageblock are removed with nothing left dangling.Non-blocking: the one-line behavior change (flags after the action,
--step-uponlistnow an unknown-flag message) is documented in torb-owner.md; mention it in the changelog if the project keeps one for CLI messages.torb login,logout,owner,yankanddeprecateparse their command line withstd/cli(step 6 of #124) #783torbparses its command line withstd/cli(CLI slice 2) #124