revert: restore memory_entity/memory_edge table names
CI / CI (pull_request) Canceled after 8m27s

knowledge_* namespace reserved for future agentic learning tables.
memory_* namespace used for facts, events, and entity graph.

- knowledge_node → memory_entity (reverted)
- knowledge_edge → memory_edge (reverted)
- Old provenance DAG (child_sha/parent_sha) renamed to
  memory_edge_provenance via migration 009
- Kept: runtime queries in versioning.rs, UUID casts, init_schema additions
This commit is contained in:
2026-09-15 17:29:53 +09:00
parent 181b0e0f99
commit fd59c6de11
26 changed files with 175 additions and 163 deletions
+4 -4
View File
@@ -383,11 +383,11 @@ pub async fn start_server(port: u16, api_key: String, database_url: &str) -> Res
loop {
interval.tick().await;
// O5: Table row counts
if let Ok(row) = sqlx::query_as::<_, (i64,)>("SELECT COUNT(*) FROM knowledge_node")
if let Ok(row) = sqlx::query_as::<_, (i64,)>("SELECT COUNT(*) FROM memory_entity")
.fetch_one(&stats_pool).await {
crate::metrics::DB_TABLE_ENTITY_ROWS.set(row.0 as u64);
}
if let Ok(row) = sqlx::query_as::<_, (i64,)>("SELECT COUNT(*) FROM knowledge_edge")
if let Ok(row) = sqlx::query_as::<_, (i64,)>("SELECT COUNT(*) FROM memory_edge")
.fetch_one(&stats_pool).await {
crate::metrics::DB_TABLE_EDGE_ROWS.set(row.0 as u64);
}
@@ -1454,7 +1454,7 @@ async fn query_temporal_graph(
) -> anyhow::Result<serde_json::Value> {
// Step 1: Find entities (order by name for deterministic results)
let entities_rows: Vec<(String, String, String)> = sqlx::query_as(
"SELECT id::TEXT, name, entity_type FROM knowledge_node WHERE project_id = $1 LIMIT $2"
"SELECT id::TEXT, name, entity_type FROM memory_entity WHERE project_id = $1 LIMIT $2"
)
.bind(&params.project)
.bind(params.limit as i32)
@@ -1470,7 +1470,7 @@ async fn query_temporal_graph(
for (entity_id, _name, _type_str) in &entities_rows {
let entity_edges: Vec<(String, String, String, String, f32, Option<chrono::DateTime<chrono::Utc>>, Option<chrono::DateTime<chrono::Utc>>)> =
sqlx::query_as(
"SELECT id::TEXT, target_id::TEXT, relation_type, fact, confidence, t_valid, t_invalid FROM knowledge_edge WHERE project_id = $1 AND source_id = $2::UUID"
"SELECT id::TEXT, target_id::TEXT, relation_type, fact, confidence, t_valid, t_invalid FROM memory_edge WHERE project_id = $1 AND source_id = $2::UUID"
)
.bind(&params.project)
.bind(entity_id)