fix: address review nits from batch integration follow-ups (#818)
- browser: reject empty Referrer-Policy tokens structurally while still skipping them per W3 fallback semantics. - browser: document that WebMCP keys cannot collapse since unknown frames are excluded before keying. - ghidra: split NativeAOT non-recovery diagnostics into reason-missing vs payload-present variants with exact assertions. - reference: lock secret-patterned exclusion before failure projection so failure messages cannot carry secret paths. - doctor: lock direct-launcher Codex timeout ordering both ways. - native: note plutil -n macOS 12+ requirement; add fat-output control guarding the thin pre-scan. - reconstruction: multi-unknown limitation coverage via shared helper. Tracks #817 for the remaining smol-toml advisory.
This commit is contained in:
@@ -275,6 +275,7 @@ const parseXmlPlistExecutable = (plist: string): string => {
|
||||
};
|
||||
|
||||
const readBinaryPlistExecutable = async (plistPath: string): Promise<string> =>
|
||||
// `-n` strips only the newline plutil appends; it requires macOS 12+.
|
||||
(
|
||||
await execFileAsync("/usr/bin/plutil", [
|
||||
"-extract",
|
||||
|
||||
@@ -16,28 +16,28 @@ import { jsonValueSchema } from "../domain/jsonValue.js";
|
||||
import { MANAGED_WORKFLOW_PROVIDER } from "./InvestigationProviders.js";
|
||||
import { deriveReconstructionObligationCandidates } from "./ReconstructionObligationCandidates.js";
|
||||
|
||||
describe("reconstruction obligation candidates", () => {
|
||||
it("preserves admitted unknown application nodes as limitations", () => {
|
||||
const source = createEvidence(
|
||||
undefined,
|
||||
{ id: "fixture-source", name: "Fixture source", version: "1" },
|
||||
{
|
||||
operation: "inspect_fixture_source",
|
||||
parameters: {},
|
||||
result: {},
|
||||
confidence: "observed",
|
||||
authority: "shipped-artifact",
|
||||
},
|
||||
);
|
||||
const base = buildSyntheticJavaScriptApplicationGraph();
|
||||
const unknownNode = createJavaScriptApplicationNode({
|
||||
const applicationWithUnknowns = (keys: readonly string[]) => {
|
||||
const source = createEvidence(
|
||||
undefined,
|
||||
{ id: "fixture-source", name: "Fixture source", version: "1" },
|
||||
{
|
||||
operation: "inspect_fixture_source",
|
||||
parameters: {},
|
||||
result: {},
|
||||
confidence: "observed",
|
||||
authority: "shipped-artifact",
|
||||
},
|
||||
);
|
||||
const base = buildSyntheticJavaScriptApplicationGraph();
|
||||
const unknownNodes = keys.map((key) =>
|
||||
createJavaScriptApplicationNode({
|
||||
kind: "unknown",
|
||||
identity: {
|
||||
strategy: "artifact-local-key",
|
||||
stability: "artifact-version",
|
||||
artifact_sha256: APPLICATION_GRAPH_DIGESTS.asar,
|
||||
namespace: "fixture",
|
||||
key: "unclassified-boundary",
|
||||
key,
|
||||
},
|
||||
observations: [
|
||||
{
|
||||
@@ -49,52 +49,68 @@ describe("reconstruction obligation candidates", () => {
|
||||
),
|
||||
},
|
||||
],
|
||||
});
|
||||
const graph = createJavaScriptApplicationGraph({
|
||||
schema: "JavaScriptApplicationGraph",
|
||||
root_node_ids: base.root_node_ids,
|
||||
nodes: [...base.nodes, unknownNode],
|
||||
edges: base.edges,
|
||||
coverage: completeCoverage,
|
||||
limitations: base.limitations,
|
||||
});
|
||||
const application = createEvidence(undefined, MANAGED_WORKFLOW_PROVIDER, {
|
||||
predicateType: "rea.managed-application-graph",
|
||||
operation: "project_managed_application_graph",
|
||||
parameters: {},
|
||||
result: jsonValueSchema.parse({
|
||||
projection_id: `magp_${"a".repeat(64)}`,
|
||||
root_artifact_sha256: APPLICATION_GRAPH_DIGESTS.asar,
|
||||
source_evidence: {
|
||||
managed_artifact_evidence_id: source.evidence_id,
|
||||
managed_members_evidence_id: null,
|
||||
managed_native_boundaries_evidence_id: null,
|
||||
},
|
||||
summary: {
|
||||
graph_nodes: graph.nodes.length,
|
||||
graph_edges: graph.edges.length,
|
||||
assemblies: 0,
|
||||
modules: 0,
|
||||
types: 0,
|
||||
methods: 0,
|
||||
fields: 0,
|
||||
pinvoke_imports: 0,
|
||||
native_implementations: 0,
|
||||
},
|
||||
graph,
|
||||
coverage: { status: "complete-within-inputs" },
|
||||
evidence_links: [source.evidence_id],
|
||||
limitations: [],
|
||||
}),
|
||||
confidence: "inferred",
|
||||
authority: "analyst-inference",
|
||||
evidenceLinks: [source.evidence_id],
|
||||
});
|
||||
|
||||
const generated = deriveReconstructionObligationCandidates(
|
||||
}),
|
||||
);
|
||||
const graph = createJavaScriptApplicationGraph({
|
||||
schema: "JavaScriptApplicationGraph",
|
||||
root_node_ids: base.root_node_ids,
|
||||
nodes: [...base.nodes, ...unknownNodes],
|
||||
edges: base.edges,
|
||||
coverage: completeCoverage,
|
||||
limitations: base.limitations,
|
||||
});
|
||||
const application = createEvidence(undefined, MANAGED_WORKFLOW_PROVIDER, {
|
||||
predicateType: "rea.managed-application-graph",
|
||||
operation: "project_managed_application_graph",
|
||||
parameters: {},
|
||||
result: jsonValueSchema.parse({
|
||||
projection_id: `magp_${"a".repeat(64)}`,
|
||||
root_artifact_sha256: APPLICATION_GRAPH_DIGESTS.asar,
|
||||
source_evidence: {
|
||||
managed_artifact_evidence_id: source.evidence_id,
|
||||
managed_members_evidence_id: null,
|
||||
managed_native_boundaries_evidence_id: null,
|
||||
},
|
||||
summary: {
|
||||
graph_nodes: graph.nodes.length,
|
||||
graph_edges: graph.edges.length,
|
||||
assemblies: 0,
|
||||
modules: 0,
|
||||
types: 0,
|
||||
methods: 0,
|
||||
fields: 0,
|
||||
pinvoke_imports: 0,
|
||||
native_implementations: 0,
|
||||
},
|
||||
graph,
|
||||
coverage: { status: "complete-within-inputs" },
|
||||
evidence_links: [source.evidence_id],
|
||||
limitations: [],
|
||||
}),
|
||||
confidence: "inferred",
|
||||
authority: "analyst-inference",
|
||||
evidenceLinks: [source.evidence_id],
|
||||
});
|
||||
return {
|
||||
graph,
|
||||
unknownNodes,
|
||||
generated: deriveReconstructionObligationCandidates(
|
||||
createEvidenceBundle([source, application]),
|
||||
[],
|
||||
);
|
||||
),
|
||||
};
|
||||
};
|
||||
|
||||
const unknownLimitation = (graphId: string, nodeId: string): string =>
|
||||
`Application graph ${graphId} contains unresolved node ${nodeId}; reconstruction obligations remain unknown.`;
|
||||
|
||||
describe("reconstruction obligation candidates", () => {
|
||||
it("preserves admitted unknown application nodes as limitations", () => {
|
||||
const { graph, unknownNodes, generated } = applicationWithUnknowns([
|
||||
"unclassified-boundary",
|
||||
]);
|
||||
const unknownNode = unknownNodes[0];
|
||||
if (unknownNode === undefined) throw new Error("Expected one unknown node");
|
||||
|
||||
expect(generated.candidates.length).toBeGreaterThan(0);
|
||||
expect(
|
||||
@@ -103,7 +119,26 @@ describe("reconstruction obligation candidates", () => {
|
||||
),
|
||||
).toBe(false);
|
||||
expect(generated.limitations).toEqual([
|
||||
`Application graph ${graph.graph_id} contains unresolved node ${unknownNode.node_id}; reconstruction obligations remain unknown.`,
|
||||
unknownLimitation(graph.graph_id, unknownNode.node_id),
|
||||
]);
|
||||
});
|
||||
|
||||
it("emits one deterministic limitation per unknown node", () => {
|
||||
const { graph, unknownNodes, generated } = applicationWithUnknowns([
|
||||
"unclassified-first",
|
||||
"unclassified-second",
|
||||
]);
|
||||
|
||||
expect([...generated.limitations].sort()).toEqual(
|
||||
unknownNodes
|
||||
.map((node) => unknownLimitation(graph.graph_id, node.node_id))
|
||||
.sort(),
|
||||
);
|
||||
for (const node of unknownNodes)
|
||||
expect(
|
||||
generated.candidates.some(
|
||||
({ target }) => target.application_node_id === node.node_id,
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user