Skip to content

Commit 81b5d5f

Browse files
committed
feat: add task projection table
1 parent 6f0d649 commit 81b5d5f

9 files changed

Lines changed: 1667 additions & 13 deletions

File tree

garyx-gateway/src/composition/app_bootstrap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use crate::mcp_metrics::McpToolMetrics;
4343
use crate::recent_thread_projection::RecentThreadProjectingStore;
4444
use crate::runtime_cells::{ChannelDispatcherCell, LiveConfigCell};
4545
use crate::skills::SkillsService;
46+
use crate::task_projection::register_gateway_task_projection_reader;
4647
use crate::wikis::WikiStore;
4748
use crate::workflows::WorkflowScheduler;
4849

@@ -311,6 +312,7 @@ impl AppStateBuilder {
311312
self.garyx_db.clone(),
312313
self.thread_history.transcript_store(),
313314
));
315+
register_gateway_task_projection_reader(&thread_store, &self.garyx_db);
314316
let thread_history = ThreadHistoryRepository::new(
315317
thread_store.clone(),
316318
self.thread_history.transcript_store(),

garyx-gateway/src/composition/app_state.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use crate::recent_thread_projection::{
3434
};
3535
use crate::runtime_cells::{ChannelDispatcherCell, LiveConfigCell};
3636
use crate::skills::SkillsService;
37+
use crate::task_projection::{backfill_task_projection_if_incomplete, reconcile_task_projection};
3738
use crate::thread_meta_projection::{
3839
backfill_thread_meta_projection_if_incomplete, list_channel_endpoints_with_projection_backfill,
3940
};
@@ -291,6 +292,13 @@ impl AppState {
291292
&state.ops.garyx_db,
292293
)
293294
.await;
295+
let task_projection = backfill_task_projection_if_incomplete(
296+
&state.threads.thread_store,
297+
&state.ops.garyx_db,
298+
)
299+
.await;
300+
let reconciled_task_projection =
301+
reconcile_task_projection(&state.threads.thread_store, &state.ops.garyx_db).await;
294302
let reconciled_workflows = crate::workflows::reconcile_interrupted_workflows(
295303
&state,
296304
&workflow_reconcile_cutoff,
@@ -310,6 +318,8 @@ impl AppState {
310318
thread_meta_projection_message_routes = thread_meta_projection.message_routes,
311319
thread_meta_projection_delivery_contexts =
312320
thread_meta_projection.last_delivery_contexts,
321+
task_projection_backfill_count = task_projection,
322+
task_projection_reconcile_count = reconciled_task_projection,
313323
workflow_reconcile_count = reconciled_workflows,
314324
"gateway sync snapshots warmed"
315325
);

0 commit comments

Comments
 (0)