muse-agent-example/db/ddl/112-example角色模型策略与登记路径.sql

27 lines
1.6 KiB
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.

-- 角色运行改为 prompt 管理与模型策略绑定后的登记/回执合同。
-- 旧 DDL-97/102 是历史迁移记录;本迁移只更新当前数据库约束和 COMMENT,不改历史文件。
ALTER TABLE example_llm_call
DROP CONSTRAINT IF EXISTS chk_example_llm_call_model_match;
-- requested_model_id 可以是策略别名(如 opus),actual_model_id 是实际完整模型 ID。
-- model_match 的可信性由 RoleExecutionProfile + RoleExecutionReceipt 哈希链证明,
-- 数据库只守住两个标识非空;不能再错误地强制二者字符串相等。
ALTER TABLE example_llm_call
ADD CONSTRAINT chk_example_llm_call_model_match
CHECK (requested_model_id <> '' AND actual_model_id <> '');
COMMENT ON COLUMN example_llm_call.requested_model_id IS
'冻结模型策略的请求别名;固定模型策略可与 actual_model_id 不同。';
COMMENT ON COLUMN example_llm_call.actual_model_id IS
'供应商实际执行的完整模型 ID。';
COMMENT ON COLUMN example_llm_call.model_match IS
'实际模型是否符合冻结 RoleExecutionProfile 的模型策略;由执行 profile/回执哈希链证明。';
COMMENT ON TABLE example_agent_role IS
'五个 prompt 管理角色的库内影子;稳定合同 Git 权威位于 .agent/docs/architecture/角色合同.md,身份提示位于 .agent/agents/*.md。';
COMMENT ON COLUMN example_agent_role.model IS
'保留兼容列;角色模型由派发 profile 决定,本列保持 NULL。';
COMMENT ON TABLE example_skill IS
'Skill 元数据的库内影子;Git 权威位于 .agent/skills/*/SKILL.md。';