Repository navigation
Align with arocapi 5 and rewrite the README in its terms - #63
Merged
Merged
Conversation
…ents through arocapi (#59)
…ents The search indexer finds a crate's rows, and each document's rootCollection, with one query by meta.crateId, so the database indexer no longer hands it the ids it wrote. SearchIndexer.count counts search documents through arocapi's search backend, so the crates page shows OpenSearch's state again. Indexing runs database then search, and deleting search then database, by fixed lists; deleting a crate's database index deletes its search documents too. The top-collection walk reads parent crates as plain JSON, sharing the memberOf lookup with pickSingleMemberOf.
ocflStorage and ocflTestbed in test/app.ts import crates into a new OCFL repository and build the app over it; capturingLogger in test/logs.ts is the logger mock's factory. The admin action tests use the indexer's rowIds and countDocuments, and one test for reindexing or deleting a crate of a distributed collection.
Rows from before meta.crateId don't record their crate, so deleting by crate missed them and indexing them again failed on duplicate ids.
… and first id INDEX_TYPES and IndexType type the indexers, their orders and states, and the admin page's columns. memberOf uses firstStringOrId, which now takes a single value or an array.
One request for all of a crate's ids fails past OpenSearch's default max_terms_count of 65,536, which broke the admin listing.
…nd indexing Without the refresh, reading a crate's state straight after deleting its documents counted them again and cached it as indexed, and indexing finished before its documents were searchable. One refresh per crate, rather than waiting on every bulk request, as each text file is indexed in its own. Tests now use the backend as production does.
…n it has no rows A crate whose database indexing failed logged a warning for every entity.
This was referenced Nov 4, 2026
Closed
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns ldacapi with arocapi 5 where it had drifted, and rewrites the README, glossary and ADRs in arocapi's terms (spec #52).
Closes #55, closes #57, closes #59, closes #60, closes #61, closes #62. Part of #52, #56 and #58 (manual checks below still to do).
Summary
What clients and admins see:
How a crate is indexed and deleted now:
Also:
/api/*. arocapi's delivery headers (sandbox CSP plus nosniff, with audio and video left out) reach the client./api, with a comment saying why.GLOSSARY.mdgains Crate, Import, Index, Database index and Search index.CLAUDE.md's arocapi upgrade note now says to recheck the README's links.Changes from the spec, decided during the run:
pnpm crates:importinstead ofpnpm import. A built-in pnpm command takes precedence over a script of the same name.recordTypefacet holds the readable labels. Oni can't label facet values, soentityTypestays the class URI as a filter only.Test seams:
buildTestApp/ocflTestbed(whole app,test-dataimported and indexed), the admin action tests, and the licence tests against a fake REMS.Evidence
rootCollectionwas itself, and nested distributed crates pointed at themselves.total.pnpm lintis clean, andpnpm testpasses 225 tests in 25 files. New and changed tests:A local
caddy:2running the newdeploy/Caddyfilein front of a stub passed arocapi's CSP and nosniff through unchanged. Audio arrived with no CSP.Still to check by hand:
Known and not fixed:
meta.crateIdhave no database index. arocapi owns the Entity model, so our Prisma schema can't add one. These lookups scan the entity table, which is fine at the current size.Merge Danger
Door: two-way
Reverting means rebuilding the indexes again (
pnpm index), and stored data has no migration in either direction.Blast Radius: API clients
These are breaking changes for anything reading
rootCollectionor faceting ontype, and Oni's configuration changes with them. The search mapping changes too. On upgrade, delete the OpenSearch index (see the README's upgrade steps) and runpnpm index.pnpm indexnow deletes and rebuilds both indexes.