Repository navigation
[Issue #150] Bounded remediation: defect-episode fix_batches and lead diagnosis before batch 3 (v2.1.3 P5) - #152
Conversation
…nosis before batch 3 Count fix batches on a defect_episodes[] entry referenced by each PR's defect_episode_ref (additive under schema_version: 2). Batches 1 and 2 are automatic; batch 3 needs a lead diagnosis entry that authorizes only its named additional batch count. A cap never clears a blocker or escalates by itself. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
…de example Validator pins the phase4, phase3.5 (QA fails) and template sentences; tests parse the worked example with dev_state.py, show old ledgers stay valid, and show the validator fails when a pinned sentence is removed. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
No CRITICAL/WARNING/SUGGESTION findings in changed code. All changed-code issues reviewed in a single pass; no pre-existing unchanged-line issues reported. Reviewed by nemotron-3.5-super-vl:free · Input: 110.9K · Output: 18.2K · Cached: 325.2K Review guidance: REVIEW.md from base branch |
Keep both sides: check_risk_tiers and RiskTierTests from P2, and check_bounded_remediation and BoundedRemediationTests from P5. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
Closes #150
Rationale
Remediation loops had no bound. Fix batches are now counted on a durable
defect_episodes[]entry in the lead ledger; each PR points to it withdefect_episode_ref, so the count survives new heads, worker swaps, handoffs and related PRs. Batches 1 and 2 are automatic; before batch 3 the lead writes a diagnosis entry that authorizes only a named additional batch count. A cap never clears a blocker or escalates by itself. Only material findings (P4 definition) drive a batch; advisory findings go to the debt log. Prose + template + pins only;dev_state.pyis unchanged (it already accepts new keys) and "dispatch refused by the SOP" is a pinned rule for the lead, not enforcement code.Changes (all additive under
schema_version: 2):DEV_STATE_TEMPLATE.md:defect_episodes: [],defect_episode_refin the PR field list, new "Defect episode record schema (Issue [v2.1.3 P5] Bounded remediation: defect-episode fix_batches and lead diagnosis before batch 3 #150)" section with a worked examplephases/phase4.md: new "Bounded remediation" section, referenced from the fix-batch paragraph and the REQUEST CHANGES ratingphases/phase3.5.md: QA-fails gate step (only that section)scripts/validate_skill.py:BOUNDED_REMEDIATION_PINS+check_bounded_remediation(self-contained)tests/test_backend_contract.py:BoundedRemediationTests(self-contained class)Acceptance criteria
ep-1; rule pinnedbound+ sum(authorized_additional_batches); example uses exactly its limit; counterexamples (overrun, no diagnosis) exceed itdev_state.py --validate; old ledgers stay valid: ✓ tests run the repo'sdev_state.pyon the example, on the template without the new key, on a PR entry withoutdefect_episode_ref; flow syntax on the new key is still rejectedFocused checks (head 6ffa0b1; CI Verification Gate owns the full suite)
scripts/verify.sh, the full suite and installer suites were not run (CI-owned).Coverage-path audit
Caller impact
Additive only.
dev_state.pyunchanged; existing pins and the P1/P4 text untouched. Merge note: P2 (#149) also editsphase3.5.md(trigger section),validate_skill.pyandtests/test_backend_contract.py; my edits are self-contained blocks (new constants/function abovemain, new test class at end of file).🤖 Generated with Claude Code