feat: report recoverable bug steps as degraded (#1641)#1644
Conversation
Independent testing & verificationVerified this PR in an isolated worktree against Automated tests
Live GitHub end-to-endDrove the real
Secret redaction also runs on this path — a planted token rendered as Resume-state logicTraced the resume-validator change adversarially across the edge cases:
New unit tests cover all three, plus the transient degraded-comment retry on resume. CI note (pre-existing flake, not this PR)
|
A recoverable soft-failure on a step that hands downstream work a deterministic fallback (test strategy -> fallback test plan) is persisted with the FAILED: sentinel, but the workflow legitimately continues and produces valid later results. The resume validator treated that sentinel as a gap, downgrading last_completed_step and rerunning already-completed, side-effectful steps (test generation through PR creation) on resume. Gate the contiguous walk to the recoverable-fallback step set so such a step is non-blocking once a later step has completed, while ordinary failed steps (e.g. triage) and end-of-run failures still rerun. Add a helper unit test and a resume regression test (proven to fail on the pre-fix walk), and document the semantics in the prompt so regeneration preserves them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When a recoverable step's degraded fallback comment post fails transiently, _maybe_post_step_comment records failed_pending=True intending a resume retry. But the on-entry backfill sweep skipped every FAILED: output before checking pending markers and only honored fallback_pending, so the pending comment was never re-posted. With recoverable-fallback steps no longer rerun on resume, that sweep is the comment's only retry path, and the required DEGRADED status could be lost permanently. Have the sweep re-post a failed step whose entry is failed_pending and not failed_posted, via failure_mode=recoverable. Route the degraded recovery detail through a shared _step_failure_detail helper so the live post and the resume re-post can't drift. Adds a regression test proven to fail on the pre-fix sweep. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0597543 to
8a0c133
Compare
|
Do not merge yet. The degraded/fatal reporting change is needed for #1641, but this branch still violates the prompt/code interface contract. Required change:
Fix by adding a real public wrapper with the declared signature, for example |
The prompt <pdd-interface> and architecture.json declare extract_step_report as a callable, but the code exposed it only as an assignment alias (extract_step_report = _extract_step_report). The conformance verifier resolves declared symbols solely via FunctionDef/AsyncFunctionDef nodes, so the alias read as a missing symbol and failed architecture conformance once this branch's prompt edit re-triggered the agentic_common check. Replace the alias with a behavior-identical public wrapper def and reword the prompt prose so a future sync regenerates a real def, not an alias. Public API and return values are unchanged; four orchestrators import the name. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Fixed (commit
Verification:
|
Summary
This PR updates
pdd bugreporting semantics so recoverable step failures are shown as degraded/continuing while terminal failures remain failed/aborting. Step 8 recoverable test-strategy failures now call out fallback/default planning, while later success behavior remains intact.Closes #1641
Changes Made
Prompts Modified
pdd/prompts/agentic_common_python.prompt- adds explicit recoverable/fatal failure comment semantics while preserving legacy fallback behavior.pdd/prompts/agentic_bug_orchestrator_python.prompt- updates bug workflow requirements for degraded soft failures, fatal abort comments, Step 8 fallback wording, and resume-compatible failed-step state.Documentation Updated
README.md- documents degraded vs aborting step-comment statuses forpdd bug.docs/TUTORIALS.md- adds guidance for interpreting degraded workflow comments.Code and Tests Updated
pdd/agentic_common.py- implements explicit failure-mode comment templates.pdd/agentic_bug_orchestrator.py- passes recoverable/fatal semantics to step-comment posting.tests/test_agentic_common.py- covers degraded/fatal comment formatting and legacy compatibility.tests/test_agentic_bug_orchestrator_step_comments.py- covers Step 8 degraded continuation and fatal provider abort behavior.architecture.json- updates prompt architecture metadata.User Stories
warnuser_stories/story__agentic_bug_orchestrator_agentic_common.md— issue-derived story linked to:agentic_bug_orchestrator_python.prompt,agentic_common_python.promptuser_stories/contracts/agentic_bug_orchestrator_agentic_common.contract.md— generated machine-checkable contractuser_stories/story__agentic_bug_orchestrator_agentic_common.mdReview Checklist
Next Steps After Merge
Created by pdd change workflow