Harden Piranha utility mutation campaigns - #1
Merged
Conversation
D1: ModelEngine (portfolio/model_engine.py) — a model-driven Engine that
delegates candidate generation to a pluggable proposer (in-process deterministic
for the verifier; real LLM CLI via ClaudeCodeEngine for production). Sits below
the sandbox/safety guards; writes only under ctx.workdir; never raises.
D2: make_engine('model', ...) + --engine choices {model,codex,claude-code} in
tools/piranha.py. No safety override added; non-shell engines require an explicit
--engine-command (no fake default).
D3: tools/piranha_model_verify.py — a deterministic, offline end-to-end verifier
(no sys.executable, no network) proving the planted improvement wins the champion,
a null variant is demoted (never champion) under the improvement gate, and S1-S4 +
blast-radius parity + source immutability + report-always-written all hold. Emits
'PIRANHA-MODEL-ENGINE-VERIFY: PASS'. Non-vacuous (sensitivity-probed: an escaping
write, a raising proposer, and a false-champion are all caught).
Also fixed the historical env-flaky shell-engine tests toward determinism by
quoting the (space-containing) interpreter path — no assertion weakened. Piranha
suite now 20/20 (+ verifier) green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Safety and behavior
The original source tree remains byte-identical. Candidate code is tested only in an owned sandbox and fails closed when required confinement evidence is unavailable. Promotion evidence comes from trusted metrics rather than candidate-supplied values.
Known limitation: macOS resident-memory enforcement is supervisory; hostile native code still belongs in a memory-capped VM or container.
Verification
PIRANHA-UTILITY-VERIFY: PASSPIRANHA-MODEL-ENGINE-VERIFY: PASS