feat: task complete gains --force flag - #83
Conversation
There was a problem hiding this comment.
This session is the worktree itself (we skipped worktree creation per the ALREADY_AT_HEAD short-circuit). No cleanup needed.
{
"verdict": "approve",
"summary": "PR adds --force flag to task complete, correctly wiring the flag through CLI -> ops layer with a bypass of the incomplete-checkbox guard. CHANGELOG uses correct feat: prefix, command docs are properly formatted, mock is correctly regenerated. All 150 mechanical findings are pre-existing patterns in unchanged code; no new violations introduced.",
"comments": [],
"concerns_addressed": []
}…te-force # Conflicts: # CHANGELOG.md
superseded by new automated review
There was a problem hiding this comment.
Now I have all the information I need. Let me compile the findings:
Mechanical funnel findings (150 total) are pre-existing issues in the codebase — the PR adds a small amount of net new code but doesn't introduce new patterns. The core change is straightforward and correct.
Manual review of the PR:
pkg/ops/complete.go:100-106—!forceguard correctly wraps thecheckSubtaskCompletioncall. Whenforce=true, the guard is bypassed; whenforce=false, it runs as before. ✅pkg/cli/cli.go:151,180—forceis aboolvariable captured by reference in theRunEclosure and registered viaBoolVarbeforereturn cmd. The capture is safe —cmd.RunEexecutes after all flag registration, and the closure readsforceat call time, not at closure-creation time. ✅mocks/complete-operation.go— auto-generated mock updated correctly to match newExecute(ctx, string, string, string, bool)signature. ✅pkg/ops/complete_test.go— new tests coverforce=false(block) andforce=true(bypass) cases with appropriate assertions. ✅
Remaining mechanical findings in changed files are pre-existing in the codebase (not introduced by this PR) or are in test setup where mock setter methods (*Returns()) have no return value and the rule is a false positive for those patterns.
{
"verdict": "approve",
"summary": "The `--force` flag implementation is correct and well-tested. The guard bypass at `complete.go:100-106` is sound, the CLI closure capture is safe, the mock is properly updated, and the new tests cover both the blocked and bypassed paths. The CHANGELOG entry is well-written with clear motivation. Pre-existing mechanical findings in the diff are outside this PR's scope.",
"comments": [
{
"file": "pkg/ops/complete_test.go",
"line": 1,
"severity": "minor",
"message": "Test file lacks a companion *_suite_test.go with TestSuite + RunSpecs. Ginkgo will still discover specs via the Describe block, but without a suite file the TestSuite entry point is missing — tests will run but the harness lacks the standard setup/teardown hook. Non-blocking for this PR since the file was not introduced by this change."
}
],
"concerns_addressed": [
"correctness: subtask completion guard is now conditional on !force — the bypass logic at complete.go:100-106 is correct (force=false → guard runs; force=true → guard skipped). Verified by new tests in complete_test.go.",
"correctness: force flag boolVar is captured safely — force is declared before cmd construction, registered via Flags().BoolVar before return, and Read at execution time inside RunE. No stale closure capture issue.",
"correctness: mock updated to match new Execute signature — mocks/complete-operation.go now includes arg5 bool in Execute signature throughout."
]
}
Summary
task completegains--force, bypassing the incomplete-checkbox guard (mirrorsgoal complete --force).commands/complete-task.mdstep (c) now actually passes--forceto the CLI (it previously documented the flag in argument-hint and the abort-path advice but never wired it through).--forceis for items that were never the task's actual work, not for closing out unfinished work.Why
commands/complete-task.mdhas advertised--forcesince it was written — but onlygoal completeimplemented it. On the task path the advice was a dead end: the run failed withincomplete subtasks: N pendingand the only way through was editing the task file to delete checkboxes, which is lossy. First reported 2026-08-11; hit twice again on 2026-08-16.Test plan
make precommitpasses (8 packages, golangci-lint 0 issues, go vet clean, osv-scanner + trivy 0 vulns, CHANGELOG OK, license headers OK)incomplete_items), forced completes and marks status