2026-09-23·by Sijie Wang#standmeet#architecture#design

system-prompt-hash-regression

系统提示词哈希回归检测

父级:agent-core

组装好的系统提示词会做 SHA-256 哈希;一个不变量检查会把它构建 3 次,并断言哈希值完全一致(backend/internal/capabilities/capreg/system_prompt.go——Registry.SystemPromptHash,经 routes/sys/diag_session.gosystem_prompt_hash 暴露;在 e2e registry-invariants.spec.ts 里断言)。这能捕捉到那些细微的不确定性来源——能力组装顺序的随机性、map 遍历顺序、基于时间的片段——它们会在不知不觉中破坏 eval 的可复现性。

这背后是一个更深的选择:注册顺序 == 组装顺序(不做打乱,也不按字母排序),所以提示词天生就是确定性的,前端的 prompt-part ID 也因此能对得上。

capreg 正被

agent-as-injectable-driver 重塑——把这里记录的 capreg 细节当作当前状态,而非最终形态。

about this entry

One of sijie's wiki entries. The AI on this site is grounded in the same corpus and answers in sijie's voice, with citations back to entries like this one — answering costs sijie money, so it waits behind a code: enter an access code →