fix(address-space): announce surgically-added raw nodes; equipment-with-references removal stays surgical (#599)

- AnnounceAddedNodes raises NodeAdded in the Raw realm for the existing parents of
  added raw containers/tags (ComputeRawAddAnnouncements); Uns side unchanged.
- ApplyPureRemove removes UNS reference variables BEFORE the equipment subtree, so a
  reference the subtree's id-prefix scope reaches no longer ratchets to a full rebuild
  (03/P5). A NotSubsumed filter was not used: in production a reference NodeId is
  Area/Line/Equipment/Name, outside the subtree scope, so filtering would leak it.
  The matching RemoveEquipmentSubtree severing (03/S20) is in the node-manager commit.
- UnsReferenceBackingParityTests: reflection guard discovering the classifier's surgical
  raw-tag whitelist and requiring a same-typed mirror field (03/U11).

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-08 07:12:29 -04:00
parent 3baa332d6b
commit 0bd3ec00e4
6 changed files with 414 additions and 38 deletions
+12 -3
View File
@@ -99,9 +99,18 @@ mirror **in place** (its MonitoredItems survive); a re-point or effective-name c
removes and recreates **that one mirror node**. See [`Uns.md`](Uns.md) and
[`plans/2026-08-15-surgical-deploys.md`](plans/2026-08-15-surgical-deploys.md).
⚠️ A surgically added raw container/tag is materialised but **not** announced —
`AnnounceAddedNodes` is UNS-only, so model-aware clients see new raw nodes on their next
browse. This mattered less when every add forced a rebuild (and therefore a re-browse).
A surgically added raw container/tag is **announced** (Gitea #599): `AnnounceAddedNodes`
raises a `GeneralModelChangeEvent(NodeAdded)` in the **Raw** realm for each distinct
existing parent of the added nodes (a parent that is itself new in the same deploy is
skipped — its own parent is announced, and a re-browse there finds the whole new subtree;
a new top-level folder announces itself). UNS-side adds announce in the Uns realm as
before. Until #599 raw adds were materialised but never announced, so model-aware clients
only saw them on their next browse — invisible while every add still forced a rebuild.
Removing an equipment that holds UNS references is also surgical: the references are
removed (terminal Bad, then `RemoveVariableNode`, which severs the backing raw node's
inverse `Organizes` edge) **before** the equipment subtree, and the subtree removal severs
the same edge for anything it reaches itself (archreview 03/P5 + 03/S20).
## The `Calculation` driver