todo2code

Ticket 039: Bounded immutable Git branch snapshot materializer

Goal

Add a dependency-free runtime service that reads a bounded set of existing local Git refs and materializes the immutable topology required before t2c.branch/v1 semantic evidence can be assembled. The result binds the repository, base and candidate names to exact commit/tree/merge-base SHAs, ahead/behind counts, changed paths, stable patch identities and conservative textual merge results.

This is the third delivery from ticket-036’s Branch Intelligence blueprint and depends on ticket-037’s deterministic projector. It closes only the local Git observation boundary. A later runtime ticket will combine these facts with per-tree graph/truth-map analyses; an interfaces ticket will expose the combined portfolio through CLI, MCP and A2A.

Read-only boundary

The service may execute only local, read-only Git queries against refs that already exist in the supplied repository. It must:

It must not fetch, contact GitHub, call an LLM, checkout into the user’s work tree, update the index, create a ref, write a commit, merge, rebase, push, force-push, close or delete anything.

Output boundary

The internal BranchGitMaterialization value contains:

This internal runtime value is not a second public DSL and is not approval evidence. Semantic completeness, graph/truth-map fingerprints, PR identities and recommendations remain absent rather than being fabricated. The next assembler must map missing semantic evidence to unknown before calling the ticket-037 projector.

Delivery boundary

Acceptance criteria

Participants

Approval boundary

The user explicitly approved continuation and testing of ticket-039 on 2026-08-05 after reviewing the initialized plan. Chat approval authorizes only the bounded interactive edit. The implementation was independently reviewed and merged through the protected path; merge authority came from exact-head Validator App evidence and required checks.

Validation result

Live read-only audit

The built materializer was run in a disposable fresh clone of wellmanifest/new-project against exact base 13c2f8e21a243fbbd6ea243b173305b0368a9729. It produced fingerprint b9672aca66b1d1590489c23ab06e130218df4cfc16610c975b254c3e44b58c5e:

The first live pass exposed and the implementation repaired an incorrect base..head patch identity for contained branches. The final logic uses merge-base..head, so work already contained in the base is not presented as a reverse patch. The audit created no persistent local checkout and made no remote mutation.

Protected completion evidence