Close the BareOS shell + Fish REPL roadmap tracker and ship the remaining
shell surfaces in-tree. Roadmap / CI - docs/data/shell-roadmap-features.json: all shell-001…shell-100 rows and P1–P8 phases marked implemented; note documents closure date and pointers. - scripts/verify-shell-roadmap.mjs: validate JSON (schema 1, 8 phases, 100 implemented items) plus existing source needles; wire npm run verify:shell-roadmap into root pretest (package.json). - scripts/README.md: document verifier behavior. Lexer & expansion (packages/bare-os-booter/lib) - shell-lex.js: central lexShellLine; ANSI-C $'…' via decodeBareOsDollarQuote; keep diagnostics/tokenizer aligned with execution tokenizer. - shell.js: stray reserved words at statement start → syntax error exit 2; optional [[ … ]] when BARE_OS_SHELL_DOUBLE_BRACKET=1 (==, !=); alias expansion before function dispatch (ordering tests); expandWordWithCmdSubst: balanced $(…) vs skipped $((…)); backtick command substitution when BARE_OS_SHELL_CMDSUBST; default ctx.execLine for nested cmdsubst when unset; index passthrough for DOUBLE_BRACKET env. - shell-glob.js: ~login → HOME when USER matches, else /home/login (bounded login pattern); tests for pathname + execShellLine. - shell-tokenizer.js: align with shell-lex detailed spans/modes where needed. Completion / REPL - completion-engine.js: completion depth / collectors per shell program work. - packages/bare-os-booter/index.js: small wiring for shell env passthrough. /bin/sh front-end - packages/bare-os-coreutils/src/sh.js; kernel/bin/sh; seeder copies: stay in sync with shell behavior and env flags. Tests - packages/bare-os-booter/test.js: coverage for misplaced reserved words, gated [[ ]], alias vs function, ~user/~~ paths, $'…', cmdsubst $(…) and backticks, and related regressions. Documentation - docs/reference/shell-grammar.md: $'…', $(…) / backticks vs $((…)). - handbook/09-posix-utilities-shell-and-vfs.md, environment appendix, shell-troubleshooting / shell-unsupported-behavior, release checklist, docs/reference/README.md: shell behavior and operator surfaces. - developer-guide/19-how-to-fish-keybinding-completer.md: Fish keybinding / completer how-to (new). Generated / synced artifacts - kernel/lib/bare/manifest.json, kernel/share/man/man.json, kernel/lib/bare/shell-completion.json, posix_utilities.json, docs/audit/bundle-health.json: regenerated or synced with tooling. - scripts/bench-shell-phases.mjs: bench script touch.
This commit is contained in:
@@ -122,7 +122,7 @@ flowchart LR
|
||||
lists --> pipes --> param --> globs --> subst --> stage --> cap
|
||||
```
|
||||
|
||||
**Interactive REPL (TTY):** when **`BARE_OS_SKIP_REPL`** is off and `**BARE_OS_FISH` ≠ `0**`, the booter uses a Fish-style line editor with **tab completion** (commands, flags from **`/share/man/man.json`**, paths, `**kill`/`wait**` targets, env vars, and optional **`ctx.bareOsRegisterCompleter`** hooks), **ghost** history hints, and per-user history on the personal drive. Canonical detail: [Shell completion and REPL editor](../docs/reference/shell-completion-and-repl-editor.md). The **`/bin/sh`** utility only **executes script files** via **`execLine`** (same language as this interactive shell); it is **not** the REPL itself — see **`man bare-os-shell`** vs **`man sh`**.
|
||||
**Interactive REPL (TTY):** when **`BARE_OS_SKIP_REPL`** is off and `**BARE_OS_FISH` ≠ `0**`, the booter uses a Fish-style line editor with **tab completion** (commands, flags from **`/share/man/man.json`**, paths, `**kill`/`wait**` targets, env vars, and optional **`ctx.bareOsRegisterCompleter`** hooks), **ghost** history hints, and per-user history on the personal drive. Canonical detail: [Shell completion and REPL editor](../docs/reference/shell-completion-and-repl-editor.md). The **`/bin/sh`** utility only **executes script files** via **`execLine`** (same language as this interactive shell); it is **not** the REPL itself — see **`man bare-os-shell`** vs **`man sh`**. Shell **operator tokenization** (including **`;;`**, **`;&`**, **`|&`**, **`>&`**) is centralized in **`shell-lex.js`** and summarized in [shell-grammar.md](../docs/reference/shell-grammar.md); roadmap status lives in [shell-roadmap-features.json](../docs/data/shell-roadmap-features.json).
|
||||
|
||||
**Top-level syntax:** the line is split on **`;`** into separate lists (semicolons **inside** compound blocks do not end the outer statement). **`if`** **`then`** **[** **`else`** **]** **`fi`** uses the same `**&&**` / `**||`** / pipeline rules inside the condition and each branch; the condition is true when the last evaluated command in that `**&&`/`||**` list exits **0**. **`while`** **`list;`** **`do`** **`list;`** **`done`** and **`for`** **`name`** **`in`** **words** `**;`** **`do`** **`list;`** **`done`** repeat the body while respecting **`BARE_OS_SHELL_LOOP_MAX`**. **`case`** **`word`** **`in`** **`pattern)`** **`list`** **`;;`** … **`esac`** matches the first pattern (token-safe); patterns support **`|`** alternation and fnmatch-style **`*`**, **`?`**, and **`[…]`** (excluding **`|`** branches handled separately). Branch count is capped by **`BARE_OS_SHELL_CASE_MAX_BRANCHES`**. Each list is an **AND-OR** chain: **pipelines** separated by **`&&`** or **`||`**, evaluated left-to-right with POSIX-style short-circuiting (**`ctx.exitCode`** — treat missing as **0**). Within a pipeline, `**|`** connects stages as before (simulated stdin between utilities).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user