Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6012,10 +6012,10 @@ async fn pyramid_publish_question_set(
async fn pyramid_check_staleness(
state: tauri::State<'_, SharedState>,
slug: String,
files: Option<Vec<wire_node_lib::pyramid::staleness_bridge::FileChangeEntry>>,
files: Option<Vec<wire_node_lib::pyramid::staleness::FileChangeEntry>>,
threshold: Option<f64>,
) -> Result<serde_json::Value, String> {
use wire_node_lib::pyramid::staleness_bridge;
use wire_node_lib::pyramid::staleness;

let threshold = threshold.unwrap_or(state.pyramid.operational.tier2.staleness_threshold);

Expand All @@ -6024,13 +6024,13 @@ async fn pyramid_check_staleness(
let explicit = files
.as_ref()
.filter(|f| !f.is_empty())
.map(|f| staleness_bridge::entries_to_changed_files(f));
.map(|f| staleness::entries_to_changed_files(f));

if let Some(files) = explicit {
(files, "explicit".to_string())
} else {
let conn = state.pyramid.reader.lock().await;
let files = staleness_bridge::auto_detect_changed_files(&conn, &slug)
let files = staleness::auto_detect_changed_files(&conn, &slug)
.map_err(|e| format!("failed to auto-detect changed files: {}", e))?;
(files, "auto_detect_observation_events".to_string())
}
Expand All @@ -6043,13 +6043,13 @@ async fn pyramid_check_staleness(
let slug_owned = slug.clone();
let result = tokio::task::spawn_blocking(move || {
let c = conn.blocking_lock();
staleness_bridge::run_trace_decide_check(&c, &slug_owned, &changed_files, threshold)
staleness::run_trace_decide_check(&c, &slug_owned, &changed_files, threshold)
})
.await;

match result {
Ok(Ok((report, decide_work, deltas_processed))) => {
let response = staleness_bridge::CheckStalenessResponse {
let response = staleness::CheckStalenessResponse {
source,
files_processed,
report,
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/pyramid/dadbear_extend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ pub async fn run_tick_for_config(
}

// Tombstone deleted paths: route through the canonical file_deleted -> tombstone
// primitive (staleness_bridge -> dadbear_compiler -> dispatch_tombstone) so the
// primitive (staleness -> dadbear_compiler -> dispatch_tombstone) so the
// deletion propagates (supersedes only THAT file's L0 + upstream delta). Previously
// this called db::mark_ingest_stale, which only flips status='stale'; get_pending_ingests
// is pending-only, so the deletion was never re-claimed NOR tombstoned — silently dropped.
Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/pyramid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ pub mod stale_check_decision;
pub mod stale_helpers;
pub mod stale_helpers_upper;
pub mod staleness;
pub mod staleness_bridge;
pub mod step_context;
pub mod structural_extract;
pub mod supersession;
Expand Down
16 changes: 8 additions & 8 deletions src-tauri/src/pyramid/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use super::query;
use super::reading_modes;
use super::recovery;
use super::slug;
use super::staleness_bridge;
use super::staleness;
use super::types::CharacterizationResult;
use super::types::*;
use super::vine;
Expand Down Expand Up @@ -1919,7 +1919,7 @@ pub fn pyramid_routes(
.and(warp::path::end())
.and(warp::post())
.and(with_auth_state(state.clone()))
.and(warp::body::json::<staleness_bridge::CheckStalenessRequest>())
.and(warp::body::json::<staleness::CheckStalenessRequest>())
.and_then(handle_check_staleness));

// REMOTE-SAFE: GET /pyramid/:slug/question-overlays — read-only, dual auth
Expand Down Expand Up @@ -10974,7 +10974,7 @@ async fn handle_publish_question_set(
async fn handle_check_staleness(
slug_name: String,
state: Arc<PyramidState>,
body: staleness_bridge::CheckStalenessRequest,
body: staleness::CheckStalenessRequest,
) -> Result<warp::reply::Response, warp::Rejection> {
let threshold = body
.threshold
Expand All @@ -10986,13 +10986,13 @@ async fn handle_check_staleness(
.files
.as_ref()
.filter(|f| !f.is_empty())
.map(|f| staleness_bridge::entries_to_changed_files(f));
.map(|f| staleness::entries_to_changed_files(f));

if let Some(files) = explicit {
(files, "explicit".to_string())
} else {
let conn = state.reader.lock().await;
match staleness_bridge::auto_detect_changed_files(&conn, &slug_name) {
match staleness::auto_detect_changed_files(&conn, &slug_name) {
Ok(files) => (files, "auto_detect_observation_events".to_string()),
Err(e) => {
return Ok(json_error(
Expand All @@ -11011,13 +11011,13 @@ async fn handle_check_staleness(
let slug_owned = slug_name.clone();
let result = tokio::task::spawn_blocking(move || {
let c = conn.blocking_lock();
staleness_bridge::run_trace_decide_check(&c, &slug_owned, &changed_files, threshold)
staleness::run_trace_decide_check(&c, &slug_owned, &changed_files, threshold)
})
.await;

match result {
Ok(Ok((report, decide_work, deltas_processed))) => {
let response = staleness_bridge::CheckStalenessResponse {
let response = staleness::CheckStalenessResponse {
source,
files_processed,
report,
Expand Down Expand Up @@ -12109,7 +12109,7 @@ async fn handle_ingest_scan(
}

// Tombstone deleted paths: route through the canonical file_deleted -> tombstone
// primitive (staleness_bridge -> dadbear_compiler -> dispatch_tombstone) so the
// primitive (staleness -> dadbear_compiler -> dispatch_tombstone) so the
// deletion propagates (supersedes only THAT file's L0 + upstream delta). Previously
// this called db::mark_ingest_stale, which only flips status='stale'; get_pending_ingests
// is pending-only, so the deletion was never re-claimed NOR tombstoned — silently dropped.
Expand Down
Loading