20
Drift · workflow
seed-db-prompt-drift-audit
20-seed-db-prompt-drift-audit.md
◉
WHAT IS THIS
定位检查本地 seed、数据库配置、agent instructions、skill files、capability registry 和文档之间的漂移。它适合 AIDA 这类“配置即运行时行为”的系统。
这个 workflow 的核心目标是防止:线上 DB 已经修好,本地 seed 一跑又回滚;或者 DB 已挂新 skill,但 prompt 仍说“不支持写操作”。
⚡
TRIGGERS
触发场景▸DB 里 agent 已关联 skill,但仓库里没有对应 skill 文件。
▸Agent prompt、skill 文案和 tool schema 对能力边界描述不一致。
▸重跑 seed 后线上能力消失或回到旧口径。
▸Capability registry 数量、名称、required_inputs 与测试断言不一致。
▸文档说只读,但实际已经开放写能力,或反过来。
↹
INPUT & OUTPUT
输入 / 产出↘ INPUT
- 目标 agent id/name。
- 当前 DB agent、skill、capability、tool 配置。
- 本地 seed scripts。
- 本地 skill files 和 prompt/instructions。
- Capability seed/tests。
- 相关运行时 session,可选。
↗ OUTPUT
- Drift matrix。
- 需要固化回仓库的 DB 配置。
- 需要同步到 DB 的 seed 改动。
- 过期 prompt/docs 清单。
- Seed 脚本修复。
- DB 验证 SQL 或脚本结果。
🪜
STEPS
编排步骤- 1读取 DB 当前真相查询 agent、skill_ids、skill_files、tool_names、capability_definitions、required_inputs、risk level。
- 2读取本地 seed 真相检查 seed scripts、skill markdown、prompt templates、capability seed、测试断言。
- 3建 drift matrix每个能力按 DB、seed、skill file、prompt、docs、tests 六列对账。
- 4判断 canonical source如果 DB 是用户刚确认的运行时真相,把 DB 内容固化回仓库;如果 seed 是 canonical,则同步 DB。
- 5修 seed 的幂等性Seed 应复用已有 provider/agent,不应因为缺 env 创建失败后半更新。
- 6同步 capability 和 tests更新数量断言、required_inputs、risk/sideEffect、route filter 测试。
- 7同步 docs 和 prompts删除旧口径,比如“不支持写操作”;更新能力边界和确认规则。
- 8验证 DB 和代码跑 seed、targeted tests,并查询 DB 确认最终状态。
⚙
AGENT ROLES
Agent 分工⚙
DB Auditor
读取运行时配置。
⚙
Seed Auditor
读取本地 seed 和 skill files。
⚙
Drift Mapper
产出 drift matrix。
⚙
Seed Fix Agent
修脚本和 seed 内容。
⚙
Docs Agent
同步 prompts/docs。
⚙
Verifier Agent
跑 seed、tests、DB 验证。
✓
ACCEPTANCE GATE
验收 gate- ✓DB、seed、skill file、prompt、docs 对同一能力描述一致。
- ✓重跑 seed 不会删除当前应保留的 runtime skills。
- ✓Capability tests 和数量断言同步更新。
- ✓Agent instructions 不包含过期能力边界。
- ✓写能力有 risk/sideEffect 和确认链路。
- ✓Drift matrix 里没有 unresolved P0 项。
⊘
FAILURE HANDLING
失败处理⌘
TEMPLATE
Drift matrix 模板| Capability | DB | Seed | Skill file | Prompt | Docs | Tests | Action |
| --- | --- | --- | --- | --- | --- | --- | --- |