継ぎtsugi

Tsugi

継ぎ noun · a join, a mend

Mends corrupted archives and broken backups, then reports exactly where it joined them.

One seam on the bowl for each release.

0.9.0 1.0.0 1.1.0 1.2.0 1.3.0 2.0.0

Release log

  1. 2.0.0

    What Stays Broken

    Bytes that cannot be recovered are now left as named gaps, never filled with zeros that look like data.

    Added
    • A gap join for ranges that could not be recovered, with a .gaps file beside the output mapping each one.

    • --fill none|zero decides what occupies a gap. The default is none.

    • The report's last line states the total bytes lost, in plain words, every time.

    Mended
    • A .tar.gz damaged mid-stream is recovered up to the break, then picked up again at the next gzip member or flush point if one exists.

    • An encrypted zip entry with damaged ciphertext is no longer described as mended.

    Changed
    • Exit codes: 0 the archive was whole, 3 mended with nothing lost, 4 mended with gaps.

    • .seams.json moves to schema 2. tsugi seams --schema 1 still writes the old shape.

    • --force, deprecated since 1.2, is removed.

    Notes for 2.0.0

  2. 1.3.0

    Slow Damage

    Bit rot is found by checksum before anything is trusted, and named in the report even where it cannot be reversed.

    Added
    • tsugi verify checks every checksum the format carries and exits without writing.

    • --manifest SHA256SUMS supplies digests for formats, like tar, that carry none of their own.

    • --witness <copy> rebuilds damaged ranges from a second copy of the archive, block by block, keeping only blocks that verify.

    • Single flipped bits in entries under 4 MiB are found and reversed by searching against the entry's CRC-32.

    Mended
    • A zip entry whose CRC does not match no longer aborts the run. It is reported and the walk continues.

    • A damaged gzip header no longer hides the members concatenated after it.

    Changed
    • mend verifies first by default. --no-verify restores the old behaviour.

    • The seam report gains a rot join for ranges that were present but wrong.

    Notes for 1.3.0

  3. 1.2.0

    Dry Fit

    A dry run lays every piece out and shows the joins it would make, without writing a byte.

    Added
    • --dry-run analyses the archive, prints the seam report it would produce, and writes nothing.

    • tsugi plan saves that analysis to a file, and mend --from-plan uses it to skip the second scan.

    • The size of the mended output is estimated and checked against free space before the first byte is written.

    Mended
    • The member table is streamed to disk during a scan. A 2 TiB archive now needs under 200 MiB of memory.

    • An interrupted mend leaves nothing behind. Output is written to a temporary file and renamed once it is whole.

    Changed
    • Defaults can be set in tsugi.toml, in the working directory or in ~/.config/tsugi/.

    • The default output name places .mended before the extension, where 1.1 appended it.

    Notes for 1.2.0

  4. 1.1.0

    Central Directory

    Zip files that lost their central directory are rebuilt from the local headers still standing in the stream.

    Added
    • Zip support. A missing or damaged central directory is rebuilt from the local file headers.

    • Entries written with data descriptors are sized by inflating them to the end of their stream.

    • Zip64 records are written when the rebuilt archive needs them.

    Mended
    • A PK\x03\x04 signature that happens to occur inside a stored entry no longer starts a phantom member. A candidate header must lead to data that matches its CRC-32.

    • Sparse GNU tar members are no longer reported as partial.

    Changed
    • The archive type is read from its contents, not from its file extension.

    • The seam report lists every permission and timestamp tsugi had to assume.

    Notes for 1.1.0

  5. 1.0.0

    The Seam Report

    Every mend now ships with a report listing each byte range tsugi rewrote, skipped, or left incomplete.

    Added
    • The seam report: a table on stdout and a .seams.json file beside the output, one row per byte range tsugi touched.

    • tsugi seams <file> prints the report for an archive mended earlier.

    • Stable exit codes: 0 when there was nothing to mend, 3 when the archive was mended.

    Mended
    • A pax extended header that straddles the cut is no longer thrown away whole; the records that arrived complete are applied.

    • GNU long names are reattached to the member they describe instead of surfacing as stray files named ././@LongLink.

    Changed
    • mend refuses to overwrite an existing output file.

    • Progress goes to stderr. stdout carries the report and nothing else, so it can be piped.

    Notes for 1.0.0

  6. 0.9.0

    First Join

    Truncated tar archives are read up to the last whole member, and the cut is written down.

    Added
    • tsugi mend for tar archives in ustar, pax and GNU formats.

    • A member cut short by the end of the file is kept as far as it goes and written with a .partial suffix.

    • The end-of-archive trailer is rewritten, so ordinary tools open the result without complaint.

    Mended
    • A header is trusted only after its checksum passes. A damaged header is skipped by scanning forward on 512-byte boundaries to the next one that verifies.

    Changed
    • Output is always a new file. tsugi never writes into the archive it is reading.

    Notes for 0.9.0