Repository navigation
fix: align local file operands with built-in decoding - #2095
Conversation
Use typed operand decoding for contextual evidence and target selection. Cover actual built-in execution, complete transfer operands, and selected-target evidence and dependency revalidation. Relates to #2094 Co-authored-by: Mecatl <[email protected]>
jhrozek
left a comment
There was a problem hiding this comment.
LGTM. LocalFileOperands now decodes through the same session.ParseArgs struct path as the built-in tools, so review and execution select the same operand (case variants, duplicate keys, null, Unicode folding). Both callers (actionreview.go, contextual_evidence.go) follow the executed target, and custom/MCP non-inference is preserved. The tests check against real built-in execution on memfs, which is the right oracle.
Optional nit: the "wrong-typed unrelated field still yields the operand" case is pinned only for Read (offset). Rows for Shell timeout_ms:"x" and for null / [] / empty args would guard against a future change in failure policy.
The test:race qualification noted in the description is still outstanding before this leaves draft.
Summary
Relates to #2094.
session.ParseArgssemantics used by built-in tools, including case variants, duplicate keys, nulls, and operand type errors.This is a direct bug fix under the operator-approved scope, with no new acceptance plan, exported signatures, tool schemas, or global argument-validation policy. Operand extraction intentionally does not validate unrelated tool arguments.
Verification
Passed:
engine/adapter/fstools,engine/agent, andinternal/app.task lint(the first 600-second attempt timed out; a subsequent run with a larger budget passed).task docs.task api:update— no API snapshot changes.go run ./cmd/mecademo— tool call, permission ask/approval, and result demonstrated.git diff --check.Local full
task testandtask test:racedid not pass: existingcmd/mecatuiembedded-socket fixtures reject this checkout's path length.compositionScratchRootrequires a generated socket path shorter than 100 bytes; neither the worktree nor its main-checkout ancestor satisfies that bound.CI completed successfully for
568216f254e5c472926b67a190660cf20b63a3a1: all executed checks passed, including the non-race draft test suite, analysis, build, docs, API compatibility, standalone modules, MicroVM checks, and the PR performance gate. Draft CI does not run the full race suite; that qualification remains outstanding. This PR remains draft.Review and remaining scope
Four-axis review found no blocking in-scope code defects. The outstanding important finding is the dependency/invariant amendment in the separate hierarchy plan PR #2092: applicability targets must match effective executed operands. This PR does not copy or modify that separate plan.
The previously identified discrepancies in
authorityPathNamed,nonShellPattern, andShellCommandFromArgsare separate security companion work. This patch does not claim to resolve those enforcement paths or qualify a production permission bypass.Documentation
The owning artifact for library consumers is
engine/CHANGELOG.md, updated under Fixed. No public configuration or workflow changes; generated references and API snapshots are unchanged.