Repository navigation
Add representation-preserving YAML entry removal #44
Copy link
Copy link
Open
Labels
Description
Why
Configuration authors need to remove selected YAML data without converting the stream into lossy PowerShell objects. Existing object projection cannot preserve tags, complex keys, anchors, aliases, shared or recursive graphs, mapping order, or multiple-document boundaries.
What
Add Remove-YamlEntry as a pure text transformation that removes one or more entries selected by RFC 6901 JSON Pointer while preserving the unaffected YAML representation graph.
Acceptance criteria
- Accept YAML through mandatory pipeline-capable
-InputObject [string[]], aggregate records with LF as one stream, and return exactly one normalized LF-only string without a final newline - Accept one or more mandatory JSON Pointers through
-Path [string[]]; an empty pointer selects a document root, and non-empty pointers require strict/,~0, and~1syntax - Select document zero by default through
-DocumentIndex, or apply every path independently to every original document with mandatory-AllDocuments - Address mapping entries only through ordinal-matching scalar string keys; preserve but never coerce complex, non-string, or unknown-tagged keys
- Address sequences only with canonical non-negative decimal indexes and reject signs,
-, leading zeros, overflow, and malformed values - Resolve and validate every target against an immutable deep-cloned representation graph before applying changes;
-IgnoreMissingskips only unresolved targets - Coalesce duplicate logical targets reached through aliases, let ancestors subsume descendants, and remove sequence children and document roots in descending original index order
- Preserve unaffected tags, anchors, aliases, shared and cyclic identity, complex keys, mapping order, and document order; removing inside a shared collection is visible through every alias, and removing an alias edge removes only that edge
- Remove selected root documents and return an empty string when no documents remain
- Mirror parser and emitter safety controls for indentation, depth, nodes, aliases, scalar length, tag lengths, and numeric length; bound cloning, pointer parsing and resolution, coalescing, mutation, and output validation with classified errors
- Include complete command help, README and example usage, generated documentation and package export coverage, source and built-artifact tests, deterministic self-parse coverage, and cross-platform Process-PSModule validation
Reactions are currently unavailable
Activity
[-]Add representation-preserving YAML merge[/-][+]Add representation-preserving YAML entry removal[/+]MariusStorhaug commentedon Jul 25, 2026
Aligned the stale duplicate merge description with the assigned removal work. - Replaced the duplicate #43 merge scope with the supplied
Remove-YamlEntrycontract - Added representation, pointer, transaction, safety, test, documentation, and stacked-delivery decisions - Recorded current core/test progress and the remaining package, documentation, artifact, and CI gatesMariusStorhaug commentedon Jul 25, 2026
Completed the implementation plan and validation record. - Added the public representation-preserving removal command and transactional graph helpers - Covered strict pointers, documents, ordering, aliases, cycles, tags, limits, determinism, package export, and fresh-process behavior - Updated README, examples, generated command help, and site output - Passed full source and generated-module Pester, parser and analyzer gates, plus Process-PSModule on Windows, Linux, and macOS in run 30149822606 - Kept draft PR #46 stacked on #45
MariusStorhaug commentedon Jul 26, 2026
What changed: Reformatted the issue body to the MSXOrg Issue Format — a local Why plus an outcome-level What/acceptance criteria. Removed the Technical Decisions and Implementation Plan sections (and other implementation-tradeoff notes).
Why: Issue bodies should state local purpose and observable outcome without leaking implementation detail into the outcome-level description; durable technical decisions belong in the PR/design, not the tracking issue.
Follow-up: None.
Drop Remove-YamlEntry from README and usage example
MariusStorhaug commentedon Aug 2, 2026
Deferring this out of the v1.0.0 module go-live (#47).
The initial release scopes the module to a focused YAML surface: parse/serialize (
ConvertFrom-Yaml,ConvertTo-Yaml), validate against the YAML 1.2.2 specification (Test-Yaml), import/export files (Import-Yaml,Export-Yaml), format (Format-Yaml), and merge streams (Merge-Yaml). Representation-preserving entry removal via a JSON Pointer path is a mutation surface that sits outside that core intent, soRemove-YamlEntryand its helpers have been removed from the release branch to keep v1.0.0 tight and well-defined.This issue stays open as a deferred candidate for a future release. PR #47 references it as a non-closing, deferred link rather than a closing keyword, so cutting v1.0.0 will not auto-close it.
🌟 [Major]: New PowerShell module v1.0.0 with complete YAML 1.2.2 comm…
MariusStorhaug commentedon Aug 7, 2026
Alignment note from the YAML 1.2.2 gap pass:
This issue should align with the representation-level backlog now split into focused issues:
<<remains ordinary YAML 1.2 mapping data.For idiomatic PowerShell,
Remove-YamlEntryshould keep a clear parameter-set boundary between document selection (-DocumentIndexversus all documents), path selection, and transformation policy. It should continue to operate as a representation-preserving pipeline command rather than projecting to rich PowerShell objects and back.Official references: