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:
@@ -17,9 +17,15 @@ describe("canonical skill transaction", () => {
|
||||
".agents/skills/reverse-engineer-anything/SKILL.md",
|
||||
);
|
||||
const sibling = join(home, ".agents/skills/unrelated/SKILL.md");
|
||||
const nativeGuide = join(
|
||||
dirname(destination),
|
||||
"references/native-and-artifacts.md",
|
||||
);
|
||||
await mkdir(dirname(destination), { recursive: true });
|
||||
await mkdir(dirname(nativeGuide), { recursive: true });
|
||||
await mkdir(dirname(sibling), { recursive: true });
|
||||
await writeFile(destination, "stale managed skill\n");
|
||||
await writeFile(nativeGuide, "stale filesystem-write permission grant\n");
|
||||
await writeFile(sibling, "unrelated skill\n");
|
||||
|
||||
expect(await canonicalSkillNeedsInstall(home)).toBe(true);
|
||||
@@ -28,7 +34,34 @@ describe("canonical skill transaction", () => {
|
||||
"stale managed skill\n",
|
||||
);
|
||||
const installedSkill = await readFile(destination, "utf8");
|
||||
expect(installedSkill).toContain('version: "23"');
|
||||
expect(installedSkill).toContain('version: "24"');
|
||||
expect(installedSkill).toContain("call available analysis tools");
|
||||
expect(installedSkill).toContain("obtain approval before setup writes");
|
||||
expect(await readFile(`${nativeGuide}.rea.backup`, "utf8")).toBe(
|
||||
"stale filesystem-write permission grant\n",
|
||||
);
|
||||
for (const reference of [
|
||||
"native-and-artifacts.md",
|
||||
"runtime-observation.md",
|
||||
"evidence-workflows.md",
|
||||
]) {
|
||||
const installed = await readFile(
|
||||
join(dirname(destination), "references", reference),
|
||||
"utf8",
|
||||
);
|
||||
expect(installed).toBe(
|
||||
await readFile(
|
||||
new URL(
|
||||
`../../../skills/reverse-engineer-anything/references/${reference}`,
|
||||
import.meta.url,
|
||||
),
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
expect(installed).not.toMatch(
|
||||
/filesystem-write permission grant|native_mount_approved|only with explicit approval|Obtain the per-call/u,
|
||||
);
|
||||
}
|
||||
expect(installedSkill).toContain(
|
||||
"use normal repository tools and do not run REA",
|
||||
);
|
||||
|
||||
@@ -75,6 +75,28 @@ describe("tool registration options", () => {
|
||||
annotations: tool.annotations,
|
||||
})),
|
||||
);
|
||||
for (const [name, expected] of [
|
||||
["binary_session", { readOnlyHint: true, openWorldHint: false }],
|
||||
["read_bytes", { readOnlyHint: false, destructiveHint: false }],
|
||||
["set_comment", { readOnlyHint: false }],
|
||||
["unset_bookmark", { destructiveHint: true }],
|
||||
[
|
||||
"capture_process_scenario",
|
||||
{ readOnlyHint: false, openWorldHint: true },
|
||||
],
|
||||
["inspect_artifact", { readOnlyHint: false, openWorldHint: true }],
|
||||
["extract_artifact", { readOnlyHint: false, idempotentHint: false }],
|
||||
["compare_web_captures", { readOnlyHint: false, openWorldHint: false }],
|
||||
[
|
||||
"compare_web_screenshots",
|
||||
{ readOnlyHint: false, openWorldHint: false },
|
||||
],
|
||||
] as const) {
|
||||
expect(
|
||||
advertised.find((tool) => tool.name === name)?.annotations,
|
||||
name,
|
||||
).toMatchObject(expected);
|
||||
}
|
||||
} finally {
|
||||
await Promise.allSettled([client.close(), server.close()]);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { createTestTempDirectory } from "../../../fixtures/temporaryDirectory.js
|
||||
|
||||
import { ArtifactProvider } from "../../../../src/artifacts/ArtifactProvider.js";
|
||||
import { artifactExtractionExecutionSchema } from "../../../../src/contracts/artifactToolContracts.js";
|
||||
import { TOOL_EFFECTS } from "../../../../src/contracts/toolEffects.js";
|
||||
import {
|
||||
artifactExtractionResultSchema,
|
||||
artifactInventoryResultSchema,
|
||||
@@ -14,6 +15,33 @@ import {
|
||||
import type { BinaryTarget } from "../../../../src/domain/binaryTarget.js";
|
||||
|
||||
describe("artifact extraction", () => {
|
||||
it("declares possible native mounts and fresh extraction directories", () => {
|
||||
for (const platform of ["linux", "darwin"] as const) {
|
||||
const provider = new ArtifactProvider(platform);
|
||||
for (const operation of [
|
||||
"inventory_artifact",
|
||||
"inspect_artifact",
|
||||
"extract_artifact",
|
||||
] as const) {
|
||||
expect(
|
||||
provider
|
||||
.capabilities()
|
||||
.find((capability) => capability.operation === operation)?.effects,
|
||||
).toMatchObject({ launchesProcess: true, mayWriteFilesystem: true });
|
||||
}
|
||||
}
|
||||
expect(TOOL_EFFECTS.inspect_artifact).toMatchObject({
|
||||
launchesProcess: true,
|
||||
writesFilesystem: true,
|
||||
mutatesTarget: false,
|
||||
});
|
||||
expect(TOOL_EFFECTS.extract_artifact).toMatchObject({
|
||||
launchesProcess: true,
|
||||
writesFilesystem: true,
|
||||
idempotent: false,
|
||||
mutatesTarget: false,
|
||||
});
|
||||
});
|
||||
it("extracts all regular occurrences through an exclusively owned output tree", async () => {
|
||||
const root = await createTestTempDirectory("rea-extract-");
|
||||
const source = join(root, "source");
|
||||
|
||||
Reference in New Issue
Block a user