docs(mcp): list every tool that omits the untrusted-content marker (#8837)

This commit is contained in:
RRFZ authored and GitHub committed 2026-11-04 19:04:57 +08:00
1 parent 67552d56cc
commit 52ff3123cb
2 files changed
+20 -4

No files matched your search

+6 -4
View File
@@ -500,10 +500,12 @@ result's `_meta`, whether the call succeeded or failed:
```
The marker is declared once per tool contract (`returnsTargetContent`) and is
on by default: `export_evidence_bundle`, `record_unknown`, `search_guidance`,
and `read_guidance_section` omit it. The first two contain only REA session
state or caller-supplied values; the guidance tools return REA's own installed
documentation, not text from an analysis target. Tools whose results or errors
on by default: `inspect_analysis_settings`, `update_analysis_settings`,
`export_evidence_bundle`, `record_unknown`, `guided_workflows`,
`search_guidance`, and `read_guidance_section` omit it. The first four contain
only REA session state or caller-supplied values; the workflow and guidance
tools return REA's own installed workflows and documentation, not text from an
analysis target. Tools whose results or errors
can include provider, launcher, or device output stay marked, including
`binary_session` (provider failure
reasons and availability diagnostics), `close_binary` (provider cleanup
@@ -1,3 +1,6 @@
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
import { TOOL_CONTRACTS } from "../../../src/contracts/toolContracts.js";
@@ -28,6 +31,17 @@ describe("target-content provenance audit", () => {
]);
});
it("documents exactly the audited content-free exceptions", async () => {
const guide = await readFile(resolve("docs/mcp-contracts.md"), "utf8");
const exceptions = /on by default: ([^.]*?) omit it\./su.exec(guide)?.[1];
expect(exceptions).toBeDefined();
expect(
[...(exceptions ?? "").matchAll(/`([a-z_]+)`/gu)]
.map(([, name]) => name)
.sort(),
).toEqual([...TARGET_CONTENT_FREE_TOOLS].sort());
});
it.each([
"procedure_pseudo_code",
"list_strings",