Skip to content

🌟 [Major]: Native YAML 1.2.2 commands for PowerShell 7.6/Core#47

Draft
Marius Storhaug (MariusStorhaug) wants to merge 91 commits into
mainfrom
release/v1.0.0
Draft

🌟 [Major]: Native YAML 1.2.2 commands for PowerShell 7.6/Core#47
Marius Storhaug (MariusStorhaug) wants to merge 91 commits into
mainfrom
release/v1.0.0

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 25, 2026

Copy link
Copy Markdown
Member

YAML workflows in PowerShell now have a complete built-in command set for parsing, validating, formatting, merging, reading, writing, and targeted removal using YAML 1.2.2 semantics, delivered without third-party runtime dependencies.

Breaking Changes

PowerShell 7.6/Core is now the supported runtime for this module capability, and Windows PowerShell 5.1/Desktop is out of scope. YAML mappings with duplicate keys are now rejected by design to prevent ambiguous data projection.

New: Complete YAML 1.2.2 command set

The module now provides end-to-end YAML handling with ConvertFrom-Yaml, ConvertTo-Yaml, Test-Yaml, Import-Yaml, Export-Yaml, Format-Yaml, Merge-Yaml, and Remove-YamlEntry.

Command User outcome
ConvertFrom-Yaml Parse YAML text into PowerShell objects
ConvertTo-Yaml Serialize PowerShell objects into YAML text
Test-Yaml Validate YAML syntax and structure without object construction
Import-Yaml Read YAML files directly into PowerShell objects
Export-Yaml Write PowerShell objects directly to YAML files
Format-Yaml Normalize YAML text with representation-preserving, idempotent output
Merge-Yaml Deep-merge two or more YAML streams with configurable policy
Remove-YamlEntry Remove entries by RFC 6901 JSON Pointer path

Changed: YAML processing behavior is stricter and safer

Processing now enforces bounded parse, clone, merge, removal, and emit work budgets, avoids arbitrary .NET type activation, and uses iterative graph traversal to reduce failure amplification on large or adversarial inputs.

Fixed: Conformance and parser/emitter edge-case handling

The implementation resolves conformance and hardening defects across scanner, parser, constructor, serializer, and emitter surfaces, including edge cases around BOM handling, NBSP behavior, flow scalars, and tag decoding. Validation coverage includes 480 passing Pester tests and green cross-platform CI for Windows, Linux, and macOS on PowerShell 7.6.

Technical Details

Related issues

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add YAML 1.2 core-schema construction, safe tag handling, duplicate-key validation, aliases, resource limits, object projection, Test-Yaml, and pinned conformance fixtures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normalize supported PowerShell data, emit a YAML 1.2-compatible subset, preserve repeated acyclic references, reject cycles and normalized duplicate keys, and cover packaging metadata.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document command contracts, safety limits, pipeline behavior, supported data types, unknown-tag handling, and non-preserved YAML presentation details with working examples.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Prefer the workflow-imported artifact so Pester coverage measures real module execution, exclude pinned YAML fixtures from repository config linting, and skip PlatyPS docs generation because it preloads a conflicting YamlDotNet assembly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use yamllint's native ignore rules for vendored spec and invalid parser fixtures without relying on unsupported reusable-workflow environment settings.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Match absolute fixture paths passed by Super-Linter and satisfy repository analysis for the coverage test helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Align workflow pin and packaging assertions to Process-PSModule v6.1.13, and disable Build-Site until this repo migrates from mkdocs to zensical.toml required by the latest release.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace legacy .github/mkdocs.yml with .github/zensical.toml and re-enable normal Build-Site execution under Process-PSModule v6.1.13.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove YamlDotNet artifacts and implement repository-owned layered YAML reader/composer/projector/emitter with iterative graph traversal, safety limits, and explicit tag handling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add deterministic yaml-test-suite runner surfaces for syntax, event-structure, JSON construction, out.yaml comparison, and emitter round-trip accounting; update packaging and regression tests for PowerShell 7.6 Core-only contract and zensical docs config.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mark .zip fixtures as binary in .gitattributes so the pinned yaml-test-suite archive is not altered by line-ending normalization.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Handle explicit keys with node properties followed by indentless block sequences, and add a regression test based on yaml-test-suite 6BFJ out.yaml shape.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add explicit-key indentless-sequence parsing for 6BFJ, and fix suite runner document-array argument passing so multi-document JSON/out.yaml comparisons evaluate all documents. Add regressions and update conformance assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve expanded tags in the representation graph for event comparisons and normalize yaml-test-suite event parsing/output so scalar escapes, style markers, flow markers, and anchor reuse are compared semantically instead of presentation text.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Read and write internal value boxes via raw PSObject properties so empty arrays and nested complex keys are preserved without pipeline-style flattening. Add a regression for nested empty-sequence keys and lock conformance accounting to the new zero-fail corpus counts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Decode %xx escapes as UTF-8 during tag-handle expansion, reject malformed/invalid UTF-8 escapes, and preserve unknown expanded tags in representation comparisons. Update conformance expectations so event surface has no policy differences and keep JSON policy cases explicitly enumerated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Make test bootstrap deterministic by sourcing repository code unless an artifact manifest override is supplied, and make packaging artifact detection resolve from env/output paths so module-local CI does not bind to ambient gallery modules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Inline percent-escape hex parsing in the tag URI decoder to satisfy source linting and recommit the yaml-test-suite release archive as binary bytes so the pinned SHA-256 matches in CI and module-local conformance runs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Consolidates the full 7-layer draft PR stack:
- PR #37: YAML 1.2.2 scanner/parser/emitter engine (ConvertFrom-Yaml, ConvertTo-Yaml, Test-Yaml)
- PR #39: Conformance fixes (tag URI percent-decoding, PS 7.6/Core only)
- PR #40: Engine hardening (20 defect fixes: BOM, NBSP, flow scalars, resource limits, etc.)
- PR #41: File I/O (Import-Yaml, Export-Yaml)
- PR #42: Formatter (Format-Yaml — representation-preserving, idempotent)
- PR #45: Merge (Merge-Yaml — recursive, policy-configurable)
- PR #46: Removal (Remove-YamlEntry — RFC 6901 JSON Pointer, transactional)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MariusStorhaug Marius Storhaug (MariusStorhaug) added the Major Breaking change or major new capability label Jul 25, 2026
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Fail ❌
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Fail ❌
TRIVY Pass ✅
YAML Pass ✅

Super-linter detected linting errors

For more information, see the GitHub Actions workflow run

Powered by Super-linter

NATURAL_LANGUAGE

/github/workspace/README.md
  339:31  ✓ error  Incorrect term: “Base64”, use “base64” instead  terminology

✖ 1 problem (1 error, 0 warnings, 0 infos)
✓ 1 fixable problem.
Try to run: $ textlint --fix [file]
SPELL_CODESPELL
/github/workspace/tests/Export-Yaml.Tests.ps1:244: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:128: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:346: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:349: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:382: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:386: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:394: caf ==> calf
/github/workspace/tests/Import-Yaml.Tests.ps1:397: caf ==> calf
/github/workspace/tests/Merge-Yaml.Tests.ps1:838: nd ==> and, 2nd

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🚀 [Feature]: YAML 1.2.2 data module 🌟 [Major]: Native YAML 1.2.2 commands for PowerShell 7.6/Core Jul 25, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Major Breaking change or major new capability

Projects

None yet

1 participant