From 37df884c6411da10196e59b741a538f792deeee5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 18 Jul 2026 21:33:46 +0100 Subject: [PATCH] Batch workspace coverage checkpoints --- .../src/workspace_coverage_projector.rs | 25 +++++++++++------- notes/fresh-workspace-handoff.md | 10 +++++++ state/ledgers.msgpack | Bin 530536 -> 530942 bytes 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/epiphany-core/src/workspace_coverage_projector.rs b/epiphany-core/src/workspace_coverage_projector.rs index b55a551f..45f88cee 100644 --- a/epiphany-core/src/workspace_coverage_projector.rs +++ b/epiphany-core/src/workspace_coverage_projector.rs @@ -1,14 +1,14 @@ use crate::repository_body_observer::RepositoryBodyReadSession; -#[cfg(test)] -use crate::semantic_backend::QDRANT_POINT_BATCH_MAX; use crate::semantic_backend::{ - CollectionCompatibility, OllamaEmbedder, QdrantBackend, SemanticPoint, SemanticStoredPoint, + CollectionCompatibility, OllamaEmbedder, QDRANT_POINT_BATCH_MAX, QdrantBackend, SemanticPoint, + SemanticStoredPoint, }; use crate::workspace_coverage_process_documents::{ publish_workspace_coverage_advancement_sight, publish_workspace_coverage_terminal_sight, }; use crate::workspace_coverage_projection_batch_checkpoint::{ - ObservedWorkspaceCoverageBatchInput, WorkspaceCoverageProjectionBatchCheckpointAdmission, + ObservedWorkspaceCoverageBatchInput, WORKSPACE_COVERAGE_BATCH_CHECKPOINT_MAX_POINTS, + WorkspaceCoverageProjectionBatchCheckpointAdmission, WorkspaceCoverageProjectionBatchCheckpointEntry, WorkspaceCoverageProjectionBatchCheckpointHeadEntry, admit_observed_workspace_coverage_batch, load_authenticated_checkpoint_chain, @@ -49,10 +49,11 @@ use std::path::{Path, PathBuf}; pub(crate) const CLAIM_TYPE: &str = "gamecult.epiphany.workspace_coverage_projection_claim"; pub(crate) const ATTEMPT_TYPE: &str = "gamecult.epiphany.workspace_coverage_projection_attempt"; -/// Physiological durability cadence, deliberately distinct from Qdrant's -/// transport ceiling. On the deployment baseline this bounds checkpoint loss -/// to a few minutes while retaining waited, exact batch writes. -const WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS: usize = 1; +/// One authenticated Qdrant batch is one durable checkpoint. The shared bound +/// keeps transport, readback, and immutable checkpoint cardinality identical. +const WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS: usize = + WORKSPACE_COVERAGE_BATCH_CHECKPOINT_MAX_POINTS; +const _: () = assert!(WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS <= QDRANT_POINT_BATCH_MAX); const CLAIM_SCHEMA: &str = "gamecult.epiphany.workspace_coverage_projection_claim.v1"; const ATTEMPT_SCHEMA: &str = "gamecult.epiphany.workspace_coverage_projection_attempt.v1"; const CLAIM_SCHEMA_V2: &str = "gamecult.epiphany.workspace_coverage_projection_claim.v2"; @@ -3665,11 +3666,15 @@ mod tests { fn sealed_batch_ranges_preserve_plan_order_and_own_checkpoint_cadence() { let total = WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS * 2 + 3; let ranges = sealed_batch_ranges(total); - assert_eq!(WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS, 1); - assert_eq!(ranges.len(), total); + assert_eq!(WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS, 128); + assert_eq!( + ranges.len(), + total.div_ceil(WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS) + ); assert!(ranges.iter().all(|range| range.len() <= WORKSPACE_COVERAGE_CHECKPOINT_BATCH_POINTS && range.len() <= QDRANT_POINT_BATCH_MAX)); + assert_eq!(ranges.last().unwrap().len(), 3); assert_eq!( ranges.into_iter().flatten().collect::>(), (0..total).collect::>() diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 07707d9c..b99822e8 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -2449,6 +2449,16 @@ deployed body. The next authority cut is Idunn and aggregate health: consume the exact provider progress document with a no-advance lease, never a generic job progress noun or total projection wall clock. +Live storage pressure later exposed that the production cadence still admitted +one immutable Redb checkpoint/progress transaction per point despite the +128-point batch contracts. The cadence now aliases the shared checkpoint maximum +of 128 and is compile-time constrained by Qdrant's same 128-point transport +ceiling. Durability still follows waited upsert plus exact payload/vector +readback; only the authenticated commit unit changed. Existing one-point chains +remain valid predecessors for later larger batches when their exact Qdrant +collection survives. A progress store whose collection is absent must not be +resumed from counts alone. + ## Organizational Epiphany is the product, not a remote-control experiment (2026-07-18) The Yggdrasil deployment is the first ordinary organizational Epiphany body. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index a56e4229c01017386c9c635ba15839d45d097540..28f47002bc34780f4885e8ab24da33376035a8c7 100644 GIT binary patch delta 419 zcmX|5y-EW?81&*#0u~lV2!il|g%-JxTw#K#>}&-=u=}$2-QAMC-E((OlPZOUg{6kH zK0+Xc_yWFwr7w`D5I>_>%+4~*d^5{Ad@W$!2)3i{X{U4jzE*2|E)Ij6AXwf{D-Y93 z!1&>H#s*`PvBjvqPAj#Ky`AT`s2!bz?QYoVT}JKM!BG`|=>FMRT zJ`os`W>K3vKqb+U1D_GN3@ydbiF#pSr1l^(62sqbjw6|uIiQX~I=+_|Qc>t-PB1W~ zjyX6O!$oY7gPvbk80+CL*N4Q2(y__nM5hFWH6{Ua9tTRgj28%!3I^y!CUx2bf!b&( zP=T>A+2*P_k(z}9t(VLza|_N1mCweYC`B;_qv?M>O6|Z>&J51mQuxy1zEWcrU72$? e^&yweaV5|QXJ?Pqdfl;CDg_DhBB2b=ZhZs%+mx9A delta 65 zcmeyjS>eS7g$)vn+y-V=2If)67&ydTH!Cw1GBQ4Ip32ldm5C9EK{PWEvj8zG5VHX> L`}V0!9G67_!