muse-agent-example/数据库/迁移/V0060__评测单元复用来源.sql
zizi c154ca9085 配置与数据库:迁移 V0056–V0060 与流程模板
- 迁移:调用结算与配置验证(V0056)、来源当前授权(V0057)、成品补充验证回执(V0058)、检索索引代次(V0059)、
  评测单元复用来源(V0060);新表按既有约定加只追加守卫与角色授权。
- 流程模板与载入口径同步(内联保护字段改为登记类型约束);旧库迁移工具链按新表结构对齐。
- 配置:提供方模板与运行配置同步角色策略版本;角色策略白名单新增 qwen3.8-flash(见收尾报告待裁决项:
  该模型精确身份与独立性尚未核验,且策略版本号未随白名单升版)。
2026-09-18 01:15:25 +08:00

15 lines
893 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- B10逐例复用只追加原来源,不复制任务、响应或费用账。
CREATE TABLE evaluation.muse_evaluation_reuse (
unit_id uuid PRIMARY KEY REFERENCES evaluation.muse_evaluation_unit(unit_id),
source_unit_id uuid NOT NULL REFERENCES evaluation.muse_evaluation_unit(unit_id),
source_experiment_id uuid NOT NULL REFERENCES evaluation.muse_experiment(experiment_id),
payload jsonb NOT NULL CHECK (jsonb_typeof(payload)='object'),
payload_hash text NOT NULL CHECK (payload_hash ~ '^[0-9a-f]{64}$'),
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
CHECK (unit_id <> source_unit_id)
);
CREATE INDEX evaluation_reuse_source ON evaluation.muse_evaluation_reuse(source_experiment_id);
CREATE TRIGGER evaluation_reuse_guard
BEFORE UPDATE OR DELETE ON evaluation.muse_evaluation_reuse
FOR EACH ROW EXECUTE FUNCTION public.muse_guard_literary_history();