Skip to content

Fix: adopt published CAS recovery for attachment GC - #925

Merged
flyingrobots merged 7 commits into
mainfrom
fix/mktree-gc-recovery
Oct 2, 2026
Merged

flyingrobots merged 7 commits into
mainfrom
fix/mktree-gc-recovery

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Outcome

Adopt published @git-stunts/git-cas@6.5.11 and @git-stunts/plumbing@3.3.2 so closed mktree transport failures enter CAS's existing bounded retry. Match Deno dependency ranges and remove the temporary Plumbing patch. Retain six regressions for single/batch recovery, retry exhaustion, closed-input races, and producer/unrelated error identity.

Fixes #923. Upstream Plumbing #20 and git-cas #132 are merged and published; this change consumes real npm artifacts. Public Runtime/Lane attachment methods (#901) and bounded streams (#818) remain separate.

Validation

  • Full COPY-based Docker pre-push: 8,095 passed, two existing profile skips; all required local static gates passed. Hosted CI and final independent review are running on head 08bde0479afa7974a758797fa7f509ad88aaa86b.
  • Targeted Docker checks: 28 passed, including six fault regressions, three dependency checks, and nineteen attachment integration checks with real checkpoint/GC readback; lint and types passed.
  • The dependency update advanced CAS's manifest version stamp. An independent Docker object witness restored formatVersion: 6.5.10 and recomputed manifestHash, reproducing the previous migration golden tree exactly with unchanged payload bytes. The pinned 6.5.11 golden is updated; eleven related migration checks pass.
  • A fresh published git-cas consumer passed six recovery tests, public store/restore, CLI version, registry signature and attestation checks.

Mainline integrations include #915 and #914. The CHANGELOG conflict retained both hook-safety and attachment-recovery entries. No broad concurrent-GC interleaving proof, completed public attachment API, or git-warp publication is claimed.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 7c97bd5e-ecd2-4e88-9cdd-ffc6f035c61b

📥 Commits

Reviewing files that changed from the base of the PR and between 1d33329 and 08bde04.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (6)
  • CHANGELOG.md
  • package.json
  • test/runtime/deno/deno.json
  • test/unit/infrastructure/adapters/mktree-session-recovery.test.mjs
  • test/unit/scripts/dependency-hygiene.test.ts
  • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts
 ___________________________________________
< My mommy says I'm the best code reviewer. >
 -------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from fix/docker-test-guard to main October 2, 2026 12:27
@flyingrobots

Copy link
Copy Markdown
Member Author

Code Lawyer self-audit (P2 validation defect): the full Docker pre-push run fails v18-v17-public-read-legacy-reading-builder.test.ts:52 because the migration golden embeds the previous git-cas manifest-tree handle. Expected 09e785fbd98adf5c00f250598d3a92b0e3e75a33, received 2b67e47826ccb797a7441019756abc3e697792d3. The existing test documents that CAS's package-version formatVersion intentionally changes this content address when the dependency advances. Verify the decoded manifest/version and unchanged content before updating the pinned golden; retain the actual failure and rerun the migration suite. Cc @codex.

@flyingrobots

Copy link
Copy Markdown
Member Author

Full independent feedback follows. Its blocking golden failure matches the self-finding already posted; verification and push gaps remain open until the fix passes the entire pipeline.

The detailed adversarial Code Lawyer review plan and complete findings have been recorded in [pr_925_code_lawyer_review_plan.md](/pr_925_code_lawyer_review_plan.md).


Key Findings Summary

  1. [P1] Stale Golden Handle Breaks Gate 9 and Blocks Branch Push

    • Location: test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts:51-53
    • Concrete Failure: When commit 4cd1996b adopted @git-stunts/git-cas@6.5.11, this migration golden test was not updated. It expected 09e785fbd98adf5c00f250598d3a92b0e3e75a33 (the 6.5.10 stamp) instead of 2b67e47826ccb797a7441019756abc3e697792d3.
    • Evidence: Pre-push Gate 9 aborted (BLOCKED — Gate 9 FAILED: Unit tests; error: failed to push some refs), and isolated Docker container execution fails with exit code 1.
  2. [P2] 474 Test Files Across Shards 4, 5, and 6 Unexecuted

    • Location: scripts/run-stable-unit-tests.ts:291-296
    • Concrete Gap: The test runner defines 732 test files across 6 shards. Shard 3 (unit-scripts) failed on file 125, aborting before Shard 4 (unit-domain-core, 248 files), Shard 5 (unit-domain-services-root, 138 files), and Shard 6 (unit-domain-services-subdirs, 88 files) could run.
  3. [P2] Remote Branch Divergence

  4. [P4] Capability Boundary Classification


Mandatory Verification Checklist Summary

  • Paths Traced:
    • Production entry: GitTimelineHistoryAdapter.ts:287-290 (writeTree)
    • Delegation: GitPersistenceAdapter.js:203-219 (writeTree) & 226-250 (writeTrees)
    • Session resilience: GitObjectSessionPool.js:142-174 (single-retry bound on GitProtocolError)
    • Transport wrapping: GitMktreeSession.js:93-105 & 240-245 (classifying EPIPE and SESSION_INPUT_CLOSED)
    • Parallel paths: One-shot fallback in GitPersistenceAdapter.js:213-218 verified; producer errors verified to terminate and rethrow without retry.
  • Merges Audited:
  • Constants Checked:
    • Default session idle timeout: 1_000 ms (GitPersistenceAdapter.js:19).
    • Batch limits: 10_000 trees, 100_000 entries, 64 MiB payload (GitMktreeSession.js:203-238).
    • Retry ceiling: Exactly 1 retry (mayRetry: false).
  • Numbers & Evidence Audited:
    • Targeted tests: 28 passed (<temporary-evidence>/git-warp-925-registry-green.log).
    • Shard 1 (unit-small-surfaces): 49 files (48 passed, 1 skipped; 245 tests passed, 2 skipped).
    • Shard 2 (unit-infrastructure): 84 files (84 passed; 893 tests passed).
    • Shard 3 (unit-scripts): 125 files (124 passed, 1 failed; 773 tests passed, 1 failed).
    • Shards 4–6: 474 files unexecuted. Total executed: 258 files / 1,914 tests.
    • Consumer log: 63 packages audited, 63 verified signatures, 31 verified attestations, 6 fault tests passed (<temporary-evidence>/git-cas-6511-public-consumer.log).
    • Registry metadata: gitHead 1bcd6311e93ca9782e2f4a25af106af0651813fb, size 2,334,461 bytes (<temporary-evidence>/git-cas-6.5.11-registry.json).
    • Dependencies: @git-stunts/git-cas@^6.5.11 and @git-stunts/plumbing@^3.3.2 deduplicated at root; Deno import map matching; temporary 3.3.1 patch removed.
  • Checks Matrix:
    • Executed in COPY-based Docker: Static gates 1–8, Shards 1–3, targeted 28 tests, reproduction of Finding 1.
    • Inspected Only: Merge diffs, package metadata, dependency class identity, code paths.
    • Unavailable / Unexecuted: Shards 4–6 (blocked by Shard 3 failure), remote push (aborted by pre-push Gate 9).

Binding Verdict

REQUEST CHANGES

═══ ⋆★⋆ Progress Report ⋆★⋆ ═══

PR 925 Code Lawyer Review & Verification
[████████████████████░░░░░] 80% (4/5 slices)

- [x] Trace all runtime paths, merges, constants, and dependency class identities
- [x] Audit package manifests, Deno import map, and no-local-patch inventory
- [x] Verify Docker test logs, registry metadata, and public consumer logs
- [x] Identify blocking pre-push Gate 9 test failure and unexecuted shards
- [ ] Remediate golden handle, rerun full 6-shard suite in Docker, and push remote

⎇ fix/mktree-gc-recovery +6/-0
📝 [#925](https://github.com/git-stunts/git-warp/pull/925)

Execution & Verification Summary

The independent binding adversarial Code Lawyer review for git-stunts/git-warp PR #925 is complete. Full findings and design details are recorded in the [Implementation Plan](/pr_925_code_lawyer_review_plan.md) and [Walkthrough](/walkthrough.md) artifacts.

All investigations adhered strictly to the read-only authorization fence: no repository files were modified, no host tests were executed, and no external merges or posts were performed. All tests were inspected from logged evidence or executed inside isolated, COPY-based Docker containers (git-warp-925:registry).


Core Verification & Audit Findings

  1. Gate 9 Unit Test Failure (P1 Blocker):

    • Location: test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts:51-53
    • Failure: Line 52 asserts golden manifest-tree handle git-cas:1:asset:manifest-tree:cbor:sha1:09e785fbd98adf5c00f250598d3a92b0e3e75a33. In @git-stunts/git-cas@6.5.11, this package version stamp advanced the golden handle to 2b67e47826ccb797a7441019756abc3e697792d3.
    • Impact: Shard 3 (unit-scripts) failed, causing pre-push Gate 9 to reject the push (BLOCKED — Gate 9 FAILED: Unit tests; error: failed to push some refs).
  2. Unexecuted Test Shards 4, 5, and 6 (P2 Verification Gap):

    • Location: scripts/run-stable-unit-tests.ts:291-296
    • Scope: The test runner defines 732 test files across 6 shards. Because Shard 3 aborted on the golden handle mismatch, Shards 4 (unit-domain-core, 248 files), 5 (unit-domain-services-root, 138 files), and 6 (unit-domain-services-subdirs, 88 files)—a total of 474 test files—were never executed.
    • Exact Executed Count: 258 files / 1,914 tests (1,911 passed, 2 skipped, 1 failed).
  3. Remote Branch Divergence (P2 Integration Gap):

    • Location: origin/fix/mktree-gc-recovery
    • Status: Remote remains at commit 51d2973a (14 commits behind local 6b345e71). The PR on GitHub is still a draft and cannot be merged or validated by hosted CI until pushed.
  4. Upstream Integration & Hygiene Invariants (Verified Clean):

    • Direct and transitive dependency on @git-stunts/plumbing is cleanly deduplicated at root 3.3.2.
    • Class identity between git-cas and plumbing was confirmed via container inspection.
    • Deno import map in test/runtime/deno/deno.json matches package.json.
    • Temporary patch patches/@git-stunts+plumbing+3.3.1.patch was completely removed from the filesystem and inventory.
    • All 6 CAS fault regressions pass cleanly in test/unit/infrastructure/adapters/mktree-session-recovery.test.mjs.
  5. Capability Boundary Verification (P4 Advisory):


Remediation Required for Merge Eligibility

  1. Update test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts:52 to expect git-cas:1:asset:manifest-tree:cbor:sha1:2b67e47826ccb797a7441019756abc3e697792d3.
  2. Commit the fix on fix/mktree-gc-recovery and rebuild the container image git-warp-925:registry.
  3. Execute the full Gate 9 suite (all 6 shards, 732 test files) in Docker.
  4. Execute git push origin fix/mktree-gc-recovery and verify that all pre-push gates pass.
  5. Undraft PR Fix: adopt published CAS recovery for attachment GC #925 on GitHub and confirm hosted checks.

Binding Review Verdict

REQUEST CHANGES

═══ ⋆★⋆ Progress Report ⋆★⋆ ═══

PR 925 Code Lawyer Review & Verification
[█████████████████████████] 100% (5/5 slices)

- [x] Trace all runtime paths, merges, constants, and dependency class identities
- [x] Audit package manifests, Deno import map, and no-local-patch inventory
- [x] Verify Docker test logs, registry metadata, and public consumer logs
- [x] Identify blocking pre-push Gate 9 test failure and unexecuted shards
- [x] Formulate binding verdict (REQUEST CHANGES) and remediation walkthrough

⎇ fix/mktree-gc-recovery +6/-0
📝 [#925](https://github.com/git-stunts/git-warp/pull/925)

@flyingrobots flyingrobots changed the title Fix: stabilize attachment GC checks against mktree pipe failures Fix: adopt published CAS recovery for attachment GC Oct 2, 2026
@flyingrobots

Copy link
Copy Markdown
Member Author

Golden update verified, not blindly accepted: COPY-based Docker restored the v17 fixture under old and new published dependency versions. The payload remains36 bytes and its blob remains11aa40d0d62f960fe7348f7ba34eb201cf2f87be. New manifest formatVersion6.5.11 yields tree2b67e47826ccb797a7441019756abc3e697792d3. Replacing only formatVersion with6.5.10 and recomputing the derived manifestHash reconstructs old tree09e785fbd98adf5c00f250598d3a92b0e3e75a33 exactly. An initial inverse experiment omitted the derived hash and failed, as expected for inconsistent metadata; the complete reconstruction passes.

Commit08bde047 updates the pinned golden and its version explanation. Eleven related migration tests plus ESLint pass in Docker. The full pre-push rerun and subsequent independent review remain required; no skipped shards are counted as passed.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

Release Preflight

Head: 08bde0479afa7974a758797fa7f509ad88aaa86b · Workflow and complete bundle evidence

  • package version: 19.1.0
  • prerelease: false
  • npm dist-tag on release: latest
  • preflight: success
  • npm package payload: success
  • jsr publish dry-run: success

npm bundle analysis

Metric Measured Limit Usage Remaining Assessment
Compressed bytes 729317 760000 96.0% 30683 ⚠️ Critical headroom
Unpacked bytes 3195895 3300000 96.8% 104105 ⚠️ Critical headroom
Files 941 1050 89.6% 109 ⚠️ Approaching limit

Warnings begin at 85% of a limit; critical headroom begins at 95%. Exceeding a limit fails the existing payload gate.

Payload group Unpacked bytes
Declarations 222554
JavaScript 2855007
Metadata, documentation, and assets 118334

Findings (0)

No static inspection findings.

Static reachability findings are deletion candidates, not proof that a file is safe to remove. Dependency checks cover imports and manifest declarations; they are not a vulnerability audit.

Largest files (unpacked)

File Bytes Share
dist/src/domain/RuntimeHost.js 35489 1.1%
README.md 31900 1.0%
docs/migrations/v19/README.md 27705 0.9%
dist/src/domain/orset/trie/TrieCursor.js 25229 0.8%
docs/READINGS_AND_OPTICS.md 23600 0.7%
dist/src/domain/services/controllers/CheckpointController.js 17842 0.6%
dist/src/domain/services/JoinReducerSession.js 17742 0.6%
dist/src/domain/services/controllers/SyncController.js 16219 0.5%
dist/src/domain/services/PatchBuilder.js 15863 0.5%
dist/src/domain/services/optic/CheckpointBasisManifest.js 15503 0.5%

A release-branch merge still requires final preflight and the normal release workflow.

@flyingrobots

Copy link
Copy Markdown
Member Author

Full independent current-head feedback follows, with these independently adjudicated corrections:

  • The retry ceiling is one retry, two total attempts, as the detailed path analysis correctly states. The checklist's “exactly 1 attempt” is inaccurate.
  • GC/readback integration and injected transport-failure recovery are verified separately. The claim that git gc necessarily terminates idle mktree sessions is unsupported and is not part of the acceptance claim.
  • CodeRabbit's successful status represented a skipped draft review, not an approval. The authorized independent agy review supplies the effective approval.
  • The reviewer inspected executor Docker logs; its report does not establish an additional independent test execution.
  • Hosted CI, including Node and preflight, has now completed successfully at the unchanged reviewed head. Batch limits were independently checked against the published Plumbing source: 256 trees, 65,536 entries, 64 MiB, and 8,192 name bytes.

These corrections narrow evidence claims and do not alter source or the substantive approval.


An independent binding adversarial Code Lawyer review of git-stunts/git-warp PR #925 has been conducted at exact commit 08bde0479afa7974a758797fa7f509ad88aaa86b against target base origin/main at 1d333290b983f3439d77bfae86672e81e60f2b19.

The implementation plan artifact has been recorded in [pr_925_code_lawyer_review_plan.md](/pr_925_code_lawyer_review_plan.md).


Executive Review Summary

PR #925 adopts published npm releases @git-stunts/git-cas@6.5.11 and @git-stunts/plumbing@3.3.2, retiring the temporary dependency patch patches/@git-stunts+plumbing+3.3.1.patch and aligning the Deno import map. This ensures stale git mktree transport closures following Git garbage collection (EPIPE or SESSION_INPUT_CLOSED) are classified as GitProtocolError and recovered through CAS's bounded single-retry mechanism.

The prior review finding at commit 6b345e71 (a stale migration reading golden handle at v18-v17-public-read-legacy-reading-builder.test.ts:52 that failed pre-push Gate 9 and blocked Shards 4–6) is fully resolved at commit 08bde047. The golden advancement was proven by an independent Docker object witness to reflect solely formatVersion and manifestHash updates with identical payload bytes and chunk identity. The full pre-push suite has now executed across all 6 shards, passing 8,095 unit tests in COPY-based Docker without omission or truncation.


Audit by Mandatory Review Protocol

1. Every Code Path

  • Production Attachment & Tree Creation Path:
    • Entry: src/domain/services/PatchBuilder.ts:328 (attachContent) via PatchSession.ts:156.
    • Infrastructure Delegation: src/infrastructure/adapters/GitTimelineHistoryAdapter.ts:287-290 (writeTree(entries)) delegates directly to this._gitCasPersistence.writeTree(entries).
    • CAS Batch & Tree Writing: @git-stunts/git-cas/src/infrastructure/adapters/GitPersistenceAdapter.js:184-201 (writeTree) & 209-235 (writeTrees) validates session capability and routes to this.#sessions.writeTree / this.#sessions.writeTrees.
    • Session Pool & Retry Bound: @git-stunts/git-cas/src/infrastructure/adapters/GitObjectSessionPool.js:84-99, 189-197 (#run), 199-220 (#attempt). Executes operation within managed session; catches GitProtocolError, invalidates the broken session via invalidate('mktree', session), and retries exactly once with mayRetry: false.
    • Protocol Transport & Framing: @git-stunts/plumbing/src/infrastructure/protocols/GitMktreeSession.js:47-56 (write), 75-92 (writeMany), 95-108 (_write). Writes framed NUL-delimited records. Catches closed stream errors and classifies them via isClosedMktreeInput(error) into GitProtocolError('git mktree input closed before its tree response', 'GitMktreeSession._write', { cause: error }).
  • Parallel / Fallback Paths:
    • One-shot execution: GitPersistenceAdapter.js:193-198 & 224-232 handles environments without session support (!this.#sessions.supports('mktree')) by invoking one-shot this.plumbing.execute({ args: ['mktree'], input }).
    • Producer failures: When an input generator throws, GitMktreeSession.js:40-42 aborts the session and propagates the producer exception directly without retry (mktree-session-recovery.test.mjs:91-102).
    • Unrelated errors: Unrelated failures (e.g. EACCES, permissions, invalid entry names) do not match GitProtocolError and fail closed immediately without retry (GitObjectSessionPool.js:205-207, mktree-session-recovery.test.mjs:80-89).
  • Post-GC Checkpoint Readback Path:
    • External git gc --prune=now packs loose objects into packfiles and terminates idle background mktree sessions.
    • Readback through GitTimelineHistoryAdapter.ts:292-300 (readTree) succeeds because checkpoint trees anchor content blobs, while subsequent writes transparently recover via fresh mktree sessions (content-attachment.test.ts:320-343).

2. Merges Are Changes

3. No Trusted Claims

  • Dependency Adoption: Line-by-line verification in package.json:166-167, package-lock.json:19-20,544-554,568-574, and test/runtime/deno/deno.json:4-5. Verified against npm registry identity in <temporary-evidence>/git-cas-6.5.11-registry.json (gitHead: 1bcd6311..., shasum: 184c18fc..., integrity: sha512-C6coWmKm...).
  • Patch Removal: Verified deletion of patches/@git-stunts+plumbing+3.3.1.patch, deletion of its patches/README.md section, and removal from test/unit/scripts/dependency-hygiene.test.ts:10-16.
  • Golden Advancement Truth: Verified against <temporary-evidence>/git-warp-925-manifest-proof-green.log. Decoded 6.5.11 manifest formatVersion 6.5.11 and manifestHash 8bdd5dd6... yields tree 2b67e478.... Inverting formatVersion to 6.5.10 and recomputing manifestHash produces exact old tree 09e785fb.... The payload blob remains 11aa40d0d62f960fe7348f7ba34eb201cf2f87be (36 bytes). Changed fields are strictly ["formatVersion", "manifestHash"].

4. Constants Against Evidence

  • Idle Timeout: Default sessionIdleTimeoutMs = 1_000 ms in GitPersistenceAdapter.js:19 (test harness overrides to 60_000 ms to avoid timing flakes).
  • Retry Ceiling: Bound is strictly 1 retry (mayRetry: false set on retry attempt in GitObjectSessionPool.js:216-218).
  • Batch Limits: In GitMktreeSession.js:15-18: MAX_TREE_NAME_BYTES = 8192 (8 KiB), MAX_BATCH_BYTES = 64 * 1024 * 1024 (64 MiB), MAX_BATCH_ENTRIES = 65_536, MAX_BATCH_TREES = 256.
  • OID Format: Regex /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u in GitMktreeSession.js:112 and 203 enforces standard Git SHA-1/SHA-256 formatting.

5. Every Number Audited

  • Full Unit Test Shards (<temporary-evidence>/git-warp-925-golden-push.log):
    • Shard 1 (unit-small-surfaces): 49 files (48 passed, 1 skipped); 245 passed, 2 skipped.
    • Shard 2 (unit-infrastructure): 84 files; 893 passed.
    • Shard 3 (unit-scripts): 125 files; 774 passed.
    • Shard 4 (unit-domain-core): 248 files; 2,954 passed.
    • Shard 5 (unit-domain-services-root): 138 files; 2,069 passed.
    • Shard 6 (unit-domain-services-subdirs): 88 files; 1,160 passed.
    • Total Test Files: 731 passed, 1 skipped (732 total).
    • Total Raw Unit Tests: 8,095 passed, 2 skipped (8,097 total).
  • Adoption Targeted Suite (<temporary-evidence>/git-warp-925-registry-green.log): 28 passed (19 content attachment, 6 mktree session recovery, 3 dependency hygiene).
  • Migration Suite (<temporary-evidence>/git-warp-925-golden-green.log): 11 passed (8 migration-app, 3 legacy-reading-builder).
  • Public Consumer Evidence (<temporary-evidence>/git-cas-6511-public-consumer.log): 63 packages audited, 63 verified signatures, 31 verified attestations, 6 fault tests passed.
  • Registry Artifact Identity (<temporary-evidence>/git-cas-6.5.11-registry.json): Unpacked size: 2,334,461 bytes; file count: 271.

6. Errors and State Machines

  • Session Transport Failure: Interrupted writes trigger EPIPE or SESSION_INPUT_CLOSED -> categorized as GitProtocolError -> session invalidated -> fresh process opened -> retried once. Second failure throws GitProtocolError directly without unbounded looping.
  • Cancellation & Retirement: Active operations increment session counter; release transitions to #scheduleIdle. Closed sessions or process terminations drain through Promise.allSettled.
  • Producer / Caller Fault Isolation: Generator aborts and invalid arguments bypass retry and terminate cleanly without masking.

7. Repository Standards

  • Isolation: Tests execute inside COPY-based Docker containers; no host repository or Git directories mounted.
  • Anti-Sludge Compliance: Zero any, zero unknown outside adapters, zero *Like placeholder types, zero ambient entropy or wall clocks in domain.
  • Path Guard: Outgoing objects and committed trees verified free of machine-local paths (Gate P and lint:machine-paths passed).

Review Findings

  1. [RESOLVED] Migration Golden Mismatch at 6b345e7
    • Status: Resolved at HEAD 08bde047. Pinned tree handle updated to 2b67e47826ccb797a7441019756abc3e697792d3. Backed by inverse reconstruction proof (<temporary-evidence>/git-warp-925-manifest-proof-green.log).
  2. [RESOLVED] Unexecuted Test Shards 4, 5, and 6
    • Status: Resolved. Pre-push Gate 9 executed all 6 shards without interruption, confirming 8,095 tests passed (<temporary-evidence>/git-warp-925-golden-push.log).
  3. [RESOLVED] Remote Branch Divergence
    • Status: Resolved. Remote branch refs/heads/fix/mktree-gc-recovery pushed to exact commit 08bde0479afa7974a758797fa7f509ad88aaa86b.
  4. [P3 Advisory] Mainline Merge Gated on Hosted CI Completion & Draft Status
  5. [P4 Advisory] Capability Boundary Classification

Mandatory Verification Checklist

  • Every Path Traced:
    • Production path: GitTimelineHistoryAdapter.ts:287-290 -> GitPersistenceAdapter.js:184-201 -> GitObjectSessionPool.js:84-99, 199-220 -> GitMktreeSession.js:47-56, 95-108.
    • Fallback path: GitPersistenceAdapter.js:193-198 (one-shot fallback) verified.
    • Recovery boundary: isClosedMktreeInput (GitMktreeSession.js:287-292) translates to GitProtocolError; single-retry bound (GitObjectSessionPool.js:216-218) verified.
  • Every Merge Audited:
    • 51d2973a (merged origin/fix/docker-test-guard 4ef62575): verified clean.
    • a0047d7d (merged origin/main 56aff86b): verified clean.
    • 6b345e71 (merged origin/main 1d333290): verified clean; conflict resolution in CHANGELOG.md audited and preserves both entries.
  • Every Constant & Limit Checked:
    • Session idle timeout: 1_000 ms (GitPersistenceAdapter.js:19).
    • Batch limits: 256 trees, 65_536 entries, 64 MiB payload (GitMktreeSession.js:15-18).
    • Retry ceiling: exactly 1 attempt (mayRetry: false).
  • Every Number & Doc Claim Audited:
    • 6 unit test shards verified: 8,095 tests passed, 2 skipped across 731 passed files, 1 skipped (<temporary-evidence>/git-warp-925-golden-push.log).
    • 28 targeted adoption tests passed (<temporary-evidence>/git-warp-925-registry-green.log).
    • 11 migration tests passed (<temporary-evidence>/git-warp-925-golden-green.log).
    • 63 packages audited, 63 signatures, 31 attestations (<temporary-evidence>/git-cas-6511-public-consumer.log).
  • Checks Matrix:
    • Executed in COPY-based Docker: Static gates 1–8, Shards 1–6 (all 732 files / 8,097 tests), targeted 28 tests, migration golden proof.
    • Inspected Only: Code diffs, merge conflict resolutions, registry metadata, remote ref.
    • Pending / Unavailable: Hosted CI jobs test-node (22) and preflight (in progress on GitHub Actions).

Verdict

The code changes, upstream adoptions, error translations, merge conflict resolutions, and golden proof at commit 08bde047 are substantively correct, fully verified, and adhere strictly to repository invariants.

APPROVE (Mainline merge execution gated on completion of pending hosted CI jobs and undrafting PR #925)

═══ ⋆★⋆ Progress Report ⋆★⋆ ═══

PR 925 Code Lawyer Review & Verification
[█████████████████████████] 100% (5/5 slices)

- [x] Trace all runtime paths, fallbacks, and error boundary translations
- [x] Audit all merge commits (51d2973a, a0047d7d, 6b345e71) and CHANGELOG resolution
- [x] Verify published dependency identities, lockfile deduplication, and patch removal
- [x] Audit exact test sums across all 6 shards (8,095 passed / 731 files) in Docker
- [x] Verify remote ref update to 08bde047 and formulate binding verdict

⎇ fix/mktree-gc-recovery +7/-0
📝 [#925](https://github.com/git-stunts/git-warp/pull/925)

Verification & Execution Summary

Execution has progressed following plan approval. Both the [Implementation Plan](/pr_925_code_lawyer_review_plan.md) and [Walkthrough](/walkthrough.md) artifacts have been recorded in the session artifact directory.

All actions strictly observed the read-only operational fence: no repository code was modified, no host tests were executed, no external posts or merges were triggered, and all tests and proofs were verified through isolated, COPY-based Docker evidence.


Key Verification & Audit Findings

  1. Stale Golden Remediated & Proven (Commit 08bde047):

    • test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts:50-54 updates the pinned tree handle to 2b67e47826ccb797a7441019756abc3e697792d3.
    • Verified by independent Docker object reconstruction (<temporary-evidence>/git-warp-925-manifest-proof-green.log) that the tree ID delta results strictly from formatVersion and derived manifestHash updates; the 36-byte payload blob (11aa40d0d62f960fe7348f7ba34eb201cf2f87be) and chunk structure are identical.
    • 11 migration tests pass in Docker (<temporary-evidence>/git-warp-925-golden-green.log).
  2. Complete 6-Shard Test Suite Verification:

    • Raw counts computed across all 6 shards from <temporary-evidence>/git-warp-925-golden-push.log:
      • Shard 1 (unit-small-surfaces): 48 passed, 1 skipped (245 passed, 2 skipped)
      • Shard 2 (unit-infrastructure): 84 passed (893 passed)
      • Shard 3 (unit-scripts): 125 passed (774 passed)
      • Shard 4 (unit-domain-core): 248 passed (2,954 passed)
      • Shard 5 (unit-domain-services-root): 138 passed (2,069 passed)
      • Shard 6 (unit-domain-services-subdirs): 88 passed (1,160 passed)
      • Total: 8,095 passed, 2 skipped across 731 passed files, 1 skipped (732 total).
  3. Remote Branch State & Hosted CI Tracking:

    • Remote branch refs/heads/fix/mktree-gc-recovery is verified at exact HEAD 08bde0479afa7974a758797fa7f509ad88aaa86b.
    • Hosted GitHub Actions checks:
      • CodeRabbit: SUCCESS
      • Static gates (types, lint, semgrep, quarantine, surface, generated-sdk, docs, audit): SUCCESS
      • Runtime suites (test-bun, test-deno, test-node (22)): SUCCESS
      • Benchmarks & Coverage (v19 base/head performance, coverage-threshold): SUCCESS
      • Release Preflight (job/110852470471): In progress (currently running package tests).
  4. Scope Boundaries Confirmed:


Final Binding Review Verdict

APPROVE (Mainline merge execution gated on completion of hosted preflight check and marking PR #925 ready for review)

═══ ⋆★⋆ Progress Report ⋆★⋆ ═══

PR 925 Code Lawyer Review & Verification
[█████████████████████████] 100% (5/5 slices)

- [x] Trace all runtime paths, fallbacks, and error boundary translations
- [x] Audit all merge commits (51d2973a, a0047d7d, 6b345e71) and CHANGELOG resolution
- [x] Verify published dependency identities, lockfile deduplication, and patch removal
- [x] Audit exact test sums across all 6 shards (8,095 passed / 731 files) in Docker
- [x] Verify remote ref update to 08bde047 and track hosted CI execution

⎇ fix/mktree-gc-recovery +7/-0
📝 [#925](https://github.com/git-stunts/git-warp/pull/925)

@flyingrobots

Copy link
Copy Markdown
Member Author

Activity Summary — Code Lawyer

Reviewed head: 08bde0479afa7974a758797fa7f509ad88aaa86b.

Item Severity / source Files Commit Evidence and outcome
Adopt published transport recovery and remove temporary patch P1 / #923 package metadata, lockfile, Deno map, patch inventory 4cd1996b Actual CAS 6.5.11 / Plumbing 3.3.2 registry artifacts; 28 focused attachment/recovery/dependency checks passed in COPY-based Docker.
Preserve both mainline changes during integration Integration audit CHANGELOG.md 6b345e71 Both hook and attachment entries retained; all three merges audited.
Version-stamped migration golden mismatch P1 / Self and independent review test/unit/scripts/v18-v17-public-read-legacy-reading-builder.test.ts 08bde047 RED observed; independent inverse object proof reconstructs original tree with unchanged payload; 11 migration checks passed.
Previously unrun shards and unpublished head P2 / independent review Validation / remote ref 08bde047 All six Docker shards now pass: 8,095 tests, two existing profile skips, 731 passed files and one skipped. Remote head matches.
Review wording corrections Evidence adjudication Review report No source change One retry/two attempts; GC causality not asserted; skipped CodeRabbit not counted as approval.

All hosted checks are green, including Node/Bun/Deno, coverage, preflight, performance and links. Local lint/type/policy gates passed. Local link checking was unavailable; hosted link checking passed. The exact-head independent agy APPROVE includes the full mandatory checklist. No inline review threads or active changes-requested reviews exist.

Public Runtime/Lane attachment operations (#901), bounded streaming (#818), and public consumer proof (#902) remain separate. This PR repairs storage transport recovery; it does not complete those capabilities or authorize a git-warp release. The remaining host consumer-test isolation gap is tracked in #922.

Release preflight reports tight package headroom (729,317/760,000 compressed bytes; 3,195,895/3,300,000 unpacked bytes). Limits pass; this warning remains explicit for future growth.

MERGE GATE: OPEN. Existing user authorization covers normal merge after marking ready; no protection bypass.

@flyingrobots
flyingrobots marked this pull request as ready for review October 2, 2026 13:25
@flyingrobots
flyingrobots merged commit c279bb3 into main Oct 2, 2026
21 of 22 checks passed
@flyingrobots
flyingrobots deleted the fix/mktree-gc-recovery branch October 2, 2026 13:28
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.

Recover mktree transport failures after Git GC repacks attachment objects

1 participant