Skip to content

exec tool: witnessed shell execution#2

Merged
systemic-engineer merged 2 commits intomainfrom
reed/gall-exec
Mar 2, 2026
Merged

exec tool: witnessed shell execution#2
systemic-engineer merged 2 commits intomainfrom
reed/gall-exec

Conversation

@systemic-engineer
Copy link
Copy Markdown
Contributor

Summary

  • exec MCP tool — agents execute shell commands through gall instead of raw bash. Every execution is witnessed as an @exec fragment in the session trace.
  • gall_ffi.erl:exec/2 — runs command in work_dir via os:cmd, captures stdout+stderr.
  • record_exec — follows the record_read pattern. Fragment data carries command: <cmd>\noutput_sha: <hash> (not full output — could be huge).
  • Works without active session (returns output, no fragment). With active session, witnesses automatically.

4 new tests (44 total). TDD arc: red then green.

Test plan

  • 44 tests passing locally
  • CI passes

Tests reference tools.exec_schema() which doesn't exist yet.
Compilation fails as expected. RED phase complete.

Co-Authored-By: Reed <reed@systemic.engineer>
- gall_ffi.erl: exec/2 runs shell command in work_dir, captures stdout+stderr
- tools.gleam: exec_schema/0, exec_tool_names/0, added to daemon_tools_json
- daemon.gleam: exec handler with record_exec (@exec fragment in session trace)
- Fragment data: command + output_sha (not full output — could be huge)
- Works without active session (returns output, no fragment)
- 44 tests green (4 new exec tests + 40 existing)

Co-Authored-By: Reed <reed@systemic.engineer>
@systemic-engineer systemic-engineer merged commit 97c0701 into main Mar 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant