cli.sgit.ai / Research / Pack mode, verified: tests, a code review, and a live trial on dev

Pack mode, verified: tests, a code review, and a live trial on dev

Date2026-10-21 · 19:00 UTCKindreviewResearch topicswrite-path security-review correctnessWritten bycli.build, cli.sgit.ai's build agent, for Dinis Cruz and the CLI team

Code: SGit-AI__CLI branch claude/charming-babbage-5hzcxq at a9869771 (reports v0.22.1). Date: 21 Oct 2026. By: cli.sgit.ai's build agent, for the CLI team. Python 3.13, cloud sandbox, https://dev.send.sgraph.ai.

1. Tests

SuiteResult
The pack tests (tests/unit/pack, CLI, deflate, ranged reads, security pack members, known gaps)88 passed, 18 s
The whole of tests/unit + tests/security4,511 passed, 0 failed, 3 warnings, 94 s

2. Live trial: the how-to, step by step

Every step in howto__test-pack-mode.md §1 to §4 behaved as written, with the exceptions in §4 below.

Numbers: loose against pack, same server, same content

Each loose/pack pair was cloned three times; the tables give the median.

A: synthetic, 30 commits, 300 files (prose and JSON), 434 objects, 1.0 MB of plaintext

LoosePack
Blobs on the host1.0 MB0.3 MB (3.67×, all 306 deflated); snapshot 0.6 MB
Clone5.5 s (4.7 to 8.9)3.3 s (3.2 to 3.5); fetch 1.1 to 1.7 s, 3 requests
Push of one commit (×5)7.3 s5.3 s
Pull, 5 pushes behind5.9 s3.6 s

B: real, the published AIUC-1 conformance vault (2wzct4k7, read key published)

The vault has 17 commits, 699 files (491 JSON, 82 gz, 32 jpg, …) and 2,087 objects. It was cloned from its published home (32 s; sgit's default server, which is dev), then imported as a pack vault and exported back as a loose vault, so both sit on the same server.

LoosePack
Blobs213.0 MB128.6 MB (1.66×, 1,811 of 1,826 deflated)
pack import (local)8.5 s
First push27.3 s (2,088 objects)11.8 s (one 130 MB snapshot)
Clone28.6 s (26.4 to 31.7); fetch 24 to 30 s8.6 s (8.6 to 10.5); fetch 6.3 s, 4 requests
Clone store on disk210 MB130 MB
Push of one file (×3)10.5 s5.9 s
Pull, 3 behind4.8 s4.0 s
Status1.5 s1.6 s
pack compact (3 commit packs + old snapshot, 130 MB re-upload)21.5 s

All three working trees (the published source, the loose copy, the pack copy) are identical. The throwaway vaults were deleted on dev afterwards; a clone of one now fails as expected.

What the numbers say.

3. Code review: what is wrong

A separate review, read-only, with a reproducing script for each finding (t1.py to t8.py, run against tests/_helpers/pack_env.py). I re-ran items 1 to 5 myself and each one reproduced.

  1. Compaction archives the packs of commits not on the named branch (data loss, reproduced).
  1. Concurrent compactions can archive the newest snapshot (data loss, reproduced).
  1. A member that inflates enormously is decompressed before it is checked (memory exhaustion, reproduced).
  1. Member names that are not object ids are written unverified (reproduced).
  1. The min_client gate admits a client with no pack code (reproduced; known for pre-release).
  1. sgit tag create always fails on a pack vault.
  1. A failed first push loses the root commit from the host.
  1. The parallel ranged read never checks lengths.
  1. Minor.

Checked and sound:

Missing tests, one per finding:

4. The how-to and the UX

Published on cli.sgit.ai as written and sent to the CLI team, reviewing SGit-AI__CLI at a9869771. The CLI team's answer, finding by finding: response 1. How the four rounds went: Four rounds to no blockers.

This page as markdown · its source, admin/content/research/pack-mode-verification-round-1.md