Skip to content

tractor exec --json-file records unrelated processes outside traced command subtree #6

Description

@groundwater

Summary

tractor exec --json-file <path> -- <cmd> appears to record events from unrelated concurrent processes, not just the command PID and its descendants.

This caused a false attribution in the agent trace UI: a clean agent run against Projects/GhostUI/console-next looked like it had touched and committed unrelated Projects/GhostUI/test-organization-witness work. After checking the agent stream events, the Claude run itself was clean; the contamination was already present in Tractor's JSONL trace file.

Expected behavior

tractor exec --json-file ... -- <cmd> should emit events only for <cmd> and descendant processes.

Observed behavior

Trace file:

/Users/bender/Desktop/WorldTree/Library/Agent/traces/run-1030.tractor.jsonl

The traced agent run was:

  • cwd: /Users/bender/Desktop/WorldTree/Projects/GhostUI/console-next
  • Claude session: f4ad5575-5213-4e13-bc69-3bd5a008c373
  • actual clean Claude process in trace: pid 6974, ppid 6970

But the same trace file includes unrelated activity from other process trees, including:

  • pid 2440, ppid 2418: a separate Claude writing ~/.claude/projects/...test-organization-witness/f520a6dd...jsonl and opening Projects/GhostUI/test-organization-witness
  • pid 6207, ppid 6182: another Claude/session activity from a different agent run
  • pid 6991, ppid 6989: node/locker activity in Projects/GhostUI/test-organization-witness

The first events in run-1030.tractor.jsonl are already unrelated test-organization-witness opens/status checks before the expected console-next Claude activity appears.

Example evidence from the trace:

{"path":"/Users/bender/Desktop/WorldTree/Projects/GhostUI/test-organization-witness","pid":6991,"ppid":6989,...}
{"argv":"/usr/bin/env node ... Plugins/locker/src/locker.ts status","pid":6992,"ppid":6991,...}
...
{"path":"/Users/bender/.claude/projects/-Users-bender-Desktop-WorldTree-Projects-GhostUI-test-organization-witness/f520a6dd-ec4c-45c6-8681-13889d8f2139.jsonl","pid":2440,"ppid":2418,"process":"/opt/homebrew/Caskroom/claude-code/2.1.149/claude",...}
...
{"path":"/Users/bender/.claude/projects/-Users-bender-Desktop-WorldTree-Projects-GhostUI-console-next/f4ad5575-5213-4e13-bc69-3bd5a008c373.jsonl","pid":6974,"ppid":6970,"process":"/opt/homebrew/Caskroom/claude-code/2.1.149/claude",...}

The agent's own stream events for run 1030 show cwd=/Users/bender/Desktop/WorldTree/Projects/GhostUI/console-next and session f4ad5575..., with no test-organization-witness references. That makes this look like trace contamination rather than the traced command actually doing that work.

Impact

Consumers of Tractor JSON cannot safely attribute events to the traced command. This is especially dangerous for agent/supervisor tooling because unrelated writes/commits can be reported as belonging to the wrong run.

Suggested fix

Ensure tractor exec filters emitted events to the launched command pid and descendants only. It would also help to include a stable trace/session id or root pid metadata so consumers can validate attribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions