Skip to content

fix: make cy-qa-workflow extension work on compozy.tasks/v2 runs - #234

Merged
pedronauck merged 4 commits into
compozy:mainfrom
antoniofulg:fix/cy-qa-workflow-v2-tasks
Jul 16, 2026
Merged

pedronauck merged 4 commits into
compozy:mainfrom
antoniofulg:fix/cy-qa-workflow-v2-tasks

Conversation

@antoniofulg

@antoniofulg antoniofulg commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The cy-qa-workflow extension aborts every compozy tasks run on a compozy.tasks/v2 workflow. This PR fixes the two independent root-cause defects behind it. A follow-up PR adds a configurable QA runtime on top of this.

Why

With cy-qa-workflow enabled, launching any v2 (frontmatter-graph) task workflow fails during plan discovery, before run.started, and no task jobs are created. Because the extension's plan.pre_discover hook is required = true, its failure aborts the whole run. Each aborted run also leaves a partial artifact that can flip the daemon to degraded. The only workaround today is to disable the extension entirely, which loses QA-task automation.

There are two separate causes:

  1. The extension ships without a go.mod, so its go run . subprocess can't even start once installed standalone.
  2. Even with the subprocess running, its host.tasks.create call is rejected by the daemon, because that host method only understands the legacy Markdown-table _tasks.md, not the v2 frontmatter-graph format that cy-create-tasks generates and the runner requires.

What changed

Defect 1 — extension had no Go module

The installed extension contained only extension.toml + main.go, but extension.toml runs the subprocess as go run . and main.go imports github.com/compozy/compozy/sdk/extension. With no go.mod, the subprocess failed immediately with go: go.mod file not found.

  • extensions/cy-qa-workflow/go.mod (new) — makes the extension the standalone module the docs/scaffolder prescribe. Module path example.com/cy-qa-workflow: a deliberately non-publishable path (example.com is RFC 2606 reserved), matching what create-extension emits (defaultModuleName → example.com/<name>) and docs/extensibility/hello-world-go.md (go mod init example.com/hello-go). The module is an app run via go run ., never imported, so the path is only an identifier.
  • extensions/cy-qa-workflow/go.sum (new) — generated by go mod tidy; pins the SDK + transitive deps.

Defect 2 — host.tasks.create wasn't compozy.tasks/v2-aware

host.tasks.create searched for the legacy header | # | Title | Status | Complexity | Dependencies | and returned "tasks table header not found" on a v2 manifest, aborting the run at extension.ready. It now detects the manifest format and mutates the v2 graph instead.

  • internal/core/tasks/manifest_write.go (new) — three helpers on the manifest type:
    • IsTaskGraphManifestContent — detects a v2 manifest (schema version or graph.nodes).
    • AppendTaskGraphNode — adds a node to graph.nodes and dependency edges to graph.edges (dep → new), deduplicated; errors on a dangling dependency so an invalid manifest is never written; re-serializes the frontmatter.
    • RenderTaskGraphTaskFile — renders a v2 task file with only task-owned front matter (no dependencies key, which the v2 validator rejects on task files).
  • internal/core/extension/host_writes.go — CreateTask is now format-aware: it reads _tasks.md once (loadTaskIndexState) and branches the task-file rendering (renderHostTaskFile) and the index update (buildTaskIndexUpdate). For a v2 manifest it renders without dependencies and appends node + edges; the legacy Markdown-table path is unchanged.

Build coverage

Adding a go.mod makes the extension a nested module, which Go excludes from the root ./..., so make verify would silently stop covering it.

  • Makefile — new verify-extensions target (build -o /dev/null, go test -race, golangci-lint run per module listed in EXTENSION_GO_MODULES), wired into verify.
  • .github/workflows/ci.yml — extensions/** added to the CI changes paths filter so extension-only changes still trigger verify.
  • .gitignore — ignore go.work/go.work.sum (local dev) and the compiled cy-qa-workflow binary from go build ..
  • test/frontend-verification-contract.test.ts — the verify target-dependency contract now includes verify-extensions.

Tests

  • internal/core/tasks/manifest_write_test.go (new) — table-driven coverage for the three helpers, plus an end-to-end case that writes the files and runs the real LoadValidatedTaskGraphManifest to prove the mutated manifest is valid.
  • internal/core/extension/host_writes_test.go — TestHostTasksCreateUpdateIndexAppendsTaskGraphNode drives the real host.tasks.create RPC on a v2 _tasks.md and asserts the node + edge injection, the missing dependencies key, and that the runner's own validator loads the result.

Behavior notes

  • Backward compatible. The legacy Markdown-table _tasks.md path is unchanged; only v2 manifests take the new branch.
  • Invalid manifests are never written. AppendTaskGraphNode returns an error if a dependency doesn't resolve to an existing graph node.
  • No daemon protocol or host-API surface changes.

Testing

  • Regression test (red→green): confirmed TestHostTasksCreateUpdateIndexAppendsTaskGraphNode fails on the pre-fix code with the exact production error (tasks table header not found) and passes with the fix.
  • make verify-extensions — build + -race + lint, 0 issues.
  • Live end-to-end: with the fix, a real compozy tasks run on a v2 workflow reaches run.started, injects the QA tasks into the graph, and an agent creates/refactors a file to completion.

CI note

If the verify job fails on a goconst in internal/core/run/ui/multi_remote.go ("merged"), that is a pre-existing issue on main (main's own CI is currently red on it), not introduced by this change — a rebase clears it once main's lint is green. This branch is rebased on current main.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for creating and updating tasks in v2 task-graph manifests, including correct rendering and graph relationship preservation.
    • Index updates now append nodes and dependency edges while avoiding dependency frontmatter duplication.
  • Bug Fixes

    • Improved consistency when loading and updating task indexes, including validation that dependencies resolve to existing graph nodes.
  • Chores

    • Extended the verify pipeline to build, test (with race checks), and lint extension modules automatically.
    • Updated ignore rules and added the standalone Go extension module setup.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Task creation now supports v2 task graph manifests while preserving legacy indexes. New manifest utilities handle rendering and graph updates. The verification pipeline builds, tests, and lints configured standalone Go extensions.

Changes

Task graph creation

Layer / File(s) Summary
Task graph manifest utilities
internal/core/tasks/manifest_write.go, internal/core/tasks/manifest_write_test.go
Adds graph-manifest detection, task-file rendering without dependency metadata, node and edge updates, validation, deduplication, and focused tests.
Host task creation integration
internal/core/extension/host_writes.go, internal/core/extension/host_writes_test.go
Loads task-index state once, selects graph or legacy rendering and update paths, and tests creation of a task graph node and dependency edge.

Standalone extension verification

Layer / File(s) Summary
Extension verification pipeline
Makefile, extensions/cy-qa-workflow/go.mod, .gitignore, test/frontend-verification-contract.test.ts
Adds the extension module to verify, runs build, race-test, and lint checks, declares the module dependency, ignores local artifacts, and updates the verification contract.

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

Sequence Diagram(s)

sequenceDiagram
  participant HostCreateTask
  participant TaskGraphUtilities
  participant TasksManifest
  participant TaskFile
  HostCreateTask->>TaskGraphUtilities: Load and classify _tasks.md
  HostCreateTask->>TaskGraphUtilities: Render task graph task file
  TaskGraphUtilities->>TaskFile: Write task_02.md
  HostCreateTask->>TaskGraphUtilities: Append task node and dependency edge
  TaskGraphUtilities->>TasksManifest: Rewrite _tasks.md
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing cy-qa-workflow for compozy.tasks/v2 runs.
✨ 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.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR makes the cy-qa-workflow extension work with v2 task-graph workflows. The main changes are:

  • Added a standalone Go module for the extension.
  • Added v2-aware task creation for graph manifests.
  • Rendered v2 task files without per-file dependency metadata.
  • Added extension verification to make verify and CI path filtering.
  • Added tests for graph manifest mutation and verification coverage.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
internal/core/extension/host_writes.go Adds format-aware task creation that updates v2 graph manifests while preserving the legacy table path.
internal/core/tasks/manifest_write.go Adds helpers to detect v2 task manifests, render v2 task files, and append graph nodes with dependency edges.
extensions/cy-qa-workflow/go.mod Adds a standalone module so the extension can run outside the root module.
Makefile Adds nested extension build, test, and lint coverage to the verification target.
.github/workflows/ci.yml Includes extension paths in the CI verification filter.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[host.tasks.create] --> B[Read _tasks.md]
  B --> C{Task graph manifest?}
  C -- Yes --> D[Render v2 task file]
  D --> E[Append graph node]
  E --> F[Append dependency edges]
  C -- No --> G[Render legacy task file]
  G --> H[Append table row]
  F --> I[Write task file and index]
  H --> I
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
  A[host.tasks.create] --> B[Read _tasks.md]
  B --> C{Task graph manifest?}
  C -- Yes --> D[Render v2 task file]
  D --> E[Append graph node]
  E --> F[Append dependency edges]
  C -- No --> G[Render legacy task file]
  G --> H[Append table row]
  F --> I[Write task file and index]
  H --> I
Loading

Reviews (6): Last reviewed commit: "Merge branch 'main' into fix/cy-qa-workf..." | Re-trigger Greptile

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbdc60f6b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/cy-qa-workflow/go.mod
@antoniofulg

antoniofulg commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor Author

I found some issues when trying locally, I'll put again as ready to review it when I have it working well.

@antoniofulg antoniofulg reopened this Jul 10, 2026
@antoniofulg
antoniofulg marked this pull request as draft July 10, 2026 06:49
@antoniofulg
antoniofulg force-pushed the fix/cy-qa-workflow-v2-tasks branch from bbdc60f to 6bd08af Compare July 10, 2026 16:15
…-aware

The cy-qa-workflow extension aborted every `compozy tasks run` on a
compozy.tasks/v2 workflow. Two independent defects were involved.

Defect 1 — missing go.mod. The extension ships `[subprocess] go run .`
and imports the SDK, but was committed without go.mod/go.sum, so a
standalone install failed with "go.mod file not found". It only compiled
in-repo because it was absorbed into the root module. Package it as the
standalone module the docs and scaffolder prescribe (module
example.com/cy-qa-workflow, require github.com/compozy/compozy v0.2.11).

Defect 2 — host.tasks.create only understood the legacy Markdown-table
index. It rejected a v2 frontmatter-graph _tasks.md with "tasks table
header not found" and wrote a dependencies key the v2 validator rejects.
Make the writer format-aware: for a compozy.tasks/v2 manifest, render the
task file without a dependencies key and append a node (+ dependency
edges) to the frontmatter graph so injected tasks are visible to the
runner. Legacy Markdown-table behavior is unchanged.

Also keep the now-separate extension module covered: a verify-extensions
make target wired into verify, extensions/** in the CI paths filter, and
go.work*/extension binaries gitignored for local workspace-based dev.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@antoniofulg

Copy link
Copy Markdown
Contributor Author

Good catch — fixed. Raised min_compozy_version to 0.2.14 in extensions/cy-qa-workflow/extension.toml.

Caveat: this PR is the host-side graph fix, so the "first release containing the new graph branch" isn't tagged yet — the current latest release (v0.2.13) predates it. 0.2.14 is my anticipated next release; please confirm/adjust it to whatever version you actually cut with this change. The go.mod require can only reference an existing tag, so it stays on a released version for now — happy to pin it to the fix release once tagged, or to land the host fix first and raise the extension floor + go.mod pin in a follow-up, whichever you prefer.

Without the raise, the newly added go.mod lets the extension start on any host ≥ 0.1.10, and its required plan.pre_discover → host.tasks.create on a v2 _tasks.md would still abort with tasks table header not found on hosts predating the graph branch — exactly the case you flagged.

@antoniofulg
antoniofulg marked this pull request as ready for review July 10, 2026 18:48
@antoniofulg

Copy link
Copy Markdown
Contributor Author

Re-validated against a real compozy.tasks/v2 workflow on a canonical (flat) layout: with cy-qa-workflow enabled, host.tasks.create correctly appends the QA report + execution tasks to the v2 graph.nodes/graph.edges — no tasks table header not found abort and no shadow _tasks.md — and the run executes all four jobs (2 implementation + 2 injected QA) to completion. Marking ready for review.

@antoniofulg antoniofulg changed the title fix: make cy-qa-workflow work on compozy.tasks/v2 runs fix: make cy-qa-workflow extension work on compozy.tasks/v2 runs Jul 10, 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.

🧹 Nitpick comments (1)
Makefile (1)

162-173: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider extracting the per-module verification into a helper target.

checkmake flags this target body as exceeding the 5-line limit (8 lines). Extracting the inner loop body into a separate recipe target would improve readability and satisfy the linter.

♻️ Optional refactor to reduce target body length
 EXTENSION_GO_MODULES=extensions/cy-qa-workflow
+
+define verify-extension-module
+	echo "Verifying extension module $$dir"; \
+	( cd $$dir && \
+		$(GOBUILD) -o /dev/null ./... && \
+		$(GOTEST) -race ./... && \
+		$(LINTCMD) run ) || exit 1
+endef

 # ...

 verify-extensions:
-	`@for` dir in $(EXTENSION_GO_MODULES); do \
-		echo "Verifying extension module $$dir"; \
-		( cd $$dir && \
-			$(GOBUILD) -o /dev/null ./... && \
-			$(GOTEST) -race ./... && \
-			$(LINTCMD) run ) || exit 1; \
-	done
+	`@for` dir in $(EXTENSION_GO_MODULES); do \
+		$(verify-extension-module); \
+	done
 	`@echo` "$(GREEN)Extension modules verified$(NC)"
🤖 Prompt for 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.

In `@Makefile` around lines 162 - 173, Extract the per-module build, test, and
lint commands from verify-extensions into a dedicated helper target, passing
each module directory as an argument. Keep verify-extensions focused on
iterating over EXTENSION_GO_MODULES and invoking the helper, preserving the
existing failure handling and verification message while reducing the target
body below checkmake’s five-line limit.

Source: Linters/SAST tools

🤖 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.

Nitpick comments:
In `@Makefile`:
- Around line 162-173: Extract the per-module build, test, and lint commands
from verify-extensions into a dedicated helper target, passing each module
directory as an argument. Keep verify-extensions focused on iterating over
EXTENSION_GO_MODULES and invoking the helper, preserving the existing failure
handling and verification message while reducing the target body below
checkmake’s five-line limit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 873fb549-d77d-483d-9793-3276e5305866

📥 Commits

Reviewing files that changed from the base of the PR and between bbdc60f and e0d78f5.

⛔ Files ignored due to path filters (3)
  • .github/workflows/ci.yml is excluded by !**/*.yml
  • extensions/cy-qa-workflow/extension.toml is excluded by !**/*.toml
  • extensions/cy-qa-workflow/go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • .gitignore
  • Makefile
  • extensions/cy-qa-workflow/go.mod
  • internal/core/extension/host_writes.go
  • internal/core/extension/host_writes_test.go
  • internal/core/tasks/manifest_write.go
  • internal/core/tasks/manifest_write_test.go
  • test/frontend-verification-contract.test.ts
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (6)
  • extensions/cy-qa-workflow/go.mod
  • internal/core/tasks/manifest_write_test.go
  • test/frontend-verification-contract.test.ts
  • internal/core/tasks/manifest_write.go
  • internal/core/extension/host_writes_test.go
  • internal/core/extension/host_writes.go

@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.

The PR-specific implementation and local gates passed in my audit, but the required GitHub verify check on head e0d78f56654534e2544edea96e7dafb7d26fc7ce is red, so this cannot be merged under the repository's zero-issue policy. The failing log is internal/core/run/ui/multi_remote.go:1038:21: string merged has 4 occurrences, make it a constant (goconst).

I confirmed that file is identical between this head and current main, so this is a base/environment failure rather than a defect introduced by #234. Please update the branch after the main Go 1.26.4 lint failure is fixed (or coordinate the base fix first), trigger a fresh CI run, and return with the required verify check green. I am not requesting a workaround or unrelated suppression in this PR; the blocking condition is the failed canonical gate.

@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-review completed at head 1ffb01eeb19285ec9925ea065ff63b7ecee8d79d. The prior host-version concern is resolved, no active review threads remain, and the current merge ref 87427a84bb861660045df70014905d5be5211993 passed CI run 29539072178 end to end: zero lint issues, 4,775 tests with 4 intentional skips, extension-module verification, build, and Playwright. Approved for squash merge.

@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 29542823245 verified merge SHA 4f4e66a: formatting passed, golangci-lint reported 0 issues, 4,798 Go tests passed (4 intentional skips), build and cy-qa-workflow module verification passed, and 5 Playwright E2E tests passed.

@pedronauck
pedronauck merged commit bf5291c into compozy:main Jul 16, 2026
6 of 7 checks passed
antoniofulg added a commit to antoniofulg/compozy that referenced this pull request Jul 23, 2026
cy-capture-decisions (compozy#237) and cy-qa-workflow (compozy#234) are independent
skill-only extensions with zero coupling to task groups; they belong in
their own PRs. Removing them keeps this PR scoped to Task Groups.
antoniofulg added a commit to antoniofulg/compozy that referenced this pull request Jul 23, 2026
Reverts an over-eager removal: cy-qa-workflow already ships in main (this
branch only carries its compozy#234 module-packaging/version bump), so it must stay.
Only cy-capture-decisions (genuinely new on this branch) remains removed.
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/cy-qa-workflow-v2-tasks 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