Skip to content

fix: share parallel task status enum - #241

Merged
pedronauck merged 5 commits into
compozy:mainfrom
antoniofulg:fix/multi-remote-merged-goconst
Jul 16, 2026
Merged

pedronauck merged 5 commits into
compozy:mainfrom
antoniofulg:fix/multi-remote-merged-goconst

Conversation

@antoniofulg

@antoniofulg antoniofulg commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The canonical verify gate is blocked under Go 1.26.4 by:

internal/core/run/ui/multi_remote.go:1038:21: string `merged` has 4 occurrences, make it a constant (goconst)

This is a base failure rather than a defect introduced by downstream PRs such as #234: the affected UI file is identical to main. Because verify is required and the repository has a zero-issue policy, downstream PRs cannot merge while inheriting this failure.

Root cause

Parallel-task terminal values—merged, recovered, failed, skipped, and canceled—form one domain, but consumers interpreted them through repeated string literals. The repeated merged value triggers goconst under the Go 1.26.4 lint environment.

Fix

  • Define TaskParallelTaskStatus in the shared event contract with all five terminal per-task values.
  • Reuse that type from the parallel orchestrator.
  • Centralize the semantic rule that only merged and recovered mean task content reached the integration branch.
  • Reuse IsIntegrated() in UI task settlement, worktree outcome decisions, and daemon artifact synchronization.
  • Treat incoming status text as an exact protocol value; malformed whitespace is not normalized into a valid status.
  • Keep wave display status independent from per-task outcome status despite their shared merged label.

No lint suppression or unrelated workaround is included.

Tests

  • Add a table-driven truth table covering all five statuses, empty, unknown, and non-canonical whitespace.
  • Add UI boundary coverage proving malformed status text cannot settle a task successfully.
  • Existing UI and daemon suites continue to cover event handling and artifact synchronization.

Impact

This removes the base goconst failure so #234 and other downstream PRs can update from main, rerun CI, and be evaluated on their own changes.

Verification

  • Red phase: the new UI boundary test failed because " merged " was accepted.
  • Focused green phase: 14 tests passed across event kinds, UI, and daemon packages.
  • make verify

Fresh local results on Go 1.26.4:

  • golangci-lint: 0 issues
  • Go: 4,528 tests passed, 4 explicitly skipped
  • build: passed
  • E2E: 5 passed
  • final result: All verification checks passed

Summary by CodeRabbit

  • New Features
    • Introduced a standardized parallel task terminal status type, along with a shared IsIntegrated helper (integrated = merged/recovered).
  • Bug Fixes
    • Updated parallel task completion, cleanup, and artifact synchronization to rely on the shared integrated definition and reject non-canonical statuses (including whitespace variants).
  • Tests
    • Added integration and unit tests to verify canonical integrated statuses are accepted and invalid variants are rejected.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1b238104-5eb6-4159-9e5f-99227af2a297

📥 Commits

Reviewing files that changed from the base of the PR and between 0fcf3b8 and acc7b19.

📒 Files selected for processing (2)
  • internal/core/run/ui/integration_test.go
  • pkg/compozy/events/kinds/task_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • pkg/compozy/events/kinds/task_test.go
  • internal/core/run/ui/integration_test.go

Walkthrough

Parallel task statuses are centralized in a shared events enum with an IsIntegrated classifier. Orchestration cleanup, UI completion handlers, and artifact synchronization now use this classifier, with tests covering canonical integrated statuses.

Changes

Parallel task status handling

Layer / File(s) Summary
Shared status contract and orchestration cleanup
pkg/compozy/events/kinds/task.go, internal/core/run/parallel/orchestrator.go
Defines shared terminal statuses and integration classification, updates outcome constants, and uses integration status when cleaning task worktrees.
UI integration classification
internal/core/run/ui/integration.go, internal/core/run/ui/multi_remote.go, internal/core/run/ui/integration_test.go
Uses IsIntegrated() for completion success and verifies that whitespace-padded statuses are not treated as canonical integrated statuses.
Integrated artifact synchronization
internal/daemon/task_multi_artifacts.go, pkg/compozy/events/kinds/task_test.go
Uses IsIntegrated() to determine artifact synchronization and tests integrated and non-integrated status values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: introducing and sharing a parallel task status enum.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@antoniofulg
antoniofulg force-pushed the fix/multi-remote-merged-goconst branch from b049858 to 62e9bea Compare July 15, 2026 06:57
@antoniofulg antoniofulg changed the title fix: restore green verification on Go 1.26.4 fix: share parallel task status enum Jul 15, 2026
@antoniofulg
antoniofulg marked this pull request as ready for review July 15, 2026 07:08
@greptile-apps

greptile-apps Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR centralizes parallel-task terminal status handling. The main changes are:

  • Adds a shared status type and integration predicate.
  • Reuses the shared predicate in cleanup, artifact sync, and UI paths.
  • Rejects malformed status text at the UI boundary.
  • Adds status truth-table and UI boundary tests.

Confidence Score: 5/5

This looks safe to merge.

  • The shared predicate preserves the existing merged and recovered behavior.
  • Exact status matching is covered at both the contract and UI boundaries.
  • No blocking issue was found in the updated code.

Important Files Changed

Filename Overview
pkg/compozy/events/kinds/task.go Adds the shared parallel-task status type, constants, and integration predicate.
internal/core/run/parallel/orchestrator.go Reuses the shared status contract for task outcomes and worktree cleanup.
internal/core/run/ui/integration.go Uses exact shared status matching when settling live task-completion messages.
internal/core/run/ui/multi_remote.go Uses the shared integration predicate when applying aggregate task outcomes.
internal/daemon/task_multi_artifacts.go Uses the shared predicate to select task artifacts for synchronization.
pkg/compozy/events/kinds/task_test.go Tests every canonical status and rejects empty, unknown, and padded values.
internal/core/run/ui/integration_test.go Tests that padded status text cannot mark a task as successfully integrated.

Reviews (4): Last reviewed commit: "fix: update status integration branch wi..." | Re-trigger Greptile

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/core/run/ui/integration_test.go`:
- Around line 334-343: Apply the required Should... subtest naming convention:
in internal/core/run/ui/integration_test.go, wrap
TestParallelTaskCompletedRequiresCanonicalIntegratedStatus’s case in
t.Run("Should reject non-canonical integrated status", ...); in
pkg/compozy/events/kinds/task_test.go, prefix every table-driven subtest name
with "Should".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 62c5de4e-a905-4445-97a1-5e711aa94ea3

📥 Commits

Reviewing files that changed from the base of the PR and between 98aa7c2 and 0fcf3b8.

📒 Files selected for processing (5)
  • internal/core/run/ui/integration.go
  • internal/core/run/ui/integration_test.go
  • internal/core/run/ui/multi_remote.go
  • internal/daemon/task_multi_artifacts.go
  • pkg/compozy/events/kinds/task_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/core/run/ui/multi_remote.go

Comment thread internal/core/run/ui/integration_test.go
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026

@pedronauck pedronauck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Blocking the current head acc7b19 on the repository gate. I approved the previously action-required CI run, and its exact make verify execution on merge ref f25b724 failed in internal/daemon: TestRunManagerStartTaskWorktreeChildCleansUpAllocatedWorktreeOnLaunchFailure left the allocated worktree present after startup failure. The same focused race test fails deterministically 5/5 on this merge ref and 5/5 on current main fdfd45b. The PR diff does not touch that launch/cleanup path; this is inherited from main, where the #231 ownership change made startTaskWorktreeChild return the allocation to its caller while the existing invariant still requires internal cleanup.\n\nThe status-enum diff itself reviewed cleanly, but this repository requires the complete gate to pass with no exceptions. Please refresh the branch after the base cleanup contract is repaired, then obtain a green make verify run on the final merge ref and request re-review.

@pedronauck pedronauck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Updating the blocker for head acc7b19 after #230 landed. The inherited worktree-cleanup failure is now repaired on main, but this PR is currently CONFLICTING with main in internal/core/run/ui/integration.go and internal/core/run/ui/multi_remote.go. The change is not wholly redundant: the public TaskParallelTaskStatus API and centralized IsIntegrated contract remain useful. However, the conflict sites now contain the additional stall/recovery and triage behavior from #230, so the old patch cannot be merged safely as-is.\n\nPlease update the branch onto current main, preserve the unique public-enum/IsIntegrated behavior while retaining all #230 status and triage semantics, rerun the focused status tests, and obtain a green full make verify on the resulting final merge ref before requesting re-review. The current verify result is red and belongs to the obsolete pre-#230 merge tree.

Copy link
Copy Markdown
Contributor Author

@pedronauck The branch is now updated onto current main at f5332ef (including #230). I resolved the two UI conflicts while preserving #230’s stall/recovery and triage behavior, and retained the public TaskParallelTaskStatus API plus centralized IsIntegrated() contract.

Fresh verification on the resulting merge tree is green:

  • go test -race ./pkg/compozy/events/kinds
  • go test -race ./internal/core/run/ui
  • make verify: lint 0 issues, 4,780 Go tests passed (4 explicit skips), build passed, and 5/5 Playwright smoke tests passed

GitHub now reports the PR as mergeable. Please re-review when you have a chance.

@antoniofulg
antoniofulg requested a review from pedronauck July 16, 2026 22:55

@pedronauck pedronauck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-reviewing current head f5332ef after the main update: the conflict resolution is correct and preserves the #230 stall, recovery, triage, and aggregate-task settlement semantics. The status-enum diff is statically clean, and focused race validation passed on the exact merge tree across the event truth table, UI protocol boundary and aggregate paths, daemon artifact sync, and parallel orchestrator scenarios. There are no remaining code findings in this diff. However, the required full make verify gate has not run on this merge tree. Both repository workflow runs are still action_required, and the authenticated GitHub PR-files endpoint currently returns an HTML/503 response; approving CI now would deterministically reproduce the pre-verification paths-filter failure already observed twice on #236. Keeping this head blocked until that endpoint returns JSON/200 and the exact merge tree completes make verify with zero issues. Once the service recovers, CI can be approved and this review can be cleared without any speculative code change.

@pedronauck pedronauck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Current head and exact merge tree are clear. Canonical workflow run 29541798534 verified merge SHA 2f73d0a: formatting passed, golangci-lint reported 0 issues, 4,780 Go tests passed (4 intentional skips), build passed, and 5 Playwright E2E tests passed.

@pedronauck
pedronauck merged commit 5df2365 into compozy:main Jul 16, 2026
2 checks passed
antoniofulg added a commit to antoniofulg/compozy that referenced this pull request Jul 24, 2026
Reverts six PRs that rode along on this branch but are independent of the
Task Groups feature (verified: no task-group code depends on them):
- compozy#234 cy-qa-workflow module + host.tasks.create v2 (extension SDK)
- compozy#237 cy-capture-decisions extension
- compozy#226 Kiro CLI ACP model handling
- compozy#248 sync-test isolation (touched cy-capture-decisions)
- compozy#252 release v0.2.15 prep
- compozy#253 test-daemon reaping

Kept the task-group-relevant infra: compozy#230 (multi-run recovery), compozy#236
(reviews-fix progress), compozy#241 (parallel task status), compozy#250 (task artifacts).
@antoniofulg
antoniofulg deleted the fix/multi-remote-merged-goconst branch July 28, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants