feat(provenance): fork-first-class chain model — ADR-0010 (#31; supersedes #32)#109
Merged
Merged
Conversation
…sedes #32) Implements ADR-0010 (now Accepted). The provenance integrity property is tamper-evidence + no-silent-loss, NOT linearity: legitimate divergence (partitioned/replicated/offline writers, simulation branches) must be representable, persisted, detectable and verifiable. Schema - NO `UNIQUE(entity_id, previous_hash)` (#32, superseded): it would reject a divergent writer's honest history at insert time. The `hash` PRIMARY KEY is the correct duplicate guard (domain-tagged preimage). - Add non-unique `idx_provenance_predecessor` → O(log n) fork detection. - `verisimdb_provenance_chain_heads(entity_id, head_hash)` multi-head tip set; legacy single-head table kept one release with an idempotent `INSERT … SELECT` migration (no destructive DROP ships here). Behaviour - `append_provenance`: linear fast-path — extends the unique head; errors (not silently collapses) if the entity has >1 head. - `append_provenance_fork(from_hash)`: extends a specific ancestor, *adds* a head without removing one → the entity now has ≥2 tips. - `fork_points()`: every predecessor with >1 child. - `verify_chain`: per-branch walk (each tip → genesis) so a forked- but-honest entity verifies true while tampering any branch still fails. codegen `overlay.rs` mirrors the schema (harmful `ux_provenance_chain` removed); its DDL tests inverted to assert the ADR-0010 contract. Tests: `tests/provenance_fork_test.rs` rewritten to the 4 ADR-0010 cases (the previously failing-by-design test now passes) + `exact_duplicate_entry_is_rejected`. Full suite green (107 lib + 9 + 4 + 2, 0 failed). ADR-0010 Proposed → Accepted. Closes #31. Supersedes #32 (closed not-planned). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 21 issues detected
View findings[
{
"reason": "Required file missing",
"type": "missing",
"file": "SECURITY.md",
"action": "create",
"rule_module": "root_hygiene",
"severity": "high"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action Swatinem/rust-cache@v2 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action dtolnay/rust-toolchain@master needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Action Swatinem/rust-cache@v2 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Required file missing (condition: public_repo)",
"type": "missing_requirement",
"file": "SECURITY.md",
"action": "create",
"rule_module": "cicd_rules",
"severity": "high"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
🔍 Hypatia Security ScanFindings: 21 issues detected
View findings[
{
"reason": "Required file missing",
"type": "missing",
"file": "SECURITY.md",
"action": "create",
"rule_module": "root_hygiene",
"severity": "high"
},
{
"reason": "Issue in quality.yml",
"type": "missing_workflow",
"file": "quality.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Issue in security-policy.yml",
"type": "missing_workflow",
"file": "security-policy.yml",
"action": "create",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
"type": "unpinned_action",
"file": "governance.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action Swatinem/rust-cache@v2 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action actions/checkout@v4 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Action dtolnay/rust-toolchain@master needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Action Swatinem/rust-cache@v2 needs attention",
"type": "unpinned_action",
"file": "rust-ci.yml",
"action": "pin_sha",
"rule_module": "workflow_audit",
"severity": "medium"
},
{
"reason": "Required file missing (condition: public_repo)",
"type": "missing_requirement",
"file": "SECURITY.md",
"action": "create",
"rule_module": "cicd_rules",
"severity": "high"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
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.
Implements ADR-0010 (Proposed→Accepted). No UNIQUE(entity_id,previous_hash) (#32 superseded; hash PK is the dup guard); non-unique idx_provenance_predecessor; multi-head verisimdb_provenance_chain_heads + idempotent non-destructive migration; append_provenance linear fast-path; append_provenance_fork; fork_points; per-branch verify_chain; overlay.rs mirrored (ux_provenance_chain removed). provenance_fork_test rewritten to the 4 ADR-0010 cases + dup-rejection. Full suite green (107 lib + 9 + 4 + 2). Closes #31; supersedes #32.
🤖 Generated with Claude Code