@@ -2,31 +2,61 @@ function Assert-YamlRemovalGraph {
22 <#
33 . SYNOPSIS
44 Validates a removed representation graph and its resource budgets.
5+
6+ . DESCRIPTION
7+ Traverses the post-removal representation graph to enforce depth, node,
8+ alias, scalar, and tag limits before emitting YAML. It also rechecks
9+ tagged collection invariants and duplicate-key comparisons so removed
10+ output remains valid and deterministic.
11+
12+ . EXAMPLE
13+ Assert-YamlRemovalGraph -Documents $documents -Depth 100 -MaxNodes 100000 -MaxAliases 1000 -MaxScalarLength 1048576 -MaxTagLength 1024 -MaxTotalTagLength 65536 -State $state
14+
15+ Validates the mutated documents and throws a classified removal exception if an output limit is exceeded.
16+
17+ . LINK
18+ https://psmodule.io/Yaml/Functions/Remove-YamlEntry/
519 #>
620 [CmdletBinding ()]
721 param (
22+ # The post-removal document roots are walked so validation covers exactly
23+ # what will be emitted.
824 [Parameter (Mandatory )]
925 [AllowEmptyCollection ()]
1026 [object []] $Documents ,
1127
28+ # The depth limit prevents a removal result from producing an over-deep
29+ # graph.
1230 [Parameter (Mandatory )]
1331 [int ] $Depth ,
1432
33+ # The node limit bounds traversal, duplicate-key comparison, and output
34+ # graph size.
1535 [Parameter (Mandatory )]
1636 [int ] $MaxNodes ,
1737
38+ # The alias limit keeps emitted alias count within the caller's resource
39+ # budget.
1840 [Parameter (Mandatory )]
1941 [int ] $MaxAliases ,
2042
43+ # The scalar length limit rejects oversized decoded scalar content after
44+ # mutation.
2145 [Parameter (Mandatory )]
2246 [int ] $MaxScalarLength ,
2347
48+ # The per-tag limit prevents an emitted node from carrying an oversized
49+ # expanded tag.
2450 [Parameter (Mandatory )]
2551 [int ] $MaxTagLength ,
2652
53+ # The cumulative tag limit bounds total expanded tag text across the
54+ # output graph.
2755 [Parameter (Mandatory )]
2856 [int ] $MaxTotalTagLength ,
2957
58+ # The shared removal work state accounts validation operations against
59+ # the invocation budget.
3060 [Parameter (Mandatory )]
3161 [pscustomobject ] $State
3262 )
0 commit comments