Summary
The v2.0.0 execute_code audit contract requires engagement metadata, saves the Python source, and records a digest/status/duration in history. It does not preserve the tool result or output in a structured receipt comparable to violin_exec.
Affected paths on dev at dc53bbb:
plugins/violin_guard/code_execution_audit.py
plugins/violin_guard/__init__.py
plugins/violin_guard/execution.py
tests/guard/test_terminal_policy.py
Current behavior
record_completion(source, result, duration_ms) writes only:
evidence/<phase>/execute-code-<timestamp>-<digest>.py
- one history row containing digest, target, duration, and status
_result_summary() parses enough of result to decide success/error, then discards the result body.
Impact
Complex scripts used for structured HTTP requests or payload construction are source-auditable but outcome-poor. Reviewers cannot reconstruct what the script printed or returned from the same receipt model used by guarded command execution.
Suggested fix
Write a bounded JSON sidecar manifest containing:
- schema version and receipt ID;
- source digest and relative source path;
- engagement, phase, target, and session metadata;
- start/completion or duration fields;
- normalized status/error information;
- a size-capped result/output field;
- truncation and redaction indicators.
Reference the JSON manifest from history. Preserve the source file separately. Avoid storing unbounded results or secrets.
Acceptance criteria
- Successful, failed, non-JSON, and oversized results produce valid manifests.
- Output truncation is explicit and deterministic.
- Sensitive-field redaction follows repository privacy conventions.
- History references the JSON manifest used for review.
- Existing source-digest validation remains unchanged.
- Regression tests prove the result body can be audited without reading tool chat output.
Summary
The v2.0.0
execute_codeaudit contract requires engagement metadata, saves the Python source, and records a digest/status/duration in history. It does not preserve the tool result or output in a structured receipt comparable toviolin_exec.Affected paths on
devatdc53bbb:plugins/violin_guard/code_execution_audit.pyplugins/violin_guard/__init__.pyplugins/violin_guard/execution.pytests/guard/test_terminal_policy.pyCurrent behavior
record_completion(source, result, duration_ms)writes only:evidence/<phase>/execute-code-<timestamp>-<digest>.py_result_summary()parses enough ofresultto decide success/error, then discards the result body.Impact
Complex scripts used for structured HTTP requests or payload construction are source-auditable but outcome-poor. Reviewers cannot reconstruct what the script printed or returned from the same receipt model used by guarded command execution.
Suggested fix
Write a bounded JSON sidecar manifest containing:
Reference the JSON manifest from history. Preserve the source file separately. Avoid storing unbounded results or secrets.
Acceptance criteria