Repository navigation
Fix CI prompt contracts and YAML scalar round trips - #74058
Conversation
Co-authored-by: Copilot App <[email protected]>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ Warning threat detection engine error What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details.
|
|
✅ 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. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Warning threat detection engine error What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details. Test Quality SentinelOutcome: 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. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. Warning threat detection engine error What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details.
|
This comment has been minimized.
This comment has been minimized.
🏗️ Design Decision Gate — ADR RequiredThis PR has more than 100 new lines in business logic directories (230 in The design decision is in 📄 Draft ADR committed:
📋 What to do next
Once the PR body links an ADR, this gate will re-run and check that the implementation matches the decision. ❓ Why ADRs MatterADRs create a searchable, permanent record of why the codebase looks the way it does. Future contributors, including your future self, can find the reasoning instead of reconstructing it. 📋 Michael Nygard ADR Format ReferenceAn ADR is complete only if it has these four sections:
ADRs are stored in
|
|
Warning threat detection engine error What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details. Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
Request changes
Two actionable regressions need correction before merge.
Findings
- The debug playbook drops the live PR-state reconciliation step, weakening merge-guard safety guidance.
- The scalar rewrite discards excess whitespace on trailing keep-chomping lines, risking data changes during unrelated edits.
The specialist pass completed; its additional speculative/performance concerns were not included. Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~5 AIC · ⊞ 1.7K
Comment /review to run again
There was a problem hiding this comment.
Warning
threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd, and /codebase-design. The core keep-chomping fix is solid: I confirmed the base commit rejects an untouched |+ literal (edited YAML source does not match the requested AST) and the PR head preserves parsed values for untouched, tail, and nested-sequence cases. Leaving as a comment with follow-ups, not a blocker.
📋 Anchor corrections and key themes
Anchor corrections (two inline comments landed on adjacent lines):
- The sequence
followingBlankLinenote belongs atpkg/workflow/actions/source_scalar.golines 61 and 72, not 104. - The shifted-indent suffix note belongs at
source_scalar.goline 109, not 108. - The removed model/engine link is at base
.github/aw/debug-playbook.mdline 149 (LEFT side), not 77.
Key themes
- Shifted-indent coverage gap:
preserveSourceLiteralSuffixreusessourceLiteralIndent(origin); add a test where an enclosing edit re-indents a keep-chomping literal. - Fragile sequence check: the
followingBlankLinelogic depends onNode.String()prefixes; document the invariant or add a comment/CRLF regression case. - Silent fallback in test helper:
promptRenderPlanretries the jobs shape on any unmarshal failure, so a wrong shape can pass quietly. - Playbook budget: the playbook is at its 26000-byte guidance limit at HEAD, so restoring the removed link may require trimming elsewhere.
Positive highlights
- ✅ The post-merge fixup in
emitWithValidationcovers bothemitandEditSourcepaths, including scalar replacement. - ✅ New
TestEditSourcePreservesKeepChompingScalarscovers nested mappings, sequences, folded scalars, and CRLF (26 subtests pass).
@copilot please address the review comments above.
Comments that could not be inline-anchored
pkg/workflow/actions/source_scalar.go:104
**[/diagnosing-bugs]** The `followingBlankLine` decision for sequence children relies on `strings.HasPrefix(value.Values[next].String(), "\n")`. That makes the fix depend on how a node stringifies, not on token positions, so comments or CRLF in the source could flip the result silently. <details> <summary>💡 Suggestion</summary> Add a regression case where a keep-chomping literal is followed by a comment line and then a blank line, in both mapping and sequence form, and assert the output round...
pkg/workflow/actions/source_scalar.go:108
**[/tdd]** `preserveSourceLiteralSuffix` appends the trailing blank lines using `sourceLiteralIndent(origin)`, computed from the original literal. I checked untouched, tail, and nested-sequence keep-chomping literals and they round-trip, but there is no test for a literal whose indentation was shifted by an enclosing edit. <details> <summary>💡 Suggested test</summary> Add a table case that re-indents a keep-chomping literal (for example, moving it under a deeper mapping) and asserts the parse...
pkg/workflow/actions/source.go:105
**[/codebase-design]** The new `preserveSourceLiteralNewlines(body.Body, false)` runs once for the whole emitted body, and both `emit` and `EditSource` route through `emitWithValidation`, so every path is covered. Good. The `false` argument hard-codes that the top-level document has no following blank line. A short comment on why the top level is always `false` would help future readers. @copilot please address this.
pkg/workflow/prompt_render_plan_test.go:28
**[/tdd]** If `yaml.Unmarshal` into `[]promptStep` fails, the helper silently retries as the workflow-jobs shape. A malformed or wrong-shape output can therefore pass with an empty or incorrect env instead of failing on the shape mismatch. <details> <summary>💡 Suggested fix</summary> Detect the shape first (for example, check for a top-level `jobs` key), or assert that the steps list is non-empty after the fallback, so an unexpected shape fails loudly. </details> @copilot please address thi...
.github/aw/debug-playbook.md:77
**[/codebase-design]** This removes the only link from the "Compare one success" section to `debug-model-engine-misconfiguration.md`, while the guide itself still exists and is linked from three other rows. Please confirm the removal was intentional. The playbook also sits at its 26000-byte guidance limit at HEAD, so adding the link back may need wording trimmed elsewhere. @copilot please address this.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⊞ 5.4K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Scalar round-tripping can discard content-bearing whitespace or add extra blank lines before comments, causing unrelated edits to fail semantic validation.
2 open issues
What changed in this PR
Updates gh-aw’s CI test contracts for author-file prompt loading and adjusts YAML source editing to preserve keep-chomping scalar values after syntax merging.
Changes:
- Share prompt-render test helpers and align fixtures and assertions with compiler-selected author files.
- Move scalar newline preservation after syntax merging and add round-trip regression cases.
- Expand merge-guard diagnostic guidance while retaining the playbook’s size limits.
| File | Description |
|---|---|
pkg/workflow/unified_prompt_creation_test.go |
Removes the helper moved into a shared test file. |
pkg/workflow/template_expression_integration_test.go |
Checks author-file prompt configuration. |
pkg/workflow/runtime_import_expansion_integration_test.go |
Updates prompt-loading assertions and import comments. |
pkg/workflow/prompt_render_plan_test.go |
Provides the shared structured prompt-plan helper. |
pkg/workflow/pi_safe_outputs_transport_integration_test.go |
Gives the fixture a workflow directory and workspace. |
pkg/workflow/cache_memory_integration_test.go |
Updates the expected YAML quoting. |
pkg/workflow/actions/source.go |
Runs newline preservation after syntax merging. |
pkg/workflow/actions/source_scalar.go |
Reworks keep-chomping scalar suffix handling. |
pkg/workflow/actions/source_scalar_test.go |
Adds scalar round-trip regression cases. |
pkg/cli/portfolio_analyst_workflow_contract_test.go |
Verifies the configured author file preserves the prompt guard. |
.github/aw/debug-playbook.md |
Adds merge-guard codes and condenses guidance. |
Review effort: Max (auto)
Address PR review feedback with lossless source-edit snapshots, whitespace regression coverage, live PR-state reconciliation, and a completed proposed ADR. Co-authored-by: Copilot App <[email protected]>
|
In response to the review-start notification: No code change is needed for this status-only notification. The actionable findings are addressed in their corresponding review threads. |
|
In response to the Ponytail Reviewer result: No code change is requested by this notification, and I have not treated the no-op result as proof of completed validation or publication. The fixes were checked independently before being pushed. |
|
In response to the Test Quality Sentinel result: Acknowledged the incomplete threat-detection analysis; this is a tooling failure, not a clean result or a security finding. This status-only notice does not identify a code change; the scalar regression suite and guidance checks were run independently. |
|
In response to the PR Code Quality Reviewer result: Accepted and fixed the concrete live-state and scalar-preservation findings in their inline threads. The failed threat-detection analysis remains unavailable, not a security verdict. |
|
In response to the Design Decision Gate notification: Reviewed and completed the generated ADR with the implemented design and actual alternatives considered, preserving the automation's commit. Its status is Proposed pending maintainer review, with no approval or unverified deciders attributed. |
|
In response to the ADR requirement: Completed ADR-74058 with context, decision, actual alternatives, consequences, and the significant-whitespace invariant, and linked it in the PR body. It remains Proposed pending maintainer review rather than recording approval that has not occurred. |
|
In response to the managed review summary: Both recorded findings are addressed: the live PR-state check is restored and excess-indented scalar whitespace is preserved with regression coverage. I left the managed memory unchanged and have not treated the threat-detection failure as a security verdict. |
Retain block mappings and plain keys in EditSource snapshots while JSON-quoting multiline scalars. Preserve semantic validation, cover inserted mapping layout and scalar suffix whitespace, and update ADR-74058. Co-authored-by: Copilot App <[email protected]>
|
🎉 This pull request is included in a new release. Release: |

Main CI and CGO runs were failing on outdated prompt-loading assertions, missing merge-guard diagnostic guidance, and a YAML source-editing defect. This restores those contracts without reverting the author-file prompt boundary or weakening merge guards.
Changes
ADR: ADR-74058: Rebuild Keep-Chomping Scalar Newlines After Source Merging. Completed proposal; maintainer approval is not recorded.
Validation
make buildandmake fmtmake test-guidance(60 tests)go test ./pkg/workflow/actions ./pkg/workflow/codemod -count=1, including edits across all 395 repository workflows and new scalar-whitespace regressionsmake agent-report-progress; final lint, schema, and workflow-drift checks passed withmake agent-report-progress-no-testafter correcting custom-linter diagnostics