feat(moshscript): R8 error convention, shell() verb, TUI /run options - #19
Merged
Conversation
- R8 [P0]: CLI verbs return { ok: false, code } on non-zero exit instead
of throwing, so scripts can branch on outcomes without try/catch.
Only truly fatal spawn errors (ENOENT) still throw.
- R6: Add shell(cmd) verb — runs $SHELL -c <cmd> (blocking, spawnSync),
returns { ok, code }. Honors --dry-run.
- R3: TUI /run now accepts --max N and --dry-run flags, matching the CLI
entrypoint. Both share DEFAULT_MAX=3.
- Tests: 8 new tests covering R8 error convention, shell() in dry-run,
shell() with real commands, and shell() from moshscript.
- README: document shell() verb, error handling convention.
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
Contributor
Author
ralyodio
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #18 — completing moshscript implementation (issue #16)
The prior PR was a starting point. This addresses the remaining gaps from PRD 0004:
R8 [P0] — Error convention
CLI verbs now return
{ ok: false, code }on non-zero exit instead of throwing, so scripts can branch on outcomes withouttry/catch:Only truly fatal spawn errors (ENOENT) still throw. This prevents a single failing verb from crashing the entire script mid-
while (alive)loop.R6 —
shell()verbAdded
shell(cmd)to the moshscript vocabulary — runs$SHELL -c <cmd>(blocking, spawnSync with inherited stdio). Returns{ ok, code }following the R8 convention. Honors--dry-run.R3 — TUI
/runoptions parityTUI
/runnow accepts--max Nand--dry-runflags, matching the CLI entrypoint. Both shareDEFAULT_MAX=3.Tests
8 new tests covering:
{ ok: false }, script continuesshell()verb: dry-run narration, real execution, error returns, moshscript integrationDocs
shell()verb + error handling convention/help: updated to showshell()and/runoptionsRefs #16