feat(comments): unified comment system + plan review command#346
feat(comments): unified comment system + plan review command#346birdmanmandbir merged 2 commits intomainfrom
Conversation
- Add `ttal comment add/list` backed by ent SQLite comments table - Remove `ttal task comment` and `ttal pr comment` commands - Simplify LGTM approval to use `+lgtm` taskwarrior tag (guarded by on-modify hook for reviewer role only) - Simplify ParsePRID: strip legacy `:lgtm` suffix silently for backward compat - Add `ttal plan review <uuid>` command with internal/planreview package - Update all agent/skill/doc references to new commands
PR Review — ttal comment system + LGTM tag gateSummarySolid architectural improvement. The comment DB unification and LGTM tag gate are clean designs. The main concerns are silent failure modes and missing test coverage for new security-critical logic. Important Issues1. Three forge side-effect errors swallowed silently — Three of the four error paths in the forge side-effect block are silently dropped with no user feedback. Only // These failures are currently silent:
task, taskErr := taskwarrior.ExportTask(taskUUID) // taskErr only checked as guard
prCtx, ctxErr := pr.ResolveContextWithoutProvider() // ctxErr swallowed
idx, idxErr := pr.PRIndex(prCtx) // idxErr swallowedFix: emit 2. All tmux notification errors discarded in All four Fix: Best-effort notification is fine, but failures should 3. if err != nil || len(tasks) == 0 {
return "", fmt.Errorf("no active task with +%s tag", agent)
}If Fix: 4. The // current (two new sites):
if !slices.Contains(ctx.Task.Tags, "lgtm") {
// preferred:
if !ctx.Task.HasTag("lgtm") {5. Fetches all comments ordered by round and reads the last element. A full table scan per 6. Missing tests for This is the enforcement point for the new security model. It's a pure function with no I/O except
The empty-role path is the most dangerous unverified path — if the condition were accidentally inverted, the gate would be open to everyone. 7. Missing tests for
Suggestions
Strengths
VERDICT: NEEDS_WORKFix the two silent failure issues (#1, #2) and add |
- Emit warnings to stderr for each silent forge side-effect failure (#1) - Log warnings for tmux notification failures; extract notifyReviewer/Coder/PlanReviewer/Designer helpers to reduce cyclomatic complexity (#2) - Distinguish taskwarrior query error from empty-list in resolveCurrentTask (#3) - Use ctx.Task.HasTag("lgtm") instead of slices.Contains at both call sites (#4) - CurrentRound uses Limit(1)+DESC instead of full table scan (#5) - Add checkLGTMGuard tests: reviewer/coder/empty-role/already-set/unrelated cases (#6) - Add comment.Service tests: round increment, cross-target isolation, list order, empty round (#7) - Flatten checkLGTMGuard to guard clause style per CLAUDE.md - Add defensive json.Marshal guard in LGTM rejection path - Update TestValidateTaskCompletion tests to use "7" not legacy "7:lgtm" - Add "123:other" error case to ParsePRID tests
Triage UpdateFixed
No Remaining Issues |
Re-review — bb29ac0Fixed ✓
No Remaining IssuesAll critical, important, and suggestion-level items from the original review have been addressed. The fix commit is thorough and complete. VERDICT: LGTM |
Summary
ttal comment add/list— unified comment command backed by ent SQLitecommentstable; auto-resolves current task fromTTAL_JOB_ID(workers) orTTAL_AGENT_NAME(managers); notifies counterpart via tmuxttal task commentandttal pr comment— all commenting now goes throughttal comment+lgtmtag — reviewers runtask <uuid> modify +lgtm; on-modify hook enforcesTTAL_ROLE=reviewerguard;ParsePRIDsilently strips legacy:lgtmsuffixttal plan review <uuid>— spawns plan-reviewer tmux window (or triggers re-review if already running); backed byinternal/planreviewpackage mirroringinternal/reviewTest plan
make cipasses (confirmed before PR)ttal comment add "msg"works in a worker session (resolves viaTTAL_JOB_ID)ttal comment listshows task commentstask <uuid> modify +lgtmblocked outside reviewer rolettal plan review <uuid>spawns plan-review window