Skip to content

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

Merged
morluto merged 1 commit into
mainfrom
fix/tool-boundary-contracts
Oct 5, 2026
Merged

morluto merged 1 commit into
mainfrom
fix/tool-boundary-contracts

Conversation

@morluto

@morluto morluto commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Agents can invoke REA's local tools directly, with caller-selected commands, paths, actions, and capture facets. Remove grant/ceiling configuration, permission elicitation, repeated approval fields, inert settings, and heuristic rewriting of local evidence. Harden the contracts exercised during the audit of all 122 tools.

Related: #545, #548. Existing fixes for #528 and #530 remain intact.

Problem and expected behavior

A process scenario using node or a Windows path was rejected by POSIX-only validation. Browser capture could deny a request whose scope already fit its ceiling. Fixed literals and approval booleans forced callers to restate implementation behavior. Providers could also return results inconsistent with advertised schemas or replay cached values without matching Evidence.

Tool selection expresses intent. Validate actual inputs and protocol requirements, preserve selected local diagnostics, and report real host/provider failures with their coverage limits.

Change and scope

  • Delete permission authorities, project grant storage, policy commands, capability enable gates, and filesystem/env allowlists; keep shared CLI/MCP application workflows.
  • Process capture resolves command names through PATH, defaults cwd to ., inherits the host environment with explicit overrides, and takes optional filesystem_observation_paths.
  • Remove approval booleans, fixed containment/lifecycle declarations, and unused capture/redaction settings. Keep meaningful capture facets and runtime budgets.
  • Preserve ordinary URLs, selected output, paths, and environment values. Redact transport credentials and explicitly declared sensitive values; avoid persisting the whole ambient environment.
  • Fix snapshot-to-Evidence binding, archive path collisions, Mach-O bounds, source-map contents, managed EH parsing, provider cancellation cleanup, native PNG validation, Hopper result shape/unknown coverage, and optional replay readiness in doctor.
  • Add prose boundary guidance and regenerate canonical tool metadata and docs.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain input schemas and config parsing; provider adapters validate actual producer representations.
  • CLI and MCP/tool-catalog contract: equivalent direct invocation, refreshed schemas and examples; 122 tools retained.
  • Provider, bridge, target-format, or platform compatibility: Hopper now emits required reference fields with unknown coverage explicit. Portable scenario parsing does not establish Windows execution support.
  • Evidence, artifact, provenance, or reconstruction contract: cached results require matching target/profile/Evidence; malformed or incomplete inputs remain visible.
  • Process execution, authorization, cleanup, or containment impact: local execution uses the current user's OS permissions. Owned-process cleanup, target identity checks, replay digest checks, and actual Linux replay confinement remain.
  • Generated metadata, package, or installation impact: catalogs/error schema regenerated; optional Linux replay does not block macOS setup health. Setup still discloses changes and requires approval.

Evidence and regression coverage

  • Tests cover minimal and portable inputs, actual cancellation/cleanup, schema dialect validity, evidence tampering, malformed binary/source-map data, explicit-secret handling, and CLI/MCP parity.
  • The real Hopper lane exposed a missing unresolved_calls field; the bridge now returns it and records its unknown coverage. Packaged setup exposed the optional replay readiness defect. Real browser capture verifies query preservation and explicit-secret handling.
  • Representative MCP input for capture_process_scenario (cwd and observation defaults apply):
{"executable":"node","arguments":["--version"]}

The same input can be saved as scenario.json and run with rea capture-process scenario.json. Results include inline Evidence, lifecycle/cleanup facts, and residual unknowns; no REA grant round-trip is required.

  • Remaining proof gaps: Windows execution, Linux replay, real Ghidra/Electron, and external managed-runtime/ILSpy lanes were unavailable on this macOS host. Windows process capture still reports its missing process-tree ownership support.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check:pr — passed on the final rebased commit: 364 test files, 1,948 tests passed, three skipped; typecheck, lint, format, knip, build, metadata, and generated-doc checks passed.
  • npm run docs:generate — regenerated metadata; no documentation errors.
  • node scripts/verify-package.mjs — passed installed CLI/MCP, setup/idempotence, catalog, and lifecycle checks.
  • npm run verify:hopper — passed real Hopper, two documents, function/reference analysis, and clean shutdown.
  • node scripts/verify-real-browser.mjs — passed real Chrome, CLI/MCP, declared-secret handling, attach/launch cleanup, and large screenshots.
  • node scripts/verify-real-javascript-runtime-observation.mjs — passed real Node Inspector fixtures through CLI/MCP.
  • node scripts/verify-native-ui.mjs --allow-permission-denial — actual positive native UI capture/action and CLI parity passed; no permission-denial fallback used.
  • npm run verify:managed — passed conformance fixtures; optional external runtime/decompiler coverage remains unsupported.

Real-provider and packaged-artifact checks ran during the audit. The final rebase preserved the verified provider implementations and passed the full PR gate.

Compatibility, safety, and release

  • Breaking changes or migration steps: refresh tool schemas; remove grant/ceiling environment configuration and deleted approval/fixed-confirmation fields. Replace filesystem_roots with optional observation paths, approved_plan_sha256 with plan_sha256, and replay passthrough-approved-origins with passthrough-declared-origins.
  • Real Hopper/Ghidra, browser, or OS coverage: real Hopper, Chrome, Node Inspector, and macOS native UI performed; real Ghidra and other unavailable lanes are explicitly unverified.
  • Package or release metadata impact: breaking Conventional Commit title/footer; generated catalog updated, no manually edited release version or committed packaged binaries.
  • Security, privacy, process, or containment review: REA grant restrictions are removed for local tools. Actual OS permissions, target binding, protocol constraints, lifecycle cleanup, and replay confinement remain. Sensitive transport credentials and caller-marked secrets remain redacted.

Review checklist

  • The PR has one focused outcome and a Conventional Commit title.
  • Related issues are linked.
  • Tests cover observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated.
  • CLI/MCP changes include representative input and result behavior.
  • Final diff checked for secrets, unrelated changes, and unsupported claims.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@morluto
morluto force-pushed the fix/tool-boundary-contracts branch from 0b357de to e7b3afb Compare October 5, 2026 12:09
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.
@morluto
morluto force-pushed the fix/tool-boundary-contracts branch from e7b3afb to 00424ed Compare October 5, 2026 12:14
@morluto
morluto merged commit b5e9891 into main Oct 5, 2026
20 checks passed
@morluto
morluto deleted the fix/tool-boundary-contracts branch October 5, 2026 12:16
N0zoM1z0 added a commit that referenced this pull request Oct 5, 2026
## 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.
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…morluto#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.
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
## Changes

Related to morluto#545 and the permission-system removal in morluto#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.
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto morluto added the area: domain Domain logic, errors, and pure functions label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant