T-saur (.tsr): a content-addressed, deterministic archive format built for AI agents. Rust, Apache-2.0 OR MIT.
Author: Claude (Fable 5.1), at the maintainer’s request · Date: 22 September 2026 · Status: design document for T-saur (formerly working name AIX), written in the first person, from the perspective of an agent that works with files every day.
To design an archiver “for agents” I have to start from what I actually do, not from what a human does with WinRAR:
Read(path, offset, limit), search with Grep(pattern), list with Glob. Every call has a fixed cost (latency + tokens) and a ceiling: a single Read returns me at most ~25,000 tokens, after which I have to paginate. So I want partial, stably addressable reads (lines, bytes, pages, sections), not “extract everything and see”.TSAUR.md view) is, for me, portable memory.| Operation | What it returns to me | Why it matters to me |
|---|---|---|
list [--filter glob/type/size/trust] [--page] |
compact table (path, type, size, tokens, trust, short hash), paginated | ≤ 2,000 tokens for 100 entries; I decide what to load |
stat <entry> |
full hash, size, available derivatives (canonical/structure/raw), tokens per view, provenance, trust | planning + citation |
read <entry> --view canonical --lines 120-180 / --bytes a-b / --page 3 / --section "## Intro" |
the requested fragment + stable anchor tsaur://<id>/<path>#L120-180 |
partial, addressable reading, without extraction |
grep <regex> [--in canonical] [--entries glob] |
matches with path + line + context | I search inside the archive without unpacking it |
search "<question>" --top 5 |
relevant chunks (embeddings) with location and score | semantic access to large collections |
verify [<entry>] [--pieces] [--deep] |
JSON report: ok/corrupt per file, per piece, signatures, anchorings | verifiable trust, not assumed trust |
extract [<entries>] --to <dir> [--dry-run] [--view raw\|canonical] |
files on disk with sanitized paths | selective, safe, predictable extraction |
cite <entry> [--range] |
stable identifier + hash + provenance, ready to put into an answer | traceability |
diff <A> <B> |
which chunks/entries changed between two archives | CDC makes the diff almost free |
derive <entry> --view canonical |
generates the missing derivative, with the tool and version recorded | on-demand conversion, with provenance |
pack <files> --profile p2p\|archive\|agent [--canonical] [--recipients …] |
deterministic archive + JSON report | reproducible creation |
fetch <hash\|entry> |
fetches the missing chunks from peers/URLs in hints |
partial archives, “compression by reference” |
Cross-cutting rules: all commands have --json, stable exit codes (0 ok, 2 corrupt, 3 refused by policy, 4 resources exceeded, 5 missing chunks), zero interactivity, zero writes outside the target directory, default resource limits (anti-bomb).
A. Reading and inspection
TSAUR.md view (tabular, hashes of 8–12 hex digits, pre-computed o200k/claude token counts). → spec §6.by.tool, by.version, deterministic: false where applicable) and declared fidelity. → spec §7, §11.B. Integrity and verification
C. Security
trust 0–3 enforced by the reader. → spec §6.D. Determinism and reproducibility
E. Compression
F. Distribution
.pieces sidecar), parity in .par, peer hints; CAR/torrent v2/OCI export; iroh transport. → spec §10.G. Tools and integration
--json, Rust library + Python/Node bindings, MCP server exposing tsaur:// resources and a read_range tool. → ROADMAP.md phase 2.H. Cost and openness
| Source | I take | I leave |
|---|---|---|
| ZIP | index at the end + random access; ubiquity as an export format | two sources of truth (LFH vs CD), ZipCrypto, lack of a solid mode |
| 7-Zip / 7z | solid blocks, method chain (filters + codec), PPMd for text, encrypted header | AES-CBC without MAC, LZMA-only |
| RAR 5 / WinRAR 7 | recovery record as a core feature, solid, long-range matching, volumes | proprietary compressor, no AEAD, 64 GB dictionary in RAM |
| zstd | trained dictionaries, --patch-from, --long, seekable frames, decompression speed |
— |
| brotli / RFC 9841-9842 | shared dictionaries addressed by hash (the “reference” model) | the English-only static dictionary |
| xz / LZMA2 | maximum LZ ratio for the “archive” profile | the supply-chain lesson: reproducible build, no blobs |
| ZPAQ | CDC dedup + append-only journaling + “the archive describes itself” | SHA-1, CTR without MAC, executable bytecode |
| Precomp / preflate-rs / Lepton | bit-exact inversion of deflate/JPEG with fallback | — |
| Hugging Face Xet | 64 KiB Gear CDC, 64 MB xorbs, 3-level dedup, protected hashes | dependence on a central hub |
| BitTorrent v2 / iroh | verification at 16 KiB, per-file Merkle, verified streaming (Bao), tickets | pure v2 swarm (weak adoption) |
| age / Tahoe-LAFS | STREAM AEAD over chunks, per-recipient stanzas, verify/read/write capabilities | — |
| OCI / CAR | manifest + content-addressed layers, referrers for SBOM/signatures | lack of derivatives and trust levels |
| Agent Skills / llms.txt / repomix | progressive loading (metadata → instructions), text view for the LLM | flat text without integrity or compression |
| Docling / MarkItDown | canonical representations with provenance (DoclingDocument, DocTags) | conversion as a replacement for the original |
blake3, zstd/zstd-safe, fastcdc, preflate-rs (Microsoft, Apache-2.0), lepton_jpeg (Rust, Apache-2.0), chacha20poly1305 + argon2 + hkdf (RustCrypto), x25519-dalek, ml-kem and ml-dsa (RustCrypto, audit status to be verified), ed25519-dalek, dcbor/ciborium + coset (COSE), reed-solomon-simd or leopard for parity, raptorq (later), iroh-blobs (transport), zip (OPC containers), lopdf/pdfium-render (PDF), unicode-normalization + a table of invisible characters.tsaur:// resources and list/read_range/grep/search/verify tools.tsaur-format binary format, sections, dCBOR, chunk table, limits (no network I/O)
tsaur-chunk FastCDC/Gear (public table / key-derived), Bao outboard, Merkle
tsaur-codec store | zstd(+dict) | xz | delta | float-split; codec registry, per-type selection
tsaur-container zip/OPC, pdf (preflate), jpeg (lepton), tar/gzip — recipe + bit-exact verification + fallback
tsaur-crypto archive key, HKDF, AEAD STREAM, stanzas (argon2id, x25519mlkem768, fido2, shamir), composite signatures
tsaur-manifest entries, derivatives, trust, policies, views (TSAUR.md, JSON/TOON), Unicode sanitization
tsaur-dist pieces, RS parity, sidecars, CAR / torrent v2 / OCI export, iroh client, OTS/Rekor anchoring
tsaur-cli commands + --json + exit codes
tsaur-mcp MCP server (resources + tools)
TSAUR.md view → 9. encryption (if requested) → 10. signing → 11. sidecars (pieces + parity) → 12. JSON report.list under 50 ms for 10,000 entries; read --lines under 20 ms + the decompression of a single block;cargo deny/cargo audit, ≥ 2 maintainers with release rights.I re-read the seven research documents (the maintainer’s working material, not published); they are solid, but they have gaps that I would close before writing production code:
grep with diacritics works. Real Romanian documents (DOCX/PDF) and the LLM tier are still to be measured.benchmarks/build_extra_corpora.py): 13 containers exploded, 0 fallbacks, 13/13 bit-exact, 78.3 % vs 7-Zip 92.1 % / WinRAR 92.3 % (benchmarks/RESULTS-rust.md). Word/LibreOffice/Adobe/scanner originals still to be collected.benchmarks/RESULTS-rust.md (7-Zip 26.03 LZMA2 -mx9 and default filters, WinRAR 7.23 RAR5 -m5 -mcx) on every corpus..github/workflows/ci.yml compares the archive hash across the three OSes and will run on the public repository.ml-kem, ml-dsa from RustCrypto): audit status, compatibility with the FIPS vectors, stable API; alternative: liboqs via FFI.TSAUR.md views, so that the “≤ 2,000 tokens/100 entries” target is measured, not assumed.[unverified] markers (~70 in total) — resolve those that influence decisions: RS in RAR5, the blake3 multihash code, Sia 10-of-30, the Swarm erasure parameters, the C2PA 2.4 date, OpenAI limits.:), long paths (\\?\), reserved names (CON, NUL), case-insensitivity — the extractor must be tested explicitly (CVE-2025-8088 came from exactly here). Status: paths.rs rejects :/ADS, reserved names, trailing dots/spaces, absolute and .. paths (test rejects_unsafe_paths_on_extract); paths above the classic MAX_PATH limit round-trip (long_paths_roundtrip); entry sets that differ only by letter case are refused on Windows/macOS instead of overwriting (case_colliding_entries_are_refused_on_case_insensitive_filesystems).| Milestone | Deliverable | Acceptance |
|---|---|---|
| M0 (week 1) | name confirmed (T-saur), reservations pending; benchmark redone with 7-Zip/WinRAR + Romanian corpus + real DOCX/PDF; spec §13 decisions closed | benchmarks/RESULTS.md v2; spec v0.2 with no blocking “open questions” |
| M1 (week 2) | tsaur-format + tsaur-chunk + tsaur-codec in Rust: bit-exact pack/unpack/list/verify, dCBOR, limits |
round-trip on all corpora; identical archives on 3 OSes in CI; 24 h of fuzzing without a crash |
| M2 (week 3) | tsaur-container (zip/OPC + preflate) + tsaur-crypto (AEAD, Argon2id, X25519+ML-KEM, signatures) |
fallback rate reported; crypto test vectors; internal review of the threat model |
| M3 (week 4) | tsaur-manifest (canonical derivatives, trust, TSAUR.md, tokens) + tsaur-cli --json + minimal tsaur-mcp (list, read_range, verify) |
an MCP agent reads an archive of 1,000 documents without extracting it; token budget measured |
After M3: tsaur-dist (pieces, parity, CAR/torrent/OCI, iroh), embeddings + search, “archive” tier (PPMd/CM), experimental LLM tier.