Only zip was unpacked. A .tar.gz upload, the usual export from Linux build hosts and git forges, was kept as one opaque file, and the scan still finished as "completed" with nothing analysed.
What
ingest/archive.rs (new; zip extraction moved here from blob.rs):
Format from content:ArchiveFormat::sniff reads the blob's first bytes: zip, ustar/GNU tar, or a gzip whose content is a tar. A lone gzipped file is not treated as an archive. A gzip that cannot be decoded still counts as tar.gz, so it fails visibly.
Same limits for every format: entry count and bytes actually written, as for zip.
Hostile entries: absolute paths and .. entries are skipped. Symlinks, hard links, devices and FIFOs are never created.
Visible failure:
an uploaded source archive that cannot be unpacked is an ingest error;
the classification step records it as the ingest skipped stage;
the run then fails with "the uploaded archive could not be unpacked…" instead of completing over nothing.
PLC projects and mobile packages keep their single-file fallback, so plc-corrupt-archive is unchanged.
Closes #335. Part of the pilot P0 (#338).
## Why
Only zip was unpacked. A `.tar.gz` upload, the usual export from Linux build hosts and git forges, was kept as one opaque file, and the scan still finished as "completed" with nothing analysed.
## What
- `ingest/archive.rs` (new; zip extraction moved here from `blob.rs`):
- **Format from content:** `ArchiveFormat::sniff` reads the blob's first bytes: zip, ustar/GNU tar, or a gzip whose content is a tar. A lone gzipped file is not treated as an archive. A gzip that cannot be decoded still counts as `tar.gz`, so it fails visibly.
- **Same limits for every format:** entry count and bytes actually written, as for zip.
- **Hostile entries:** absolute paths and `..` entries are skipped. Symlinks, hard links, devices and FIFOs are never created.
- **Visible failure:**
- an uploaded *source archive* that cannot be unpacked is an ingest error;
- the classification step records it as the `ingest` skipped stage;
- the run then **fails** with "the uploaded archive could not be unpacked…" instead of completing over nothing.
- PLC projects and mobile packages keep their single-file fallback, so `plc-corrupt-archive` is unchanged.
- Wizard label: "Source archive (zip, tar, tar.gz)".
- Nightly harness: an artifact can say `"pack": "tar_gz"`. The new target `archive-order-intake-tgz` uploads `fixtures/nightly/archive` as a `.tar.gz`.
## Verification
- Unit tests:
- format sniffing (zip, tar, tar.gz, gzipped non-tar, plain file, empty);
- tar/tar.gz extract like zip;
- traversal, absolute and symlink entries are not written;
- a tar.gz bomb is refused and cleaned up;
- the entry limit holds in every format;
- a truncated tar.gz fails;
- an archive exactly at the limits extracts whole.
- Full local nightly (bless, then compare on a second fresh DB):
- passes;
- the `.tar.gz` baseline is **identical** to the zip baseline;
- no other baseline changed.
- fmt; clippy with the CI flags.
Touches `orchestrator.rs` and `targets.json` like #339. Whichever merges second may need a trivial rebase.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Only zip was unpacked. A .tar.gz upload was kept as one opaque file and
the scan still finished as "completed" with nothing analysed.
- The archive format is read from the blob's first bytes (zip, tar, gzip
holding a tar); the stored blob has no file name to go by.
- tar and tar.gz are held to the same ExtractLimits as zip (entry count,
bytes actually written). Entries that would leave the destination are
skipped, and links, devices and FIFOs are never created.
- An uploaded source archive that cannot be unpacked fails the scan run
with the reason, and ingest failures are recorded as a skipped stage,
instead of completing over a tree that was never there. PLC projects and
mobile packages keep their single-file fallback.
- Zip extraction moved from ingest/blob.rs into ingest/archive.rs.
- Nightly target archive-order-intake-tgz uploads the archive fixture as
a .tar.gz; its baseline is identical to the zip's.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang
merged commit 0e0dfadf56 into main2026-09-23 13:08:07 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #335. Part of the pilot P0 (#338).
Why
Only zip was unpacked. A
.tar.gzupload, the usual export from Linux build hosts and git forges, was kept as one opaque file, and the scan still finished as "completed" with nothing analysed.What
ingest/archive.rs(new; zip extraction moved here fromblob.rs):ArchiveFormat::sniffreads the blob's first bytes: zip, ustar/GNU tar, or a gzip whose content is a tar. A lone gzipped file is not treated as an archive. A gzip that cannot be decoded still counts astar.gz, so it fails visibly...entries are skipped. Symlinks, hard links, devices and FIFOs are never created.ingestskipped stage;plc-corrupt-archiveis unchanged."pack": "tar_gz". The new targetarchive-order-intake-tgzuploadsfixtures/nightly/archiveas a.tar.gz.Verification
.tar.gzbaseline is identical to the zip baseline;Touches
orchestrator.rsandtargets.jsonlike #339. Whichever merges second may need a trivial rebase.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p