Skip to content

feat(cabr): add optional persistence to consensus finalization (Phase 3)#581

Merged
Foundup merged 1 commit into
mainfrom
feat/cabr-consensus-phase3-auto-persist
May 13, 2026
Merged

feat(cabr): add optional persistence to consensus finalization (Phase 3)#581
Foundup merged 1 commit into
mainfrom
feat/cabr-consensus-phase3-auto-persist

Conversation

@Foundup
Copy link
Copy Markdown
Member

@Foundup Foundup commented May 13, 2026

Summary

  • Optional store parameter added to finalize_cabr_consensus/batch functions
  • store=None preserves Phase 1 behavior (no filesystem writes)
  • Provided store saves CABRConsensusRecord after finalization
  • Duplicate record handling remains idempotent
  • New finalize_cabr_consensus_with_result() returns explicit persistence status

WSP 97 Compliance

  • Persistence is evidence storage only
  • Persisted records preserve truth fields as False
  • No automatic state progression
  • No default DB path, caller must provide store explicitly

Test plan

  • 26 new persistence integration tests
  • 192 total tests passing with store/finalizer/quorum/scoring regression
  • Store failure returns explicit persistence_success=False

Slice: CABR_CONSENSUS_FINALIZATION_PHASE3_AUTO_PERSIST_INTEGRATION
Worker: W10

🤖 Generated with Claude Code

Integrate optional caller-provided CABRConsensusStore persistence into CABR
consensus finalization. When a store is provided, records are automatically
persisted after finalization.

WSP 97 Critical: Auto-persist means storing the review-only record when a
store is explicitly provided. It does NOT mean state progression, payout
approval, DAO activation, or truth field mutation.

Changes:
- Add optional `store` parameter to finalize_cabr_consensus()
- Add optional `store` parameter to finalize_cabr_consensus_batch()
- Add finalize_cabr_consensus_with_result() for explicit persistence status
- Add finalize_cabr_consensus_batch_with_results() for batch with status
- Add CABRConsensusFinalizeResult dataclass for persistence status
- No default DB path (caller must provide store explicitly)
- Store failures logged but do not block record return
- Duplicate record_id handled as idempotent (ALREADY_EXISTS)

Test coverage: 26 new tests, 192 total tests passing (no regression)

Slice: CABR_CONSENSUS_FINALIZATION_PHASE3_AUTO_PERSIST_INTEGRATION
Worker: W1

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Foundup Foundup merged commit 8cba287 into main May 13, 2026
3 checks passed
@Foundup Foundup deleted the feat/cabr-consensus-phase3-auto-persist branch May 13, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant