Commit Graph
1126 Commits
Author SHA1 Message Date
Vincent Koc 9aa48b05b8 test(pyinstaller): share stored data member fixtures (#17082) 2026-12-05 21:26:55 +08:00
Vincent Koc dcee5d1d7d refactor(ogg): share OpusTags prefix reads (#17081) 2026-12-05 21:20:46 +08:00
Vincent Koc ee740b5152 refactor(nib): share malformed archive diagnostics (#17070) 2026-12-05 20:46:37 +08:00
Vincent Koc 9dfbd5f981 refactor(tar): share malformed member diagnostics (#17047) 2026-12-05 19:15:49 +08:00
Vincent Koc 1431b4682e refactor(ktx): share mip-level region construction (#17037) 2026-12-05 18:53:19 +08:00
Vincent Koc 3750bd83fd refactor(android): share boot image wide integer decoding (#17025) 2026-12-05 18:19:47 +08:00
Vincent Koc b17cd21c01 refactor(xar): reuse the signature recognizer (#17011) 2026-12-05 17:22:58 +08:00
Vincent Koc 3f9f6fce6c test(tar): share GNU long-name fixture members (#17016) 2026-12-05 17:22:05 +08:00
Vincent Koc 50f9b9dc39 test(fit): share incomplete zero padding fixtures (#17013) 2026-12-05 17:21:11 +08:00
Vincent Koc 969b4e3859 refactor(apple): share XAR table size limit results (#17006) 2026-12-05 16:56:06 +08:00
Vincent Koc 49dde7e16a refactor(apple): reuse installer XML record budget results (#17005) 2026-12-05 16:54:30 +08:00
Vincent Koc 1725e9bbe5 refactor(pyz): share malformed archive result construction (#17001) 2026-12-05 16:38:34 +08:00
Vincent Koc 9af9305a17 refactor(inventory): infer extraction wrapper result types (#16993) 2026-12-05 16:13:52 +08:00
Vincent Koc d9dc82316b test(ubi): share malformed image assertions and cleanup (#16994) 2026-12-05 16:08:54 +08:00
Vincent Koc cf1d2c0f93 test(python): reuse the marshal small tuple fixture (#16975) 2026-12-05 15:11:56 +08:00
Vincent Koc b0bb67a93f test(artifacts): share asset entry region assertions (#16969) 2026-12-05 14:38:51 +08:00
Vincent Koc 6038cea422 refactor(pyinstaller): simplify the bounded cookie sum (#16946) 2026-12-05 13:02:12 +08:00
Vincent Koc f97e823e7d test: share artifact entry and coverage collection (#16937) 2026-12-05 12:41:24 +08:00
639da1a3cf feat(artifacts): read ESP8266 images when the caller names the chip (#16662)
* feat(artifacts): inventory and extract ESP32 firmware images

ESP32-family app and bootloader images (magic 0xE9) had no reader, so
open_binary refused OTA downloads, app partitions and bootloaders.

Add the esp-image container format behind inspect_artifact and
extract_artifact. A pure decoder reads each byte once and keeps only
fixed-size fields. Derived facts cover the chip, from a table cited to
ESP-IDF v6.1; segment classification as ESP-IDF's should_map and
should_load; checksum and appended SHA-256 results; app and bootloader
descriptors; Secure Boot v2 signature blocks, observed and unverified;
and undescribed trailing byte ranges. Truncation and undescribed bytes
make coverage unknown. ESP8266 images are refused with a specific
reason, and ciphertext stays unrecognized.

Add the format to every target, Evidence, snapshot, live-summary and
artifact vocabulary, document it, and add an optional verify:esp-images
lane that compares esptool-built images with esptool image-info and
espsecure signature-info-v2.

Refs #3615

* test(artifacts): run the ESP image lane on esptool v5.6.0

The lane compared descriptor fields only when esptool image-info printed
one, so a descriptor that REA reports and esptool does not print passed
without comparison. Compare the descriptor kind in both directions.

Record that the lane passed for all 13 images with esptool and espsecure
v5.6.0, the version the layout facts cite, as well as with 4.12.0.

* refactor(artifacts): define ESP image layout sizes once

The decoder and the derived facts each defined the segment-header,
appended-digest and flash-sector sizes, the erased-byte scan and the
offset formatter. Define them once with the other fixed-layout structures
and import them in both places. The signature slot count is the one
constant that drives the slot scan.

Correct the observedEnd comment: it is the end of the last chunk read.

* fix(artifacts): report ESP-IDF's segment length limit by chip

ESP-IDF's verify_segment_header rejects a segment of 16 MiB or more
unless the chip maps flash through 32-bit cache addresses
(SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP: ESP32-S3, P4, C5, C61, H4 and
S31 in v6.1). Record that capability in the chip table and add a
limitation for such segments; unknown chips get none.

`loaded` repeats should_load. It does not mean the bootloader accepts the
segment: verify_load_addresses still rejects one outside the chip's RAM,
which REA does not model. Say so in the docs, the skill reference and the
inventory limitation.

* test(artifacts): check ESP lane tools first and verify extraction

The lane started work before checking its tools, so a missing RISC-V
target, ld.lld, esptool or espsecure surfaced as a raw spawn or command
error. Check each one before building and name the variable to set. Warn
when esptool is not v5.6.0, the release the layout facts cite.

Assert each segment's class for the ESP32-C3 app, its variants and the
bootloader, as the Xtensa image already did. Extract the app and the
signed image through the CLI and compare every file with the bytes at
esptool's segment offsets or in the appended signature sector; the
source's SHA-256 must be unchanged and equal the reported root_sha256.

* docs(artifacts): state what the ESP image lane does not establish

The Verification section listed the lane's checks but not its gaps: only
ESP32-C3 and ESP32 images come from a real producer, no real project
build, OTA download or flash dump is inspected, no signature is verified,
and the lane does not run in CI.

Record the timing of the final lane run on esptool v5.6.0.

* fix(artifacts): compare ESP segment declarations

Segment entries hash only their data, so compare_artifacts reported a
segment that moved to another load address with the same bytes as
unchanged; only the image itself changed. Compare each segment's
load_addr and data_len as its declaration, as Node SEA and PyInstaller
members are compared, and count a changed declaration as a metadata
change, also when content is unavailable.

Header offsets are layout and the classification is derived, so neither
is compared.

* test(artifacts): run ESP lane commands as owned process trees

The lane ran its tools through execFile. A timeout killed only the direct
child, so a linker or assembler that Clang or GCC had started could keep
running while the lane removed its workspace. Run every command through
createVerifierCommands, check the tools inside withVerifierCleanup, and
remove the workspace only after commands.close() has stopped every tree;
a failed close keeps the workspace.

Only a nonzero exit now counts as a refusal or an expected esptool
failure; timeouts and spawn failures propagate. Supervising each command
roughly doubles the lane's run time.

* test(artifacts): cancel ESP decoding after its first decoded chunk

The cancellation test requested cancel or close on setImmediate, which
can land while the file is still being opened and checked, so it never
showed that decoding had started. It also passed against a reader that
ignored both requests while decoding. Acknowledge the decoder's first
chunk, then cancel or close, join the operation, and assert that no
later chunk reaches the decoder and that the reader ends closed.

* docs(artifacts): record which ESP metadata comparison ignores

Segments are compared by their declaration. The image's and the
signature blocks' format_metadata are not: every field comes from their
own bytes, which content comparison already covers, and a block's
image_digest_matches follows the image's content.

* docs(artifacts): state that ESP mmu_page_size is a base-2 logarithm

The app descriptor's mmu_page_size keeps ESP-IDF's name and value, the
MMU page size in log base 2 as esp_app_desc_t declares it, so 16 means
64 KiB. Say so in docs/esp-image.md and the schema comment; a reader
could otherwise take 16 as 16 KiB.

* fix(esp-image): retain member consumption and share lifecycle regressions

* test(artifacts): scope MCP catalogs and budget full-schema validation

* test(artifacts): verify compact output profiles and document bounded catalogs

* test(artifacts): close readers when cleanup-test admission fails

* test(artifacts): compare ESP image limitations with their owners

The decoder and reader tests froze complete limitation sentences, so a
harmless rewording failed them. The wording now has two owners:
ESP_IMAGE_LIMITATIONS in espImageFacts.ts, which the decoder, the inventory
and the reader use, and ESP_DESCRIPTOR_LIMITATIONS beside the descriptor
decoder. Tests compare delivered limitations with the owner, called with the
facts each case establishes (segment index, declared and available bytes,
offsets, chip, page range), next to the structured assertions they already
make. Delivered text is unchanged.

* test(esp-image): assert structured facts and owned guidance

* fix(esp-image): keep spi_flash_mode and descriptor fields before a truncated tail

ESP-IDF v6.1's esp_app_desc_t declares spi_flash_mode at byte 181, after
mmu_page_size, as the committed reference layout shows; the descriptor now
keeps it as stored. The decoder also required all 256 descriptor bytes,
though it reads none past byte 181, so a file ending in the reserved tail
lost the version, project, digest and revision facts it does hold. The app
descriptor now needs only its fields; the segment's truncation is reported
as before.

* test(esp-image): pin the P-192 public key digest to espsecure's layout

espsecure packs ECDSA signature blocks as "<BBBx32sB64s64s1031x" and
zero-pads a 48-byte P-192 point to 64 bytes, so the signature starts at
byte 101 for every SHA-256 curve. signature_info_v2 hashes sig_block[36:101]
and _digest_sbv2_public_key the curve ID with the padded point. No test built
a P-192 block; this one checks public_key_sha256 against that definition.

* fix(esp-image): keep each app descriptor field the file holds in full

A file can end anywhere inside the 256-byte esp_app_desc_t. The decoder
needed every field byte, so a cut at byte 176 dropped the version, project
and app_elf_sha256 it does hold. Once the 4-byte magic identifies an app
descriptor, each field is now kept when the file holds all of its bytes and
is null otherwise; observed_length records where the descriptor ends, so a
cut field is told apart from text that is not UTF-8. The fields after the
magic become nullable in the metadata schema.

* fix(esp-image): report a signature block whose image digest does not match

A CRC-valid Secure Boot v2 block can carry another image's digest. The
block recorded image_digest_matches false, but no limitation said so, unlike
a checksum or appended-SHA mismatch, so CLI and MCP summaries showed only
the generic unverified note. The mismatch is now a limitation; coverage
stays complete and signature_status stays unverified. The three other
signature-sector limitations move into ESP_IMAGE_LIMITATIONS with their
text unchanged, so all ESP image wording has one owner.

* feat(artifacts): read ESP8266 images when the caller names the chip

An ESP8266 image shares the 0xE9 magic with ESP32-family images, and its
8-byte header does not name the chip, so REA still never detects one.
The caller now names it with one additive explicit format,
`esp8266-image`: `open_binary` `format`, or `--target-format` on
`inspect-artifact` and `extract-artifact`. The native `--target-format`
excludes it, because the target is an archive.

With the chip named, REA reads the file as esptool v5.6.0's
ESP8266ROMFirmwareImage does: the 8-byte header, the header-declared
segments and the XOR checksum seeded with 0xEF. The shared streaming
decoder takes the layout from the caller's format, and one domain function
admits the header for the resolver, inventory classification and the
decoder. Integrity, truncation and coverage follow the ESP32 rules where
they apply. Segments keep `esp-image-segment` metadata and its comparison
declaration, but their classification is always unknown, because ESP-IDF's
should_map and should_load do not describe the ESP8266 loaders. A segment
that esptool warns about, or that esptool would not write, gets a
limitation, which also shows when an ESP32-family image was named
ESP8266. Magic 0xEA (esptool's version 2) is refused as unsupported.

The auto-detection refusal now names the explicit format. Inventory and
extraction receive the caller's format, so byte classification does not
reclassify the root.

Contract: `esp8266-image` joins the explicit format, Evidence subject,
artifact graph, snapshot target and live summary enums, and
`format_metadata` gains the `esp8266-image` root kind. The ESP32 schemas
are unchanged: the shared checksum and byte-range shapes are separate
instances, so the advertised JSON Schema keeps them inline.

* fix(artifacts): name every ESP8266 route and own the caller's root format (panel review)

The refusal for an unnamed ESP8266 image told CLI users to pass
`--target-format esp8266-image`, which the native commands reject. It now
names `open_binary` `format` and the two artifact commands.

`CALLER_SELECTED_ROOT_FORMATS`, next to the explicit-format enum, owns the
formats whose root inventory must not reclassify. The CLI option, the
native exclusion, the artifact selection type and inventory derive from it,
and extraction derives the format from its input format instead of taking
a second field.

Other changes:
- The 8-byte common header has one parser.
- Reader messages name an ESP8266 image as one.
- The lane's version 3 digest check no longer assumes the digest begins
  with a byte other than 0xFF.
- The docs no longer call the absent digest fields established, and no
  longer claim that snapshots record the format. Artifact sessions cannot
  be saved as snapshots.
- New tests cover esptool's segment-warning bounds.
- The lane passed with esptool v5.6.0 and 4.12.0.

* chore(plugin): regenerate the skill bundle from the authored skill

* refactor(firmware): format the ESP8266 magic byte with the shared byteToHex owner

Main's architecture guard admits no new inline byte-to-hex formatting; the
header refusal now uses src/kernel/byteToHex.

* chore(verify): record open_binary's input schema with esp8266-image

CI's package build compares the committed advertised-schema summaries with
the packaged catalog; regenerated with
`node scripts/verify-advertised-schemas.mjs --update-summary`.

* fix(artifacts): say how to read an ESP8266 image inside an ESP flash dump

A partition or bootloader region of an ESP flash dump that begins with an
ESP8266 image header carried the whole-file refusal, which tells the caller
to open "this file" as esp8266-image. Inside a dump that file is the dump.

The region now carries ESP8266_REGION_REFUSAL: extract the region, then
open the extracted file with format esp8266-image. Both refusals share the
reason ESP8266 images are never detected. The test follows that advice
through extraction and a named read, and fails with the old message.

* refactor(artifacts): skip ESP32-only decoder state for ESP8266 images

---------

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-05 04:16:40 +00:00
Vincent Koc 8aace05d16 refactor(pkg): fold the CPIO scan into the prefix reader (#16921) 2026-12-05 11:40:43 +08:00
Vincent Koc acab699a31 refactor(bun): share standalone graph result types (#16888) 2026-12-05 09:26:20 +08:00
Vincent Koc 0af8817643 refactor(filesystem): share reported missing-file checks (#16865) 2026-12-05 07:25:22 +08:00
Vincent Koc 43a36d3870 refactor(media): share RIFF format truncation diagnostics (#16862) 2026-12-05 06:58:56 +08:00
Vincent Koc 769753f140 refactor(artifacts): share prepared metadata snapshots (#16852) 2026-12-05 06:19:44 +08:00
Vincent Koc f3e5e20a0a refactor(json): share optional record projection (#16851) 2026-12-05 06:12:45 +08:00
Eliran Zach 4e93e5a8d6 perf(contracts): shorten the shared detail parameter description (#16823)
* perf(contracts): shorten the shared detail parameter description

The detail input description is repeated on 42 tools in the default
tools/list. Shorten it from 523 to 369 bytes while keeping the omitted,
complete and summary semantics; delivery facts still name the budget and
recovery at the point of use.

Also drop a redundant inventory scan in the release-exposure container
reader: both callers already pass the occurrence digest resolved through
the nodeSha map.

* test(schemas): refresh advertised schema summaries for the detail description
2026-12-04 15:26:51 -05:00
Vincent Koc 04a628c8f3 test(zip): share member-region fixture reader (#16809) 2026-12-05 02:14:47 +08:00
Eliran Zachandmorluto 33b2763423 feat(artifacts): inspect PlayStation PS-X EXE headers (#16251)
* feat(artifacts): inspect PlayStation PS-X EXE headers

A file starting with the PS-X EXE magic is inventoried as psx-exe. Root
metadata reports the initial PC and GP, the text, data and BSS ranges,
the stack base and offset with the initial SP, the region marker and
its licensed region, and whether the file length agrees with 0x800 plus
the declared text size. header.bin and text.bin are stored ranges;
text.bin carries its load address and holds only the bytes present.

A file shorter or longer than the declared text, or a text size that is
not a whole number of 2048-byte sectors, leaves coverage unknown with
the offset involved. A file that ends inside the header is refused as
truncated with the offset where it ends. Nothing is executed.

* fix(artifacts): read PS-X EXE fields through BinaryReader and match regions exactly

A region marker such as constructor matched an inherited property of the
region table, so the metadata held a function and inventory failed when
it was cloned. Regions now come from a Map. Header words are read
through BinaryReader instead of a local decoder. The fixture writes
literal offsets with distinct non-zero values, including data and a
stack offset, and the guide says inventory reads the members to hash
them.

* fix(artifacts): validate PS-X file sizes and name the omitted text member

* test(artifacts): extract PS-X EXE members in the reader test

* style(artifacts): format the PS-X reader test

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-04 17:31:34 +00:00
Vincent Koc f852f9c7a8 refactor(bun): share standalone region declarations (#16799) 2026-12-05 01:14:47 +08:00
Eliran Zachandmorluto 208b81d724 feat(artifacts): inspect Game Boy and GBA ROM headers (#16249)
* feat(artifacts): inspect Game Boy and GBA ROM headers

Game Boy and Game Boy Color images (game-boy-rom) are claimed when at
least the first 24 bytes of the boot logo at 0x104 match, the half every
boot ROM compares. Root metadata reports the entry code and its JP
target, full or top-half logo match, title and manufacturer code, CGB
and SGB flags, mapper and features, declared ROM and RAM sizes,
destination, licensee codes, version, and declared and computed header
and global checksums. The global checksum is summed over the file in
bounded reads.

Game Boy Advance images (gba-rom) are claimed from an ARM branch at 0,
the fixed 0x96 at 0xB2, and the boot logo or a matching complement
check. Root metadata reports the entry branch target, logo match, title,
game and maker codes, fixed value, unit and device type, version, the
complement check, and the multiboot fields when that layout could apply.

Both serve header.bin and program.bin as stored ranges. Logos are
compared by SHA-256 digest, so no logo bytes are carried. Checksum,
logo and size disagreements leave coverage unknown; a header cut short
is refused as truncated with the offset where the file ends.

* fix(artifacts): keep missing GBA multiboot fields unknown and pin checksum vectors

A GBA file that ends inside the multiboot fields reported boot_mode and
slave_id as zero. They are now null, with a limitation naming where the
file ends. The Game Boy reader charges artifact_limits.expanded_bytes
from the file size before it sums the file for the global checksum.
Checksum tests now use hand-derived vectors instead of copying the
parser's own result.

* refactor(artifacts): read Game Boy and GBA header fields through BinaryReader

The GBA parser decoded words with a local reader that read missing bytes
as zero. Both parsers now read header fields through BinaryReader, as the
tool-design guide requires, after their length checks. The fixtures write
literal offsets instead of the parsers' field constants, and the guides
say inventory reads the stored members to hash them.

* fix(artifacts): read documented GB size codes and MBC4, refuse truncated GBA headers

* style(artifacts): format the handheld ROM test

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
2026-12-04 12:08:57 -05:00
Vincent Koc c94607feb5 refactor(deno): share VFS child range declarations (#16794) 2026-12-05 00:59:06 +08:00
Vincent Koc baa7871e07 refactor(glb): reuse the first BIN chunk record (#16786) 2026-12-05 00:40:58 +08:00
Vincent Koc f3308487e9 refactor(deno): share embedded module region projection (#16781) 2026-12-05 00:19:34 +08:00
Vincent Koc 80be901897 refactor(macos-pkg): emit retained PackageInfo fields directly (#16731) 2026-12-04 20:57:28 +08:00
Vincent Koc 05cd2ec61b refactor(dds): use one map for storage geometry (#16723) 2026-12-04 20:42:48 +08:00
Vincent Koc 124d287a90 refactor(apple): share macOS package compression vocabulary (#16689) 2026-12-04 18:21:25 +08:00
Vincent Koc aa6b6ea289 refactor(apple): project macOS Distribution metadata directly (#16688) 2026-12-04 18:21:08 +08:00
Shuaixin Huangandgensokyo-dev 534428cf25 fix(artifacts): preserve embedded newlines in GNU ar long names
Use the full GNU terminator for entry starts and ends. Keep the existing
COFF variant detection, including llvm-lib's newline padding.

Adapted from morluto/rea#15941.

Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-04 18:20:57 +08:00
Vincent Koc 5fbe7ca210 test(apple): share single-object Nib archive fixtures (#16685) 2026-12-04 18:15:35 +08:00
Vincent Koc 6bd33dcc7f refactor(android): consolidate boot OS metadata decoding (#16682) 2026-12-04 18:03:25 +08:00
Vincent Koc 2b0e7f764e test(artifacts): share classification expectations (#16681) 2026-12-04 17:42:36 +08:00
N0zoM1z0andgensokyo-dev 68a7ab70cf fix(fit): account for legacy external devicetree alignment
Accept the exact four-byte padding emitted by older mkimage releases
alongside the eight-byte padding used for flat_dt today.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-04 17:32:48 +08:00
N0zoM1z0andgensokyo-dev 46e92e2b64 fix(fit): require exact external image padding
Derive the trailing padding length while validating external ranges.
Attribute linked ranges to their owning image. Only accept a fully read
zero-filled tail of the expected length as mkimage padding.

Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Co-authored-by: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
2026-12-04 17:32:48 +08:00
Anurag Singh c75b676637 fix(fit): report bytes after the image data as unknown coverage
FIT inventory reported complete coverage whenever the devicetree and
image ranges were valid, even when bytes followed the last of them.
OpenWrt sysupgrade images carry metadata and an fwtool signature there,
and recovery images pad to 64 KiB; neither was exposed or mentioned.

The FIT structure now reports its extent, the first byte after the
devicetree and every external image range. Bytes past it leave coverage
unknown with a limitation naming their size and offset. Up to 7 zero
bytes after external image data stay accounted for, since mkimage -E
pads the last image to its 4- or 8-byte alignment.

Closes #16230
2026-12-04 17:32:48 +08:00
Anurag Singh 3741beeafc fix(asar): report bytes outside every packed member as unknown coverage
The ASAR reader declared complete coverage after listing the header's
members, even when bytes after the header belonged to no packed member:
bytes after the last member, gaps between members, or the declared range
of a member that cannot be read. Coverage is now unknown in those cases,
with a limitation giving the unaccounted bytes, their range count and the
first offset. Unpacked members need no packed bytes.

The gap measurement the wxapkg reader used moves to a shared
unaccountedBytes helper that both readers call.

Closes #16588
2026-12-04 17:06:37 +08:00
Vincent Koc 2ac3716899 refactor(artifacts): reuse canonical occurrence type (#16644) 2026-12-04 15:55:26 +08:00
hhangandhhang 0a71a25e4d fix(tar): recognize gzip archives with long comments (#16188)
Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
2026-12-04 04:28:45 +00:00
clyde a143031b8f fix(ubi): report unknown coverage for conflicting volume tables (#16233) 2026-12-04 04:24:23 +00:00
ShuaixinHuangandShuaixinHuang 6dee08cdd1 fix(ogg): require OpusTags before classifying audio (#15972)
Co-authored-by: ShuaixinHuang <197200901+ShuaixinHuang@users.noreply.github.com>
2026-12-04 04:21:33 +00:00
morluto a37994b3e8 feat(artifacts): inspect MetaTrader EX4 and EX5 program headers and resources (#16501)
* feat(artifacts): inspect MetaTrader 5 EX5 program headers and resources

Recognize compiled MQL5 programs by their EX5 magic and inventory them
through inspect_artifact and extract_artifact. Report the program type,
compiler build, copyright/link/version property slots, nonzero header
fields of unknown meaning, and the resource table. List the opaque body
and resource payloads as stored byte ranges; nothing is decrypted,
decompressed or decompiled.

Refs #16495

* feat(artifacts): read MetaTrader 4 EX4 programs with the EX5 layout

EX4 (magic EX-) shares the EX5 header, property slots and resource
table, so both containers become one mql-program format with a
container field. The version slot is 64 bytes and the opaque body
starts at 0x2E8 in both containers; the earlier 0x3A8 header length
counted 192 opaque bytes as part of the version slot. EX4 type code 3
is a library; build is reported under a neutral name because its EX4
meaning is not established.

* fix(artifacts): bound repeated MQL resource ranges and let tar outrank printable magics

Resource records may share one payload range, and each occurrence is
hashed and extractable, so the reader now charges every record against
artifact_limits.expanded_bytes, as the DTBO reader does.

A checksum-valid tar header now runs before the recognizers that match a
printable magic at offset 0. A tar whose first member was named EX-...,
GDPC... or UnityFS was claimed as an MQL program, Godot PCK or UnityFS.

Slot text keeps a leading U+FEFF, which is declared content rather than
an encoding mark.

* fix(artifacts): refuse an invalid tar header only after leading-magic formats

Only a checksum-valid tar header outranks the printable leading magics. A
Godot pack can hold ustar at 257 inside its own content without a valid
tar checksum; refusing that header first rejected the valid pack.

* fix(artifacts): compare MetaTrader resource declarations

A resource's name, kind, record index and unpacked size live in the
resource table, outside the stored payload that content comparison
hashes, so a renamed resource compared as unchanged. Compare them as
the resource's declaration, as tar, ar and UnityFS members do.

* fix(artifacts): keep unreadable MetaTrader resource names unknown in comparison
2026-12-03 19:16:36 -05:00