Skip to content

fix(drift): digest mismatch with no per-item diff is drift, never clean (DSE-2125) - #126

Merged
ernestprovo23 merged 2 commits into
mainfrom
fix/dse-2125-digest-mismatch-backstop
Oct 24, 2026
Merged

ernestprovo23 merged 2 commits into
mainfrom
fix/dse-2125-digest-mismatch-backstop

Conversation

@ernestprovo23

Copy link
Copy Markdown
Member

What

compute_drift returned [] (check exit 0) when overall_digest differed but no per-item diff fired, e.g. a baseline with duplicate tool/resource/prompt keys collapsed by _index_by. Now emits digest-mismatch-unexplained (high) so a changed surface can never be clean.

Evidence (builder)

  • New tests fail without the fix (2 failed) and pass with it; a third asserts the finding is absent when items already explain the mismatch.
  • Full suite: 1508 passed, 7 skipped; test_precommit 25 passed (needs venv python first on PATH, same as main).
  • SPEC section 6.2 table + note, CHANGELOG Unreleased updated.

Security-specific (gate verdict path). Owner receipt: Ernest, chat, 2026-10-24.

https://claude.ai/code/session_01AsS8oRVvT4oiSCHmk4fkEm

…lean (DSE-2125)

compute_drift short-circuited only on a digest match. When overall_digest
differed but name-keyed indexing collapsed duplicate entries (or a digest-
covered field had no item-level check) on an unapproved baseline, it returned
[] and check exited 0.

After all item diffs, if nothing fired and the digests differ, emit
digest-mismatch-unexplained (high). Tests: duplicate-name baseline and a
forced digest both yield non-empty drift (both fail without the fix); the
finding is not added when items already explain the mismatch. SPEC 6.2 and
CHANGELOG updated.

Claude-Session: https://claude.ai/code/session_01AsS8oRVvT4oiSCHmk4fkEm
CSO review: the TypeScript verifier shared the fail-open. Add the same
digest-mismatch-unexplained backstop to packages/lock-ts, a drift conformance
vector (duplicate-name baseline) generated from the Python reference, and the
SPEC section 8 / CHECKS 2.1 entries.

The schema-version-migrated advisory still counts as explaining the mismatch:
a legacy unapproved lock differs by format alone and already exits non-zero.

Claude-Session: https://claude.ai/code/session_01AsS8oRVvT4oiSCHmk4fkEm
@ernestprovo23
ernestprovo23 merged commit 42e08c5 into main Oct 24, 2026
15 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