feat(core): update backend coordinator, docgov lease, squad workflow and web governance integration

This commit is contained in:
WeiCHEN
2026-09-13 02:50:20 +00:00
committed by weichen
parent 658e9db65e
commit e5e80a6fc6
140 changed files with 20414 additions and 264 deletions
+10 -1
View File
@@ -162,7 +162,8 @@ CREATE TABLE IF NOT EXISTS context_memory_chunks (
CREATE INDEX IF NOT EXISTS idx_mem_chunks_domain_proj ON context_memory_chunks(domain, project_id, created_at DESC);
CREATE INDEX IF NOT EXISTS idx_mem_chunks_user ON context_memory_chunks(user_id, domain);
CREATE INDEX IF NOT EXISTS idx_mem_chunks_hash ON context_memory_chunks(chunk_hash);
-- chunk_hash 必须唯一:IndexApprovedDocument 使用 ON CONFLICT (chunk_hash)
CREATE UNIQUE INDEX IF NOT EXISTS uq_mem_chunks_hash ON context_memory_chunks(chunk_hash);
CREATE INDEX IF NOT EXISTS idx_mem_chunks_tsv ON context_memory_chunks USING gin (tsv);
CREATE INDEX IF NOT EXISTS idx_mem_chunks_vec ON context_memory_chunks USING hnsw (embedding vector_cosine_ops);
@@ -210,6 +211,14 @@ CREATE TABLE IF NOT EXISTS document_records (
-- 可配置项 (Config JSONB)
config JSONB NOT NULL DEFAULT '{"reject_rollback_to": "drafting", "allow_approver_to_reviewer": true}'::jsonb,
-- 编辑租约 (运行时互斥,正交于 is_locked)
lease_holder_type TEXT NOT NULL DEFAULT '', -- squad | human | ''
lease_holder_id TEXT NOT NULL DEFAULT '', -- run_id / user_id
lease_work_dir TEXT NOT NULL DEFAULT '',
lease_expires_at TIMESTAMPTZ,
lease_heartbeat_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);