feat(task-run): add bulk progress completion guard (#1041)#1116
Merged
shaun0927 merged 2 commits intoMay 13, 2026
Conversation
27 tasks
eae252c to
4ba6bf6
Compare
Owner
Author
Merge rationale (stack consolidation)Intent. Closes #1041 — adds opt-in Why this is correct.
CI. Targets the task-run lifecycle feature branch; CI workflow only runs on |
Owner
Author
|
Hit merge conflicts after #1110 merged into the same git checkout feat/1041-bulk-progress-contract
git fetch origin && git rebase origin/feat/1039-task-run-lifecycle
git push --force-with-leaseOnce the rebase lands, this PR will be ready to merge — the content review pass already cleared it (see the merge rationale comment above). |
Add an opt-in bulk progress contract that records item progress, cursor state, stop-condition satisfaction, and machine-readable completion guard results. TaskRun completion now rejects incomplete linked contracts unless the caller forces completion with an explicit reason. Constraint: Stack on #1039 TaskRun lifecycle and avoid duplicating async ledger, scheduler, dashboard, or progress notification work. Rejected: Changing default completion behavior for all TaskRuns | short non-bulk tasks must remain unaffected. Confidence: high Scope-risk: moderate Directive: Keep future workflow/crawl integrations opt-in by attaching contracts rather than embedding new schedulers. Tested: npm test -- --runTestsByPath tests/core/progress-contract/storage.test.ts tests/tools/bulk-progress-tools.test.ts tests/core/task-run/storage.test.ts tests/tools/task-run-tools.test.ts --runInBand Tested: npm run build Tested: npm run lint:changed Co-authored-by: OmX <omx@oh-my-codex.dev>
9269d64 to
fb6cbcb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Progress / Review status
Auto-refreshed 2026-05-13 — owner comments cleaned up to reduce review noise.
feat/1041-bulk-progress-contract→feat/1039-task-run-lifecycle0cdbef8— Guard repetitive tasks from premature completionOwner comment cleanup: 0 issue + 0 inline review comments deleted. Outstanding feedback from automated/external reviewers above is unchanged.
Summary
BulkProgressContractstorage/helpers for repetitive item work.oc_bulk_progress_start/update/checktools for expected-count and unknown-total cursor workflows.oc_task_run_completereturn a typed guard failure when linked bulk progress is incomplete, unlessforce:trueandforce_reasonare supplied.Closes #1041.
Stacked on #1083 /
feat/1039-task-run-lifecycle; merge #1083 first.Direction / duplicate check before implementation
Success criteria
completed + failed >= expected_total.min_completedblocks completion when successes are below threshold.stop_satisfied:true.Verification performed
npm test -- --runTestsByPath tests/core/progress-contract/storage.test.ts tests/tools/bulk-progress-tools.test.ts tests/core/task-run/storage.test.ts tests/tools/task-run-tools.test.ts --runInBandnpm run buildnpm run lint:changedReal OpenChrome verification after merge
oc_task_run_startfor goalVisit three URLs and collect titles.oc_bulk_progress_startwith returnedrun_id,expected_total: 3,item_key: "url", andstop_condition: "processed all input urls".https://example.com, then calloc_bulk_progress_updatewith that URL incompleted.oc_task_run_complete; verify it returnsisError:true,error.code: "bulk_completion_guard_failed",completion_guard.missing_count: 2, and a warning hint suggestingoc_bulk_progress_update.oc_bulk_progress_update.oc_task_run_completeagain; verify the TaskRun reachesCOMPLETED.expected_total, attempt completion beforestop_satisfied:true, then verify completion succeeds only after updatingstop_satisfied:true.oc_task_run_get; verify cursor/completed/failed state persisted.Out of scope