insipx/db integrity 4 node bindings - #4032
Conversation
|
Claude finished @insipx's task —— View job PR Review CompleteReview Date: 2026-08-27 15:47 UTC SummaryThis PR cleanly adds database integrity check APIs to the Node bindings. The implementation is solid with good error handling, proper off-event-loop execution, and adequate test coverage. Two minor improvements recommended below. Findings1. Inconsistent error handling between The standalone function converts Current: .map_err(|e| Error::from_reason(e.to_string()))?Suggested: .map_err(ErrorWrapper::from)?2. Missing test coverage for malformed encryption key error path (bindings/node/test/Integrity.test.ts) The standalone function validates 32-byte keys at integrity.rs:60-64, but the test suite doesn't verify that wrong-length keys return "Malformed 32 byte encryption key". The existing "wrong key" test (line 66-74) validates wrong contents, not wrong length. Consider adding: it('rejects malformed encryption key', async () => {
const user = createUser()
const client = await createRegisteredClient(user)
await client.close()
const shortKey = new Uint8Array(16)
await expect(checkDatabaseIntegrity(dbPathFor(user), shortKey))
.rejects.toThrow('Malformed 32 byte encryption key')
})Positive observations
|
07a50b5 to
23e7175
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## insipx/db-integrity-3-client-method #4032 +/- ##
======================================================================
Coverage ? 85.96%
======================================================================
Files ? 421
Lines ? 68882
Branches ? 0
======================================================================
Hits ? 59211
Misses ? 9671
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3ce2217 to
3febf9b
Compare
3febf9b to
0c060df
Compare
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds two explicitly invoked Node database-integrity diagnostics over existing read-only functionality, with blocking-thread execution and coverage for live, path-based, and encrypted-database checks. Existing callers, database data, schemas, and production request paths remain unchanged, and all modified files are owned by the author. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
0c060df to
6428c6a
Compare
6428c6a to
ddb0534
Compare
a6a0be7 to
91830e8
Compare
91830e8 to
9fe25ea
Compare
9fe25ea to
62f5ecd
Compare
62f5ecd to
83830bf
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
83830bf to
b43082b
Compare
Stacked on #4031. Node napi surface: async
checkDatabaseIntegrity(dbPath, encryptionKey?, level?)andclient.dbIntegrityCheck(level?), both running the Rust work off the JS event loop viaspawn_blocking, returning{ outcome, findings }with outcome ∈ok|corrupt|unreadable|saltMissing|locked|failed. Key conversion mirrorscreate_client. Vitest coverage: live + by-path ok on real DBs; wrong-keyunreadableagainst a genuinely SQLCipher-encrypted DB. Full node suite 118/118.🤖 Generated with Claude Code
https://claude.ai/code/session_01V1AXHNsnQmHW174i5rRUEb
Note
Add Node bindings for database integrity check APIs
dbIntegrityCheck(level?)onclient.Clientand a standalonecheck_database_integrity(path, key?, level?)function to run read-only integrity checks off the JS event loopIntegrityCheckLevelenum (Quick/Full) andIntegrityCheckOutcomestruct (outcome+findings) for Node-facing typescheck_database_integrityrequires a 32-byte key; wrong-length keys return anapi::Errorrather than being silently handledMacroscope summarized b43082b.