feat(graph): owner_id 寫入鏈必經(根治無主資料)——配合 base owner-mandatory(D28)

- kbdb-client requireOwner 守衛:漏 owner 插件端即 throw,不再靜默送 owner:''
- owner 一路 thread:persistNodes/ingestEnvelope/entity-crud/triplet-crud 全必填
- 病灶修:POST /triplets/ingest 原本沒傳 owner→加 owner_id query+400
- 寫入 route 缺 owner→400;vitest 23→27
- 註:gloss-bridge 分支的 backfill/gloss-entry 另需套 owner 必填(附說明),不跨支疊改
This commit is contained in:
Claude
2026-07-05 11:00:30 +00:00
parent b53c5c94a9
commit 4190fbcf90
16 changed files with 152 additions and 54 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ describe('getSource — 回節點的原文來源指標', () => {
source: { uri: 'github:u/w@a.md', content_hash: 'h1', anchor: '#graph-rag' },
extractor: { model: 'm', tier: 'deep' },
triplets: [{ subject: 'GraphRAG', predicate: '是', object: 'RAG 變體' }],
});
}, 'leo');
const refs = await getSource(c, 'GraphRAG');
expect(refs.length).toBe(1);
@@ -27,12 +27,12 @@ describe('getSource — 回節點的原文來源指標', () => {
source: { uri: 'github:u/w@a.md', content_hash: 'h1', anchor: '#old' },
extractor: { model: 'm', tier: 'deep' },
triplets: [{ subject: 'X', predicate: 'r', object: 'old' }],
});
}, 'leo');
await ingestEnvelope(c, {
source: { uri: 'github:u/w@a.md', content_hash: 'h2', anchor: '#new' },
extractor: { model: 'm', tier: 'deep' },
triplets: [{ subject: 'X', predicate: 'r', object: 'new' }],
});
}, 'leo');
const refs = await getSource(c, 'X');
expect(refs.length).toBe(1);