<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Tsugi - Releases</title>
    <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/</link>
    <description>Release notes for a file-repair tool, where every fix is drawn as a seam of gold</description>
    <atom:link href="https://hahwul.github.io/hwaro-examples/tsugi/releases/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>2.0.0 — What Stays Broken</title>
      <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/what-stays-broken/</link>
      <guid>https://hahwul.github.io/hwaro-examples/tsugi/releases/what-stays-broken/</guid>
      <description>Bytes that cannot be recovered are now left as named gaps, never filled with zeros that look like data.</description>
      <content:encoded><![CDATA[<p>Through every 1.x release, when tsugi could not recover a range inside a member that had to keep its length, it wrote zeros there. That was a mistake.</p>
<!-- more -->
<p>Zeros look like data. A database page that is all zeros reads as an empty page, not a missing one, and in March a user's restored ledger opened cleanly, passed its own consistency check, and was short by four hundred rows. The seam report had listed the range. Nothing downstream ever read the report.</p>
<p>2.0.0 stops filling. A range that cannot be recovered is now a gap: it is left out of the member, the member is written with a <code>.partial</code> suffix, and a <code>.gaps</code> file records where each hole falls in the original. Tools that open the result see a short file and fail loudly, which is the correct behaviour for a file that is not whole. If you need length-preserving output, for a disk image say, <code>--fill zero</code> brings the old behaviour back, and the report says that you asked for it.</p>
<p>It is worth being plain about what tsugi cannot do. It cannot recover encrypted data whose ciphertext is damaged. It cannot continue a solid compressed stream past the point where it breaks, unless the compressor left a boundary to restart from. It cannot rebuild anything for which no second copy, no checksum and no structure survives. No tool can, and one that appears to is inventing bytes.</p>
<pre><code class="language-text hljs">$ tsugi mend vm-images.tar.gz
verify   gzip stream breaks at 0x1C2A4F310
kept     212 members intact
gap      images/build-07.qcow2   0x1C2A4F310 – 0x1D0000000   218.7 MiB, no restart point
resumed  at gzip member boundary 0x1D0000000
kept     58 members intact
wrote    vm-images.mended.tar   images/build-07.qcow2.partial   vm-images.gaps

2 seams   270 members untouched   218.7 MiB lost and not recoverable   exit 4
</code></pre>
<p>A gap with a name is worth more than a file that lies about being whole.</p>
]]></content:encoded>
      <pubDate>Tue, 02 Jun 2026 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>1.3.0 — Slow Damage</title>
      <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/slow-damage/</link>
      <guid>https://hahwul.github.io/hwaro-examples/tsugi/releases/slow-damage/</guid>
      <description>Bit rot is found by checksum before anything is trusted, and named in the report even where it cannot be reversed.</description>
      <content:encoded><![CDATA[<p>Not every break is a clean cut. Some archives arrive at their full length with eleven wrong bytes in the middle.</p>
<!-- more -->
<p>That was the case that started this release: a cold-storage drive, eight years old, returning a zip that opened, listed correctly, and extracted a spreadsheet nobody could read. Nothing was missing, so nothing 1.2 looked for was there to find. The damage was slow, a bit here and a bit there, and the only witnesses were the checksums written when the archive was made.</p>
<p>1.3.0 reads those witnesses before it believes anything. Zip entries carry a CRC-32 each, gzip members carry one in their trailer, and pax headers can carry digests. For plain tar, which has no content checksums at all, tsugi accepts a manifest in the format <code>sha256sum</code> writes.</p>
<p>Finding rot is not the same as mending it, and this release is careful about the difference. If a second copy of the archive exists, even a damaged one, tsugi can use it as a witness and take each block from whichever copy verifies. If the damage is a single flipped bit in a small entry, the CRC is enough to find it. Past that, tsugi can only tell you which bytes are wrong. It tells you.</p>
<pre><code class="language-text hljs">$ tsugi mend ledger-2018.zip --witness /mnt/offsite/ledger-2018.zip
verify   412 entries, 3 fail CRC-32
rot      q3/receipts.xlsx    0x00C41A20 – 0x00C41A2A   rebuilt from witness
rot      q4/summary.pdf      0x01F03C11                1 bit reversed by CRC search
rot      q4/scans/0417.tif   0x0220B000 – 0x0220BFFF   witness also damaged, not mended
wrote    ledger-2018.mended.zip   exit 3
</code></pre>
]]></content:encoded>
      <pubDate>Tue, 17 Mar 2026 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>1.2.0 — Dry Fit</title>
      <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/dry-fit/</link>
      <guid>https://hahwul.github.io/hwaro-examples/tsugi/releases/dry-fit/</guid>
      <description>A dry run lays every piece out and shows the joins it would make, without writing a byte.</description>
      <content:encoded><![CDATA[<p>Before lacquer is mixed, the pieces of a broken bowl are fitted together dry, to learn whether they still make a bowl.</p>
<!-- more -->
<p>tsugi had no equivalent, and the lack of one showed up on a volume with 40 GiB free and a damaged 2 TiB archive on it. Mending always writes a new file, so there was no room to mend. What the operator needed was an answer to a narrower question: is enough of this archive recoverable to be worth freeing two terabytes somewhere else?</p>
<p><code>--dry-run</code> answers that. It performs the whole analysis, including every checksum, and prints the seam report exactly as a real run would, with the exit code a real run would return. It opens the archive read-only and creates no files, not even temporary ones.</p>
<p>Because the analysis is the slow part, it can now be kept. <code>tsugi plan</code> writes it to a small file, and a later <code>mend --from-plan</code> goes straight to writing. A plan records the size and modification time of the archive it describes, and it is refused if either has changed.</p>
<p>The same release adds a configuration file, mostly so that these choices stop being flags.</p>
<pre><code class="language-toml hljs"># tsugi.toml
[mend]
output     = &quot;{stem}.mended{ext}&quot;
on_partial = &quot;keep&quot;            # keep | drop

[report]
format = [&quot;table&quot;, &quot;json&quot;]

[limits]
resync_scan = &quot;64MiB&quot;          # how far to look for the next valid header
</code></pre>
<p>The scan itself was rewritten to stream, which is why the archive that prompted all this can now be planned on a laptop.</p>
]]></content:encoded>
      <pubDate>Tue, 09 Dec 2025 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>1.1.0 — Central Directory</title>
      <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/central-directory/</link>
      <guid>https://hahwul.github.io/hwaro-examples/tsugi/releases/central-directory/</guid>
      <description>Zip files that lost their central directory are rebuilt from the local headers still standing in the stream.</description>
      <content:encoded><![CDATA[<p>A zip file keeps its index at the very end, which means an interrupted upload loses exactly the part every reader asks for first.</p>
<!-- more -->
<p>The reports that led to this release were all the same shape. A 3 GiB export stops at 2.7 GiB, the central directory was in the missing 300 MiB, and the archive utility shows an empty window. The entries themselves are fine. Each one is preceded by a local header with its name, its sizes and its CRC-32, and those headers are still standing in the stream like fence posts after the fence has gone.</p>
<p>tsugi now walks the stream, finds each local header, inflates the entry behind it, and checks the result against the stored CRC. Entries that verify are listed in a fresh central directory, which is written with a new end record. Streaming zips, where the sizes follow the data instead of preceding it, take longer because the only way to find the end of an entry is to decompress it.</p>
<p>One thing does not come back. Unix permissions, entry comments and some timestamps live only in the central directory, so when it is gone they are gone. tsugi writes <code>0644</code> and the local header's DOS time, and says so in the report.</p>
<pre><code class="language-text hljs">$ tsugi mend export-2025-08.zip
reading  export-2025-08.zip   2.7 GiB, no end record
found    1,286 local headers
kept     1,285 entries, CRC-32 verified
partial  media/site-walk-04.mov   stream ends mid-block
joined   central directory rebuilt, 1,285 records
assumed  mode 0644 on 1,285 entries
wrote    export-2025-08.mended.zip   exit 3
</code></pre>
]]></content:encoded>
      <pubDate>Tue, 02 Sep 2025 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>1.0.0 — The Seam Report</title>
      <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/the-seam-report/</link>
      <guid>https://hahwul.github.io/hwaro-examples/tsugi/releases/the-seam-report/</guid>
      <description>Every mend now ships with a report listing each byte range tsugi rewrote, skipped, or left incomplete.</description>
      <content:encoded><![CDATA[<p>Three weeks after 0.9.0, someone restored a mail spool from a mended archive and then could not say which of its files tsugi had touched.</p>
<!-- more -->
<p>The repair had worked. That was the problem: it had worked so quietly that the mended archive was indistinguishable from one that had never been damaged, and so nobody could decide which files deserved a second look. A repair you cannot see is a repair you cannot trust.</p>
<p>So 1.0.0 is less about mending than about saying what was mended. Every run now ends with a seam report. Each row is one contiguous byte range in the output, the kind of join made there, and the evidence that justified it. A range tsugi skipped because a header failed its checksum is a seam. The trailer it wrote is a seam. A member that stops early is a seam. Everything not listed was copied through byte for byte, and the last line counts those members too, so the report accounts for the whole file.</p>
<p>The same data is written as JSON beside the output. The format is versioned, and we intend to keep it readable for as long as tsugi exists.</p>
<pre><code class="language-text hljs">SEAM REPORT  nightly-0211.mended.tar

  #  range                          join       evidence
  1  0x0A07D2400 – 0x0A4C1EDFF      partial    var/db/ledger.sqlite, 1.1 of 1.6 GiB
  2  0x0A4C1EE00 – 0x0A4C1EFFF      skipped    header checksum failed, no later header
  3  0x0A4C1F000 – 0x0A4C1F3FF      rewritten  end-of-archive trailer, 2 zero blocks

  3 seams   18,402 members untouched   1 member incomplete
</code></pre>
<p>With the report in place the command line is frozen. This is 1.0.</p>
]]></content:encoded>
      <pubDate>Tue, 20 May 2025 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>0.9.0 — First Join</title>
      <link>https://hahwul.github.io/hwaro-examples/tsugi/releases/first-join/</link>
      <guid>https://hahwul.github.io/hwaro-examples/tsugi/releases/first-join/</guid>
      <description>Truncated tar archives are read up to the last whole member, and the cut is written down.</description>
      <content:encoded><![CDATA[<p>tsugi began with one tape image: a nightly backup, 41 GiB of tar, cut short at 03:12 when the disk it was being written to filled up.</p>
<!-- more -->
<p>Every extractor we tried said the same thing, <code>Unexpected EOF in archive</code>, and then declined to hand over the 18,402 members that were sitting there intact. That refusal is reasonable for a tool whose job is extraction. It is not much use at four in the morning.</p>
<p>A tar archive is a simple thing. Each member is a 512-byte header followed by its data, padded to the next block. The header carries the member's size and a checksum of itself, so it is possible to walk the file header by header, verify each one, and know precisely where the last whole member ends. That walk is all 0.9.0 does. When the final member's declared size runs past the end of the file, tsugi keeps the bytes that exist, marks the member as partial, and closes the archive properly behind it.</p>
<p>It does not pad the missing part, and it does not pretend the member is complete. The cut is printed, with its offset, every time.</p>
<pre><code class="language-text hljs">$ tsugi mend nightly-0211.tar
reading  nightly-0211.tar   41.2 GiB, ends inside a member
kept     18,402 members intact
partial  var/db/ledger.sqlite   1.1 GiB of 1.6 GiB present
joined   trailer rewritten at 0x0A4C1F000
wrote    nightly-0211.mended.tar
</code></pre>
<p>This is a pre-release. The command line will change before 1.0, and tar is the only format it understands.</p>
]]></content:encoded>
      <pubDate>Tue, 11 Feb 2025 00:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>
