Files
rea/tests/fixtures/zipSymlinkMetadata.ts
T
morluto 6ba6aea5eb fix(parsers): respect container facts and real decoding boundaries
Use zip.js's parsed symlink fact for inventory and open refusal. Treat an
unmatched Godot trailer as an unconfirmed candidate while preserving failures
for confirmed malformed packs. Report entropy path-resolution failures at the
selected-input boundary.

Separate Go header discovery from inline string extents in ELF and Mach-O,
and apply the aggregate content allowance after validating real source ranges.
Normalize binary plist UID widths through the existing scalar-copy owner,
budget exact clone growth, preserve source identity, and refuse inexact UIDs.

Validation: 389 distinct tests passed, one Linux /proc test skipped on Darwin;
build, typecheck/lint, docs, single-thread formatting, and discovery (2142 files)
passed. CLI/MCP Go fixtures and public ZIP/Godot/keyed-archive workflows ran.
Real producer prevalence and external provider execution were not established.

Repeated ordinary keyed-archive CLI inventory facts and estimated reply tokens
were equal before/after. Warm median elapsed was 0.5166s / 0.5177s; no speed claim.

Fixes #6751
Fixes #6763
Fixes #6754
Fixes #6767
Fixes #6762
Fixes #6779
2026-10-23 23:02:07 +08:00

18 lines
663 B
TypeScript

import { TextReader, Uint8ArrayWriter, ZipWriter } from "@zip.js/zip.js";
/** Real ZIP entries whose Unix external attributes declare symlinks. */
export const zipSymlinkMetadataFixture = async (): Promise<Buffer> => {
const writer = new ZipWriter(new Uint8ArrayWriter(), {
versionMadeBy: 3 << 8,
});
await writer.add("target.txt", new TextReader("harmless target text"));
for (const [name, mode] of [
["type-only-link", 0o120000],
["permissions-link", 0o120777],
] as const)
await writer.add(name, new TextReader("target.txt"), {
externalFileAttributes: (mode << 16) >>> 0,
});
return Buffer.from(await writer.close());
};