From eeabf6216fde5f387d6173da93d0df882ed8a34e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 21 Sep 2026 12:49:54 -0400 Subject: test: ocn alignment check Asserts the two known divergences in live-manual's translations by name and value: ja two objects short of en, and pl's ocn 313 a paragraph in English and a heading in Polish. It asserts that nothing else is reported: exactly one document warned about, exactly two languages of it. Also the exit codes: 0 without --strict, non-zero with it on the diverging document, and 0 with it on a single language document. It will fail when those two translations are mended, which is the right moment to hear about it, and the message names the expectation that went stale. test-abstraction-db.sh excludes translation.ocn_aligned from its header block comparison, with the other two keys that are the database's notes about the artefact rather than properties of the document. (assisted by Claude-Code) --- test/test-abstraction-db.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/test-abstraction-db.sh') diff --git a/test/test-abstraction-db.sh b/test/test-abstraction-db.sh index 2fac414..78c27b9 100755 --- a/test/test-abstraction-db.sh +++ b/test/test-abstraction-db.sh @@ -234,7 +234,11 @@ for ssp in $(find "$OUT_DIR/pod" -name "*.ssp" 2>/dev/null | sort); do done # the header blocks: every @source/@meta/@make/@doc_has property in the .ssp - # must be in the database under its own key, with the same value. this is + # must be in the database under its own key, with the same value. the three + # excluded keys are the database's own notes about the artefact rather than + # properties of the document: what it was built from (source.filename, + # source.ssp_digest) and how its languages compared once they had all been + # read (translation.ocn_aligned), which no single .ssp can state. this is # what catches a header property that reaches one artefact and not the # other, which a count of objects cannot see. awk ' @@ -249,7 +253,7 @@ for ssp in $(find "$OUT_DIR/pod" -name "*.ssp" 2>/dev/null | sort); do ' "$ssp" | sort > "$OUT_DIR/.sspmeta.$$" sqlite3 -separator "$(printf '\t')" "$db" \ "select key, value from metadata where doc_id=$did and key not in - ('source.filename','source.ssp_digest');" \ + ('source.filename','source.ssp_digest','translation.ocn_aligned');" \ 2>/dev/null | sort > "$OUT_DIR/.dbmeta.$$" if ! diff -q "$OUT_DIR/.sspmeta.$$" "$OUT_DIR/.dbmeta.$$" > /dev/null 2>&1; then [ $doc_fail -eq 0 ] && echo "$base" -- cgit v1.2.3