docs(contracts): align examples and guidance with produced evidence

This commit is contained in:
morluto
2026-10-24 02:36:22 +08:00
parent ad629b2e31
commit 2ebaadfa84
6 changed files with 21 additions and 8 deletions
File diff suppressed because one or more lines are too long
+11 -2
View File
@@ -143,8 +143,17 @@ const exampleScenarioCapture = () => ({
network_transaction_range: null,
},
},
completeness: scenarioCompleteness,
limitations: [],
completeness: {
status: "incomplete",
equality_eligible: false,
missing_sections: ["events"],
truncated_sections: [],
},
limitations: [
"CDP attachment cannot recover pre-attach events or guarantee launch-time context options.",
"Attached locale en-US applies to Intl formatting only; navigator.language(s) and Accept-Language remain caller-controlled. Use launch mode for matching page and request languages.",
"Detaching a CDP page session may clear caller-owned navigator.platform emulation. REA cannot snapshot the caller's complete user-agent/client-hint state before attachment; use launch mode to avoid mutating that external browser.",
],
});
/** Passive browser reverse-engineering contracts. */
+1 -1
View File
@@ -68,7 +68,7 @@ export const ENHANCED_TOOL_CONTRACTS = [
...FUNCTION_WORKFLOW_TOOL_CONTRACTS,
enhanced(
"trace_feature",
"Trace the complete literal query, preserving spaces, through every matching string and procedure, their xrefs, and truthful containing-procedure resolution. Returns observations, operation count, and residual unknowns without inferring reference kinds.",
"Trace the complete literal query, preserving spaces, through every matching string and procedure, their xrefs, and truthful containing-procedure resolution. Returns observations and residual unknowns without inferring reference kinds.",
enhancedInputSchemas.trace_feature,
),
enhanced(
@@ -167,8 +167,8 @@ export const JAVASCRIPT_APPLICATION_EVIDENCE_EXAMPLE = createEvidence(
invalid_utf8_files: 0,
parsed_javascript_files: 1,
skipped_javascript_files: 0,
visited_ast_nodes: 1,
findings: 0,
visited_ast_nodes: 7,
findings: 1,
modules: 0,
parse_failures: 0,
},
+1 -1
View File
@@ -1068,7 +1068,7 @@ const unsupportedParent = (
parentArtifactPath(parent),
parent.operation === "capture_browser_scenario"
? `Parent Evidence operation "capture_browser_scenario" supports only the environment-manifest and environment-state views.`
: `Parent Evidence operation ${JSON.stringify(parent.operation)} does not support analysis views. Use completed binary layout, JavaScript application, native function/inventory, artifact inventory/inspection, WASM, Mach-O, Interface Builder, EVM, managed artifact or member, Android package, Dart AOT, IL2CPP metadata, or web network capture Evidence.`,
: `Parent Evidence operation ${JSON.stringify(parent.operation)} does not support analysis views. Use completed Evidence from a supported parent operation with a compatible view. For a summary receipt, use its normalized_result.parent_evidence_id rather than the receipt's own evidence_id.`,
);
const parentArtifactPath = (parent: AnalysisViewParent): string => {
@@ -56,7 +56,7 @@ async function capturePassivePair(
}
describe("browser comparison input boundary", () => {
it("advertises complete producer captures and agrees with SDK validation on both comparison families", async () => {
it("advertises producer captures and agrees with SDK validation on both comparison families", async () => {
const browser = await startFakeCdpBrowser({ sensitiveShapes: true });
const server = new McpServer({ name: "capture-input", version: "0" });
const client = new Client({ name: "capture-input", version: "0" });
@@ -172,6 +172,10 @@ describe("browser comparison input boundary", () => {
});
expect(calls - beforeCalls).toBe(runtimeValid ? 1 : 0);
expect(result.isError === true).toBe(!runtimeValid);
if (input === scenario)
expect(result.structuredContent).toMatchObject({
normalized_result: { overall_status: "unknown" },
});
if (runtimeValid)
expect(result.structuredContent).toMatchObject({
operation: contract.name,