fix(skill): remove obsolete grants and audit tool effects

## Changes

Related to #545 and the permission-system removal in #555.

- Upgrade the shipped skill to v24 and remove obsolete filesystem grants, per-call approval flags, Electron file-root configuration, and DMG approval flags. Calls follow the user-requested investigation directly. Keep setup plan confirmation, actual OS requirements, and process/archive lifecycle boundaries.
- Correct the passive browser guide: endpoint/scope come from requests; ordinary local URL queries are retained, while credentials remain redacted.
- Audit canonical tool effects: declare possible DMG process/temp-directory effects, mark fresh extraction non-idempotent, and mark comparisons of supplied captures/PNGs as closed-world. Align artifact-provider capability effects with temporary mount-directory writes.
- Retain non-read-only hints for calls that add Evidence to the session; document that annotations are hints and that clients control their confirmation UI. Do not mislabel session mutations as read-only to suppress prompts.
- Regenerate package, skill, MCP, and product metadata from source.

## Verification

- `npm run test:focused -- <11 affected test files>`: **40 tests passed**, including skill transaction/backup/idempotence, SDK tools/list annotations, actual local capture/PNG comparisons, artifact extraction/containment/cancellation, DMG launcher/cleanup seam, setup confirmation, browser MCP and scenario MCP, CLI catalog parity.
- `npm run check`: typecheck, lint, format, knip, package metadata.
- `npm run docs:check`: generated catalogs, skill metadata, documentation facts, completion ledger, error schema.

No local real Hopper/Ghidra run: their adapters and analysis operations are unchanged. Native macOS DMG behavior is covered locally through the launcher seam; no local macOS/hdiutil claim is made.

Real browser verification passed using existing Headless Chrome143.0.7499.4: actual CLI/stdio MCP,9,331,407-byte PNG, passive capture/source maps, and owned/external scenario cleanup. An initial full Chrome143 run failed the existing screenshot-height assertion (1397 versus1536); the dedicated headless-shell run passed the complete verifier without code changes. The verifier run-lineage field remained unavailable; no lineage-coverage claim is made. Browser download into `.codex` was blocked by CDN403, so the successful run used an existing browser without changing host configuration.
This commit is contained in:
N0zoM1z0
2026-10-06 01:40:58 +08:00
committed by GitHub
parent d19686a2a5
commit 2919def828
18 changed files with 194 additions and 38 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ import type { BinaryTarget } from "../domain/binaryTarget.js";
import { scanArtifactInventory } from "./ArtifactInventory.js";
import { digestCanonical } from "./ArtifactGraphConstruction.js";
/** Already-approved extraction request from a caller-owned policy boundary. */
/** Local extraction input with the output root chosen by the adapter. */
export interface ArtifactExtractionInput {
readonly inputPath: string;
readonly inputFormat: BinaryTarget["format"];
@@ -1,7 +1,15 @@
import { describe, expect, it } from "vitest";
import { listBrowserTargetsInputSchema } from "../domain/browserObservation.js";
import { listBrowserTargets } from "./BrowserObservationService.js";
import { browserCaptureComparisonInputSchema } from "../domain/browserCaptureComparison.js";
import { compareWebScreenshotsInputSchema } from "../domain/webScreenshot.js";
import { BROWSER_TOOL_CONTRACTS } from "../contracts/browserToolContracts.js";
import { CdpBrowserProvider } from "../browser/CdpBrowserProvider.js";
import {
compareWebCaptureEvidence,
compareWebScreenshotEvidence,
listBrowserTargets,
} from "./BrowserObservationService.js";
describe("browser observation service prerequisites", () => {
it("reports a missing provider without requiring a permission grant", async () => {
@@ -21,4 +29,31 @@ describe("browser observation service prerequisites", () => {
},
});
});
it("compares supplied scenarios and PNG artifacts without a CDP endpoint", async () => {
const browser = new CdpBrowserProvider();
const captures = await compareWebCaptureEvidence(
browser,
browserCaptureComparisonInputSchema.parse(
example("compare_web_captures"),
),
);
const screenshots = await compareWebScreenshotEvidence(
browser,
compareWebScreenshotsInputSchema.parse(
example("compare_web_screenshots"),
),
);
for (const result of [captures, screenshots]) {
expect(result.ok).toBe(true);
if (!result.ok) throw result.error;
expect(result.value.parameters).not.toHaveProperty("cdp_endpoint");
}
});
});
const example = (name: string) => {
const input = BROWSER_TOOL_CONTRACTS.find((tool) => tool.name === name)
?.examples[0]?.input;
if (input === undefined) throw new Error(`Missing example for ${name}`);
return input;
};
+4 -1
View File
@@ -53,7 +53,10 @@ export class ArtifactProvider implements AnalysisProvider {
operation !== "inspect_keyed_archive",
mayShowUi: false,
mayAccessNetwork: false,
mayWriteFilesystem: operation === "extract_artifact",
mayWriteFilesystem:
operation === "extract_artifact" ||
operation === "inspect_artifact" ||
operation === "inventory_artifact",
changesPermissions: false,
requiresRoot: false,
}),
+15 -5
View File
@@ -1,6 +1,7 @@
/** Canonical side effects for one caller-visible tool. */
/** Possible effects across a tool's supported inputs, including temporary work. */
export interface ToolEffects {
readonly mutatesTarget: boolean;
/** Includes additive Evidence recording, navigation state, and unknown updates. */
readonly mutatesSession: boolean;
readonly writesFilesystem: boolean;
readonly launchesProcess: boolean;
@@ -117,8 +118,17 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
inspect_plist: nativeEvidence,
list_architectures: nativeEvidence,
demangle_swift: nativeEvidence,
inspect_artifact: evidence,
extract_artifact: effects({ mutatesSession: true, writesFilesystem: true }),
inspect_artifact: effects({
mutatesSession: true,
launchesProcess: true,
writesFilesystem: true,
}),
extract_artifact: effects({
mutatesSession: true,
writesFilesystem: true,
launchesProcess: true,
idempotent: false,
}),
decode_interface_builder: evidence,
inspect_asset_catalog: nativeEvidence,
inspect_keyed_archive: evidence,
@@ -134,9 +144,9 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
analyze_web_bundle: browserEvidence,
observe_web_session: browserEvidence,
discover_webmcp_tools: browserEvidence,
compare_web_captures: browserEvidence,
compare_web_captures: sessionEvidence,
capture_web_screenshot: browserEvidence,
compare_web_screenshots: browserEvidence,
compare_web_screenshots: sessionEvidence,
capture_browser_scenario: effects({
mutatesTarget: true,
mutatesSession: true,
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -5,5 +5,5 @@ export const PACKAGE_METADATA = {
serverSdkVersion: "2.0.0",
clientSdkVersion: "2.0.0",
coreSdkVersion: "2.0.0",
skillVersion: "23",
skillVersion: "24",
} as const;
+1 -1
View File
@@ -16,7 +16,7 @@ interface BrowserScenarioToolRegistration {
readonly recordEvidence: BinarySessionPort["recordEvidence"] | undefined;
}
/** Register the controlled browser scenario tool even when policy disables it. */
/** Register the browser scenario tool with execution-time provider diagnostics. */
export const registerBrowserScenarioTool = (
server: McpServer,
options: BrowserScenarioToolRegistration,
+1 -1
View File
@@ -37,7 +37,7 @@ interface BrowserToolContext {
readonly progress: ProgressReporter;
}
/** Register browser tools even when policy/provider availability denies execution. */
/** Register browser tools with execution-time provider diagnostics. */
// oxlint-disable-next-line max-lines-per-function -- direct SDK calls retain each schema-handler type correlation.
export const registerBrowserTools = (
server: McpServer,