summaryrefslogtreecommitdiffhomepage
path: root/README.md
AgeCommit message (Collapse)AuthorFilesLines
2026-10-02gleam sisudoc-ocda-libRalph Amissah1-19/+19
2026-10-02README: the reader, in each language, and what writing it foundRalph Amissah1-2/+30
The library's reader, ocda-read: where it lives and why (src/read/, kept out of the library in D by dub configuration, in Gleam because nothing outside src/ is compiled), its modes in each language, and the two properties it holds, the same output from every form and D == Gleam byte for byte. And the one defect it found in the library, the database loader unable to say what it had not read. The module tables gain ocda.inventory and the reader, the build notes the three programs in one result. (assisted by Claude-Code)
2026-10-02a third input form: the abstraction out of a pod archiveRalph Amissah1-7/+31
A pod built with --pod2 carries the abstraction inside it, at media/abstraction/<uid>.<lang>.ssp. So ocda.load gains .sisupod and .zip, and because the dispatch is in one place a writer over the library gained a third input form without being touched. Over the reference collection a .sisupod gives the same model as the .ssp beside it: 36 of 36 document-languages, byte identical dumps. And the text writer, unchanged, renders a document from its .sisupod byte identically to spine --text, 36 of 36. Two small readers, neither of them a library: ocda.zstd declares the four libzstd entry points needed to unwrap a frame, as ocda.sqlite declares sqlite3; ocda.zip reads a central directory and one stored entry. Deflate is refused rather than mishandled, since spine writes stored entries and a library that says it read what it skipped is worse than one that says it cannot. A frame that declares an expansion over 512 MiB is refused before anything is allocated: a reader of an artefact it did not make declines to be told how much memory to take. The Gleam library reads the zip and not the frame. The only zstd on the BEAM is a NIF that clones zstd from github in its own build, so it cannot be built sandboxed without patching it. A .zip pod is read in both languages, a .sisupod in D only, and the Gleam refusal says why and says "zstd -d" rather than claiming the file is malformed. It is a packaging limit, not anything about the format, and the only place the two libraries differ in what they accept. A pod without an abstraction is refused with a message naming the flag that puts one in, because that is a fact about the pod. (assisted by Claude-Code)
2026-10-02ocda-lib in Gleam, and four agreements of 36 of 36Ralph Amissah1-19/+58
The model, both loaders, the dispatch and the canonical dump, in Gleam. A deliberate field-for-field mirror of the D library, including where that is not the most idiomatic Gleam: text is one string with the lines joined by newline rather than a list of lines, and the properties are typed fields rather than a list of pairs. A difference that existed in one language and not the other would show in every dump and mean nothing, so the two lose the same distinctions in the same places. The dump is what makes the agreement testable. Both languages write it byte for byte alike, so four questions are diff, and over the reference collection all four hold: D: .ssp == .ocda.db 36 of 36 Gleam: .ssp == .ocda.db 36 of 36 .ssp: D == Gleam 36 of 36 .ocda.db: D == Gleam 36 of 36 and a fifth, that the two report exactly the same ignored properties with the same counts. The Gleam .ssp loader agreed with the D one at the first attempt. The Gleam .ocda.db loader had one defect of its own, found by the sweep and worth recording because of its shape: a JSON element decoder handled strings and integers and fell through to a fallback that yielded "". table_widths is an integer array except where the columns divide evenly, when it is [33.3333,...], and one table in the collection does that. Its widths came back as three empty strings, so a value that could not be read turned into one that looked read. That is the failure the unknown counts exist to prevent, and a decoder fallback quietly reintroduces it. Shipped as an Erlang shipment rather than an escript, as the .ocda.db reader is and for the same reason: sqlite on the BEAM is a NIF and a NIF cannot load from inside an escript archive. gleam.toml and the model came in with the previous commit, which was about the dump; they belong here. (assisted by Claude-Code)
2026-10-02docs: the repository is sisudoc-ocda-libRalph Amissah1-5/+5
Prefix the repository name, as every other repository of this project's own is prefixed. This one needed it most: "ocda-lib" is a three letter acronym and the word "lib", and in a clone, away from the parent directory that supplied the context, it reads as a generic library belonging to no-one. The dub path-dependency example and the note on where the blank-line fix also went follow the new sibling name. Binary, package and module names are unchanged: ocda-agree and the ocda.* modules are read with the repository already in hand. (assisted by Claude-Code)
2026-09-25the abstraction as a library, and a defect it found at onceRalph Amissah1-0/+84
The readers each read one serialisation and print. A writer needs neither: it needs the document. So the model and both loaders live here, and a writer cannot tell which serialisation it was handed, exactly as spine own writers cannot. ocda.model imports nothing, which is the property that makes writers possible: they depend on the model and on neither loader. The model and the .ssp loader are the ssp-reader code, moved and renamed to the level they belong to: the model is neither the .ssp nor the .ocda.db. ocda.load_db is new, and returns the same value from sqlite that load_ssp returns from text. ocda.load is the one place that decides what a path is. The claim is only true if the two loaders agree, so test/agree.d asks: load a document both ways and compare the models object by object. It found a real defect on its first run. Eight of thirty-six disagreed, and the cause was the .ssp loader, not the formats: an object whose first text line is blank lost it, the loader having decided whether to start a new line by asking whether the accumulated text was empty, which is a different question from whether a line has been seen. Seven documents of the sample set have verse opening on a blank line and every one of them was wrong. Nothing else had caught it: the two .ssp readers were compared on section counts, which the bug does not disturb. It took loading one document two ways and comparing the objects. Fixed here, and in ssp-reader/dlang which carried the same code. 36 of 36 now agree. (assisted by Claude-Code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>