Repository navigation
fix(store): gate Ward audit schema by fingerprint - #675
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates coven-cli’s Ward audit schema handling to rely on a fingerprinted schema-state contract from coven-threads-core, so initialization/migration is fail-closed on drift and safer under concurrent legacy migrators.
Changes:
- Replace SQL substring/component-version routing with a four-state
ward_auditschema fingerprint query and state-driven migration/initialization. - Add guarded DDL execution with rollback handling and reclassification to safely converge concurrent legacy migrators.
- Pin
coven-threads-coreto a specific commit to preserve deployed Phase-5 schema fingerprints.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/coven-cli/src/store.rs | Switches Ward audit schema detection to fingerprint states; adds guarded migration execution and new/updated tests for drift + concurrency. |
| crates/coven-cli/Cargo.toml | Pins coven-threads-core git rev to the commit that defines the expected fingerprint contract. |
| Cargo.lock | Updates the locked coven-threads-core git source to match the pinned revision. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "SELECT COUNT(*) FROM pragma_table_info('ward_audit', 'main') | ||
| WHERE name = 'unexpected'", |
There was a problem hiding this comment.
The existing order is intentional and correct for SQLite table-valued PRAGMAs: pragma_table_info(table-name, schema-name), so pragma_table_info('ward_audit', 'main') inspects main.ward_audit. The pinned core also has executable coverage (schema_qualified_table_valued_pragmas_resolve_main_and_temp_separately) proving main/temp separation with this exact argument order. No code change needed.
| WARD_AUDIT_SCHEMA_STATE_UNKNOWN => { | ||
| anyhow::bail!("unsupported ward_audit schema fingerprint") | ||
| } | ||
| WardAuditSchemaAction::None => {} | ||
| _ => anyhow::bail!("unsupported ward_audit schema fingerprint state"), | ||
| } |
There was a problem hiding this comment.
Fixed in cfe28e7. Unexpected state errors now include the returned fingerprint value, with ward_audit_unrecognized_fingerprint_state_names_the_value covering the fail-closed diagnostic.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
coven-threads-coreto PR Roadmap: establish Discord progress update cadence #23 commitc102844, preserving exact deployed Phase-5 schema fingerprintsValidation
cargo test --locked -p coven-cli ward_audit_cargo test --locked -p coven-cli concurrent_store_initialization_serializes_migrationscargo clippy --locked --workspace --all-targets -- -D warningspython scripts/check-secrets.pypython3 scripts/check-coven-privacy.py --stagedDependency
Requires OpenCoven/coven-threads#23 at
c102844(threads-3jx). Unknown or drifted schemas are never rebuilt or stamped.