interplane.Get Omega
Read in your language

omtex

aien-dev/omtex

Brought by drakestapleton

branch main Branches Tags History

omtex / README.md

122 lines · 5818 bytes Raw Blame History Rendered
1# omtex: write papers in Omega, publish LaTeX and PDF
2
3## Human-Directed Agentic Engineering
4
5Development follows Human-Directed Agentic Engineering (HDAE): humans define goals,
6architecture, constraints, acceptance criteria, and stopping points; agents implement,
7execute checks, diagnose failures, and revise within those boundaries. Human review
8retains responsibility for claims, acceptance, and release decisions.
9
10For the documented method and a systems-software case study, see Gregory M. Kurtzer,
11[*Ginux: Building an Independent Kernel That Runs Linux Userspace through
12Human-Directed Agentic Engineering* (2026)](https://doi.org/10.5281/zenodo.23682548).
13
14
15omtex is an Omega library (`lib/omtex.om`). A paper is an Omega program that calls omtex words such as
16`title`, `section`, `para`, `equation`, `figure`, `table`, `bibitem` and `omlisting`. Compiled with the
17pinned seeded compiler, the program writes the paper's LaTeX to stdout. `pdflatex` then makes the PDF.
18
19- **Escaped or refused, never passed through.** Prose uses a small markup (`*emph*`, `**bold**`,
20 `` `code` ``, `$math$`, `[@cite]`, `[#ref]`, `"quotes"`, `~` tie). Everything else is escaped. A byte
21 the library cannot render safely stops the program with `omtex: refused element N: <reason> at byte B`
22 and exit 111. Math passes only a check: balanced braces, no `% $ #`, and no `\input`, `\write`, `\def`
23 or other deny-listed control sequences.
24- **Omega listings are compiled.** `omlisting` bodies must compile with the pinned `omc` (rc 0).
25 `omrefuse N` + `omlisting` must be refused with error N. `omfragment` is shown and reported as
26 NOT_CHECKED. A failed check stops the build (exit 113). Highlighting uses an `Omega` `listings`
27 language generated from the compiler's own keyword table.
28- **Deterministic.** The same source gives the same `.tex`, and with `SOURCE_DATE_EPOCH` the same PDF bytes.
29
30Design and rationale: [`docs/DESIGN.md`](docs/DESIGN.md). omtex is a library, not a `target latex` in omc.
31
32## Quick start
33
34Needs Linux AArch64 (the pinned omc emits arm64 ELF), `git`, `sh`, and TeX Live with `cm-super`
35(see [`DEPENDENCIES.md`](DEPENDENCIES.md)).
36
37```sh
38git clone https://github.com/aien-dev/omtex.git && cd omtex
39tools/build.sh examples/hello/hello.om build/hello # fetches the pinned omc on first use
40tests/run.sh # TESTS pass=59 fail=0 not_run=0
41```
42
43`tools/build.sh` checks the omc sha256 against `tools/pin.sh` and refuses any other compiler. Set `OMC`
44to use an existing copy of the pinned `seed/out/omc`. The build:
45
461. concatenates `lib/omtex.om` with the paper (Omega has no imports yet) and compiles it;
472. runs the program to produce `paper.tex`;
483. runs `paper.gen check OMC DIR` to compile every Omega listing;
494. runs `pdflatex` (and `bibtex` if the paper uses it) until references settle. An unresolved
50 reference fails the build.
51
52## A paper
53
54```
55text o1 "11pt"
56text c1 "article"
57text fe "fontenc"
58text fo "T1"
59text t1 "Hello from *Omega*"
60text a1 "M. Drake Stapleton"
61text s1 "Intro"
62text l1 "sec:intro"
63text p1 "Costs 5% & more_stuff, see Section[#sec:intro]; \"quoted\" and `a_b{c}` and $x^2 + y_{i}$ and **bold *nested* bold**."
64fn main to int
65docclass o1 c1
66usepkgo fo fe
67title t1
68author a1
69begindoc
70maketitle
71sectionl s1 l1
72para p1
73enddoc
74ret 0
75end
76```
77
78This is `examples/hello/hello.om`. Each word takes the names of Omega `text` constants as arguments.
79
80| Phase | Words |
81|---|---|
82| preamble | `docclass opts cls`, `usepkg name`, `usepkgo opts name`, `preamble line`, `omlang`, `title`, `author`, `date` |
83| document | `begindoc`, `maketitle`, `docabstract`, `enddoc` |
84| structure | `section`, `sectionl t label`, `sectionn` (unnumbered), `subsection`, `subsectn` |
85| text | `para`, `paran` (no indent), `prose` (does not end the paragraph), `parbreak`, `rawtex` (math-checked) |
86| lists | `itemize`, `itemizeo opts`, `enumerate`, `item`, `endlist` |
87| math | `equation`, `equationl label m`, `displaymath`, `align` |
88| floats | `figure path caption label`, `table caption label spec`, `cell`, `row`, `hline`, `endtable` |
89| references | `bibbegin`, `bibitem key text`, `bibtex style file` |
90| listings | `codelang name`, `listing`, `omlisting`, `omrefuse rc`, `omfragment` (each `caption label body`) |
91
92Examples:
93- `examples/omega-language`: reproduces the published *Omega* paper (Zenodo 23547811).
94- `examples/turing-brief`: reproduces *The Turing* brief from aienos.com.
95- `examples/listings`: feature tour, with listings checked by the compiler, a table, a figure, a
96 bibliography and math.
97
98## Reproductions
99
100Both papers were reproduced from Omega source. In each case the PDF text matches the published PDF
101with 0 differing lines, and every page is pixel-identical to the original `.tex` built with the same
102pdfTeX. Details, including the remaining source-level differences, are in
103[`evidence/REPRODUCTION.md`](evidence/REPRODUCTION.md). Run the comparison with `tools/compare.sh`.
104
105## Zenodo
106
107`tools/zenodo-draft.sh` creates an unpublished draft (`new`) or a new-version draft of a published
108record (`newversion`), uploads the PDF, and checks the md5. `show` and `discard` also exist. It
109**never publishes**: any URL containing `publish` is refused, and the run fails unless the deposition is
110still an unsubmitted draft afterwards. Publishing is done by a person in the Zenodo web UI.
111
112```sh
113atlas-vault run ZENODO_TOKEN -- sh tools/zenodo-draft.sh new build/listings/paper.pdf examples/listings/zenodo.json
114atlas-vault run ZENODO_TOKEN -- sh tools/zenodo-draft.sh newversion 23547811 build/omega-language/paper.pdf
115```
116
117`--sandbox` uses sandbox.zenodo.org with `ZENODO_SANDBOX_TOKEN`. Runs against zenodo.org are in
118`evidence/zenodo-*.txt`.
119
120## License
121
122Apache License 2.0 with LLVM Exceptions; see `LICENSE` and `NOTICE`.