Resolve the commit_queue_timeout / unexpected_commit_failure error during parallel elaboration in the commit queue, and verify correctness with unit tests before re-running integration tests.
- Use TDD. Always make sure relevant unit tests run before attempting integration tests (unless for a quick verification or to test assumptions).
- Do not use integration tests to drive correctness.
- If behaviors are odd, ensure the correct logic is established in unit tests for the relevant components.
- Make code and logic testable.
- Rust fast path now handles simple docs with or without explicit
@id; rejects non-Random keys and subdocuments. - Contract construction moved from Prolog to Rust for the fast path.
parallel_elaborationunit tests: 21 passed (debug prints/counter removed).- Relevant unit suites: 105 passed.
- Priority integration tests: 203 passing, 4 pending (no failures):
document-get.js,document-delete.js,document-full-replace.js,document-backlink.js,document-auth.js,document-get-hierarchy.js,document-interval.js,document-read-consistency.js,migration.js,cli-schema-migration.js. parallel_elaborationunit testset_of_people_elaboratesstill passes with a choicepoint warning.- Congestion benchmark (40k docs, 4 writers): ~3.9k docs/s at chunk 1000, ~6.1k docs/s at chunk 5000/10000. Bottleneck is commit-queue serialization, not elaboration or contract construction.
manual/parallel-elaboration-comparison.jsnow runs cleanly in cached mode withPARALLEL_ELIGIBLE=trueby default; uncached mode removed.
Run these first when making changes:
commit_queue_helpersparallel_elaborationjson_preservecommit_queuedocument_id_generationreplace_documentdelete_documentfull_replacedocument_error_reportingdocument_id_capturesubdocument_as_document
Verify these before declaring the fix complete:
test/document-get.js— original failing test; queued insert with simple docs and nestedSet/Optionalreferences.test/document-delete.js— queued delete path.test/document-full-replace.js— queued full-replace path.test/document-backlink.js— backlink handling in queued commits.test/document-auth.js— auth checks with queued commits.test/document-get-hierarchy.js— document hierarchy retrieval after queued commits.test/document-interval.js— interval/document feature.test/document-read-consistency.js— data-version consistency with queued commits.test/migration.js— migration API sanity.test/cli-schema-migration.js— CLI migration path.
test/document-backlink.js— 6 failures withUnhandled exception: unable_to_assign_ids. Appears pre-existing (also fails withTERMINUSDB_PARALLEL_ELABORATION=off). Needs a unit test to reproduce.tests/manual/parallel-elaboration-comparison.js— fails withType error for <atom-id> which should be stringin thecached + disjointconfiguration. Isolated debug scripts using the same data and server settings do not reproduce it; likely triggered by the benchmark's specific startup/sequencing. Needs targeted reproduction.test/document-auth.js— FIXED.add in parallelnow correctly fails withapi:SameDocumentIdsMutatedInOneTransactionafter changingpairs_to_insert_ids_and_captures_to return all non-subdocument IDs from the contract'sid_pairs.test/document-full-replace.js— FIXED. Empty-body queued insert now succeeds after: (a) reading the lazy stream directly incollect_stream_docsand (b) short-circuiting empty pairs inapi_insert_documents_core.
# Relevant unit tests
make test SUITE='[commit_queue_helpers,parallel_elaboration,json_preserve,commit_queue,document_id_generation,replace_document,delete_document,full_replace,document_error_reporting,document_id_capture,subdocument_as_document]'
# Priority integration tests (run from tests/)
cd tests
npx mocha 'test/document-get.js'
npx mocha 'test/document-delete.js'
npx mocha 'test/document-full-replace.js'
npx mocha 'test/document-backlink.js'
npx mocha 'test/document-auth.js'
npx mocha 'test/document-get-hierarchy.js'
npx mocha 'test/document-interval.js'
npx mocha 'test/document-read-consistency.js'
npx mocha 'test/migration.js'
npx mocha 'test/cli-schema-migration.js'- Keep this file updated whenever a new unit or integration test fails.
- Do not remove tests from the lists without a note explaining why.