Skip to content

Build immutable snapshot packets and verified diff anchors - #206

Merged
HemSoft merged 3 commits into
mainfrom
feature/issue-176-snapshot-evidence
Oct 20, 2026
Merged

HemSoft merged 3 commits into
mainfrom
feature/issue-176-snapshot-evidence

Conversation

@HemSoft

@HemSoft HemSoft commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The controller currently receives a caller-supplied packet and diff map. This adds an immutable Git collector that produces both from the captured merge-base-to-head comparison, verifies hunk coordinates/text against committed blobs, and preserves controller-observed omissions through review and recovery.

Related to #176, which stays open. Private polling/backoff, qualified object acquisition and installation-token attestation, runtime composition and packaging remain required. This change does not activate the retired controller or qualify live subscription use.

Acceptance Criteria

  • Require all captured revisions to be commits and the recorded merge base to be the unique actual merge base. Missing/ambiguous history defers capture.
  • Validate a complete NUL-delimited changed-path inventory, full SHA-1/SHA-256 object IDs, modes and statuses. Disable renames; retain deletion/addition provenance. Refuse unsafe paths, partial inventories and more than 128 files.
  • Read immutable blobs without checkout, inherited Git environment, external/textconv drivers, replacement objects or lazy fetching. Bound total source bytes, individual output, packet bytes and overall capture time.
  • Keep explicit path-specific coverage for binaries, links, submodules, missing blobs and size omissions. Omitted patches supply no inline anchors.
  • Check hunk text, coordinates, counts, gaps and EOF newline markers against old/new blobs. Only verified right-side lines become inline anchors; source-valid non-diff findings retain summary behavior.
  • Bind readers and inline maps to the exact job packet/snapshot returned by SQLite admission. A recapture cannot silently replace a previously admitted packet. Preserve initial controller coverage when the source broker forks an independently budgeted reader.

Definition of Done

  • Library, integration guidance, limits and remaining qualification gates documented.
  • Actual Git producer tests, hostile protocol tests and durable fake-provider recovery/rendering integration.
  • Required current-head Codex review completed without further findings; guarded merge completed.

Validation

Head 84d62c2, tree e86c3398ef483de3991253860f72bffdec7f6f44, based on main e469979. Targeted snapshot race tests pass. All 18 Python tests and diff check pass. Go 1.25.14 vet and full race suite pass, including reviewer 43.307s and all fixture packages. Actions remains disabled by owner; no CI pass is claimed. No UI changes.

Actual installed Git 2.53.0 creates synthetic SHA-1 and SHA-256 commits, including an independently advanced base with the same tree as head. Tests still capture the merge-base changes. Quoted/Unicode paths, renames, deletion, newline markers, binaries, symlinks and submodules exercise the real producer rather than a second handwritten spelling of its output.

Working-tree and environment canaries plus executable hooks/external/textconv drivers remain inert during capture. A local inert promisor helper first proves lazy fetching would run without the controls, then proves capture records the missing blob without invoking that helper. No network is used.

Adversarial cases reject forged source/counts/coordinates, hidden gap edits, missing EOF markers, unsafe/duplicate paths, incomplete inventories, missing/non-commit revisions, wrong merge bases, cancellation and mismatched admitted packets. Blob/patch/file caps preserve omissions or refuse the whole packet.

Review corrections force --ignore-submodules=none against candidate/repository ignore settings; search preserves omissions while continuing to later readable matches; overflowing source coverage combines reasons per allowed path while preserving global exhaustion; typed rendering/publication revalidates the complete admitted job hash. Captured packets reject the low-level map-taking APIs. Existing ordinary denial records remain unchanged below the cap.

Three new behavior regressions fail against the exact reviewed source archive and pass after the fixes. Cross-job publication tests reject mismatched jobs before storage, while the valid typed route persists a review intent.

The SQLite integration admits the actual Git packet, runs four fake provider phases with empty model coverage, recovers completed work without another provider call, and renders the authoritative binary/link/submodule omissions. No real provider profiles, inference, App installation or deployment are used.

Risks and remaining work

The explicit Git executable/object repository and its configuration remain trusted release input. This collector does not establish fork provenance, installation scope or managed-reader OS confinement. Those remain separately qualified boundaries.

The evidence packet is capped at 64 KiB, with at most 128 changed paths and two MiB aggregate blob reads. Oversized complete inventories defer admission; per-file omissions remain visible. Recovery must reproduce the exact admitted packet, including omissions, or defer instead of substituting fresh input.

See snapshot evidence documentation for API composition and limits.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T13:11:32.508509Z 84d62c2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4745ca087

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread reviewer/snapshot_evidence.go Resolved
Comment thread reviewer/snapshot_evidence.go Resolved
Comment thread reviewer/source_broker.go Resolved
Comment thread reviewer/snapshot_evidence.go Resolved
@HemSoft

HemSoft commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 84d62c2bcf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@HemSoft
HemSoft merged commit 6b73c2e into main Oct 20, 2026
@HemSoft
HemSoft deleted the feature/issue-176-snapshot-evidence branch October 20, 2026 13:12
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