fix(hub): a denied review's status carries the operator's reason
🧪 Test / 🧪 Lock + lint (push) Canceled after 0s
🧪 Test / 🧪 Lock + lint (push) Canceled after 0s
review_status and review_wait returned only status, tree and proof, so a denial note on a card without a known recipient (every MCP card since the agent field came, because sessions keep the tool list they loaded) reached nobody: the hub logged no recipient for call and the note sat unread in reviews.json. state_of now adds channel, reason and to when the denial carries a note, as the ask status already does; a plain rejection adds nothing. The review_status description names the fields. Negative control: on the old code both new subtests fail with KeyError 'channel'. 🎯 Fix: 95 % 💥 Break: 2 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6720ee3e70
commit
0fece7664a
3 files changed
+26
-4
No files matched your search
@@ -28,6 +28,7 @@ REQUEST = ("repo", "worktree", "branch", "tree", "title", "page", "notes", "gate
|
||||
OPTIONAL = ("agent", "diff", "sealed")
|
||||
LISTED = ("id", "created", "worktree", "branch", "tree", "title")
|
||||
STATE = ("id", "status", "tree", "decided")
|
||||
DENIAL = ("channel", "reason", "to")
|
||||
|
||||
|
||||
def found(review: dict | None, review_id: str) -> dict:
|
||||
@@ -38,11 +39,12 @@ def found(review: dict | None, review_id: str) -> dict:
|
||||
|
||||
def state_of(review: dict) -> dict:
|
||||
"""Returns:
|
||||
The review's id, status, tree and decision time, and superseded_by
|
||||
once a newer review of its worktree and branch replaced it.
|
||||
The review's id, status, tree and decision time, superseded_by
|
||||
once a newer review of its worktree and branch replaced it, and
|
||||
channel, reason and to of a denial with a note.
|
||||
"""
|
||||
replaced = {"superseded_by": review["superseded_by"]} if "superseded_by" in review else {}
|
||||
return {**{key: review[key] for key in STATE}, **replaced}
|
||||
return {**{key: review[key] for key in STATE}, **replaced, **{key: review[key] for key in DENIAL if key in review}}
|
||||
|
||||
|
||||
def proven(review: dict) -> dict:
|
||||
|
||||
Reference in new issue
Block a user