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:
@@ -42,7 +42,7 @@ describe("readReferenceSource entries", () => {
|
||||
expect(result.value.limitations).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("sanitizes internal, external, and missing symlink targets", async () => {
|
||||
it("reports physical external symlink targets without following them", async () => {
|
||||
const root = await createTestTempDirectory("rea-reference-");
|
||||
const outside = await createTestTempDirectory("rea-outside-");
|
||||
await writeFile(join(outside, "secret"), "secret");
|
||||
@@ -60,7 +60,7 @@ describe("readReferenceSource entries", () => {
|
||||
status: "read",
|
||||
kind: "symlink",
|
||||
path: "external",
|
||||
target: "<outside-root>",
|
||||
target: join(outside, "secret"),
|
||||
targetState: "external",
|
||||
},
|
||||
{
|
||||
@@ -86,7 +86,9 @@ describe("readReferenceSource entries", () => {
|
||||
},
|
||||
]);
|
||||
expect(result.value.bytesRead).toBe(5);
|
||||
expect(JSON.stringify(result.value.entries)).not.toContain(outside);
|
||||
expect(JSON.stringify(result.value.entries)).toContain(
|
||||
join(outside, "secret"),
|
||||
);
|
||||
});
|
||||
|
||||
it("reads a source file larger than the former 16 MiB ceiling", async () => {
|
||||
@@ -168,16 +170,13 @@ describe("readReferenceSource failures and exclusions", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("sanitizes filesystem errors", async () => {
|
||||
it("keeps selected-root paths in actionable filesystem errors", async () => {
|
||||
const missing = join(tmpdir(), "rea-secret-root-that-does-not-exist");
|
||||
const result = await readReferenceSource(missing);
|
||||
|
||||
expect(result.ok).toBe(false);
|
||||
if (result.ok) return;
|
||||
expect(result.error.message).toBe(
|
||||
"Reference source root could not be resolved",
|
||||
);
|
||||
expect(result.error.message).not.toContain(missing);
|
||||
expect(result.error.message).toContain(missing);
|
||||
});
|
||||
|
||||
it("returns typed failures for cancellation and invalid roots", async () => {
|
||||
|
||||
Reference in New Issue
Block a user