Repository navigation
did2 sqlitedb: a file store (ingestion) - #215
Conversation
files.file_info locations with ingest true are copied into <database folder>/files/<uid> on add (the legacy layout), recorded in a files table, and found again by hasFile / filePath; ingest false is recorded and read where it is. Refusals (unsafe uid, missing source, non-file location, uid stored with other bytes) leave nothing written; removal deletes the bytes a document ingested unless another document records the same uid. A database from before the store gains it on open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
The seven subject.type kinds (#84, signed 2026-10-02) are staged with empty nodes like the other bound value sets; #84 did not raise the number because the did-schema gates run this sweep without --enforce, so it surfaced only in DID-matlab's quick gate (VH-Lab/DID-matlab#215). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
|
The fix is Waltham-Data-Science/DID-schema#87, which raises the baseline to 93. It's on the same-named did-schema branch, so this job picks it up. I've re-run the failed job once against it. Generated by Claude Code |
|
The re-run got past the ontology-term guard, so DID-schema#87 fixes that part. It then failed 78 migrator tests, for a reason that isn't this PR's either.
The tests this PR adds ( No fix exists here: it needs the migrators brought up to the #73 schema, which is separate work. Generated by Claude Code |
|
No fix belongs in this PR. I haven't re-run this ~5 h job: the one re-run went to the quick gate above. Generated by Claude Code |
did2.database.sqlitedbstored documents only. The legacydid.implementations.sqlitedbcopies files into<db folder>/files/<uid>, but that was never ported to V2. So a V2 writer that creates bytes, like the Haley V2 import's masks and tracks, had nowhere to put them. NDI'sdid2sqliteerrors on any file not recorded by location.What changes
Ingestion
add, everyfiles.file_infolocation withingesttrue is copied into<db folder>/files/<uid>. This is the same layout as the legacy backend, so NDI'sfile_directoryis unchanged.filestable.delete_originalremoves the source only after the documents are committed.ingestfalse is recorded and read where it is.Lookup:
hasFile,filePathandfileNames.filePathraises an error that names the missing piece (noSuchFile,fileNotHere,missingDocument) and never returns an empty path.Refusals instead of warnings: these are errors, and nothing in the batch is written. Files already copied for it are deleted.
file;The legacy backend warned and stored the document anyway, which left a document whose file was missing.
Removal: deletes the bytes a document ingested, unless another document still records the same uid.
Older databases gain the
filestable when opened.CI:
testSqliteDbFilesadds 14 tests.test-builder.ymlnow also runstestSqliteDb*and triggers on+did2/+databasechanges.🤖 Generated with Claude Code
https://claude.ai/code/session_01FxKLA8Tbf9cpvDe7fuVeKf
Generated by Claude Code