Skip to content

feat(agent): harness fingerprint for scaffolding-regression attribution - #2450

Merged
topcheer merged 1 commit into
mainfrom
harness-fingerprint
Sep 16, 2026
Merged

topcheer merged 1 commit into
mainfrom
harness-fingerprint

Conversation

@topcheer

Copy link
Copy Markdown
Owner

See commit 48767ff. Harness fingerprint (system prompt + check registry + tool set) stamped into debug log on change, per arXiv:2607.03691 scaffolding-version recommendation. Co-Authored-By: ggcode noreply@ggcode.dev

Stamp the harness configuration (composed system prompt, write-integrity
check registry, tool schema set) as a SHA-256 fingerprint into the debug
log under the 'harness' category, logging on first observation and again
only when any surface changes mid-session.

Rationale (frontier research):
- arXiv:2607.03691 'Don't Blame the LLM': across 35 releases of a coding
  agent with a FIXED model, resolve rate swung 23%-39% with no trend
  while token spend rose 70%+ - the swings tracked scaffolding changes.
  Core recommendation: 'report and control for the scaffolding version'.
- Anthropic Claude Code postmortem (2026-04-23): weeks of 'it feels
  dumber' reports resolved to three harness changes; evals missed all.
- arXiv:2607.06184 (TraceProbe): trajectory diffing for regression
  localization is only meaningful when the producing harness is recorded.

ggcode previously had no way to attribute a debug export to the specific
scaffolding that produced it: prompt composition, the ~191-check registry
(e.g. the fc5c4aa critical-only trim), and MCP/tool registration could
all change invisibly. The fingerprint closes that attribution gap so
quality regressions can be bisected to a scaffolding change instead of
being misattributed to the model.

Wired via defer in maybeInjectDynamicSystemPrompt (fires on every agent
Run), change-gated to avoid log spam. Zero behavior change otherwise.

Co-Authored-By: ggcode <noreply@ggcode.dev>

@topcheer topcheer left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审通过 ✅(协查两重点核销)

① fingerprint 三元组完备性:三个可变面(baseSystemPrompt 组合提示/allChecks 注册表/tool schema 集)确为 ggcode harness 的全部运行塑形面——与 body 引用的三个研究依据(scaffolding 漂移 23-39% 波动/Claude Code postmortem 三 harness 变更/TraceProbe 归因前提)逐一对上。Registry 惰性初始化的空→有转换本身也被记录(注释明示)——覆盖完整。

② 哈希稳定性:hashNames 先排序后 join(\x00 分隔)——顺序不敏感+无歧义分隔符;Sum() 含各面 count(碰撞双保险);64-bit 前缀对变更归因碰撞概率可忽略(自评正确)。测试钉住:双序同 hash/异集可分/三元组各自敏感性(prompt 改动/tool 注册)。

变更检测契约:logHarnessFingerprint 首次记录+仅变更记录(无 spam)——TestLogHarnessFingerprint 三态钉死;defer 挂接 maybeInjectDynamicSystemPrompt 出口(所有重建路径覆盖)。

非阻塞观察:checks 面读全局 allChecks 无锁——注册只发生在 init 期(read-mostly),实际竞态可忽略;若未来支持运行时注册需补同步。

CI 9/9 绿。可合并(#2451 base 已含此前 main,#2450 先合再 #2451)。

@topcheer
topcheer merged commit 8d602e8 into main Sep 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant