From 513a1490084e2679670dd6241e1473c3c221f1ff Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 8 Sep 2026 12:21:31 -0400 Subject: ocda db: .ocda.db, and a script to run 4 tests The per document database is now written as .ocda.db rather than .abstraction.db. Shorter, and it says what is in the file: the object centric document abstraction, not "some abstraction". .ocda.db pairs with .ssp and cannot be mistaken for the collection search database (spine.search.db). test/run-tests.sh runs the four in sequence, one line of result each, and a summary. It re-runs itself inside nix shell "nixpkgs#sqlite" if sqlite3 is not on PATH, so this is all that is needed: SpinePOD=../../markup/sisudoc-spine-samples/markup/pod-samples/pod \ ./test/run-tests.sh ./bin/spine-ldc The tests are independent (with test-abstraction-ssp.sh run first): 1 test-abstraction-ssp.sh is first because it is the one that says whether the abstraction itself moved; if it fails the others are answering a different question than you think 2 test-abstraction-ssp-roundtrip.sh reads the committed reference set, so it is a statement about the current binary only if 1 passes 3 test-abstraction-db.sh and 4 test-abstraction-db-roundtrip.sh generate both artefacts themselves and depend on nothing committed (assisted by Claude-Code) --- src/sisudoc/ocda/abstraction/db_in.d | 2 +- src/sisudoc/outputs/io_out/create_abstraction_db.d | 2 +- src/sisudoc/spine.d | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sisudoc') diff --git a/src/sisudoc/ocda/abstraction/db_in.d b/src/sisudoc/ocda/abstraction/db_in.d index 02007b8..f223f6d 100644 --- a/src/sisudoc/ocda/abstraction/db_in.d +++ b/src/sisudoc/ocda/abstraction/db_in.d @@ -49,7 +49,7 @@ +/ module sisudoc.ocda.abstraction.db_in; @safe: -/+ ↓ read a .abstraction.db back into the document abstraction +/+ ↓ read a .ocda.db back into the document abstraction the counterpart of sisudoc.outputs.io_out.create_abstraction_db, and the sibling of sisudoc.ocda.abstraction.ssp_in: it returns the same value, diff --git a/src/sisudoc/outputs/io_out/create_abstraction_db.d b/src/sisudoc/outputs/io_out/create_abstraction_db.d index cc90cb3..e862aba 100644 --- a/src/sisudoc/outputs/io_out/create_abstraction_db.d +++ b/src/sisudoc/outputs/io_out/create_abstraction_db.d @@ -79,7 +79,7 @@ template spineAbstractionDb() { } catch (Exception ex) { } string db_file = ((base_pth.chainPath( - doc_matters.src.doc_uid_out ~ ".abstraction.db")).asNormalizedPath).array; + doc_matters.src.doc_uid_out ~ ".ocda.db")).asNormalizedPath).array; /+ ↓ remove existing file to start fresh +/ try { diff --git a/src/sisudoc/spine.d b/src/sisudoc/spine.d index 4695c60..a1b30bd 100644 --- a/src/sisudoc/spine.d +++ b/src/sisudoc/spine.d @@ -276,7 +276,7 @@ string program_name = "spine"; "odt", "open document format text", &opts["odt"], "output", "=/path/to/output/dir specify where to place output", &settings["output"], "ssp-round-trip", "=/path/to/file.ssp read a .ssp back and re-emit it on stdout", &settings["ssp-round-trip"], - "db-round-trip", "=/path/to/file.abstraction.db read it back and emit .ssp on stdout", &settings["db-round-trip"], + "db-round-trip", "=/path/to/file.ocda.db read it back and emit .ssp on stdout", &settings["db-round-trip"], "parallel", "parallelisation", &opts["parallel"], "parallel-subprocesses", "nested parallelisation", &opts["parallel-subprocesses"], "pdf", "latex output for pdfs", &opts["pdf"], @@ -399,7 +399,7 @@ string program_name = "spine"; stdout.flush; exit(0); } - /+ ↓ read a .abstraction.db back into the abstraction and emit it as + /+ ↓ read a .ocda.db back into the abstraction and emit it as .ssp on stdout. compared against the .ssp for the same document, this says whether the two artefacts really do carry the same thing +/ -- cgit v1.2.3