Count destination wrappers in shared input limits

This commit is contained in:
2026-10-14 13:31:32 +00:00
parent 2f5d57ce1d
commit c71faf2065
5 changed files with 208 additions and 6 deletions

View File

@@ -312,7 +312,7 @@ Done: diagnostics consistently distinguish application paths from source syntax.
## Stage 7 — Complete shared placement accounting
Status: planned. Scope: resource bounds with no new public limit system.
Status: complete. Scope: resource bounds with no new public limit system.
1. Wire Stage 2's prechecks and synthetic-node charges into both tracked ordinary
acquisition and import traversal, using `importAccounting` and current limit
@@ -327,8 +327,18 @@ Status: planned. Scope: resource bounds with no new public limit system.
empty mappings. Verify root placement and NoSource do not add charges.
Preserve history/expansion limits; do not turn fixture values into defaults.
Validate: destination/limit/import/override tests and everyday check. Done:
placement cannot bypass current budgets and introduces no unrelated caps.
Validated with `go test ./internal/engine -run 'Destination|Import|Grouped|Overlay|Override'`
and `./scripts/check.sh` (go1.26.8 linux/amd64); both passed. New coverage in
`TestDestinationPlacementCountsAgainstSharedNodeBudget`,
`TestMultipleMountedInputsSharePlacementCharges`,
`TestImportedEmptyBodiesChargeEachDestinationWrapper`,
`TestSelectedOverlayAndCLIUsePlacementNodeCharges`, and
`TestNoSourceAndRootPlacementAddNoWrapperCharges` checks totals below, at, and
above the boundary, multiple shallow inputs, imported empty bodies, and charging
of upper tiers from mounted inputs. `TestPlaceDocumentRootAndBounds` continues
to cover per-document depth/node boundaries; existing grouped accounting tests
cover unchanged raw source/byte charging. Done: placement cannot bypass current
budgets and introduces no unrelated caps.
## Stage 8 — Preserve provenance, history, and source resource contexts