Commit 297e043
fix(#26): unify ProvenanceRecord/ProvenanceEntry
Canonical type: `abi::ProvenanceEntry`.
Rationale — `abi::ProvenanceEntry` is the richer, persistence-boundary
type: it carries the full chain API (`genesis` / `chain` / `verify` /
domain-tagged length-prefixed `compute_hash`), is the type the SQLite
write path (`append_provenance` / `verify_chain`) and the Idris2 ABI /
Zig FFI bridge are written against, and is the type the threat-model
doc names as the implementation. `tier1::provenance::ProvenanceRecord`
was a byte-for-byte duplicate struct (identical 8 fields) whose
`compute_hash`/`verify` had already been reduced to thin shims that
just delegated to `ProvenanceEntry`. It was orphaned — nothing in the
tree constructed it.
No field divergence: the two structs had identical fields and field
order, so this is a pure dedup, not a unification of diverged shapes.
No `From`/alias impls were needed.
Changes:
- Deleted `tier1::provenance::ProvenanceRecord` struct + impl block
(the duplicate `compute_hash`/`verify` shims).
- Replaced with `pub use crate::abi::ProvenanceEntry;` so any external
caller of `tier1::provenance::*` resolves to the single canonical
definition. `tier1/provenance.rs` now holds only write-path logic
(`append_provenance`, `verify_chain`, `SIDECAR_DDL`,
`init_sidecar_schema`) — no type definitions.
- Updated stale references in `docs/architecture/TOPOLOGY.md` and
`ROADMAP.adoc` from `ProvenanceRecord` to `ProvenanceEntry`.
Refs migrated: 0 code call sites (the tier1 type was orphaned; only
its own self-references plus 2 documentation mentions). `grep -r
ProvenanceRecord src/` now returns zero hits.
On-disk / JSON stability: unchanged. `ProvenanceEntry` and the deleted
`ProvenanceRecord` had identical fields; the deleted shims already
computed the canonical hash via `ProvenanceEntry::compute_hash`. No
serde field names, SQL column names, hash preimage, or DB schema are
touched — provenance integrity is preserved bit-for-bit.
Build/test: `cargo build` clean (only the pre-existing unrelated
`RetentionConfig` unused-import warning in gc.rs). `cargo test` green:
87 lib + 9 integration + 2 sqlite-e2e tests, 0 failed. No
offline-cache failures.
Acceptance:
- [x] `grep -r ProvenanceRecord src/` returns zero hits
- [x] `cargo build` clean, `cargo test` green
- [x] `tier1/provenance.rs` contains only write-path logic, no type defs
Unblocks #31/#32 (they touch the same provenance types — there is now
exactly one type and one `compute_hash` to evolve).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 88e5528 commit 297e043
3 files changed
Lines changed: 16 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
80 | 37 | | |
81 | 38 | | |
82 | 39 | | |
| |||
0 commit comments