fix(agentic): honest draft_plan stub + proposer invoke outcome audit events#499
Merged
Conversation
…events draft_plan was a phase-5 placeholder returning hardcoded constants for any input - a caller could silently ship its output. It now raises NotImplementedError until phase 6/7 wires real planning. LocalProposerClient .invoke audited only the attempt; it now emits paired succeeded/failed events (with error_type) matching the workspace tools' audit pattern. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3WhoiUiUak84jUmiBhhvA
The two new proposer-audit tests use the same localhost mock-transport base_url as the existing invoke test; annotate them with the repo's standard loopback-by-design suppression so code scanning stays quiet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3WhoiUiUak84jUmiBhhvA
cgfixit
pushed a commit
that referenced
this pull request
Jul 10, 2026
…udit note Two small corrections to the unwired scaffold inventory table: - The draft_plan() row still described its pre-PR-#499 behavior (returned hardcoded constants); it now raises NotImplementedError. Updated to match. - validate_phase5_policy() calls refuse_phase5_write_policy() with no audit wrapping, unlike every other call site (builder.py wraps each one in audit_log(), per its own comment explaining the function has no audit context of its own). Recorded so whichever phase wires this unwired function in adds the same wrapping deliberately, not by omission. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3WhoiUiUak84jUmiBhhvA
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.
What
Two half-measure fixes in the harness scaffold, implementing the follow-up you endorsed in your PR #495/#497 notes:
agentic/deepagent_github/runners.py—draft_plan()was a phase-5 placeholder returning identical hardcoded constants for any input (onlytask.task_idwas read;pr_bodyalways empty). Per your pasted research ("either raise NotImplementedError or gate it behind a STUB docstring"), it now raisesNotImplementedErrorpointing at the plan doc's "Unwired scaffold inventory" section, so nothing can silently ship placeholder plans before phase 6/7 wires real planning. (No TODO/FIXME wording — repo policy.)agentic/harness_optimizer/model_adapter.py—LocalProposerClient.invokeaudited only the attempt (..._model_invokedbefore the POST); failures raised with no audit event and successes logged nothing, so the trail couldn't distinguish outcomes. It now emits pairedagentic_harness_proposer_model_succeeded/agentic_harness_proposer_model_failed(witherror_type) events on every exit path, mirroring the workspace tools' allowed/denied pattern.Plus 3 tests in
tests/test_agentic_harness_phase345.py(NotImplementedError; success event; failure event witherror_type).Why / benefit
Ponytail rule 7 (no half-measures): a stub a caller could mistake for real output, and an audit contract that records attempts but not outcomes, are both silent-misuse traps. Both fixes are behavior-honest, not new capability.
Risk to monitor
draft_plannow raises instead of returning a constant — nothing in the tree calls it (confirmed unreferenced in PR #498's inventory), so no caller breaks; anything future that calls it gets a loud, accurate error. Verified: scoped suite 22/22 pass, ruff clean, invariant-guard 27/27. (Full-repo pytest not runnable in this sandbox — torch index blocked by proxy; same caveat as prior PRs.)Generated by Claude Code