Repository navigation
Preserve indentation-sensitive prompt chunks in compiled YAML - #78624
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…changed Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
✅ 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.
|
This comment has been minimized.
This comment has been minimized.
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ 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. 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. 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.
|
Comment MemoryPeek at saved memory (spec-review-history)History |
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.
|
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (210 new lines under 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate re-runs and verifies that the implementation matches the decision. 🔍 Gate evidence
|
There was a problem hiding this comment.
Request changes: the new YAML repair path does not actually preserve trailing blank lines unless another unrelated value triggers the AST serialization path. This can silently alter prompt content during compilation.
Highlights
- Fix the
repairedflag so the trailing-blank-line mutation is not discarded. - Add coverage where the trailing-blank-line case is the only repair needed.
- Static review only; tests were not run.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🔵 Needs a closer look
Conditional AST re-encoding affects shared serialization across multiple compiler paths, requiring broader semantic review to assess preservation of scalar values, comments, whitespace, and sequence indentation.
No open issues 🎉
What changed in this PR
This PR addresses #76963 by preserving indentation-sensitive prompt chunks when gh-aw compiles workflows into GitHub Actions YAML, without trimming content or changing chunk boundaries.
Changes:
- Adds shared YAML serialization that quotes whitespace-sensitive multiline values while retaining ordinary literal formatting.
- Validates prompt content after serialization and before emission, rejecting malformed YAML or altered values.
- Adds regression tests for indented chunks, whitespace preservation, and round-trip validation failures.
| File | Description |
|---|---|
pkg/workflow/yaml.go |
Uses safe serialization for field-ordered YAML. |
pkg/workflow/yaml_options.go |
Adds whitespace-preserving multiline serialization. |
pkg/workflow/yaml_options_test.go |
Tests round trips with two YAML parsers and formatting compatibility. |
pkg/workflow/workflow_import_merge.go |
Applies safe serialization to merged services. |
pkg/workflow/runs_on_snippet.go |
Applies safe serialization to runner snippets. |
pkg/workflow/run_step_sanitizer.go |
Preserves sensitive multiline values when re-serializing steps. |
pkg/workflow/frontmatter_extraction_yaml.go |
Uses safe serialization for extracted YAML sections. |
pkg/workflow/credential_free_prompt.go |
Safely serializes prompt steps and validates content before emission. |
pkg/workflow/credential_free_prompt_test.go |
Tests indented prompt chunks and validation failures. |
pkg/workflow/compiler_yaml_step_conversion.go |
Uses safe serialization when converting step maps. |
pkg/workflow/compiler_custom_job_execution.go |
Uses safe serialization for custom-job fields. |
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd, and /grill-with-docs. Requesting changes: the indentation fix works for the common case, but a dead branch and a single-line whitespace gap mean some values still change on round trip.
📋 Key Themes & Highlights
Key Themes
- Dead branch: the trailing-blank-line branch in
marshalYAMLWithOptionsnever setsrepaired, so output depends on sibling values. - Single-line whitespace gap: a single-line value with a leading tab is emitted as a plain scalar and does not round-trip. New tests only cover multiline values.
- Validator scope:
validatePromptContentRoundTripchecks re-marshal stability, not the original chunk text. - Pre-existing failure:
TestCredentialFreePromptEnvironmentinjectsGITHUB_TOKENand then asserts it is absent. The failing lines are not in this PR, so this is not a regression from it, but it should be fixed or tracked separately.
Positive Highlights
- ✅ Comment preservation survives the repaired path (
# v9.0.0kept). - ✅ Indentation matches the plain path (
ports:/- 5432:5432), so no layout regression. - ✅
gofmtis clean and the newTestCredentialFreePromptPreservesIndentedChunkspasses. - ✅ The
DefaultMarshalOptionsconsistency test was extended to cover sibling-triggered repair.
Skill selection: triage output was not used, so skill selection followed the inline guidance directly.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "0868e331851ae6918982470ca96d435370927f9a",
"kind": "requested",
"schema_version": "1",
"state": "0e872e6187a652c7bf6652d691bc34d14bfc199dcf572dc8c13d22b1e80ba5ad",
"work": [
"02bee0af83a701a8793c4b808f54aa7f18c76f25a6dba559c526979c7046b048",
"a4c47f646d0bf82b594675b1c7174581cad35a7f77aaa4072ad3dcf95d2b7d11",
"dc1088bc94ebbfcd4f3efa02158d8309b64550f25c412beb6f48f500001e21c1",
"fe0d4561245ac251e86314998185d23018f6c4cb49d73b16c144c242d60bc72d"
],
"workflow": "pr-sous-chef"
}
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ock-file Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
@copilot fix ci failures |
…ock-file Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…pt validation Co-authored-by: Copilot App <[email protected]>
Merged main using
Fixed in 049b6b1: regenerated stale WASM goldens and workflow locks. Merging main in d21dbaa also brought in the overflow-test correction. CGO passed on that revision: https://github.com/github/gh-aw/actions/runs/44134351322. Local focused/WASM tests and drift checks pass. The final local gate reports unrelated existing custom-linter findings; CodeQL timed out. |
|
🎉 This pull request is included in a new release. Release: |
Prompt chunks beginning with indentation can become invalid bare YAML literals during re-marshaling. Literal encoding can also silently lose whitespace, including newline-only chunks.
GH_AW_PROMPT_CONTENT_*value with its intended text. Reject malformed or altered output before emission.Indentation-sensitive content is represented as an escaped scalar: