Skip to content

fix(agentic): honest draft_plan stub + proposer invoke outcome audit events#499

Merged
cgfixit merged 2 commits into
mainfrom
claude/cyclaw-optimize-stub-honesty
Jul 10, 2026
Merged

fix(agentic): honest draft_plan stub + proposer invoke outcome audit events#499
cgfixit merged 2 commits into
mainfrom
claude/cyclaw-optimize-stub-honesty

Conversation

@cgfixit

@cgfixit cgfixit commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

Two half-measure fixes in the harness scaffold, implementing the follow-up you endorsed in your PR #495/#497 notes:

  1. agentic/deepagent_github/runners.pydraft_plan() was a phase-5 placeholder returning identical hardcoded constants for any input (only task.task_id was read; pr_body always empty). Per your pasted research ("either raise NotImplementedError or gate it behind a STUB docstring"), it now raises NotImplementedError pointing 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.)
  2. agentic/harness_optimizer/model_adapter.pyLocalProposerClient.invoke audited only the attempt (..._model_invoked before the POST); failures raised with no audit event and successes logged nothing, so the trail couldn't distinguish outcomes. It now emits paired agentic_harness_proposer_model_succeeded / agentic_harness_proposer_model_failed (with error_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 with error_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_plan now 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

…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
Comment thread tests/test_agentic_harness_phase345.py Fixed
Comment thread tests/test_agentic_harness_phase345.py Fixed
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 cgfixit marked this pull request as ready for review July 10, 2026 03:06
@cgfixit cgfixit merged commit 0578b7c into main Jul 10, 2026
30 checks passed
@cgfixit cgfixit deleted the claude/cyclaw-optimize-stub-honesty branch July 10, 2026 03:06
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants