Skip to content

feat(e2e-harness): bucket metadata-hash mismatches as promptChanged in the drift differ - #951

Merged
blove merged 2 commits into
mainfrom
blove/drift-metadata-hash
Sep 2, 2026
Merged

feat(e2e-harness): bucket metadata-hash mismatches as promptChanged in the drift differ#951
blove merged 2 commits into
mainfrom
blove/drift-metadata-hash

Conversation

@blove

@blove blove commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The aimock recorder stamps fixtures with metadata: { systemHash, toolsHash } fingerprints of the system prompt and tool definitions that produced each recording (11 committed entries carry systemHash, 8 toolsHash), but the structural differ ignored them.
  • diffFixtures now compares committed vs recorded hashes and buckets mismatches into a new DriftReport.promptChanged category, separate from changed — so a red weekly drift run can say "our prompt moved underneath the fixture" instead of misattributing it to model drift.
  • Hashes are compared only when both sides carry one; pre-stamp fixtures (absent metadata) are never reported. promptChanged and changed are independent — a pair can appear in both.
  • The differ stays advisory: drift.ts exit codes are unchanged; its stderr summary line gains a promptChanged count.

Testing

  • 5 new vitest cases in drift-lib.spec.ts: matching hashes, changed systemHash only, changed toolsHash only, absent metadata on either side (not reported), and structural + prompt drift reported independently. nx test e2e-harness green (16/16).
  • End-to-end: ran drift.ts on the real c-subagents.json fixtures — self-vs-self reports promptChanged=0; a copy with one mutated systemHash reports promptChanged=1 (systemHash: 03217c65 -> deadbeef), changed=0, exit 0.

🤖 Generated with Claude Code

…n the drift differ

The aimock recorder stamps fixtures with systemHash/toolsHash fingerprints
of the system prompt and tool definitions that produced each recording, but
the structural differ ignored them — so a red weekly drift run could not
distinguish "our prompt moved underneath the fixture" from model drift.

diffFixtures now compares committed vs recorded hashes when BOTH sides
carry one and reports mismatches in a new DriftReport.promptChanged
category, independent of `changed`. Entries without metadata (pre-stamp
fixtures) are never reported. The differ stays advisory: drift.ts exit
codes are unchanged; its stderr summary gains a promptChanged count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
threadplane Ready Ready Preview Sep 2, 2026 5:36am UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit 7701de4 into main Sep 2, 2026
73 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