fix(tools)!: simplify direct invocation and harden boundary contracts (#555)

Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures.

Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation.

BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
This commit is contained in:
morluto
2026-10-05 20:16:44 +08:00
committed by GitHub
parent 4f099a10f8
commit b5e98915c6
350 changed files with 5347 additions and 10599 deletions
@@ -9,7 +9,6 @@ import {
HopperRemoteError,
HopperStartError,
HopperTimeoutError,
PermissionRequiredError,
ProviderAdapterError,
ReplayPlanStaleError,
UnknownRegistryError,
@@ -184,53 +183,6 @@ describe("analysis error projection: caller contract", () => {
});
});
it.each([
[
"configure",
false,
false,
"Add the exact missing scope beneath the administrator ceiling, then retry.",
],
[
"elicit",
false,
true,
"Approve the exact missing scope, then retry the operation.",
],
[
"restart",
true,
false,
"Add the exact missing scope to the administrator configuration, then restart the registered MCP server or client.",
],
] as const)(
"projects %s permission remediation into stable protocol fields",
(remediation, restartRequired, elicitationSupported, action) => {
const projected = projectAnalysisError(
new PermissionRequiredError({
requested: {
capability: "process_capture",
roots: ["/workspace/evidence.json"],
executables: [],
environment_names: [],
network: "none",
mount: false,
operation_identity: "read:evidence",
},
missing: { roots: ["/workspace/evidence.json"] },
ceiling: null,
remediation,
}),
);
expect(projected.remediation).toEqual({
action,
restart_required: restartRequired,
elicitation_supported: elicitationSupported,
});
},
);
it("gives missing residual unknowns lookup-specific remediation", () => {
expect(
projectAnalysisError(new UnknownRegistryError("not-found")),
@@ -245,18 +197,4 @@ describe("analysis error projection: caller contract", () => {
details: { reason: "not-found" },
});
});
it("distinguishes disabled integrity continuation from format support", () => {
expect(
projectAnalysisError(
new ArtifactOperationError("inventory_artifact", "policy"),
),
).toMatchObject({
code: "artifact_operation_failed",
category: "unavailable",
message: expect.stringContaining(
"REA_ARTIFACT_INTEGRITY_CONTINUE_ENABLED=true",
),
});
});
});