fix(library): 目标隔离映射兼容旧计划与真实回归
build / build (push) Successful in 1m41s

空 mode 计划不映射;索引 source_id 按语义映射;relation 按字段表解析。
隔离回归按持久映射 ID 断言,DS02 故障注入真实命中。
This commit is contained in:
姚章浩
2026-11-04 12:40:12 +08:00
parent e0fc2c32b8
commit 0d9091e464
15 changed files with 428 additions and 91 deletions
@@ -25,7 +25,7 @@ func TestLibraryChunkSequenceIsolated(t *testing.T) {
t.Fatalf("cross-database publish must allocate local sequence: %+v", outcome)
}
var allocated int64
if err := fx.pool.QueryRow(fx.ctx, `SELECT seq_id FROM chunks WHERE id='chunk-src'`).Scan(&allocated); err != nil {
if err := fx.pool.QueryRow(fx.ctx, `SELECT seq_id FROM chunks WHERE id=$1`, expectedTargetID(wsTargetTenant, wsTargetKB, "chunks", "chunk-src")).Scan(&allocated); err != nil {
t.Fatal(err)
}
if allocated == occupied || allocated <= 0 {