Repository navigation
fix(kanban): stop contradictory review approvals from completing - #102477
Open
fangliquanflq wants to merge 2 commits into
Open
fangliquanflq wants to merge 2 commits into
fangliquanflq wants to merge 2 commits into
Conversation
This branch has not been deployed
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 does this PR do?
Protected Kanban reviews can no longer transition to
donewhile their structured approval evidence contradicts the declared acceptance contract. The kernel now validates opt-in task or board review contracts before every completion path, records rejected attempts without ending the review, and provides a separately audited manual risk override.Symptom
A same-card reviewer could report
review_outcome: "approved"while also recording failed checks, unresolved findings, untested requirements, non-passing acceptance rows, or a conflictingapproved/verdictfield. The task still transitioned from review to done.Impact
Downstream work could be released from a task whose own structured review evidence documented that mandatory acceptance criteria were not met. Operators then had to audit and reverse the false acceptance manually.
Bug Cause
Trigger:
hermes_cli/kanban_db.py/complete_task()when completing a task parked in review or claimed from the review lane.Causal chain:
complete_task()treated metadata as entirely free-form and executed thedonetransition without validation.Why it is wrong: Review metadata could claim approval and failure simultaneously, so the durable lifecycle state did not match the machine-readable evidence attached to it.
Working sibling / contrast: The existing
created_cardscompletion gate already validates structured claims in the kernel and writes a rejection event while preserving task state. Review approval evidence had no equivalent invariant.Ruled out: Parsing
caveator summary prose is intentionally excluded. Free text is explanatory and cannot provide a dependable machine contract.Fix
complete_task()so CLI, worker tool, dashboard/API, retries, and goal-mode all share one gate.review_completion_rejectedwithout mutating review state; expose a manual-only--review-override-reasonthat emits the distinctreview_completion_overriddenevent.Related Issue
Fixes #102457
Type of Change
Changes Made
hermes_cli/kanban_db.py- enforce and audit opt-in structured review contracts.hermes_cli/kanban.py- expose the explicit manual risk-acceptance override.tools/kanban_tools.py- route board identity into the shared kernel and document protected-review metadata.plugins/kanban/dashboard/plugin_api.py- return an actionable conflict response and support explicit operator override.tests/- cover valid approval, contradictory fields, review recovery, re-review persistence, CLI, worker tool, and dashboard paths.website/docs/user-guide/features/kanban.md- document protected structured reviews.How to Test
metadata.review_contract, then attempt completion with a non-PASS required row or non-empty failure list; completion is rejected and the task remains in review.Checklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
cli-config.yaml.exampleis N/A because no config key changedCONTRIBUTING.mdandAGENTS.mdare N/A because no project workflow changed