Repository navigation
Split compilation pipeline into focused stages - #80754
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
| compileOrchestrationLog.Printf("Failed to format MCP compile progress: %v", err) | ||
| return | ||
| } | ||
| if err := writeSensitiveFile(progressPath, []byte(output)); err != nil { |
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. The No-op messageReview of captured head 1275d16 was superseded by PR head 2670e49 before publication; pending specification edits were discarded and no review was submitted.
|
|
✅ Test Quality Sentinel completed test quality analysis.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. The No-op messageCompleted PR #80754 review: submitted one unified no-findings review and recorded the outcome in review-history.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. The No-op messageLean already. Ship.
|
This comment has been minimized.
This comment has been minimized.
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. 🔍 Points to confirm in the draft
📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be complete: Context, Decision, Alternatives Considered, and Consequences. References: §45459243449
|
There was a problem hiding this comment.
No blocking findings. The refactor preserves the existing compilation-stage behavior in the changed code; the specialist pass found no actionable correctness regression on changed lines.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
🧪 Test Quality Sentinel Report✅ Test Quality Score: 100/100 — Excellent
📊 Metrics (4 tests)
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 100/100. 0% implementation tests (threshold: 30%). No hard violations. Static review only: test execution was denied by the sandbox.
🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 7.4K
Comment /review to run again
There was a problem hiding this comment.
The split keeps the public behavior. Error precedence is unchanged (strict grant, then batch tool, then failures, then development diagnostics), and the directory-path errorCount increment for strict or batch failures is preserved. go vet ./pkg/cli/ and the new targeted tests pass.
The remaining points are design and coverage suggestions, not defects:
compilePipelineStagecarries batch-option accumulation alongside the compile loop.findDirectoryWorkflowsreturns two positional strings, andfinishDirectorytakes seven parameters.- The new tests do not reach the directory finish path or the dry-run
workflowDirselection.
The existing writeMCPCompileProgress comment still applies to the moved code.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~11 AIC · ⌖ ~2 AIC · ⊞ 5.1K
Comment /matt to run again
| workflows []*workflow.WorkflowData | ||
| resultIndexes []int | ||
| compiledLockFiles []string | ||
| batch batchToolsOptions |
There was a problem hiding this comment.
[/codebase-design] compilePipelineStage now mixes three concerns: the compile loop, result bookkeeping, and batch-option accumulation through the batch field. recordFile fills batch through a long run of if config.X blocks, and both callers set batch.workflowDir late. Consider a small method (for example, collectBatchInputs) so the stage stays a sequencing seam and lock-file routing lives in one place. @copilot please address this.
| // zizmor, poutine, actionlint disabled per-file (batched instead) | ||
| }, | ||
| ) | ||
| func findDirectoryWorkflows(workflowDir string, verbose bool) (string, string, []string, error) { |
There was a problem hiding this comment.
[/improve-codebase-architecture] findDirectoryWorkflows returns (string, string, []string, error), and the first two strings are gitRoot and workflowsDir. The caller at line 113 destructures them by position, so swapping them still compiles. A small named struct (for example, directoryWorkflows{gitRoot, workflowsDir, mdFiles}) would make the order explicit. @copilot please address this.
| return gitRoot, workflowsDir, mdFiles, nil | ||
| } | ||
|
|
||
| func (stage *compilePipelineStage) finishDirectory(ctx context.Context, gitRoot, workflowsDir string, mdFiles []string, purgeData *purgeTrackingData, strictGrantErr, batchToolErr error) ([]*workflow.WorkflowData, error) { |
There was a problem hiding this comment.
[/codebase-design] finishDirectory takes seven parameters, and several (gitRoot, workflowsDir, mdFiles, purgeData) are state the caller already has. finishSpecific repeats the same notice, diagnostics, post-processing, and output sequence. Passing the directory state as one value and extracting that shared sequence into a helper would keep both finish paths aligned. @copilot please address this.
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestCompilePipelineStageRecordsFiles(t *testing.T) { |
There was a problem hiding this comment.
[/tdd] Coverage gap: these tests cover compile bookkeeping, unemitted locks, cancellation, and compilationResultError precedence. None of them reaches finishDirectory, which holds the directory-only errorCount increment for strict or batch failures and the purge step. The dry-run workflowDir selection at compile_pipeline.go:142-144 is also untested. A table test for finishDirectory or a direct test of the workflowDir choice would protect those branches. @copilot please address this.
Comment MemoryPeek at saved memory (spec-review-history)History |
| return nil | ||
| } | ||
|
|
||
| func writeMCPCompileProgress(progressPath string, results []ValidationResult) { |
There was a problem hiding this comment.
🟡 Changes recommended
Strict validation can falsely succeed because NoEmit bypasses Actionlint, Zizmor, and Poutine, while runner-guard scans only the first directory in multi-directory batches.
5 open issues
What changed in this PR
Refactors gh-aw’s compilation pipeline into focused stages, addressing #80720’s maintainability goal and reducing duplicated per-file logic.
Changes:
- Shares compilation bookkeeping and scanner-input collection between specific-file and directory compilation.
- Separates purge, post-processing and notices, with regression tests for bookkeeping, cancellation and error precedence.
- Regenerates 28 workflow locks, changing Claude Code runtime pins from
2.1.331to2.1.325.
| File | Description |
|---|---|
pkg/cli/compile_pipeline_stages.go |
Adds shared per-file compilation and scanner bookkeeping. |
pkg/cli/compile_pipeline_stages_test.go |
Tests bookkeeping, unemitted locks, cancellation and error precedence. |
pkg/cli/compile_pipeline_purge.go |
Isolates purge tracking and cleanup operations. |
pkg/cli/compile_pipeline_postprocess.go |
Isolates manifest generation, cache maintenance and result output. |
pkg/cli/compile_pipeline_notices.go |
Isolates compilation notices, warnings and MCP progress output. |
.github/workflows/step-name-alignment.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/static-analysis-report.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/smoke-claude-sub-agents.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/smoke-claude-routed.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/smoke-claude-routed-anthropic.lock.yml |
Changes both Claude installation pins and version metadata. |
.github/workflows/smoke-claude-dynamic.lock.yml |
Changes agent and detector Claude pins and metadata. |
.github/workflows/smoke-claude-copilot.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/smoke-claude-copilot-auto.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/smoke-claude-auto.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/semantic-function-refactor.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/safe-output-health.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/refiner.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/org-health-report.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/lockfile-stats.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/instructions-janitor.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/go-logger.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/github-mcp-tools-report.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/example-workflow-analyzer.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/engine-conformance-claude.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/deployment-incident-monitor.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/delight.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/daily-vulnhunter-scan.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/daily-safeoutputs-git-simulator.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/daily-safe-outputs-conformance.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/daily-grader-audit.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/daily-elixir-credo-snippet-audit.lock.yml |
Changes Claude runtime pin and version metadata. |
.github/workflows/daily-byok-ollama-test.lock.yml |
Changes the Claude detector pin and version metadata. |
.github/workflows/daily-astrostylelite-markdown-spellcheck.lock.yml |
Changes Claude runtime pin and version metadata. |
Review effort: Max (adaptive)
| } | ||
| } | ||
|
|
||
| if config.Zizmor && !config.NoEmit { |
| if config.RunnerGuard && !config.NoEmit { | ||
| if err := ctx.Err(); err != nil { | ||
| return err | ||
| } | ||
| workflowDir := opts.workflowDir | ||
| if workflowDir == "" && len(opts.lockFilesForDirTools) > 0 { | ||
| workflowDir = filepath.Dir(opts.lockFilesForDirTools[0]) | ||
| } | ||
| err := runBatchDirectoryTool("runner-guard", workflowDir, config.Verbose && !config.JSONOutput, config.Strict, runBatchRunnerGuardOnDirectory) | ||
| err = opts.recordResult("runner-guard", len(opts.lockFilesForDirTools), err) | ||
| if err != nil { | ||
| if config.Strict && firstErr == nil { | ||
| firstErr = err | ||
| } | ||
| } | ||
| } |
| run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.29.20 --rootless | ||
| - name: Install Claude Code CLI | ||
| run: npm install -g @anthropic-ai/claude-code@2.1.331 | ||
| run: npm install -g @anthropic-ai/claude-code@2.1.325 |
| if resolve && len(*stage.results) == 0 { | ||
| appendMCPCachedModelInventoryWarning(stage.config, &result.validationResult) | ||
| } |
| stage.workflows = append(stage.workflows, result.workflowData) | ||
| stage.resultIndexes = append(stage.resultIndexes, len(*stage.results)) | ||
| } | ||
| if stage.config.NoEmit || result.lockFile == "" { |
|
🛠️ Agentic Maintenance updated this pull request branch. |
| compileOrchestrationLog.Printf("Failed to format MCP compile progress: %v", err) | ||
| return | ||
| } | ||
| if err := writeSensitiveFile(progressPath, []byte(output)); err != nil { |


The compilation pipeline combined file orchestration, batch scanners, notices, purge, and post-processing in one large file. This refactor separates those responsibilities and removes duplicated per-file compilation logic.
The refactor preserves the public API and existing compilation behavior.