interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / tools / name-check / README.md

104 lines · 7489 bytes Raw Blame History Source

name-check

Refuses new uses of the retired project names (ADR 0038): Aienux is the kernel, AienOS is the whole system, and Aienix is retired.

namecheck.om reads a git diff on standard input and judges every added line:

It prints one line per finding and name-check: FAIL (exit 1), or `name-check: PASS (N added lines checked)` (exit 0; an empty diff, where nothing changed, passes with 0 lines). Exit 2 is a clean refusal with nothing judged, and one line on standard output names the reason: the input is not a git diff (an added line or hunk before any diff --git header); a +++ header is neither +++ b/PATH nor +++ /dev/null (a diff made with diff.noprefix, or a file name git C-quotes because it holds a ", \ or control byte); the input cannot be read; a path is longer than 4096 bytes (PATH_MAX); or one line is longer than 16777216 bytes (the largest array the compiler builds). A file the tool cannot judge is refused, never skipped.

Run it

AIEN_OMC=/path/to/pinned/omc sh tools/name-check/gate.sh . [BASE]
# or through the gate entry point:
AIEN_OMC=/path/to/pinned/omc tests/gates/run.sh name-check

gate.sh checks AIEN_OMC against ../zero-legacy/omega.pin (otherwise NOT_RUN, exit 3), writes the change under review to build/change.diff (`git diff -U0 --no-textconv --src-prefix=a/ --dst-prefix=b/from the merge base of BASE, defaultorigin/main, else HEAD~1, to HEAD`; the fixed prefixes override any diff.noprefix or diff.mnemonicPrefix setting), and runs gate.om. gate.om hashes the compiler again with the native sha256.om, builds namecheck.om, and requires six fixtures to give exactly their recorded exit and output, counting those that pass (name_check_fixtures), before it judges the change:

FixtureExitOutputWhat it holds
fixtures/red.diff1red.out (22 findings)every retired form, an AIENIX_ identifier, compounds, a word outside a quotation, unmatched quotes, line numbers inside a hunk, a fake header line, a path with a space, another file whose name starts like ADR 0038's, a longer path that starts with ADR 0038's exact path
fixtures/green.diff0green.outthe new names, identifiers, labels, backslash path parts, file names, every history path (also nested, and ADR 0038 under its exact path), the glossary line, each kind of quotation (also double-backtick code spans)
fixtures/long.diff1long.outone added line of 1000017 bytes with the retired word at its end (longer than one inner loop)
fixtures/refuse.diff2refuse.outa file name git C-quotes
fixtures/nohdr.diff2nohdr.outan added line before any diff --git header
fixtures/pathmax.diff2pathmax.outa +++ path of 4097 bytes

The first four are real git diff output made with the same options as gate.sh; nohdr and pathmax are written by hand, because git cannot produce them. The line-length refusal (a line over 16777216 bytes) has no fixture, so as not to commit 16 MB; it was checked by hand (exit 2).

To check another repository's change with the same tool, build it and pipe that repository's diff in with the same options:

"$AIEN_OMC" < tools/name-check/namecheck.om > /tmp/namecheck && chmod +x /tmp/namecheck
git -C OTHER -c core.quotePath=false diff --no-color --no-ext-diff --no-textconv \
  --src-prefix=a/ --dst-prefix=b/ -U0 "$(git -C OTHER merge-base origin/main HEAD)" HEAD | /tmp/namecheck

The gate runs only in this repository. Another repository would need its own copy or a pin of this tool in its own gate files; that is not done here, because a copied file would have to be kept in step by hand.

Compilers

namecheck.om and gate.om compile with the repository pin, the compiler named in tools/zero-legacy/omega.pin (gate.sh refuses any other, NOT_RUN, exit 3). Every loop bound stays at or under 999999, the largest bound the pinned compiler accepts. A loop that passes its bound stops the program (trap 4), so each long scan is an outer loop of at most 17 passes around an inner loop that ends one pass below its bound (17 x 999998 >= 16777216 bytes).

The bash tool it replaces

This tool replaces the bash name-check.sh of the unlanded branch naming/name-check-gate (90296b21). On real diffs (the reverts of the twelve naming branches of 2026-11-15, which add the retired words back on 681 lines) the Omega tool reports every one of the bash tool's 675 findings, byte for byte, and 6 more: prose compounds such as AIENOS-native that the bash tool passed. It also refuses what the bash tool passed silently: a fake header line inside added text, a diff made with diff.noprefix and C-quoted file names. The bash tool's --allow GLOB option is not carried over: no caller used it, and an allowance outside the tool's own reviewed table would not be reviewed.