pub struct ForgeStore { /* private fields */ }Expand description
ForgeStore — SQLite-backed storage for all Forge state.
The connection is wrapped in a Mutex for thread-safety.
Implementations§
Source§impl ForgeStore
impl ForgeStore
Sourcepub fn open(path: &Path) -> ForgeResult<Self>
pub fn open(path: &Path) -> ForgeResult<Self>
Open (or create) a Forge database at the given path.
Invariant I1: Calls invariants::refuse_to_open_db() as the very first action.
If the file exists and is not a valid Forge DB, returns ForgeError::RefuseToOpenDb.
Sourcepub fn with_transaction<F, T>(&self, f: F) -> ForgeResult<T>
pub fn with_transaction<F, T>(&self, f: F) -> ForgeResult<T>
Execute a closure with transactional semantics.
Sourcepub fn with_transaction_conn<F, T>(&self, f: F) -> ForgeResult<T>
pub fn with_transaction_conn<F, T>(&self, f: F) -> ForgeResult<T>
Execute a closure with a write transaction handle for consumers that can execute transaction-owned CEA adapters without opening a nested tx.
Sourcepub fn with_conn<F, T>(&self, f: F) -> ForgeResult<T>
pub fn with_conn<F, T>(&self, f: F) -> ForgeResult<T>
Execute a closure with the shared write-locked SQLite connection.
pub fn insert_candidate( &self, candidate_id: &str, spec_json: &str, parents_json: &str, status: &str, ) -> ForgeResult<()>
pub fn get_candidate_spec(&self, candidate_id: &str) -> ForgeResult<String>
pub fn update_candidate_status( &self, candidate_id: &str, status: &str, ) -> ForgeResult<()>
pub fn insert_task( &self, task_id: &str, suite_name: &str, fixture_ref: &str, prompt: &str, constraints_json: &str, weights_json: &str, ) -> ForgeResult<()>
pub fn insert_eval_run( &self, eval_id: &str, candidate_id: &str, task_id: &str, backend: &str, seed: i64, mindstate_hash: &str, patch_hash: &str, structural_sig: &str, scores_json: &str, violations_json: &str, logs_ref: &str, cea_run_hash: Option<&str>, ) -> ForgeResult<()>
pub fn get_eval_runs_for_candidate( &self, candidate_id: &str, ) -> ForgeResult<Vec<EvalRunRow>>
pub fn upsert_archive_cell( &self, cell_key: &str, candidate_id: &str, score_summary_json: &str, cea_fingerprint: Option<&str>, ) -> ForgeResult<()>
pub fn get_archive_cell( &self, cell_key: &str, ) -> ForgeResult<Option<ArchiveCellRow>>
pub fn insert_promotion( &self, version_id: &str, candidate_id: &str, frozen_spec_json: &str, bounds_json: &str, invariants_json: &str, checksum: &str, cea_fingerprint_json: Option<&str>, ) -> ForgeResult<()>
pub fn get_latest_promotion(&self) -> ForgeResult<Option<PromotionRow>>
pub fn count_promotions(&self) -> ForgeResult<usize>
pub fn insert_answer_trace( &self, trace_id: &str, question_sig: &str, version_id: &str, strategy_tags_json: &str, patch_hash: &str, structural_sig: &str, score_json: &str, ) -> ForgeResult<()>
pub fn get_recent_traces_for_question( &self, question_sig: &str, limit: usize, ) -> ForgeResult<Vec<AnswerTraceRow>>
pub fn upsert_cea_node( &self, node_id: &str, node_kind: &str, sig_json: &str, ) -> ForgeResult<()>
pub fn upsert_cea_edge( &self, edge_id: &str, cause_node_id: &str, effect_node_id: &str, weight_delta: f64, version_id: &str, ) -> ForgeResult<bool>
pub fn check_cea_run_log(&self, run_hash: &str) -> ForgeResult<bool>
pub fn insert_cea_run_log( &self, run_hash: &str, eval_id: &str, edges_added: i64, edges_updated: i64, ) -> ForgeResult<()>
pub fn get_cea_edges_for_cause( &self, cause_node_id: &str, ) -> ForgeResult<Vec<CeaEdgeRow>>
Sourcepub fn get_all_cea_nodes_and_edges(
&self,
version_id: Option<&str>,
) -> ForgeResult<(Vec<CeaNodeRow>, Vec<CeaEdgeRow>)>
pub fn get_all_cea_nodes_and_edges( &self, version_id: Option<&str>, ) -> ForgeResult<(Vec<CeaNodeRow>, Vec<CeaEdgeRow>)>
Get all CEA nodes and edges, optionally filtered by version_id.
pub fn get_cea_node_sig(&self, node_id: &str) -> ForgeResult<Option<String>>
pub fn insert_evidence_bundle( &self, bundle_id: &str, candidate_id: &str, eval_id: &str, version_id: &str, trace_id: &str, scores_json: &str, hypotheses_json: &str, verification_plan_json: Option<&str>, diff_json: Option<&str>, assessment_json: Option<&str>, warnings_json: &str, ) -> ForgeResult<()>
pub fn get_evidence_bundle( &self, bundle_id: &str, ) -> ForgeResult<Option<EvidenceBundleRow>>
pub fn get_latest_evidence_bundle_for_candidate( &self, candidate_id: &str, ) -> ForgeResult<Option<EvidenceBundleRow>>
pub fn count_evidence_bundles_for_candidate( &self, candidate_id: &str, ) -> ForgeResult<usize>
pub fn count_evidence_bundles(&self) -> ForgeResult<usize>
pub fn list_recent_evidence_bundle_ids( &self, limit: usize, ) -> ForgeResult<Vec<String>>
pub fn insert_experiment_run( &self, run_id: &str, candidate_id: &str, task_id: &str, trace_id: &str, mode: &str, baseline_json: &str, patched_json: &str, diff_json: &str, baseline_descriptor_json: &str, trials_json: &str, ) -> ForgeResult<()>
pub fn insert_export_receipt( &self, export_key: &str, bundle_id: &str, rendering_version: u32, namespace: &str, write_through_ok: Option<bool>, ) -> ForgeResult<bool>
pub fn has_export_receipt(&self, export_key: &str) -> ForgeResult<bool>
pub fn insert_run_failure( &self, failure_id: &str, run_id: &str, class: &str, message: &str, phase: &str, retriable: bool, retry_count: u32, ) -> ForgeResult<()>
pub fn get_failures_for_run( &self, run_id: &str, ) -> ForgeResult<Vec<RunFailureRow>>
pub fn insert_verification_plan( &self, plan_id: &str, bundle_id: &str, target_hypotheses_json: &str, steps_json: &str, policy_json: Option<&str>, ) -> ForgeResult<()>
pub fn insert_tool_receipt(&self, row: &ToolReceiptRow) -> ForgeResult<bool>
pub fn get_tool_receipt( &self, receipt_id: &str, ) -> ForgeResult<Option<ToolReceiptRow>>
Trait Implementations§
Source§impl Debug for ForgeStore
impl Debug for ForgeStore
Source§impl Drop for ForgeStore
impl Drop for ForgeStore
Auto Trait Implementations§
impl !Freeze for ForgeStore
impl RefUnwindSafe for ForgeStore
impl Send for ForgeStore
impl Sync for ForgeStore
impl Unpin for ForgeStore
impl UnsafeUnpin for ForgeStore
impl UnwindSafe for ForgeStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more