Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/tree/main/tests/osh/vectors # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tests / osh / vectors` `f5c9bd8` train r2: 35 READY PRs in one merge (#972) aien-spark committed 2026-10-30 ``` .. README.md 4200 bash_vectors.tsv 2939 bash_verified.log 3089 bash_verify.sh 3782 expected.txt 1509 v001.in 11 v002.in 19 v003.env 28 v003.in 16 v004.in 12 v005.env 16 v005.in 17 v006.in 18 v007.in 9 v008.in 10 v009.in 19 v010.in 6 v011.env 9 v011.in 16 v012.env 6 v012.in 8 v013.in 9 v014.in 10 v015.in 1106 v016.in 11 v017.in 12 v018.in 11 v019.in 13 v020.in 16 ``` README.md # OSH conformance vectors Status: v1 DRAFT with the ABI. Expected outputs were authored from `../OSH_PLATFORM_ABI.md`; no implementation has run them yet (spec section 14, item 6). Inputs are generated by `../tools/make-vectors.sh`; `expected.txt` is committed by hand. ## Files per vector `vNNN` - `vNNN.in`: the exact input bytes handed to the core, newline-terminated unless the vector says otherwise. May contain NUL and bytes >= 0x80. - `vNNN.env` (optional): answers to variable requests, one per line, raw bytes to end of line (a value cannot contain a newline). `NAME=VALUE` sets a variable. Lines starting with `@` set specials: `@status=N` is the value of `$?` for every request, `@arg0=` to `@arg9=` set positional parameters (the number of `@argK` lines present, counting from `@arg1` with no gaps, is `$#`). A name with no line is unset. The harness never executes pipelines. After each `PIPELINE_READY` it records the request, then calls `expand_run` again, treating `$?` as the fixed `@status` (default 0). ## expected.txt line grammar ``` ok [lex_resumes=N] | P conn=<0-3> | C b=<0-6> argv=,... as==,... rd=:,... refuse off= more ``` - A pipeline is `P`; its commands follow as `C` in order, each preceded by `|`. Lists of argv, assignments and redirections are comma separated; an empty list is written as nothing after `=`. - `` is a double-quoted byte string; `\"`, `\\`, `\xHH` escape `"`, `\` and any byte outside 0x20 to 0x7E. `"a"*1100` means 1100 repetitions. - Redirection `` is `IN`, `OUT`, `APPEND` or `DUP`; `` the redirected descriptor; `` a ``, or for `DUP` the source descriptor number. - `more` means the final call returned `NEED_MORE_INPUT` with no further input available. - `lex_resumes=N` is the exact number of `BUDGET_EXHAUSTED` returns the lexer gave before `PHASE_DONE`. - A core conforms when every line matches byte for byte. Refusal offsets follow spec section 5.4. ## Local additions (not yet in aien-protocols) v016 to v020 were added in omega PR #336 for the codes 236 `GROUP`, 246 `BRACE_EXPANSION` and 247 `POSITIONAL_RANGE`, which the ABI draft does not number yet (it reserves 246 to 255). They should go upstream with the ABI amendment. ## Bash-verified vectors (omega PR #336 review fixes) `bash_vectors.tsv` holds 60 lexer vectors whose expectations come from real GNU bash 5.2, not from the reference tokenizer. Columns (TAB separated): id, input, expect, equiv. `bash_verify.sh` runs both the input and its continuation-free equivalent (or, when equiv is `-`, the script rendered from the expected tokens) under bash and requires identical transcripts (stdout, stderr, files written); the result is recorded in `bash_verified.log` (first lines: the bash version and path, 5.2.21 when written, and the pinned environment). The script re-executes itself under `env -i` with `PATH=/usr/bin:/bin LC_ALL=C TZ=UTC` (TMPDIR kept), so the caller's locale and exported variables cannot change the reference answers (omega#344). `make osh-bash-verify` runs it. The lexer driver then checks the lexer against the same expect column and also lexes the equivalent script, so the OSC lexer, the C reference and bash are three separate oracles for backslash-newline handling. Findings pinned here: backslash-newline is removed before the next byte is classified, mid-operator (`|\|` is `||`, `a>\>f` is `>>`, `2\>f` redirects fd 2, `1\2>f` is fd 12), after `$` (`$\$`, `"$\(`, `$\{`), in tilde and brace detection, inside double quotes, and not inside single quotes. A backslash in a comment is literal: `# c\e b` runs `e b`. `x+=1` is an append assignment and `$_` the last-argument parameter; both are refused (248 `APPEND_ASSIGN`, 225 `SPECIAL_PARAM`). New local code 249 `APPEND_ASSIGN` (248 is SYNTAX_EOF in the parser unit) is not in the ABI draft yet (it reserves 246 to 255); it goes upstream with 236, 246 and 247. A final lone backslash waits for the next byte (status 100, the backslash is not consumed) unless the host sets the lexer cell S_EOI (28), when it is a literal backslash.