Rust coding-agent framework treats file edits like safe transactions

Pactrail is an open-source harness written in Rust that treats every coding task as a software change transaction rather than letting the AI model touch files directly. A user's task is converted into a contract specifying permissions, write scopes, and budgets. Pactrail then creates an separate from the real repository.

Repository structure, scoped instructions, and explicit memory are compiled into a bounded context pack given to the model. The model can only interact through typed, JSON Schema-validated tools, and every tool call is checked against , path policy, and the transaction's current state. Model turns, tool calls, policy decisions, verification results, and observed effects are all written into a BLAKE3 hash-linked trace, making the whole run reconstructable later.

A completed run produces an immutable diff and an integrity-checked receipt, and the real repository only changes after the user explicitly applies that diff.

Key points

  • Converts a task into a contract with permissions, write scopes, and budgets
  • Runs in an separate from the real repo
  • Model can only touch files through JSON Schema-validated typed tools
  • Full run history is recorded in a BLAKE3 hash-linked trace for reconstruction
  • Changes only reach the real repository after explicit user approval
Read original