Skip to content

fix(scan): preserve snapshot digest for diff scans - #373

Open
charle-z wants to merge 4 commits into
openai:mainfrom
charle-z:fix/diff-snapshot-digest-299
Open

fix(scan): preserve snapshot digest for diff scans#373
charle-z wants to merge 4 commits into
openai:mainfrom
charle-z:fix/diff-snapshot-digest-299

Conversation

@charle-z

Copy link
Copy Markdown
Contributor

Fixes #299.

Preserve the canonical snapshot digest for diff scans so generated git_diff manifests satisfy the scan contract for working-tree, single-commit, and revision-range targets.

Tests:

  • bun test tests-ts/compact-diff-scan.test.ts

@github-actions github-actions Bot added the bug Something isn't working label Aug 13, 2026
@charle-z

Copy link
Copy Markdown
Contributor Author

After a broader adversarial review, I no longer recommend merging this implementation.

This patch derives committed-diff identity only from kind, baseRevision, and headRevision. That fixes the immediate missing-field failure, but it does not bind the digest to the rendered diff bytes or cover mutable Git replacement/config state, completion-time drift, SHA-256 repository empty trees, or bounded-memory hashing of large binary diffs.

#241 addresses the same failure with the stronger content-bound design and the related revalidation cases. Please treat #373 as superseded by #241.

@charle-z

Copy link
Copy Markdown
Contributor Author

After comparing this patch against #241 and its review coverage, I’m withdrawing this PR in favor of #241. This change fixes the immediate missing snapshotDigest, but deriving it only from kind/base/head does not bind the actual rendered diff and leaves mutable Git state, SHA-256 empty-tree handling, completion-time revalidation, and large-diff streaming uncovered. #241 is the more complete direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scan --diff always fails to save: scan.target.snapshotDigest: expected a non-empty string

1 participant