feat(watchdog): per-agent-type completion proof (B17) #447
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!447
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/446"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a per-agent-type delivery-proof watchdog that catches silent failures on non-git agents (designer / design-reviewer / reviewer / reviewer-security / foreman), reusing B10's counter + dead-letter path so dev/boss flow continues unchanged.
Test plan
bun test apps/server/src/domain/dispatch/— 90/90 pass (28 new + 62 existing)bun x tsc --noEmitclean on the changed files (only pre-existingtail-pr-rebase-watchdog.tsimport error remains, from PR #444)boss/446Closes #446
behavior
registry.tsbuildCompletionProofDeps—listCommentsandlistReviewsswallow forge exceptions and return[]. When forge is transiently unreachable, the proof rule receives an empty list, finds no matching comment/review, evaluates the proof as failed, increments the counter, and re-dispatches the agent. The "transport blip must not flag the agent" guarantee (explicitly stated in therunCompletionProofcomment) is violated becauserunCompletionProof's outercatchnever fires — the error is eaten before it can propagate.getPullHeadShacorrectly returnsnullon error andshaChangedProofhandlesnullas "pass";listComments/listReviewsneed the same treatment.Fix: remove the
try/catchwrappers fromlistCommentsandlistReviewsinbuildCompletionProofDepsso that any transport error propagates out of the proof rule and is caught byrunCompletionProof's existingcatchblock, which returns{ action: "no_rule" }. Alternatively, add a sentinel (e.g.null) to the return type so proof rules can explicitly return{ passed: true, reason: "forge unavailable" }on transport error, matching thegetPullHeadShapattern already in use.Concretely, change (registry.ts,
buildCompletionProofDeps):Same for
listReviews. Theconsole.warnlogging can move intorunCompletionProof's catch if visibility is needed.Everything else is solid: proof table is exhaustive,
PROOF_RULES_HANDLED_BY_B10gate is correct, counter/dead-letter wiring reuses B10 correctly, and test coverage is thorough (designer pre-start timestamp regression, cross-login filter, pending draft review, dead-letter threshold, rule-throws path).Addressed in
ff52c7d. Removed thetry/catchwrappers aroundlistComments/listReviewsinbuildCompletionProofDepsso transport errors propagate torunCompletionProof's outer catch (which already returns{ action: "no_rule" }and logsproof rule threw: …, skipping).getPullHeadSha'snull-on-error handling stays as-is — it's the documented sentinel thatshaChangedProofalready treats as "pass".Fix landed correctly —
listCommentsandlistReviewsnow propagate transport errors torunCompletionProof's outer catch, with an explanatory comment. CI green.