cli: torb login, logout, owner, yank and deprecate parse their command line with std/cli (step 6 of #124) #783
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#783
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Context
Step 6 of #124 (
torbparses its command line withstd/cli). Steps 2 to 5 (#502, #550, #568, #775) are onmain:compiler/src/cli/declaration.trbdeclarescheck build run test manifest ir natives parse tokens ast highlight new init upgrade add remove update install publish lock vendor audit, andmain.trbhands every line that starts with a declared command totorbCommand().parse(...)and amatch parsed.path. This step moves the five registry commands:login,logout,owner(nestedlist,add,remove),yank,deprecate. Today they go through the arm[command, ...more] if ["login", "logout", "owner", "yank", "deprecate"].contains(command)incompiler/src/main.trb, thenregistryOptionsOf(command, more)andrunRegistryCommandincompiler/src/cli/registry.trb.Source
compiler/src/cli/declaration.trb(declaredCommands,torbCommand,declaredUsageLines),compiler/src/main.trb(the registry arm),compiler/src/cli/registry.trb(RegistryOptions,registryOptionsOf,ownerProblem,yankProblem,deprecateProblem,runRegistryCommand),compiler/src/cli/usage.trb(the registryCommandUsageblock),compiler/tests/registry-commands.test.trb(group "The options of the commands"),compiler/tests/command-pages.test.trb(registryCommands),tools/command-line.sh,tests/command-line/arguments.expectedDesign (decided by the loop, internal)
torbCommand()anddeclaredCommands(); onematch parsed.pathcase each inmain.trbthat buildsRegistryOptionsfrom the parsedInputand callsrunRegistryCommandsynchronously (exit code handling as today: non-zero exits with it).owneris a command with three nested subcommands,["torb", "owner", "list"],["torb", "owner", "add"],["torb", "owner", "remove"]; the nestedcommandblocks ofstd/clicarry the arguments (owner,account) and flags. Flags:login/logout:--registry <url>;owner list:--registry,--project;owner add:--registry,--project,--role owner|publisher(defaultpublisher),--code <code>,--step-up;owner remove: the same without--role;yank <package> <version>:--registry,--project,--reason,--undo;deprecate <package>:--registry,--project,--use,--reason,--undo. A flag one command does not know stays a wrong line.ownerorpublisher, names are segments (isSegment),yankneeds a version (Version.tryFrom) and--reasonunless--undo,--undoexcludes--reasonand--use,--useis a package and not the package itself,--step-upexcludes--codeand neither belongs toowner list,loginnever takes a token as an argument (message unchanged: it reads standard input). They may stay inregistry.trb(takingInput, e.g.registryOptionsFrom(input));registryOptionsOfand its flag-scanning loop go.CliErrorpath (exit 2, message names command and argument). Wording may change only where the new one names command and argument; the messages about the token on the command line, the reason of a yank and--step-up/--codestay explicit. Runtime failures ofrunRegistryCommandstill exit 1 as today.CommandUsageblock leavescli/usage.trb;torb --helplists the commands throughdeclaredUsageLines()(ownershows its three actions),torb <command> --helpandtorb owner <action> --helplist every flag the old block listed.Acceptance criteria
torb login,logout,owner list|add|remove,yankanddeprecateparse their command line withstd/clithroughtorbCommand(); every flag and argument each has today is accepted with the same meaning and listed intorb <command> --help(andtorb owner <action> --help).torb ownerwithout an action or with an unknown action,owner addwithout account,owner listwith--codeor--step-up,--step-uptogether with--code,--roleonlist/remove, a role that is neitherownernorpublisher,yankwithout version or reason,--undowith--reason,deprecate --useof itself,login <token>, an unknown flag, and a flag without its value exit 2 with a message that names the command and the argument.torb owner add acme ada --role owner --code 123456 --registry <url>andtorb yank acme/http 1.2.0 --reason "..."produce the sameRegistryOptionsas before (same fields, same defaults).tests/command-line/arguments.expectedchanges only on the lines of the five commands.compiler/tests/: the group "The options of the commands" inregistry-commands.test.trbmoves to argument lists parsed throughtorbCommand()(parsed values,--help, the wrong lines above);cli-declaration.test.trbandcommand-pages.test.trbfollow; theownerListLines,chosenTokenand runtime tests stay.CommandUsageblock,registryOptionsOfand the old dispatch arm are removed; no dead code left behind.Seed
Does not touch the seed: no syntax, native, driver flag or looked-up name;
std/cli, nested commands and the declaration pattern are onmainand in the newest published seed. The two-commit seed rule does not apply. If tier A cannot compile it, stop and comment on this issue, do not force it.Size
One PR, estimated 400 to 600 lines touched (declaration ~120, registry.trb net negative, tests ~200 moved,
.expected~50), well under the 1000-line split limit, so no split. One or two Conventional Commits:feat(cli): torb login, logout, owner, yank and deprecate parse their command line with std/cliand, if needed,docs(cli): ...(CLI.md status line for step 6; regenerateskills/if docs change). Checks:torb format --checkon touched files, tier A in forge CI viaci-wait.sh; no local bootstrap. Notes from #502, #568 and #775: runtorb formaton the declaration and the new tests (120 columns), compute help text fromCommand.helpbefore editing.expectedfiles, write constructor calls with parentheses (Ok Foo(x), notOk Foo x).Dependencies
None open (#775 landed as PR #778). Step 7 (tooling commands) shares
declaration.trb: do not run the two in parallel.Part of #124 (the PR says
Refs #124, notCloses).torbparses its command line withstd/cli(CLI slice 2) #124torbparses its command line withstd/cli(CLI slice 2) #124[loop:torbscript] claim implement by session:loop-torbscript-20261114-0718 until 2026-11-14T13:30:00Z
[loop:torbscript] release implement by agent:orion:subagent:35bb7afe-027f-4cbd-a7e1-45b91096ac6a
PR: #784 (head
59cb676f9,Refs #124, #783).owner list|add|removenested) are declared indeclaration.trb.registryOptionsFrombuilds the sameRegistryOptions;registryProblemOfkeeps the checks a flag cannot say.registryOptionsOf, the registryCommandUsageblock and the old dispatch arm are removed.torbCommand()argument lists (registry-commands,cli-declaration,command-pages);tools/command-line.shandarguments.expectedgain 18 wrong lines, only for the five commands.ownernow follow the action; noted indocs/tooling/torb-owner.md.commit messages,what the change touches,gates,pdisc) stillpendingafter about 35 minutes. Other runs of the repo also showwaiting, so the runner queue is the delay, not a failure.next: waiting (review); whoever picks this up reads CI first and fixes on red.