refactor!: enforce canonical evidence and provider boundaries

Deliver complete Evidence directly through MCP with required nullable analysis profiles and immutable per-server delivery settings. Bind selected environments at construction and require typed cleanup outcomes with retained retry ownership.

Remove test-only routing, duplicate session and snapshot metadata, producer-field repairs, and ambiguous provider arguments. Separate artifact byte identity from occurrence classification and retain typed source-map and partial native facts across CLI, MCP, and verifier consumers.

BREAKING CHANGE: obsolete Evidence envelopes, session aliases, incomplete snapshots, and missing normalized producer facts are no longer accepted.
This commit is contained in:
morluto
2026-10-09 20:18:52 +08:00
parent 2a7746998d
commit 63bf91405c
514 changed files with 9296 additions and 5825 deletions
+11 -8
View File
@@ -268,9 +268,11 @@ const collectFixupCommand = (
throw new RangeError("Fixup data exceeds the Mach-O slice");
return { offset, size: length };
};
if (kind === LC_DYLD_CHAINED_FIXUPS && size >= 16)
if (kind === LC_DYLD_CHAINED_FIXUPS) {
if (size < 16) throw new RangeError("Truncated chained-fixups command");
state.chained = range(cursor + 8);
else if ((kind === LC_DYLD_INFO || kind === LC_DYLD_INFO_ONLY) && size >= 48)
} else if (kind === LC_DYLD_INFO || kind === LC_DYLD_INFO_ONLY) {
if (size < 48) throw new RangeError("Truncated dyld-info command");
for (const [at, stream] of [
[cursor + 16, "bind"],
[cursor + 24, "weak"],
@@ -279,13 +281,14 @@ const collectFixupCommand = (
const bound = range(at);
if (bound.size > 0) state.binds.push({ ...bound, stream });
}
else if (DYLIB_COMMANDS.includes(kind) && size >= 24) {
} else if (DYLIB_COMMANDS.includes(kind)) {
if (size < 24) throw new RangeError("Truncated dylib command");
const nameOffset = bytes.readUInt32LE(cursor + 8);
if (nameOffset < 24 || nameOffset >= size)
throw new RangeError("Dylib install name is outside its load command");
const end = bytes.indexOf(0, cursor + nameOffset);
state.dylibs.push(
nameOffset >= size || end < 0 || end > cursor + size
? ""
: bytes.toString("utf8", cursor + nameOffset, end),
);
if (end < 0 || end >= cursor + size)
throw new RangeError("Unterminated dylib install name");
state.dylibs.push(bytes.toString("utf8", cursor + nameOffset, end));
}
};