Skip to content

t2060: fix(task-complete-helper): move completed entries from Ready/Backlog to Done#18806

Merged
marcusquinn merged 1 commit intomainfrom
feature/auto-20260414-042250
Apr 14, 2026
Merged

t2060: fix(task-complete-helper): move completed entries from Ready/Backlog to Done#18806
marcusquinn merged 1 commit intomainfrom
feature/auto-20260414-042250

Conversation

@alex-solovyev
Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the in-place sed substitution in complete_task() with a two-pass awk extract-and-move: block is extracted from its current section, transformed ([ ][x], proof-log appended), and inserted at the top of ## Done.
  • Adds a pre-move guard that fails fast when ## Done is absent — no partial writes.
  • Fixes commit_and_push() to skip the git commit when nothing was staged (idempotent/already-complete case now exits 0 as documented).
  • Adds regression harness tests/test-task-complete-move.sh (17 assertions, 7 edge cases).
  • One-off retroactive cleanup: moved 562 completed entries (4 from ## Ready, 558 from ## Backlog) to ## Done. Total [x] count unchanged at 806.

Files Changed

  • EDIT: .agents/scripts/task-complete-helper.shcomplete_task() lines 344-378 + commit_and_push() no-op guard
  • NEW: .agents/scripts/tests/test-task-complete-move.sh — regression harness
  • EDIT: TODO.md — retroactive move of 562 completed entries

Verification

# Test harness
bash .agents/scripts/tests/test-task-complete-move.sh
# → All 17 tests passed

# Lint
shellcheck .agents/scripts/task-complete-helper.sh
# → Only pre-existing SC1091 info (not an error)

shellcheck .agents/scripts/tests/test-task-complete-move.sh
# → Clean

# Zero [x] in Ready/Backlog after cleanup
awk '/^## Ready/{f=1; next} /^## Backlog/{f=1; next} /^## /{f=0} f && /^- \[x\]/' TODO.md | wc -l
# → 0

# Total [x] count unchanged
grep -c '^- \[x\]' TODO.md
# → 806 (same as before)

Resolves #18746

…arking

- Replace in-place sed in complete_task() with two-pass awk extract-and-move:
  Pass 1 extracts the task block (parent + indented subtasks) with [x] transformation
  Pass 2 inserts the block at top of ## Done section, removing from original location
- Add ## Done presence check before backup (fail-fast, no orphaned .bak files)
- Add in_done_section verification after move (belt-and-braces correctness check)
- Fix commit_and_push() to skip commit when nothing was staged (idempotent calls)
- New test harness tests/test-task-complete-move.sh with 17 assertions covering
  all 7 edge cases: single-line, open subtask guard, complete subtask block,
  idempotent Done, In Progress → Done, missing Done header, block boundary
- Retroactive cleanup: moved 562 completed entries (4 from Ready, 558 from Backlog)
  to ## Done. Total [x] count unchanged (806). Zero [x] entries remain in Ready/Backlog.

Resolves #18746
@alex-solovyev alex-solovyev added the origin:worker Auto-created by pulse labelless backfill (t2112) label Apr 14, 2026
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • no-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a22cc935-9fef-42b0-b7b6-486d5e54c500

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260414-042250

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the bug Auto-created from TODO.md tag label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

SonarCloud: 0 bugs, 0 vulnerabilities, 231 code smells

Tue Apr 14 02:39:05 UTC 2026: Code review monitoring started
Tue Apr 14 02:39:05 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 231

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 231
  • VULNERABILITIES: 0

Generated on: Tue Apr 14 02:39:07 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link
Copy Markdown

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@alex-solovyev
Copy link
Copy Markdown
Collaborator Author

Worker Implementation Summary

Task: t2060 — fix(task-complete-helper): move completed entries from ## Ready to ## Done

What was implemented

complete_task() rewrite (.agents/scripts/task-complete-helper.sh:344-461):

  • Replaced the in-place sed substitution with a two-pass awk extract-and-move
  • Pass 1: extracts the task block (parent + indented subtasks) from its current location, transforms [ ][x], appends proof-log + completed:today
  • Pass 2: inserts the transformed block at the top of ## Done section
  • Added pre-move guard: fails fast when ## Done header is absent
  • Added post-move verification: confirms task is in ## Done, rolls back on failure

commit_and_push() fix (.agents/scripts/task-complete-helper.sh):

  • Added git diff --quiet --cached HEAD check before commit
  • Idempotent calls (task already [x]) now exit 0 instead of failing at git commit

Test harness (tests/test-task-complete-move.sh):

  • 17 assertions across 7 edge cases: single-line task, open subtask guard, complete subtask block, idempotent Done, In Progress → Done, missing Done header, block boundary

Retroactive cleanup (TODO.md):

  • Moved 562 completed entries (4 from ## Ready, 558 from ## Backlog) to ## Done
  • Total [x] count unchanged: 806 → 806 (no entries lost or duplicated)
  • Zero [x] entries remain in ## Ready or ## Backlog

Verification results

bash .agents/scripts/tests/test-task-complete-move.sh
→ All 17 tests passed

shellcheck .agents/scripts/task-complete-helper.sh
→ Only pre-existing SC1091 info (not an error)

awk '/^## Ready/{f=1; next} /^## Backlog/{f=1; next} /^## /{f=0} f && /^- \[x\]/' TODO.md | wc -l
→ 0

grep -c '^- \[x\]' TODO.md
→ 806 (unchanged)

All CI checks passed.

Merge blocked by: branch protection requires at least 1 approving review. Awaiting maintainer approval.

Copy link
Copy Markdown
Owner

@marcusquinn marcusquinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved by pulse — collaborator PR (author: @alex-solovyev). All pre-merge checks passed.

@marcusquinn marcusquinn merged commit 15c1228 into main Apr 14, 2026
37 checks passed
@marcusquinn marcusquinn deleted the feature/auto-20260414-042250 branch April 14, 2026 02:51
@marcusquinn
Copy link
Copy Markdown
Owner

Worker Implementation Summary

Task: t2060 — fix(task-complete-helper): move completed entries from ## Ready to ## Done

What was implemented

complete_task() rewrite (.agents/scripts/task-complete-helper.sh:344-461):

  • Replaced the in-place sed substitution with a two-pass awk extract-and-move
  • Pass 1: extracts the task block (parent + indented subtasks) from its current location, transforms [ ][x], appends proof-log + completed:today
  • Pass 2: inserts the transformed block at the top of ## Done section
  • Added pre-move guard: fails fast when ## Done header is absent
  • Added post-move verification: confirms task is in ## Done, rolls back on failure

commit_and_push() fix (.agents/scripts/task-complete-helper.sh):

  • Added git diff --quiet --cached HEAD check before commit
  • Idempotent calls (task already [x]) now exit 0 instead of failing at git commit

Test harness (tests/test-task-complete-move.sh):

  • 17 assertions across 7 edge cases: single-line task, open subtask guard, complete subtask block, idempotent Done, In Progress → Done, missing Done header, block boundary

Retroactive cleanup (TODO.md):

  • Moved 562 completed entries (4 from ## Ready, 558 from ## Backlog) to ## Done
  • Total [x] count unchanged: 806 → 806 (no entries lost or duplicated)
  • Zero [x] entries remain in ## Ready or ## Backlog

Verification results

bash .agents/scripts/tests/test-task-complete-move.sh
→ All 17 tests passed

shellcheck .agents/scripts/task-complete-helper.sh
→ Only pre-existing SC1091 info (not an error)

awk '/^## Ready/{f=1; next} /^## Backlog/{f=1; next} /^## /{f=0} f && /^- \[x\]/' TODO.md | wc -l
→ 0

grep -c '^- \[x\]' TODO.md
→ 806 (unchanged)

All CI checks passed.

Merge blocked by: branch protection requires at least 1 approving review. Awaiting maintainer approval.


Merged via PR #18806 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).


aidevops.sh v3.8.18 spent 16m on this as a headless bash routine.

@github-actions
Copy link
Copy Markdown
Contributor

TODO.md auto-completion blocked

The sync-on-pr-merge workflow tried to mark t2060 complete in TODO.md with proof-log pr:#18806 completed:2026-04-14 but the push was rejected by branch protection.

Run this locally to complete the audit trail:

~/.aidevops/agents/scripts/task-complete-helper.sh t2060 --pr 18806 --testing-level self-assessed

This is a known limitation on personal-account classic branch protection — required_approving_review_count cannot be bypassed by github-actions[bot], and bypass_pull_request_allowances is not supported on this plan. The real fix is either a Rulesets migration or a fine-grained PAT (tracked in a follow-up task). Until then, this comment is your cue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag origin:worker Auto-created by pulse labelless backfill (t2112)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t2060: fix(task-complete-helper): move completed entries from ## Ready to ## Done instead of in-place [x] marking

2 participants