Phase 1 runner hardening: completion audit, schema-recovery, and shell guardrails#276
Open
mmprotest wants to merge 3 commits into
Open
Phase 1 runner hardening: completion audit, schema-recovery, and shell guardrails#276mmprotest wants to merge 3 commits into
mmprotest wants to merge 3 commits into
Conversation
…on-audit Remove Phase-1 hard completion audit gate (preserve tool-call recovery & shell guardrails)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
villani_code/completion_audit.pythat returnspassed/failed, a concreteissueslist, and a compactrepair_briefbuilt from observed workspace and transcript state.Runner.run()(both completion exit paths) by callingrun_completion_audit(...); when the audit fails the run is not marked completed, acompletion_audit_blockedevent is emitted, and a concise factual repair brief is injected back to the agent for remediation (no fixed workflow enforced). (changes:villani_code/state.py, newvillani_code/completion_audit.py).Runner: track recent malformed schema failures per tool, trigger a short schema-focused corrective injection after repeated invalid calls, emit visible events (tool_schema_recovery_triggered,tool_schema_degradation_escalated) and escalate if failures persist, and clear degraded state after a successful call (changes:villani_code/state.py).validate_shell_form()invillani_code/shells.pydetects clearly incompatible patterns (Windows heredoc/redirection, POSIX$?, impractically large inline commands) and_run_bash()invillani_code/tools.pyrejects such forms before execution while emitting acommand_rejecteddebug callback; debug recording ofcommand_rejectedwas added toRunnerfor traceability (changes:villani_code/shells.py,villani_code/tools.py,villani_code/state.py).tests/test_runner_phase1_hardening.py) and left existing tool/schema/tests passing.Testing
pytest -q tests/test_runner_phase1_hardening.pyand observed3 passed(completion audit blocking + repair, repeated malformed tool-call recovery message, Windows-incompatible shell rejection).pytest -q tests/test_tools_schema.py tests/test_tools_hardening.py tests/test_trace_runtime_path.pyand observed12 passed(no regressions in tool schema or trace/runtime path behavior).Codex Task