mirror of
https://github.com/morluto/rea.git
synced 2026-11-14 10:43:30 +00:00
* feat(artifacts): inspect classic iNES container regions
* fix(artifacts): preserve iNES source disappearance as integrity failure
* fix(artifacts): revalidate iNES source before parsing header
* fix(artifacts): validate admitted roots before classification
* fix(artifacts): normalize source loss during root hashing
* fix(artifacts): bind iNES extraction admission to inventory
* test(artifacts): clarify non-executing inspection wording
* fix: preserve binary plist detection with extended magic probe
* test(browser): wait for popup document loads before capture
* fix(artifacts): honor cancellation across source validation
* fix(artifacts): prefer artifact magic over implicit database suffix
* fix(artifacts): select extraction readers from scanned format
* fix(artifacts): complete prefix reads and share ZIP format admission
* fix(browser): budget scenario cleanup for content drain and shutdown
* test(artifacts): admit valid universal inputs before routing
* test(artifacts): verify iNES workflows on macOS
* test(ci): own iNES macOS coverage and portable fixture paths
* fix: preserve cleanup retries and avoid duplicate inventory parsing
* fix(contracts): share ZIP target formats across MCP lifecycle schemas
* fix(target): preserve typed cancellation during descriptor admission
* refactor(artifacts): use JSON-safe inventory producer output directly
* test(artifacts): share file read setup and satisfy CI checks
* fix(artifacts): classify changed admission as integrity failure
* ci: run Mach-O summary delivery coverage on macOS
* test(javascript): align parameter provenance with main contract
* test(browser): await discoverable fixture pages before runtime verification
* fix(artifacts): pass target metadata to format detection
* fix(artifacts): bind extraction to opened target
* fix: repair the static-check failures on the default branch (#2895)
* fix: repair the static-check failures on the default branch
The default branch fails its own required `Static checks` job three ways, so
every pull request reports that job as failed regardless of its own change.
- `npm run format:check` reports `src/domain/functionComparison.test.ts` and
`src/ida/IdaOperationRunner.ts`.
- `npm run lint` reports a duplicate `import { join } from "node:path"` in
`tests/boundary/mcp/ghidraInventoryMcp.test.ts` (lines 4 and 17).
- `npm run typecheck` reports `format: "devin"` missing from the client format
union in `src/application/SupportedClients.ts`, and an unchecked index in
`tests/boundary/cli/clientProfileLifecycle.test.ts`, whose pair array is
inferred as `string[][]`.
Apply the pinned formatter, drop the duplicate import, list the `"devin"` format
that its own definition already uses, and mark the pair array `as const`.
Validation: `npm run check:fast` and `npm run format:check` pass.
* fix(setup): keep Devin on the JSON configuration dialect
---------
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
(cherry picked from commit df3d96da80)
* fix(artifacts): bind session inventories to target identity
* test(browser): bound fixture readiness acknowledgements
---------
Co-authored-by: 64579525 <17373302683@163.com>
Co-authored-by: 吴佳浩Alben <35291372+XiaoBinGan@users.noreply.github.com>
Co-authored-by: 吴佳浩 <wujiahao@supremind.com>
93 lines
2.1 KiB
TypeScript
93 lines
2.1 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import { parseInesLayout } from "./inesContainer.js";
|
|
|
|
const header = (): Buffer => {
|
|
const bytes = Buffer.alloc(16);
|
|
bytes.write("NES\x1a", "latin1");
|
|
bytes[4] = 1;
|
|
return bytes;
|
|
};
|
|
|
|
it("bounds the complete classic header count without inventing RAM regions", () => {
|
|
const bytes = header();
|
|
bytes[4] = 255;
|
|
bytes[5] = 255;
|
|
bytes[6] = 0xfe;
|
|
bytes[7] = 0xf3;
|
|
const parsed = parseInesLayout(bytes, 16 + 512 + 255 * (16_384 + 8_192));
|
|
if (!parsed.ok) throw new Error(parsed.error);
|
|
expect(parsed.value.header).toMatchObject({
|
|
mapper: 255,
|
|
trainer_present: true,
|
|
battery_flag: true,
|
|
mirroring: "four-screen",
|
|
});
|
|
expect(parsed.value.regions).toHaveLength(512);
|
|
expect(parsed.value.regions.at(-1)).toMatchObject({
|
|
path: "chr/254.bin",
|
|
length: 8_192,
|
|
});
|
|
});
|
|
|
|
it.each([
|
|
{
|
|
label: "short header",
|
|
modify: (bytes: Buffer) => bytes.subarray(0, 8),
|
|
size: 8,
|
|
reason: "truncated iNES header",
|
|
},
|
|
{
|
|
label: "short payload",
|
|
modify: (bytes: Buffer) => bytes,
|
|
size: 16,
|
|
reason: "truncated iNES payload",
|
|
},
|
|
{
|
|
label: "NES 2.0",
|
|
modify: (bytes: Buffer) => {
|
|
bytes[7] = 8;
|
|
return bytes;
|
|
},
|
|
size: 16_400,
|
|
reason: "nes-2.0",
|
|
},
|
|
{
|
|
label: "dirty legacy header",
|
|
modify: (bytes: Buffer) => {
|
|
bytes[12] = 1;
|
|
return bytes;
|
|
},
|
|
size: 16_400,
|
|
reason: "ambiguous iNES mapper",
|
|
},
|
|
{
|
|
label: "empty PRG",
|
|
modify: (bytes: Buffer) => {
|
|
bytes[4] = 0;
|
|
return bytes;
|
|
},
|
|
size: 16,
|
|
reason: "at least one PRG",
|
|
},
|
|
{
|
|
label: "unsupported variant",
|
|
modify: (bytes: Buffer) => {
|
|
bytes[7] = 4;
|
|
return bytes;
|
|
},
|
|
size: 16_400,
|
|
reason: "unsupported iNES header variant",
|
|
},
|
|
{
|
|
label: "unsafe extent",
|
|
modify: (bytes: Buffer) => bytes,
|
|
size: Number.MAX_SAFE_INTEGER + 1,
|
|
reason: "invalid iNES file extent",
|
|
},
|
|
])("refuses $label before producing regions", ({ modify, size, reason }) => {
|
|
expect(parseInesLayout(modify(header()), size)).toMatchObject({
|
|
ok: false,
|
|
error: expect.stringContaining(reason),
|
|
});
|
|
});
|