cli: torb add, remove, update, install, publish, lock, vendor and audit parse their command line with std/cli (step 5 of #124) #775
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#775
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 5 of #124 (
torbparses its command line withstd/cli). Steps 2 to 4 (#502, #550, #568) are onmain:compiler/src/cli/declaration.trbdeclarescheck build run test manifest ir natives parse tokens ast highlight new init upgrade, andmain.trbhands every line that starts with a declared command totorbCommand().parse(...)and amatch parsed.path. This step moves the eight package commands:add,remove,update,install,publish,lock,vendor,audit. Today they go throughpackageCommandsandpackageOptionsOf(command, arguments)incompiler/src/cli/packages.trb, thenrunPackageCommand.The registry commands (
login logout owner yank deprecate,registryOptionsOf, nestedowner list|add|remove) are a separate step (the next one): together with these eight they are ~2000 lines of readers, usage blocks and tests, which is the size problem that made #502 and #550 slices.Source
compiler/src/cli/declaration.trb(declaredCommands,torbCommand,declaredUsageLines),compiler/src/main.trb(the arm[command, ...more] if packageCommands.contains(command)),compiler/src/cli/packages.trb(packageCommands,PackageOptions,packageOptionsOf,runPackageCommand),compiler/src/cli/usage.trb(the packageCommandUsageblock),compiler/tests/packages.test.trb,compiler/tests/command-pages.test.trb(readspackageCommands)Design (decided by the loop, internal)
torbCommand()anddeclaredCommands(); one morematch parsed.pathcase each inmain.trb, buildingPackageOptionsfrom the parsedInputand callingrunPackageCommandsynchronously (no top-levelawait, see the comment at the current arm).add <package>[@<requirement>]...andremove <package>...need at least one package;update [<package>...];install,publish,lock,vendor,audittake no package. Flags on all eight:--development,--offline,--dry-run,--accept-capabilities,--project <directory>;lock --check;audit --advisories <directory>. The flags that only one command knows are declared on that command only (an unknown flag for the command stays a wrong line).CliErrorpath (exit 2, message names command and argument). Wording may change only where the new one names command and argument; the "needs a package" and "takes no package" cases stay explicit.packageOptionsFrom(command, input): PackageOptionsindeclaration.trb(orpackages.trb) replacespackageOptionsOf;packageCommandsstays only ifcommand-pages.test.trbstill needs it, else it goes with the old arm.CommandUsageblock leavescli/usage.trb;torb --helplists the commands throughdeclaredUsageLines(), andtorb <command> --helplists every flag and the audit exit codes (0 nothing found, 1 findings, 2 lock/index/advisory unreadable) the old block listed.registryOptionsOfare untouched.Acceptance criteria
torb add,remove,update,install,publish,lock,vendorandauditparse their command line withstd/clithroughtorbCommand(); every flag and argument each has today is accepted with the same meaning and listed intorb <command> --help.torb addandtorb removewithout a package,install/publish/lock/vendor/auditwith a package, an unknown flag,lock --checkaccepted butadd --checkrefused,audit --advisoriesand--projectwithout a value exit 2 with a message that names the command and the argument.torb updatewithout arguments still resolves every package;torb add acme/json@^1.2 acme/httpstill passes both names with their requirements;--project <dir>still selects the project directory.login,owner,repl,format,docs ..., ...) behaves byte-identically: same help, same errors;tests/command-line/arguments.expectedandtests/test-report/arguments.expectedchange only on the lines of the eight commands.compiler/tests/(extendcli-declaration.test.trb;packages.test.trbandcommand-pages.test.trbmove with their command): argument lists per command, parsed values,--help, wrong lines.CommandUsageblock,packageOptionsOfand 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/cliand 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, two Conventional Commits at most:
feat(cli): torb add, remove, update, install, publish, lock, vendor and audit parse their command line with std/cliand, if needed,docs(cli): ...(CLI.md status line for step 5; regenerateskills/if docs change). Checks:torb format --checkon touched files, tier A in forge CI viaci-wait.sh; no local bootstrap. Notes from #502 and #568: runtorb formaton the declaration and the new test (120 columns), compute help text fromCommand.helpbefore editing.expectedfiles, and write constructor calls with parentheses (Ok Foo(x), notOk Foo x).Dependencies
None open (#502, #550 and #568 landed on
main). Blocks the next step of #124 (registry commands).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 until 2026-11-14T06:30:00Z
[loop:torbscript] implement: checkpoint. The eight package commands are declared in std/cli, the old reader and usage block are removed, and tests, command-line table and docs are updated. Pushing branch loop/775-package-commands-std-cli next; PR and CI follow.
[loop:torbscript] implement: PR #778 opened, CI pending (commit messages, what the change touches and pdisc green; bootstrap, tier A/B and the command-line gate still queued or running behind the runner backlog at 00:46Z; nothing was compiled locally, so CI is the first compile). next: review (argus), after the bootstrap and tier A results are in.
[loop:torbscript] claim review-fix by session:loop-torbscript-20261114 until 2026-11-14T05:49:00Z
[loop:torbscript] review-fix: CI of PR #778 is red on
commit messages: commit0bfcade0has the subjectstyle(cli): ..., andstyleis not an accepted type. next: a worker rewords it tochore(cli): ...on the branch.[loop:torbscript] review-fix: new head
9bc887c0. Reworded the tip commit fromstyle(cli): ...tochore(cli): format cli-declaration.test.trb(style is not an accepted type); tools/check-commits.sh origin/main HEAD passes. Tree unchanged. next: wait for CI, then review (argus)[status] PR #778 merged as
972b2015a(fmt fix on top of5643cad70). Post-merge state: CI on the merge commit is still pending, so the change is not yet verified on main; no 'After merge' section in the PR.Next step (not finished in this run): once CI on
972b2015ais green, cut the next release. This repo builds images on x.y.z tags (.forgejo/workflows/release.yml), so the merged code is in no release until a version-bump PR (project.trb, compiler/project.trb, editors/vscode/package.json, version.trb languageVersion) is reviewed and merged by argus, then tag vX.Y.Z on main. Open after CI: check the status on972b2015a, then open the bump PR and request argus.torb login,logout,owner,yankanddeprecateparse their command line withstd/cli(step 6 of #124) #783[loop:torbscript] decided by the loop: step 5 is verified landed on
main: PR #778 merged as5643cad70feat(cli): torb add, remove, update, install, publish, lock, vendor and audit use std/cliand972b2015a(format fix). Closing as done; the PR saidRefs, so the forge did not close it. CI caveat: at 07:10 Berlin CI of972b2015awas still pending (commit messages, what the change touches, gates, pdisc).torbparses its command line withstd/cli(CLI slice 2) #124