Skip to content

🪲 [Fix]: Escaped YAML tags preserve their exact identity#39

Draft
Marius Storhaug (MariusStorhaug) wants to merge 7 commits into
yaml-conversion-foundationfrom
yaml-conformance-fixes
Draft

🪲 [Fix]: Escaped YAML tags preserve their exact identity#39
Marius Storhaug (MariusStorhaug) wants to merge 7 commits into
yaml-conversion-foundationfrom
yaml-conformance-fixes

Conversation

@MariusStorhaug

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

Copy link
Copy Markdown
Member

This draft is stacked on yaml-conversion-foundation / #37 and contains only the remaining representation, conformance-policy, corpus, and CI artifact remediation. The updated base now owns the tag URI decoder itself; this PR does not duplicate that parser implementation.

What changed

  • Verifies YAML 1.2.2 tag URI decoding through the built module for %21, multibyte UTF-8 escapes, malformed/incomplete escapes, and invalid UTF-8.
  • Preserves unknown local and global tags exactly in representation nodes/events while keeping public PowerShell value projection neutral.
  • Removes unknown-tag event policy fallback. Event differences are failures.
  • Restricts syntax/composition policy to 2JQS and X38W with reason RepresentationMappingKeyUniqueness; both inputs are syntactically recognized and their representation events pass before load/composition rejects non-unique keys.
  • Restricts JSON projection policy to 565N (BinaryByteArrayProjection) and J7PZ (LegacyOrderedMapProjection). Exact value validators and mutation regressions prevent these case IDs from masking unrelated mismatches.
  • Restores the official data-2022-01-17 archive, records source/data commits and SHA-256, and prevents ZIP EOL normalization.
  • Makes artifact imports terminating and validates generated metadata, exact exports/FileList, no Desktop/.NET Framework/assemblies/DLLs, and a fresh Core 7.6+ import/round trip.

Base CI failures and fixes

  • Conformance: the checked-in ZIP had been text-normalized/corrupted; it contained records but extracted no corpus files and no longer matched the expected hash. This PR restores the official 402-input archive (47C173AFFEB480517B30FB77DC8C76FD48609B9B65DD1C1D3D0D0BAEE48D6AA9) and explicitly unsets ZIP EOL handling.
  • Packaging: Process-PSModule derives generated runtime metadata from source #Requires; the source manifest alone left the artifact at PowerShell 5.1 with Desktop compatibility. The updated base supplies one module-header requirement pair (7.6, Core), and this PR locks the generated artifact contract with terminating built-module tests.
  • Built-module test routing: representation inspection now executes private helpers in module scope, so Linux/macOS/Windows artifact jobs cannot silently fall back to dot-sourced source.

Official corpus results

Latest official source release remains v2022-01-17 (45db50aecf9b1520f8258938c88f396e96f30831); data tag commit is 6e6c296ae9c9d2d5c4134b4b64d01b29ac19ff6f.

Surface Pass PolicyDifference Fail NotApplicable
Syntax and composition 400 2 0 0
Representation events 308 0 0 94
JSON projection 277 2 0 123
out.yaml projection 241 0 0 161
Emit and round trip 306 0 0 96

Validation

  • Local PowerShell 7.6.4 / Core: full source Pester 158 passed, 0 failed, 2 artifact-gated skips (160 total).
  • Built artifact: packaging + conformance 20 passed, 0 failed, 0 skipped; fresh runtime marker powershell-runtime=7.6.4;edition=Core.
  • Complete artifact-backed 402-input corpus: exact totals above; no unexplained failures.
  • PSScriptAnalyzer: 0 findings. Parse checks: 65 files, 0 errors.
  • Generated docs/site: 3 command docs, 17 site files, Zensical 0.0.47.
  • Manual Process-PSModule run 30038857884: success, including conformance and packaging on Windows, Linux, and macOS. All three packaging jobs reported actual runtime PowerShell 7.6.3 / Core.

Remaining limitations

  • This remains a draft stacked PR and depends on Draft: repository-owned YAML processor (Core 7.6+ conformance zero-fail) #37 / yaml-conversion-foundation landing first.
  • The workflow only attaches PR checks for PRs targeting main, so the stacked PR has no native check suite; the successful manual dispatch above validates the final head SHA.
  • The two source-run skips are artifact-only gates and pass in the separate built-artifact run.
  • Local Zensical reports the existing generated-site warning that README.md links to CONTRIBUTING.md, which is not copied into the generated site.
  • Unknown application-tag semantics are intentionally discarded only during PowerShell value projection; their representation tags remain exact.

No issue is linked because this remediation was requested directly as follow-up work for #37.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant