diff --git a/.gitattributes b/.gitattributes index 518f6aa..f66798e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,3 +8,5 @@ original/UC2_source/**/*.PRJ binary # Test corpus and archives must be byte-exact tests/corpus/** binary tests/archives/** binary +tests/archives/*.md text eol=lf diff +tests/archives/*.json text eol=lf diff diff --git a/ROADMAP.md b/ROADMAP.md index 63dd7c2..f8e369f 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,55 +2,62 @@ ## Recommended next priorities (2026-11-07) -The Python reader/writer, native CLI, mount, and integration packages are implemented. -These are the next five priorities. The phases below remain the longer-term feature inventory; -the additional project-wide task-qa + task-at audit remains open. -The order was checked against alpha6, GitHub main, and the open tracker on -November 7. All five items still need work. +The browser reader and preservation toolkit from the previous top two are +implemented for alpha7. The next five priorities are below. The separate +project-wide task-qa + task-at audit remains open (c9edf0b). -1. [ ] **Build a browser-only UC2 reader and inspector.** - Let someone drop an old archive onto a page, inspect entries and versions, - verify supported content, and download extracted files. Process archive bytes - locally, with no upload. Compile the C reader using - [Emscripten](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.html) - and run it in a worker with resource limits. First prove listing and reading - one fixture; use the existing generated-C approach for the SuperMaster data - instead of assuming the native assembly embedding works in WebAssembly. - This would give preservation users a useful first experience without an - installation and provide a concrete demo to share. +1. [ ] **Incremental collection snapshots.** + Turn the existing CDC and block store into two restorable snapshots of a + directory, with portable file/version metadata and shared chunks. Measure + second-snapshot growth, restore cost, metadata overhead and corruption + recovery against tar ingestion. Tracking: 0013121, bd13adb. -2. [ ] **Make UC2 a preservation and migration toolkit.** - Add batch inventory and migration to ZIP or tar, with a machine-readable - manifest of original paths, versions, timestamps, attributes, and verified - file hashes. Preserve the source archive and report metadata that cannot be - represented in the destination. Reuse existing output-format libraries. - Build a redistributable compatibility corpus from real old archives and use - it to prioritize missing methods, especially Turbo/method 80 (b3e413f). - Start with one directory-to-manifest migration and verify every restored - file. The product hypothesis is that rescuing old collections is a clearer - reason to adopt UC2 than general compression claims. +2. [ ] **Turbo/method 80 and broader historical compatibility.** + Obtain a pinned Turbo fixture and compare its decoded bytes with the original + executable and the independent [Go UC2 implementation](https://github.com/klauspost/uc2). + That project reports Turbo support and provides historical sample references; + it is a useful comparison target, not proof of our decoder's compatibility. + Extend the new corpus with explicit provenance, multi-volume cases and + independent expected hashes. Tracking: b3e413f, 2b65f0a. -3. [ ] **Turn stream deduplication into incremental collection snapshots.** - Start with two snapshots of a source tree and a portable manifest that maps - files and versions to shared chunks. Measure the second snapshot's added - bytes, restore cost, metadata overhead, and corruption recovery against the - current tar-ingest baseline. Connect the existing CDC and block-store modules - only where those measurements support the design. Tracking: 0013121, bd13adb. +3. [ ] **Prepare the libarchive reader for upstream review.** + Bound metadata and dictionary growth in the [prepared reader](contrib/libarchive/upstream/REVIEW.md), + complete dependency and format-ID checks, and produce a reviewable patch. + Maintainer contact/submission remains a separate step; none has been made. + The optional LGPL reader handles legacy Huffman; the full UC2 package also + handles rANS. Tracking: 7bbb6b6. -4. [ ] **Advance the prepared libarchive reader toward upstream acceptance.** - The [review patch](contrib/libarchive/upstream/REVIEW.md) now has an optional - external LGPL reader, BSD adapter, CMake/Autotools wiring, and fixtures. - Bound metadata and dictionary growth, then seek maintainer agreement on the - dependency and format ID. Submission is a separate step; none has been made. - The proposed reader supports legacy Huffman methods; the full UC2 package - also supports rANS. Tracking: 7bbb6b6. +4. [ ] **Fix Total Commander 32-bit native `.uc2` routing.** + Replace the `.u2r` copy workaround with a tested route for ordinary `.uc2` + archives. Check the native host's external-archiver interface as well as WCX + dispatch, and record exact application versions and fixtures. Tracking: 81c0c8a. -5. [ ] **Broaden compatibility with historical archives and desktop readers.** - Assemble redistributable examples of Turbo/method 80, implement its decoder, - and verify against the original executable. Resolve Total Commander 32-bit - native `.uc2` extraction routing so users can retire the `.u2r` copy workaround. - Keep exact fixture hashes and application-version evidence. Tracking: - b3e413f, 81c0c8a. +5. [ ] **Browser bulk export and offline use.** + Add a verified ZIP download for selected files/versions and an installable + offline reader. Preserve the worker's resource limits and cancellation; + test Firefox and WebKit alongside Chromium before broadening browser claims. + +### Delivered in 3.0.0a7: browser reader and preservation toolkit + +- [x] Local-only [browser reader](https://evvaletov.github.io/uc2/reader/): + inspect/search paths and versions, verify supported files, download decoded + files, and save an inventory. A WebAssembly worker bounds input, decoder + memory, output and elapsed time; cancellation terminates decoding. No archive + upload is used. [Build instructions and limits](web/README.md). +- [x] `uc2-preserve`: recursive collection inventory and ZIP/tar migration with + source and decoded SHA-256 hashes, all file versions, original paths, raw DOS + timestamps and attributes. Each output container is reopened and verified. + Originals remain in place, existing destinations are refused, source failures + produce explicit partial results, and output failures abort staged batches. + [Preservation guide](docs/preservation.md). +- [x] Five bundled original-encoder fixtures with pinned hashes, plus optional + checks for three historical archives containing 88 entries. ZIP/tar migration + passes and all 88 decoded hashes/sizes agree with an independent Go decoder. + Third-party archive bytes are fetched separately; only URLs, hashes and + metadata are redistributed. [Corpus provenance](tests/archives/README.md). +- [ ] Turbo/method 80 and multi-volume decoding remain compatibility work; + neither is implied by this release. Chromium is the browser tested so far. +- Release and scoped review evidence: [alpha7 verification](docs/releases/3.0.0a7-qa.md). ### Delivered in 3.0.0a6: writer APIs and audit repairs diff --git a/docs/releases/3.0.0a7-qa.md b/docs/releases/3.0.0a7-qa.md new file mode 100644 index 0000000..e791b7c --- /dev/null +++ b/docs/releases/3.0.0a7-qa.md @@ -0,0 +1,70 @@ +# Alpha7 browser reader and preservation toolkit + +The two features requested on November 7, 2026 are implemented. Release +publication and final CI results are recorded below as they complete. + +## Scope and behavior + +The browser reader compiles the existing C decoder with Emscripten 4.0.15. +A worker reads local File/Blob data through WORKERFS. Users can inspect paths, +stored versions and raw metadata, verify UC2 checksums, download verified files, +and save an inventory. Input is capped at 256 MiB, entries at 10,000, decoder +allocation at 64 MiB, each decoded file at 64 MiB, and verification at 1 GiB. +WebAssembly memory is capped at 256 MiB. The UI terminates the worker after +30 seconds without progress or five minutes overall. Partial completed checks +survive a timeout; further decoding requires reopening the archive. + +`uc2-preserve` inventories file/directory inputs and creates verified ZIP/tar +exports. Manifests preserve every version, original path, raw DOS timestamp, +attributes, compression method and decoded SHA-256. Numbered export paths +avoid collisions. Original archives are opened read-only. A failed source or +entry is recorded; destination errors abort the staged batch. An existing +destination is refused, including a directory created by another caller before +publication. Output parents must be controlled by the caller. + +Neither feature claims support for Turbo/method 80 or multi-volume archives. +Arbitrary tags, original compressed streams and master blocks remain in the +source archive. ZIP/tar conversion does not replace preservation of originals. + +## Validation + +- 110 installed-package Python tests pass locally, including versions, + metadata, ZIP/tar byte comparisons, checksum failures, each resource limit, + symlink input, named pipes, output failures, source mutation and publication + races. Existing reader/writer/mount tests remain included. +- Compiled-reader tests pass in Chromium 156.0.8078.4 and the older cached + browser. They cover all five original-encoder fixtures, modern rANS, + stored versions, exact downloads and SHA-256, inventory, unsafe/reserved + filenames, malformed archives, cancellation, timeout recovery and no uploads. + Narrow layouts are checked at 320, 390 and 800 pixels with three font choices. +- Sphinx builds with warnings treated as errors. +- Three historical archives (BLKTXT, MKMSG and UC2INFO) migrate successfully + to ZIP and tar. All 88 decoded file sizes and SHA-256 hashes agree with the + independent Go decoder at commit `53622f89ada1cf0d4a69f91b653bdd44ec5b0f92`. + Their URLs, source hashes and expected metadata are pinned in + `tests/archives/historical.json`. Third-party payloads are fetched separately. + +The initial Docs CI run found a narrow-screen overflow caused by differing +font metrics. The action buttons now wrap and grid tracks can shrink; expanded +font/viewport tests cover that regression. The first candidate's native builds, +fuzzing and integration-package checks passed. Final candidate results follow. + +## Independent review + +This is a scoped review of the two new features, authored by Codex. Kimi +replaces Claude at the user's request. No restricted reference material was +involved. It does not close the separate full-project audit, c9edf0b. + +Round 1: Gemini and Kimi completed. Their findings led to worker timeout-state +repair, incremental verification results, per-entry preservation limits, +separation of source and destination failures, consistent symlink handling, +and exclusive reservation of new output directories. The fixed 64 MiB browser +file limit is an intentional documented resource bound. Grok timed out after +600 seconds without a review; that attempt is not approval. + +Round 2: Gemini and Kimi completed. Further fixes cover destination read and +container-validation errors, unreadable directory traversal and invalidating +decoded hashes when the source changes. Containers close before cleanup. +Dot components remain visible as original metadata: browser downloads use safe +leaf names and never reconstruct archive paths on the user's filesystem. +Remaining review rounds and publication checks are pending. diff --git a/python/tests/test_preserve.py b/python/tests/test_preserve.py index ae05fd8..ebc23ab 100644 --- a/python/tests/test_preserve.py +++ b/python/tests/test_preserve.py @@ -182,7 +182,7 @@ def test_special_file_is_rejected_without_waiting(tmp_path): assert 'regular file' in manifest.read_text() -@pytest.mark.parametrize('failure', ['spool', 'member', 'manifest']) +@pytest.mark.parametrize('failure', ['spool', 'member', 'manifest', 'export-hash', 'bad-zip', 'bad-tar']) def test_output_failure_aborts_without_publishing(tmp_path, monkeypatch, failure): import importlib module = importlib.import_module('uc2.preserve') @@ -192,8 +192,15 @@ def test_output_failure_aborts_without_publishing(tmp_path, monkeypatch, failure monkeypatch.setattr(module._HashedWriter, 'write', lambda self, data: module._output_call(fail)) elif failure == 'member': monkeypatch.setattr(module, '_write_member', fail) - else: + elif failure == 'manifest': monkeypatch.setattr(Path, 'write_text', fail) + elif failure == 'export-hash': + monkeypatch.setattr(module, '_hash_path', fail) + else: + def bad(*args, **kwargs): + error = zipfile.BadZipFile if failure == 'bad-zip' else tarfile.ReadError + raise error('simulated destination corruption') + monkeypatch.setattr(module, '_verify_export', bad) with pytest.raises(OSError, match='simulated destination'): preserve([ROOT / 'tests/archives/single.uc2'], tmp_path / 'out', format='zip') assert list(tmp_path.iterdir()) == [] @@ -212,3 +219,30 @@ def test_publish_does_not_replace_concurrently_created_directory(tmp_path, monke assert (tmp_path / 'out').is_dir() assert list((tmp_path / 'out').iterdir()) == [] assert list(tmp_path.iterdir()) == [tmp_path / 'out'] + + +def test_walk_error_is_not_silently_skipped(tmp_path, monkeypatch): + def broken_walk(path, *, followlinks, onerror): + onerror(PermissionError('unreadable archive directory')) + return iter(()) + monkeypatch.setattr(os, 'walk', broken_walk) + with pytest.raises(PermissionError, match='unreadable'): + preserve([tmp_path], tmp_path / 'out') + assert not (tmp_path / 'out').exists() + + +def test_source_change_invalidates_manifest_hashes(tmp_path, monkeypatch): + path = tmp_path / 'changing.uc2' + path.write_bytes((ROOT / 'tests/archives/single.uc2').read_bytes()) + copy = UC2File.copy_to + def changing(self, *args, **kwargs): + result = copy(self, *args, **kwargs) + with path.open('ab') as source: + source.write(b'changed') + return result + monkeypatch.setattr(UC2File, 'copy_to', changing) + report = preserve([path], tmp_path / 'out', format='zip') + manifest = json.loads((tmp_path / 'out' / report['archives'][0]['manifest']).read_text()) + assert report['status'] == 'partial' + assert manifest['status'] == 'error' and manifest['export'] is None + assert all(e['sha256'] is None and e['status'] == 'error' for e in manifest['entries']) diff --git a/python/uc2/preserve.py b/python/uc2/preserve.py index f9c3c83..240c268 100644 --- a/python/uc2/preserve.py +++ b/python/uc2/preserve.py @@ -16,6 +16,7 @@ import sys import tarfile import tempfile import zipfile +import zlib from . import UC2File, ResourceLimitError, __version__ @@ -30,7 +31,7 @@ class _OutputError(OSError): def _output_call(function, *args, **kwargs): try: return function(*args, **kwargs) - except (OSError, ValueError, RuntimeError) as error: + except (OSError, ValueError, RuntimeError, EOFError, zipfile.BadZipFile, tarfile.TarError, zlib.error) as error: raise _OutputError(str(error)) from error @@ -50,6 +51,11 @@ def _hash(source): return digest.hexdigest() +def _hash_path(path): + with path.open('rb') as source: + return _hash(source) + + def _leaf(name): # A numbered parent makes versions and case-folding collisions independent. leaf = re.sub(r'[^A-Za-z0-9._-]', '_', name.rsplit('/', 1)[-1])[:100] @@ -203,9 +209,8 @@ def _one(path, output, format, limits): _output_call(container.close) container = None _output_call(_verify_export, export, manifest['entries'], format) - with export.open('rb') as content: - manifest['export'] = {'path': export.name, 'format': format, - 'sha256': _hash(content), 'verified': True} + manifest['export'] = {'path': export.name, 'format': format, + 'sha256': _output_call(_hash_path, export), 'verified': True} source.seek(0) if _hash(source) != manifest['source']['sha256']: raise OSError('source archive changed during the operation') @@ -215,11 +220,18 @@ def _one(path, output, format, limits): raise except (OSError, ValueError, RuntimeError) as error: manifest['errors'].append(str(error)) + if container: + _output_call(container.close) + container = None if export and export.exists(): - export.unlink() + _output_call(export.unlink) manifest['export'] = None for entry in manifest['entries']: entry['export_path'] = None + if entry['kind'] == 'file': + entry['status'] = 'error' + entry['sha256'] = None + entry['error'] = 'Archive-level failure; decoded result discarded' finally: if container: _output_call(container.close) @@ -228,13 +240,16 @@ def _one(path, output, format, limits): def _sources(inputs): + def fail(error): + raise error + result = [] seen = set() for item in inputs: path = Path(item) if path.is_dir() and not path.is_symlink(): candidates = [] - for parent, directories, files in os.walk(path, followlinks=False): + for parent, directories, files in os.walk(path, followlinks=False, onerror=fail): directories[:] = sorted(d for d in directories if not (Path(parent) / d).is_symlink()) candidates.extend(Path(parent) / f for f in sorted(files) if f.lower().endswith('.uc2') and not (Path(parent) / f).is_symlink()) diff --git a/tests/archives/README.md b/tests/archives/README.md index d1009e9..c5b8d1e 100644 --- a/tests/archives/README.md +++ b/tests/archives/README.md @@ -15,7 +15,31 @@ archives, compare each file hash to its known payload, then reopen both ZIP and tar exports and compare their contents. Browser tests use the same archives and compare downloaded files with the native reader. -Turbo/method 80, multi-volume archives, and independently sourced historical -collections remain gaps. `tests/scripts/create_archives.sh` documents the +Turbo/method 80 and multi-volume archives remain gaps. +`tests/scripts/create_archives.sh` documents the original fixture-generation procedure; regeneration changes archive timestamps and requires reviewing and updating the pinned hashes. + +## Historical collections + +`historical.json` pins three independently sourced archives from the +[Sembiance format samples](https://sembiance.com/fileFormatSamples/archive/ultraCompressor2/): +BLKTXT.UC2, MKMSG.UC2 and UC2INFO.UC2. Their 88 entries carry DOS timestamps +from 1993-1995. Both ZIP and tar migrations passed on November 7, 2026. +All decoded file sizes and SHA-256 hashes also match the independent +[Go decoder](https://github.com/klauspost/uc2) at commit +`53622f89ada1cf0d4a69f91b653bdd44ec5b0f92`, with ASCII filename case normalized. + +The repository distributes URLs, hashes and expected metadata for these +archives. Their third-party payloads are downloaded separately because their +redistribution permissions have not been established. Nothing from these +archives is executed. The Go project's pinned sample list supplied the URLs; +the JSON records exact provenance and hashes. + +Run the optional network check with an installed UC2 package: + +```sh +python tests/scripts/check_historical.py --cache /tmp/uc2-historical +``` + +The five bundled original-encoder archives remain the offline CI corpus. diff --git a/tests/archives/historical.json b/tests/archives/historical.json new file mode 100644 index 0000000..1798edb --- /dev/null +++ b/tests/archives/historical.json @@ -0,0 +1,918 @@ +{ + "schema": "uc2-historical-corpus-1", + "index_source": "https://github.com/klauspost/uc2/blob/53622f89ada1cf0d4a69f91b653bdd44ec5b0f92/testdata/samples.txt", + "redistribution": "Only URLs, source hashes, metadata and expected decoded hashes are included here. Third-party archive bytes are downloaded separately; redistribution permission has not been established. No executable payload is run.", + "checked_utc": "2026-11-07", + "archives": [ + { + "name": "BLKTXT.UC2", + "url": "https://sembiance.com/fileFormatSamples/archive/ultraCompressor2/BLKTXT.UC2", + "size": 25808, + "sha256": "5637a25f00a9e4dea3c14978dffa5e485a3532694b0d9dad9299fe14898d176e", + "expected_entries": [ + { + "path": "block.exe", + "version": 0, + "kind": "file", + "size": 10394, + "dos_time": 523000238, + "dos_attributes": 32, + "method": 5, + "sha256": "a1b715b4e1d0e91d6d2aebe56984d3d56fe6f7818bd418d9b2b37129b593517a" + }, + { + "path": "block.008", + "version": 0, + "kind": "file", + "size": 2640, + "dos_time": 516443340, + "dos_attributes": 32, + "method": 5, + "sha256": "18bd31c36c741cf4f2a80e2088ceb8c8ab0af2d2c9cce6e9208abdf35f6ff88a" + }, + { + "path": "block.005", + "version": 0, + "kind": "file", + "size": 2395, + "dos_time": 513564253, + "dos_attributes": 32, + "method": 5, + "sha256": "07d31300c0b95327adc95637c14218481fd1f6c0ea365b9dec88a77a194c8911" + }, + { + "path": "block.010", + "version": 0, + "kind": "file", + "size": 2395, + "dos_time": 513564096, + "dos_attributes": 32, + "method": 5, + "sha256": "a6b2409c7604dfb2cf34d2790092a35a062d651d6a22927690c3866af1c4d2e6" + }, + { + "path": "block.015", + "version": 0, + "kind": "file", + "size": 2166, + "dos_time": 514690839, + "dos_attributes": 32, + "method": 5, + "sha256": "dd293983752b5520ae848e4f329da34ea0e924f752557cc736eac98296d750cb" + }, + { + "path": "block.016", + "version": 0, + "kind": "file", + "size": 2166, + "dos_time": 514690839, + "dos_attributes": 32, + "method": 5, + "sha256": "dd293983752b5520ae848e4f329da34ea0e924f752557cc736eac98296d750cb" + }, + { + "path": "block.021", + "version": 0, + "kind": "file", + "size": 5645, + "dos_time": 488181468, + "dos_attributes": 32, + "method": 5, + "sha256": "efea172eaa4473f6250adb322371a24ae25989da6f435a174730ea6e2dbc6e8f" + }, + { + "path": "block.022", + "version": 0, + "kind": "file", + "size": 2889, + "dos_time": 520781408, + "dos_attributes": 32, + "method": 5, + "sha256": "ec49700f2ba8c15110bea6e4879ac307fa54a19bdb540e601eb63d2054c1f1a3" + }, + { + "path": "block.025", + "version": 0, + "kind": "file", + "size": 2205, + "dos_time": 514865582, + "dos_attributes": 32, + "method": 5, + "sha256": "c5869a06c44bda5527122ab552b7e0cb281e2c1c5886b8df9c4cf8f3729f41d0" + }, + { + "path": "block.050", + "version": 0, + "kind": "file", + "size": 2052, + "dos_time": 487696088, + "dos_attributes": 32, + "method": 5, + "sha256": "43ebe9290b739a7c2e1343db8fa1bdeeb1bfef29e89e1b685d8a588630e86404" + }, + { + "path": "block.051", + "version": 0, + "kind": "file", + "size": 2052, + "dos_time": 487696088, + "dos_attributes": 32, + "method": 5, + "sha256": "43ebe9290b739a7c2e1343db8fa1bdeeb1bfef29e89e1b685d8a588630e86404" + }, + { + "path": "block.053", + "version": 0, + "kind": "file", + "size": 2387, + "dos_time": 517277807, + "dos_attributes": 32, + "method": 5, + "sha256": "be62882d1f97481f358236c3ed8827c2ac95ae75fce93f0cbbef4047d5c00675" + }, + { + "path": "block.052", + "version": 0, + "kind": "file", + "size": 2387, + "dos_time": 517277807, + "dos_attributes": 32, + "method": 5, + "sha256": "be62882d1f97481f358236c3ed8827c2ac95ae75fce93f0cbbef4047d5c00675" + }, + { + "path": "block.062", + "version": 0, + "kind": "file", + "size": 2458, + "dos_time": 496003378, + "dos_attributes": 32, + "method": 5, + "sha256": "9343c3bae697c72a307075da19789e38519af13716c7d68171d8bfb9b162c4bc" + }, + { + "path": "block.064", + "version": 0, + "kind": "file", + "size": 2725, + "dos_time": 522691476, + "dos_attributes": 32, + "method": 5, + "sha256": "ebe33b0cc42f927b2872f870919fcb8bba0b3309b6eb01da25e0543423cf1824" + }, + { + "path": "block.066", + "version": 0, + "kind": "file", + "size": 2475, + "dos_time": 513563699, + "dos_attributes": 32, + "method": 5, + "sha256": "0c26ba18ebd46432a357c6fc739f03361aba18400ade564d31c8b8becb53e929" + }, + { + "path": "block.078", + "version": 0, + "kind": "file", + "size": 2475, + "dos_time": 513563850, + "dos_attributes": 32, + "method": 5, + "sha256": "b4f3419143c12811a8010696d57a17bba48ee993277c15324b640154dc9545a1" + }, + { + "path": "block.084", + "version": 0, + "kind": "file", + "size": 2767, + "dos_time": 514819228, + "dos_attributes": 32, + "method": 5, + "sha256": "0aac1023ea976a6504c6cc6724de13fb9a9f46c86bffce31e5356b71f1082aa3" + }, + { + "path": "block.083", + "version": 0, + "kind": "file", + "size": 2512, + "dos_time": 517087312, + "dos_attributes": 32, + "method": 5, + "sha256": "2b10608e713578fae8d8a6215e843a86e0c0e25463ff9a698c439633058c5eee" + }, + { + "path": "block.081", + "version": 0, + "kind": "file", + "size": 2232, + "dos_time": 514688088, + "dos_attributes": 32, + "method": 5, + "sha256": "e9603884ee434da2d6a57791dc861e0d7793860ad3fb9be4d62a6d33cf629bf2" + }, + { + "path": "block.013", + "version": 0, + "kind": "file", + "size": 1105, + "dos_time": 515774637, + "dos_attributes": 32, + "method": 5, + "sha256": "ee5633670831549a155848fa77e18f5990847afd25afba39b072896c23e51d96" + }, + { + "path": "block.001", + "version": 0, + "kind": "file", + "size": 209, + "dos_time": 440030707, + "dos_attributes": 32, + "method": 5, + "sha256": "602836db210bf6d86e46ff4eea0cc330768c04574f87502026184db862aeab00" + }, + { + "path": "block.002", + "version": 0, + "kind": "file", + "size": 264, + "dos_time": 510688705, + "dos_attributes": 32, + "method": 5, + "sha256": "937ad2918264e3ae12ba6b2975efa0ed27c61bfde62c5f8ebfd08cc4ac6fd74d" + }, + { + "path": "block.003", + "version": 0, + "kind": "file", + "size": 222, + "dos_time": 440031514, + "dos_attributes": 32, + "method": 5, + "sha256": "2fb855e622c01c6550a01adc766498e842b18952f1806fe51903a883182709ea" + }, + { + "path": "block.004", + "version": 0, + "kind": "file", + "size": 565, + "dos_time": 517711670, + "dos_attributes": 32, + "method": 5, + "sha256": "195b6f35556a5d53316b0c2b8d66ffcaf333ca701e4b900a159b59de08db11f6" + }, + { + "path": "block.006", + "version": 0, + "kind": "file", + "size": 1173, + "dos_time": 520784163, + "dos_attributes": 32, + "method": 5, + "sha256": "38f6118c6d04b8b1eec6a14d78966f5c235856866b2097f0398b0a882e19ea30" + }, + { + "path": "block.007", + "version": 0, + "kind": "file", + "size": 603, + "dos_time": 440098449, + "dos_attributes": 32, + "method": 5, + "sha256": "538a6361d84af69b2bdf32628f92ede9c69fa8892736dcde05890f43919e64d9" + }, + { + "path": "block.009", + "version": 0, + "kind": "file", + "size": 1374, + "dos_time": 517374923, + "dos_attributes": 32, + "method": 5, + "sha256": "e0238005579ccd0627e0a34d6cabae092b6e38dc32ea846571c49088e142b238" + }, + { + "path": "block.011", + "version": 0, + "kind": "file", + "size": 485, + "dos_time": 445953047, + "dos_attributes": 32, + "method": 5, + "sha256": "7806ba3205b2e5eca28426ef3de61f8c80b758c77e63ea13e9233f66651a6fa9" + }, + { + "path": "block.012", + "version": 0, + "kind": "file", + "size": 642, + "dos_time": 520781402, + "dos_attributes": 32, + "method": 5, + "sha256": "1e0258d187a308caeed583883464b8f633f750d4afa27a10c3c4e0b2ca1bb608" + }, + { + "path": "block.014", + "version": 0, + "kind": "file", + "size": 645, + "dos_time": 520784131, + "dos_attributes": 32, + "method": 5, + "sha256": "8034aaa7a751ecfe2a7920f9719131b9066f22f05809ad59d310f9221f84e303" + }, + { + "path": "block.017", + "version": 0, + "kind": "file", + "size": 379, + "dos_time": 478589233, + "dos_attributes": 32, + "method": 5, + "sha256": "4a7b95220eecbcdbdd7f8e5f2d27d2eacf1ada87c2edf188589810773c30c691" + }, + { + "path": "block.018", + "version": 0, + "kind": "file", + "size": 2378, + "dos_time": 522755790, + "dos_attributes": 32, + "method": 5, + "sha256": "2080409107bd825857e02f056eb45aaf86d33602a5f157fb2bc2c4d8c174d035" + }, + { + "path": "block.019", + "version": 0, + "kind": "file", + "size": 377, + "dos_time": 478589338, + "dos_attributes": 32, + "method": 5, + "sha256": "21b9faaba768b11a2aae4b6ef72889a07fc3b24786b02f88a608472cdb4b273d" + }, + { + "path": "block.020", + "version": 0, + "kind": "file", + "size": 286, + "dos_time": 478589362, + "dos_attributes": 32, + "method": 5, + "sha256": "6942d3f02449665ebac02e4f7f23287473055e14b040f1c17cd24bef8d26b906" + }, + { + "path": "block.023", + "version": 0, + "kind": "file", + "size": 1498, + "dos_time": 441035236, + "dos_attributes": 32, + "method": 5, + "sha256": "85fbc72bdf270c5cb58fcb3e8c6ca02afb086619436e0f61c3d2655634c416d6" + }, + { + "path": "block.024", + "version": 0, + "kind": "file", + "size": 559, + "dos_time": 517153225, + "dos_attributes": 32, + "method": 5, + "sha256": "e5845f21269876abfd52d0006ea05172bacdd0fcc9683948442bc57ea2151a1a" + }, + { + "path": "block.026", + "version": 0, + "kind": "file", + "size": 194, + "dos_time": 449455690, + "dos_attributes": 32, + "method": 5, + "sha256": "3105467241bdd2867a98467aa3fd8a39789ebc2c307a0eeddcdbd27a007e7665" + }, + { + "path": "block.027", + "version": 0, + "kind": "file", + "size": 143, + "dos_time": 449455689, + "dos_attributes": 32, + "method": 5, + "sha256": "1f5c63431fe4311a47798a55f2d63fbd5609bbd919e518bb1fb9d2c1025d80d5" + }, + { + "path": "block.028", + "version": 0, + "kind": "file", + "size": 323, + "dos_time": 441478902, + "dos_attributes": 32, + "method": 5, + "sha256": "9fbab5de26adc1a747f3f1f6949341fe2d3667fa36392f6c69a1383a3cf940bd" + }, + { + "path": "block.029", + "version": 0, + "kind": "file", + "size": 280, + "dos_time": 441477657, + "dos_attributes": 32, + "method": 5, + "sha256": "baf1720e84ae10f64772a3d56f3f492c7ff621c8a3d451f55ac4edba0644f31d" + }, + { + "path": "block.030", + "version": 0, + "kind": "file", + "size": 323, + "dos_time": 441478993, + "dos_attributes": 32, + "method": 5, + "sha256": "430bf9d9f3f0f254f6e524dcb0be46a62148c66341d5c1705fc85af071e6c785" + }, + { + "path": "block.031", + "version": 0, + "kind": "file", + "size": 280, + "dos_time": 441479206, + "dos_attributes": 32, + "method": 5, + "sha256": "3e6467c2c700e447e3948f5116e9c192c564832c2d55f2eaafb368848ed4dabb" + }, + { + "path": "block.032", + "version": 0, + "kind": "file", + "size": 323, + "dos_time": 441479319, + "dos_attributes": 32, + "method": 5, + "sha256": "cd74ea72b6f0f7409d9cde975bcb616b77ba84c13f296e0b0c68733958e51e59" + }, + { + "path": "block.033", + "version": 0, + "kind": "file", + "size": 280, + "dos_time": 441479240, + "dos_attributes": 32, + "method": 5, + "sha256": "db3ea7241ed5e43781dfa04cf62d7401cfb339b71416b35346afb4500aaebc76" + }, + { + "path": "block.034", + "version": 0, + "kind": "file", + "size": 323, + "dos_time": 449455764, + "dos_attributes": 32, + "method": 5, + "sha256": "3afa388b9f7ebd89eb4d9e43d0b6f8b5523d0055c24f93259572f40da1303d3e" + }, + { + "path": "block.035", + "version": 0, + "kind": "file", + "size": 280, + "dos_time": 449455763, + "dos_attributes": 32, + "method": 5, + "sha256": "51d994aabea5fe1c9e9dae21a03a235b015b88ee872c6f455053e585161f4e8d" + }, + { + "path": "block.036", + "version": 0, + "kind": "file", + "size": 316, + "dos_time": 441490587, + "dos_attributes": 32, + "method": 5, + "sha256": "87e24ba6c1385723d9bb8396c8d64ef77a4fb05c83162ece6e5e893cf05e7882" + }, + { + "path": "block.037", + "version": 0, + "kind": "file", + "size": 316, + "dos_time": 441490587, + "dos_attributes": 32, + "method": 5, + "sha256": "87e24ba6c1385723d9bb8396c8d64ef77a4fb05c83162ece6e5e893cf05e7882" + }, + { + "path": "block.038", + "version": 0, + "kind": "file", + "size": 316, + "dos_time": 441491009, + "dos_attributes": 32, + "method": 5, + "sha256": "df9fe660e25408bf2005da52bc6b8b7b39ba88faf65d3e16d9998b637b477d78" + }, + { + "path": "block.039", + "version": 0, + "kind": "file", + "size": 316, + "dos_time": 441491009, + "dos_attributes": 32, + "method": 5, + "sha256": "df9fe660e25408bf2005da52bc6b8b7b39ba88faf65d3e16d9998b637b477d78" + }, + { + "path": "block.040", + "version": 0, + "kind": "file", + "size": 379, + "dos_time": 444430545, + "dos_attributes": 32, + "method": 5, + "sha256": "7bab4d8a3952a3090ee3f7cc33cb0dcc215de227ec82096dc26f5e7f683cd72e" + }, + { + "path": "block.041", + "version": 0, + "kind": "file", + "size": 375, + "dos_time": 444430544, + "dos_attributes": 32, + "method": 5, + "sha256": "67f8353e864bfdeff3ba002c69328d8178dd6ae4eafd6c15c028527adf6e4177" + }, + { + "path": "block.042", + "version": 0, + "kind": "file", + "size": 113, + "dos_time": 444431271, + "dos_attributes": 32, + "method": 5, + "sha256": "cbc327951e89b64bcf274984c206123bd8b000239fe63bc3136e5b2c70b7172b" + }, + { + "path": "block.043", + "version": 0, + "kind": "file", + "size": 113, + "dos_time": 444431274, + "dos_attributes": 32, + "method": 5, + "sha256": "cbc327951e89b64bcf274984c206123bd8b000239fe63bc3136e5b2c70b7172b" + }, + { + "path": "block.044", + "version": 0, + "kind": "file", + "size": 280, + "dos_time": 449344262, + "dos_attributes": 32, + "method": 5, + "sha256": "54e50f46ce99ae76e0e1207e2c66d13570897f11bdb3fd3066fa3e8c02198c31" + }, + { + "path": "block.045", + "version": 0, + "kind": "file", + "size": 82, + "dos_time": 449355394, + "dos_attributes": 32, + "method": 5, + "sha256": "26b15530e0e016f04445e3e1cb32c456784909c2703b46c91cceabf5656113b2" + }, + { + "path": "block.046", + "version": 0, + "kind": "file", + "size": 1522, + "dos_time": 454255900, + "dos_attributes": 32, + "method": 5, + "sha256": "783ee08f0cdfe43bb4887d2fabf6f00909c5b84c8a651d3e75681bd17b0eb38c" + }, + { + "path": "block.047", + "version": 0, + "kind": "file", + "size": 1522, + "dos_time": 454255900, + "dos_attributes": 32, + "method": 5, + "sha256": "783ee08f0cdfe43bb4887d2fabf6f00909c5b84c8a651d3e75681bd17b0eb38c" + }, + { + "path": "block.049", + "version": 0, + "kind": "file", + "size": 292, + "dos_time": 475210866, + "dos_attributes": 32, + "method": 5, + "sha256": "54e63121d571f761c5a2c3cd0e5f13b04c9462d0642fffa43406f5873ce43a88" + }, + { + "path": "block.048", + "version": 0, + "kind": "file", + "size": 347, + "dos_time": 475210843, + "dos_attributes": 32, + "method": 5, + "sha256": "bf1a530c466558625dfb62e16cdb3f71e8a42714673196c9d44684d4bbc62c1f" + }, + { + "path": "block.055", + "version": 0, + "kind": "file", + "size": 930, + "dos_time": 488084131, + "dos_attributes": 32, + "method": 5, + "sha256": "e1e2d2c7b8083767298e69548eb7fe42a1bbdb583c16130359823cd0a2449d44" + }, + { + "path": "block.054", + "version": 0, + "kind": "file", + "size": 930, + "dos_time": 488084131, + "dos_attributes": 32, + "method": 5, + "sha256": "e1e2d2c7b8083767298e69548eb7fe42a1bbdb583c16130359823cd0a2449d44" + }, + { + "path": "block.057", + "version": 0, + "kind": "file", + "size": 471, + "dos_time": 487696694, + "dos_attributes": 32, + "method": 5, + "sha256": "f6212cede504d1a5ccd08137f8511a81f77170287733e564d52b9ab6b17616d7" + }, + { + "path": "block.056", + "version": 0, + "kind": "file", + "size": 471, + "dos_time": 487696694, + "dos_attributes": 32, + "method": 5, + "sha256": "f6212cede504d1a5ccd08137f8511a81f77170287733e564d52b9ab6b17616d7" + }, + { + "path": "block.058", + "version": 0, + "kind": "file", + "size": 382, + "dos_time": 487696745, + "dos_attributes": 32, + "method": 5, + "sha256": "db235952e67911a1cf323e58fa0ca22ebe797ce07dbcd250d98d22ebe05571b7" + }, + { + "path": "block.059", + "version": 0, + "kind": "file", + "size": 382, + "dos_time": 487696745, + "dos_attributes": 32, + "method": 5, + "sha256": "db235952e67911a1cf323e58fa0ca22ebe797ce07dbcd250d98d22ebe05571b7" + }, + { + "path": "block.060", + "version": 0, + "kind": "file", + "size": 622, + "dos_time": 495348545, + "dos_attributes": 32, + "method": 5, + "sha256": "12971204dce4b5f25bc2370f438bc42e3651feb9fb1e7066c3a419d51b44b25d" + }, + { + "path": "block.061", + "version": 0, + "kind": "file", + "size": 622, + "dos_time": 495348545, + "dos_attributes": 32, + "method": 5, + "sha256": "12971204dce4b5f25bc2370f438bc42e3651feb9fb1e7066c3a419d51b44b25d" + }, + { + "path": "block.063", + "version": 0, + "kind": "file", + "size": 221, + "dos_time": 496009365, + "dos_attributes": 32, + "method": 5, + "sha256": "59aed3e81f0a0c8fd23892f734d815d432eb119d60e2fdf27c6e78e32f5d6ac6" + }, + { + "path": "block.065", + "version": 0, + "kind": "file", + "size": 1780, + "dos_time": 517280314, + "dos_attributes": 32, + "method": 5, + "sha256": "84da3aec903a447361a9cb7a1a5f69fe7e50736baa92c5a4d9c0324004ce47ba" + }, + { + "path": "block.067", + "version": 0, + "kind": "file", + "size": 1562, + "dos_time": 508396116, + "dos_attributes": 32, + "method": 5, + "sha256": "9db235173ade9ce5be4d40164a3ef945cd7f23eecf2d6c9f1d81f3c4258c9e9e" + }, + { + "path": "block.068", + "version": 0, + "kind": "file", + "size": 1562, + "dos_time": 508396116, + "dos_attributes": 32, + "method": 5, + "sha256": "9db235173ade9ce5be4d40164a3ef945cd7f23eecf2d6c9f1d81f3c4258c9e9e" + }, + { + "path": "block.069", + "version": 0, + "kind": "file", + "size": 627, + "dos_time": 512971307, + "dos_attributes": 32, + "method": 5, + "sha256": "5a95a0afb68d2677482cb4c92d90a2f2757d4646a49b5f9beb7226f75ca01adb" + }, + { + "path": "block.075", + "version": 0, + "kind": "file", + "size": 613, + "dos_time": 513056269, + "dos_attributes": 32, + "method": 5, + "sha256": "cf96ac05899ecd7dcde70629aee47192f93d4feaf56d7b2055c30607ef89335c" + }, + { + "path": "block.070", + "version": 0, + "kind": "file", + "size": 193, + "dos_time": 512971576, + "dos_attributes": 32, + "method": 5, + "sha256": "8586b9a1f210fe6e97f62bedd4aa8bac173953bece0eae33eb7585bdb6bf674d" + }, + { + "path": "block.071", + "version": 0, + "kind": "file", + "size": 184, + "dos_time": 512973637, + "dos_attributes": 32, + "method": 5, + "sha256": "f19909851c0cef8838aae4e2d729141aa78c869a6085134dbec8e46cbcead7b0" + }, + { + "path": "block.072", + "version": 0, + "kind": "file", + "size": 290, + "dos_time": 512971852, + "dos_attributes": 32, + "method": 5, + "sha256": "a26c855e9ffd8a784d5d8afa761472dea9d601b8d9e4a5ee4836096f84b6a670" + }, + { + "path": "block.076", + "version": 0, + "kind": "file", + "size": 1332, + "dos_time": 513059028, + "dos_attributes": 32, + "method": 5, + "sha256": "8f67cbcf2d06c963aca8cd810b9f959e6ccfd79d207f02bce4ba31795e2713b2" + }, + { + "path": "block.077", + "version": 0, + "kind": "file", + "size": 711, + "dos_time": 513059311, + "dos_attributes": 32, + "method": 5, + "sha256": "63fe725c3c0d5d56c2dce6cf9a9076999f40c78da357486d5442c57652472133" + }, + { + "path": "block.073", + "version": 0, + "kind": "file", + "size": 180, + "dos_time": 512972432, + "dos_attributes": 32, + "method": 5, + "sha256": "a958826a492489d2c2f3260dcad02e4de5952882f2ca149e3db2fa9657639e21" + }, + { + "path": "block.074", + "version": 0, + "kind": "file", + "size": 179, + "dos_time": 512972439, + "dos_attributes": 32, + "method": 5, + "sha256": "7cd988530dc9b46e0891098af71225042710e461dfd7964df868e13397c5e27a" + }, + { + "path": "block.079", + "version": 0, + "kind": "file", + "size": 1564, + "dos_time": 513552923, + "dos_attributes": 32, + "method": 5, + "sha256": "01b992b44575e2093348e07be199857cc0d58cb88aa7c2a9f35a67b381b8b416" + }, + { + "path": "block.080", + "version": 0, + "kind": "file", + "size": 652, + "dos_time": 514546819, + "dos_attributes": 32, + "method": 5, + "sha256": "4ec0b555cd28fba998f2460f41ce8ece571a0aa6ea6821cd210da0e1bb452d1b" + }, + { + "path": "block.082", + "version": 0, + "kind": "file", + "size": 155, + "dos_time": 514696904, + "dos_attributes": 32, + "method": 5, + "sha256": "4c5e059f2175ea70821f1625f501805afce71e2bf3a3124044938d9e7b9e32b4" + } + ] + }, + { + "name": "MKMSG.UC2", + "url": "https://sembiance.com/fileFormatSamples/archive/ultraCompressor2/MKMSG.UC2", + "size": 10228, + "sha256": "125ca4e1278811d36afbbf3bb58a013209883a1dbef1eec7e778706f896ace36", + "expected_entries": [ + { + "path": "mkmsg.man", + "version": 0, + "kind": "file", + "size": 2996, + "dos_time": 519667504, + "dos_attributes": 32, + "method": 4, + "sha256": "8a8ff118ca20607006c6da4cff04696927bdf72a2221356310c123ffab5d63d0" + }, + { + "path": "mkmsg.exe", + "version": 0, + "kind": "file", + "size": 9323, + "dos_time": 519667350, + "dos_attributes": 32, + "method": 4, + "sha256": "6baf2cdba3ef0a88d5a4925a3638db9c3024fed1a8abbf49a388154137dd235d" + } + ] + }, + { + "name": "UC2INFO.UC2", + "url": "https://sembiance.com/fileFormatSamples/archive/ultraCompressor2/UC2INFO.UC2", + "size": 4498, + "sha256": "9331c44c0707235e3ddc46d8c2c54598a2eb1582a6ca3f30d37ec04303b4ab80", + "expected_entries": [ + { + "path": "uinfo.txt", + "version": 0, + "kind": "file", + "size": 12361, + "dos_time": 472530258, + "dos_attributes": 32, + "method": 4, + "sha256": "998f6ddfe60a4da9944baa510918478e080fc312f94b0f09c8a6542f91e5524f" + } + ] + } + ], + "independent_decode": { + "implementation": "https://github.com/klauspost/uc2", + "commit": "53622f89ada1cf0d4a69f91b653bdd44ec5b0f92", + "matched_files": 88, + "comparison": "SHA-256 and size for every decoded file/version; ASCII path case normalized; CP850 reader option." + } +} diff --git a/tests/scripts/check_historical.py b/tests/scripts/check_historical.py new file mode 100644 index 0000000..a212583 --- /dev/null +++ b/tests/scripts/check_historical.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-3.0-or-later +"""Fetch pinned historical archives and check migration against recorded hashes.""" +import argparse +import hashlib +import json +from pathlib import Path +import tempfile +from urllib.request import urlopen + +from uc2.preserve import preserve + +ROOT = Path(__file__).resolve().parents[2] + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--cache', type=Path, help='optional directory for downloaded archives') + args = parser.parse_args() + corpus = json.loads((ROOT / 'tests/archives/historical.json').read_text()) + with tempfile.TemporaryDirectory(prefix='uc2-historical-') as temporary: + scratch = Path(temporary) + cache = args.cache or scratch / 'sources' + cache.mkdir(parents=True, exist_ok=True) + inputs = [] + for item in corpus['archives']: + source = cache / item['name'] + data = source.read_bytes() if source.exists() else b'' + if hashlib.sha256(data).hexdigest() != item['sha256']: + with urlopen(item['url'], timeout=30) as response: + data = response.read(item['size'] + 1) + if len(data) != item['size'] or hashlib.sha256(data).hexdigest() != item['sha256']: + raise ValueError(f"Source hash/size mismatch: {item['name']}") + source.write_bytes(data) + inputs.append(source) + for format in ('zip', 'tar'): + output = scratch / format + report = preserve(inputs, output, format=format) + if report['status'] != 'ok': + raise ValueError(f'{format} migration failed: {report}') + for item, record in zip(corpus['archives'], report['archives']): + manifest = json.loads((output / record['manifest']).read_text()) + observed = [{key: entry[key] for key in item['expected_entries'][0]} + for entry in manifest['entries']] + if observed != item['expected_entries']: + raise ValueError(f"Decoded metadata/hash mismatch: {item['name']}") + print(f"{format}: {len(inputs)} historical archives, " + f"{sum(len(x['expected_entries']) for x in corpus['archives'])} entries verified") + + +if __name__ == '__main__': + main() diff --git a/web/style.css b/web/style.css index 6bd2065..186d193 100644 --- a/web/style.css +++ b/web/style.css @@ -1,6 +1,8 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later OR BSD-2-Clause */ +/* SPDX-License-Identifier: GPL-3.0-or-later */ :root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#20342d;background:#f4f5ef;font-synthesis:none;line-height:1.5;--green:#265c45;--line:#d7ddd1;--muted:#56665b} *{box-sizing:border-box}body{margin:0}a{color:var(--green);text-underline-offset:4px}button,input{font:inherit}button,.button{border:1px solid #b8c5b7;border-radius:6px;background:#fafcf7;color:#20342d;padding:10px 16px;font-weight:600;cursor:pointer;white-space:nowrap}button:hover,.button:hover{background:#e5eddf}.primary{background:var(--green);border-color:var(--green);color:white}.primary:hover{background:#19452f}button:disabled{opacity:.5;cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,.button:focus-within{outline:3px solid #b28529;outline-offset:4px}[hidden]{display:none!important} -header,main,footer{max-width:1260px;margin:auto;padding-left:40px;padding-right:40px}header{height:96px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:16px}header>a:last-child{font-size:14px}.brand{display:flex;align-items:center;gap:14px;text-decoration:none;font-size:12px;letter-spacing:1.6px;font-weight:750}.mark{font-family:monospace;font-size:24px;letter-spacing:-1px;padding:5px 9px;background:#203e2e;color:#ecf4dc;border-radius:3px}.intro{padding:55px 0 32px;max-width:680px}.eyebrow{font:600 11px/1.5 monospace;letter-spacing:1.8px;color:var(--green);margin:0 0 12px}h1{font-size:clamp(32px,4.8vw,52px);letter-spacing:-2px;line-height:1.12;font-weight:650;margin:0 0 20px}.intro>p:last-child{color:var(--muted);font-size:17px;max-width:640px}h2{font-size:19px;letter-spacing:-.4px;margin:0 0 4px}h3{font-size:18px;overflow-wrap:anywhere}.drop{display:flex;align-items:center;gap:24px;padding:30px;background:#fffefa;border:1.5px dashed #91a78d;border-radius:8px;flex-wrap:wrap}.drop.drag{background:#e6f0dc;border-color:var(--green)}.drop h2{font-size:19px}.drop p{margin:4px 0;font-size:14px;color:var(--muted)}.file-icon{font:46px monospace;color:#708b65}.drop>div:nth-child(2){flex:1}.button{position:relative;overflow:hidden}.button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.text-button{border:0;background:none;font-size:13px;text-decoration:underline;color:var(--green);padding:4px}.status-line{display:flex;justify-content:space-between;align-items:center;min-height:60px;gap:16px;font-size:14px}.status-line p{overflow-wrap:anywhere}.error{color:#963b23}.archive-heading{display:flex;justify-content:space-between;align-items:center;margin-top:18px;gap:20px}.archive-heading h2{font:600 25px monospace;overflow-wrap:anywhere}.archive-heading .eyebrow{margin-bottom:6px}.actions{display:flex;gap:10px}.stats{display:flex;gap:30px;padding:20px 0;color:var(--muted);font-size:13px;border-bottom:1px solid var(--line)}.stats span{font-size:18px;color:#20342d;font-weight:650;margin-right:5px}.browser-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;border:1px solid var(--line);margin-top:22px;border-radius:7px;overflow:hidden;background:#fffefa}.listing{padding:20px;min-width:0}.filters{display:flex;gap:24px;align-items:center;justify-content:space-between;margin-bottom:18px;font-size:13px}.search-label{font-size:12px;color:var(--muted);display:grid;gap:4px;flex:1}.search-label input{background:white;border:1px solid var(--line);border-radius:5px;padding:9px 12px;min-width:0;width:100%;font-size:14px;color:#20342d}.checkbox{display:flex;gap:6px;align-items:center}.table-scroll{overflow:auto;max-height:470px}table{width:100%;border-collapse:collapse;font-size:13px}th{color:var(--muted);text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.7px;padding:10px 8px;position:sticky;top:0;background:#eef1e8;z-index:1}td{padding:10px 8px;border-bottom:1px solid #edf0e7;vertical-align:top}td:first-child{max-width:320px;overflow-wrap:anywhere}td:not(:first-child){white-space:nowrap}td button{font:inherit;text-align:left;background:none;border:0;padding:0;white-space:normal;overflow-wrap:anywhere;color:var(--green);font-weight:600}tr.selected{background:#eaf1e2}.badge{font-size:11px;color:var(--muted)}.badge.verified{color:#276239}.badge.failed{color:#963b23}aside{border-left:1px solid var(--line);padding:24px 22px;background:#edf1e6}aside button{width:100%;white-space:normal}dl{font-size:13px;margin:18px 0 24px}dt{color:var(--muted);margin-top:12px}dd{margin:2px 0;overflow-wrap:anywhere;font-family:monospace}.muted{font-size:12px;color:var(--muted)}.notes{display:grid;grid-template-columns:repeat(3,1fr);gap:38px;margin:48px 0 44px;padding-top:28px;border-top:1px solid var(--line)}.notes h2{font-size:15px}.notes p{font-size:13px;color:var(--muted)}code{font-size:12px}footer{border-top:1px solid var(--line);padding-top:22px;padding-bottom:30px;display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}footer span:last-child{display:flex;gap:18px} +header,main,footer{max-width:1260px;margin:auto;padding-left:40px;padding-right:40px}header{height:96px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:16px}header>a:last-child{font-size:14px}.brand{display:flex;align-items:center;gap:14px;text-decoration:none;font-size:12px;letter-spacing:1.6px;font-weight:750}.mark{font-family:monospace;font-size:24px;letter-spacing:-1px;padding:5px 9px;background:#203e2e;color:#ecf4dc;border-radius:3px}.intro{padding:55px 0 32px;max-width:680px}.eyebrow{font:600 11px/1.5 monospace;letter-spacing:1.8px;color:var(--green);margin:0 0 12px}h1{font-size:clamp(32px,4.8vw,52px);letter-spacing:-2px;line-height:1.12;font-weight:650;margin:0 0 20px}.intro>p:last-child{color:var(--muted);font-size:17px;max-width:640px}h2{font-size:19px;letter-spacing:-.4px;margin:0 0 4px}h3{font-size:18px;overflow-wrap:anywhere}.drop{display:flex;align-items:center;gap:24px;padding:30px;background:#fffefa;border:1.5px dashed #91a78d;border-radius:8px;flex-wrap:wrap}.drop.drag{background:#e6f0dc;border-color:var(--green)}.drop h2{font-size:19px}.drop p{margin:4px 0;font-size:14px;color:var(--muted)}.file-icon{font:46px monospace;color:#708b65}.drop>div:nth-child(2){flex:1}.button{position:relative;overflow:hidden}.button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.text-button{border:0;background:none;font-size:13px;text-decoration:underline;color:var(--green);padding:4px}.status-line{display:flex;justify-content:space-between;align-items:center;min-height:60px;gap:16px;font-size:14px}.status-line p{overflow-wrap:anywhere}.error{color:#963b23}.archive-heading{display:flex;justify-content:space-between;align-items:center;margin-top:18px;gap:20px}.archive-heading h2{font:600 25px monospace;overflow-wrap:anywhere}.archive-heading .eyebrow{margin-bottom:6px}.actions{display:flex;gap:10px;flex-wrap:wrap;max-width:100%}.stats{display:flex;gap:30px;padding:20px 0;color:var(--muted);font-size:13px;border-bottom:1px solid var(--line)}.stats span{font-size:18px;color:#20342d;font-weight:650;margin-right:5px}.browser-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;border:1px solid var(--line);margin-top:22px;border-radius:7px;overflow:hidden;background:#fffefa}.listing{padding:20px;min-width:0}.filters{display:flex;gap:24px;align-items:center;justify-content:space-between;margin-bottom:18px;font-size:13px}.search-label{min-width:0;font-size:12px;color:var(--muted);display:grid;gap:4px;flex:1}.search-label input{background:white;border:1px solid var(--line);border-radius:5px;padding:9px 12px;min-width:0;width:100%;font-size:14px;color:#20342d}.checkbox{display:flex;gap:6px;align-items:center}.table-scroll{overflow:auto;max-height:470px}table{width:100%;border-collapse:collapse;font-size:13px}th{color:var(--muted);text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.7px;padding:10px 8px;position:sticky;top:0;background:#eef1e8;z-index:1}td{padding:10px 8px;border-bottom:1px solid #edf0e7;vertical-align:top}td:first-child{max-width:320px;overflow-wrap:anywhere}td:not(:first-child){white-space:nowrap}td button{font:inherit;text-align:left;background:none;border:0;padding:0;white-space:normal;overflow-wrap:anywhere;color:var(--green);font-weight:600}tr.selected{background:#eaf1e2}.badge{font-size:11px;color:var(--muted)}.badge.verified{color:#276239}.badge.failed{color:#963b23}aside{border-left:1px solid var(--line);padding:24px 22px;background:#edf1e6}aside button{width:100%;white-space:normal}dl{font-size:13px;margin:18px 0 24px}dt{color:var(--muted);margin-top:12px}dd{margin:2px 0;overflow-wrap:anywhere;font-family:monospace}.muted{font-size:12px;color:var(--muted)}.notes{display:grid;grid-template-columns:repeat(3,1fr);gap:38px;margin:48px 0 44px;padding-top:28px;border-top:1px solid var(--line)}.notes h2{font-size:15px}.notes p{font-size:13px;color:var(--muted)}code{font-size:12px}footer{border-top:1px solid var(--line);padding-top:22px;padding-bottom:30px;display:flex;justify-content:space-between;font-size:12px;color:var(--muted)}footer span:last-child{display:flex;gap:18px} .has-archive .intro{display:none}.has-archive .drop{margin-top:24px;padding:20px} -@media(max-width:800px){header,main,footer{padding-left:20px;padding-right:20px}.intro{padding-top:36px}.browser-layout{grid-template-columns:1fr}aside{border-left:0;border-top:1px solid var(--line)}.drop{padding:22px;gap:16px}.file-icon{display:none}.archive-heading{align-items:flex-start;flex-direction:column}.stats{gap:18px;flex-wrap:wrap}.filters{flex-wrap:wrap}.notes{grid-template-columns:1fr;gap:18px}.notes p{margin-bottom:0}footer{gap:14px;flex-wrap:wrap}header .brand>span:last-child{display:none}} +@media(max-width:800px){header,main,footer{padding-left:20px;padding-right:20px}.intro{padding-top:36px}.browser-layout{grid-template-columns:minmax(0,1fr)}aside{border-left:0;border-top:1px solid var(--line)}.drop{padding:22px;gap:16px}.file-icon{display:none}.archive-heading{align-items:flex-start;flex-direction:column}.stats{gap:18px;flex-wrap:wrap}.filters{flex-wrap:wrap}.notes{grid-template-columns:1fr;gap:18px}.notes p{margin-bottom:0}footer{gap:14px;flex-wrap:wrap}header .brand>span:last-child{display:none}} + +.archive-heading>div{min-width:0;max-width:100%}aside{min-width:0} diff --git a/web/test_browser.py b/web/test_browser.py index 1ec4032..0672fbf 100644 --- a/web/test_browser.py +++ b/web/test_browser.py @@ -95,8 +95,12 @@ def main(): assert downloaded.value.suggested_filename == 'entry-CON.txt' page.locator('#search').fill('café') expect(page.locator('#entries tr')).to_have_count(2) - page.set_viewport_size({'width': 390, 'height': 844}) - assert page.evaluate('document.documentElement.scrollWidth <= innerWidth') + for font in ('system-ui', 'Arial', 'monospace'): + page.evaluate('(font) => document.documentElement.style.fontFamily = font', font) + for width in (320, 390, 800): + page.set_viewport_size({'width': width, 'height': 844}) + assert page.evaluate('document.documentElement.scrollWidth <= innerWidth'), (font, width) + page.evaluate("document.documentElement.style.fontFamily = ''") # A stalled worker times out without a false checksum failure or a # fresh empty worker claiming successful verification of stale rows.