idx-cli/crates/idx-core/src/ownership
hermes 523e1409d3 fix(sync): atomic install, stored-row validation, no local artifacts from remote manifests
From the full-repo Codex audit:
- Install moved the database to a backup, then renamed the snapshot in;
  a crash between the two left no database, and the next sync deleted the
  backup first. Replace it with a single rename (old file or new, never
  neither), and restore a backup an older version left behind.
- Validation trusted the release's row_count metadata, so a snapshot with
  an empty or missing holdings table passed and replaced good data. Also
  count the rows stored for the latest release.
- A manifest fetched over HTTP(S) could name a local download_url such as
  /dev/zero, read without a size limit. Remote manifests must give an
  HTTP(S) artifact; local reads take regular files only, within the size
  limit, and manifests are capped at 1 MiB.
- A same-date build with a different row count replaced the local file
  even when it did not list it in replaces_sqlite_sha256, so a replayed
  older build could undo a corrected one. Same-date rebuilds now go only
  through replaces_sqlite_sha256, which the publisher fills.

Verified against the published snapshot: fresh install, no-op re-sync,
and forced reinstall all succeed with no leftover files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V3syn2fN2LNo5pvTSqc6eh
2026-10-17 12:23:58 +00:00
..
archive.rs fix(deps): move zip off the yanked 2.4.2, to 9.0.4 2026-10-16 10:46:00 +00:00
db.rs fix(ownership): compare each date's own rows, even in a mixed-date file 2026-10-17 12:18:20 +00:00
entities.rs fix(ownership): correct changes, alias search, graph, and name lookups 2026-10-17 04:09:51 +00:00
graph.rs fix(ownership): one release order everywhere; keep the old search API 2026-10-17 05:07:41 +00:00
mod.rs fix: address final review (path traversal, sync races, MCP limits) 2026-10-14 21:58:37 +00:00
parser.rs refactor: split into idx-core library and idx-cli binary workspace 2026-10-14 09:13:46 +00:00
remote.rs refactor: split into idx-core library and idx-cli binary workspace 2026-10-14 09:13:46 +00:00
search.rs fix(ownership): one release order everywhere; keep the old search API 2026-10-17 05:07:41 +00:00
snapshot.rs fix(sync): atomic install, stored-row validation, no local artifacts from remote manifests 2026-10-17 12:23:58 +00:00
types.rs refactor: split into idx-core library and idx-cli binary workspace 2026-10-14 09:13:46 +00:00
xlsx.rs fix(deps): move zip off the yanked 2.4.2, to 9.0.4 2026-10-16 10:46:00 +00:00