<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sisudoc-ocda-lib/dlang/test, branch orgify2</title>
<subtitle>SiSU Spine: tools</subtitle>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-ocda-lib/'/>
<entry>
<title>track</title>
<updated>2026-10-03T01:39:24+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-10-02T19:01:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-ocda-lib/commit/?id=afcdcd2e99b5d06f8b3dd9d43b5fd2033e46b9ed'/>
<id>afcdcd2e99b5d06f8b3dd9d43b5fd2033e46b9ed</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ocda-dump, and the four disagreements it found</title>
<updated>2026-10-03T01:38:08+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-09-26T01:02:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-ocda-lib/commit/?id=64571ec14438e85d740ede5810a6f3a5cca88fe3'/>
<id>64571ec14438e85d740ede5810a6f3a5cca88fe3</id>
<content type='text'>
The agreement check compared ten fields of each object. That was enough
to find the blank-first-line defect and not enough for anything
subtler, so this adds ocda-dump: the whole loaded model written out
canonically, every field, sorted dictionaries, sections in format
order, defaults omitted. It is an oracle, not an output format. Two
implementations of this model can now be compared with diff.

Run against the reference collection it found four disagreements
between the two loaders, none of which the ten-field check could see.

1. .identifier and .anchor. The .ssp emits a property only when it
   carries information, so the identifier is absent when it is simply
   the ocn and the anchor is absent when it is the segment name; the
   database stores both unconditionally. Over one document that is
   1,314 identifiers and 69 anchors. The loader now derives them, which
   is what the model means: an object's identifier is its ocn unless it
   says otherwise.

2. make and doc_has. The database has one metadata table where the
   text form has three blocks, and tells them apart by a key prefix.
   The loader now unprefixes them, so a writer asks doc.make["footer"]
   whichever serialisation it was handed and never
   doc.metadata["make.footer"].

3. The JSON columns were read by a character scan that stripped
   brackets and quotes, which is wrong the moment a value holds an
   escape: JSONValue.toString escapes "/" as "\/", so every heading
   containing a slash came back with a backslash in it. All 36
   document-languages differed on heading_ancestors_text. Now parsed as
   JSON.

4. translation.ocn_aligned is in the database and not in the .ssp,
   legitimately: it says whether the languages share one numbering, and
   a .ssp is one language and cannot know. It is a fact about the file
   rather than the document, so the loader leaves it out rather than
   letting a writer tell which serialisation it was given.

Metadata values are also stripped now, as the text loader strips them:
one topic_register value carried surrounding spaces in the database
that the text form cannot represent.

After all four: 36 of 36 document-languages give byte identical dumps
from their .ssp and from their .ocda.db.

(assisted by Claude-Code)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The agreement check compared ten fields of each object. That was enough
to find the blank-first-line defect and not enough for anything
subtler, so this adds ocda-dump: the whole loaded model written out
canonically, every field, sorted dictionaries, sections in format
order, defaults omitted. It is an oracle, not an output format. Two
implementations of this model can now be compared with diff.

Run against the reference collection it found four disagreements
between the two loaders, none of which the ten-field check could see.

1. .identifier and .anchor. The .ssp emits a property only when it
   carries information, so the identifier is absent when it is simply
   the ocn and the anchor is absent when it is the segment name; the
   database stores both unconditionally. Over one document that is
   1,314 identifiers and 69 anchors. The loader now derives them, which
   is what the model means: an object's identifier is its ocn unless it
   says otherwise.

2. make and doc_has. The database has one metadata table where the
   text form has three blocks, and tells them apart by a key prefix.
   The loader now unprefixes them, so a writer asks doc.make["footer"]
   whichever serialisation it was handed and never
   doc.metadata["make.footer"].

3. The JSON columns were read by a character scan that stripped
   brackets and quotes, which is wrong the moment a value holds an
   escape: JSONValue.toString escapes "/" as "\/", so every heading
   containing a slash came back with a backslash in it. All 36
   document-languages differed on heading_ancestors_text. Now parsed as
   JSON.

4. translation.ocn_aligned is in the database and not in the .ssp,
   legitimately: it says whether the languages share one numbering, and
   a .ssp is one language and cannot know. It is a fact about the file
   rather than the document, so the loader leaves it out rather than
   letting a writer tell which serialisation it was given.

Metadata values are also stripped now, as the text loader strips them:
one topic_register value carried surrounding spaces in the database
that the text form cannot represent.

After all four: 36 of 36 document-languages give byte identical dumps
from their .ssp and from their .ocda.db.

(assisted by Claude-Code)
</pre>
</div>
</content>
</entry>
<entry>
<title>the abstraction as a library, and a defect it found at once</title>
<updated>2026-09-25T20:34:44+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-09-25T20:34:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-ocda-lib/commit/?id=0e2c9fa40ed98ceb7a26c2af69807cf577b6e32a'/>
<id>0e2c9fa40ed98ceb7a26c2af69807cf577b6e32a</id>
<content type='text'>
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) &lt;noreply@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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) &lt;noreply@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
