fix(boot): own the rows a config override sets, queue recompositions, and let records follow the configuration

Second review round on the contained-group composition:

- Ownership scanned only `insert` rows, so an external bundle could set a
  built-in row's id as a child through `{ id: own, config: [...] }` and the
  Loader re-parented that row under the bundle while `originOf` still named
  the built-in layer. The rows an id-targeted patch sets as a group's config
  now count as the layer's own: an external bundle that sets an id another
  layer owns is left out whole, a built-in layer that takes another layer's
  id fails loud, and a layer restating its own child is not a repeat.
- `recompose` read the committed profile before awaiting the update, so a
  watcher firing while a bundle was being enabled composed the tree before
  the enable and applied it after; the plugin vanished while `layers` kept
  listing it. Recompositions now queue, each reading what the previous one
  committed, and a rejection stays its own caller's outcome.
- A patch that replaced a built-in target's config removed the wrapper the
  bundle had put there, yet later inserts still targeted the detached
  wrapper and vanished. The composition forgets the wrapper on such an
  override and creates a new one under the same id.
- Generated wrapper ids bypassed the duplicate check, so a bundle declaring
  a row spelled like a wrapper produced two nodes with one id. Declared and
  generated ids now go through one registration.
- Failure records outlived their rows when a bundle update dropped a failed
  row without unmounting the group, or when a pending row sat in a plain
  nested group whose id the record named. A contained group now drops the
  records of rows its configuration no longer names after each update, and
  the audit records every row under the contained group that isolates it.
- `applyEntryPatches` assigned override values by reference, so applying a
  patch list carried a later insert's rows back into the patch object; the
  vendored include now clones object-valued overrides as it does inserts.
This commit is contained in:
Yichen Jiang committed 2026-09-07 11:28:19 +08:00
1 parent 8357838bc5
commit aaf58eb5bf
23 files changed
+344 -86

No files matched your search

+2 -2
View File
@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write docs/subsystems/core.md
core.md: 9a8633a4e62b87f98629df95a96aa5b1910f50e9
core.zh.md: f204532ed2dcb862587c23892af37c50684b0483
core.md: 44975507f4a31aae49b644593a4dcc74864df629
core.zh.md: b91f236cf4d65928e5806d8d30d75c23d7b5f703
+3
View File
@@ -870,6 +870,9 @@ userDisabledRowIds(): Set<string>
* its ownership, and its conflicts become the committed composition only
* once the update holds; until then, and after a rejection, `current`,
* `layers`, `originOf`, and `conflicts` keep describing the running tree.
* Calls queue: one that arrives while another is in flight starts after it
* settled and reads what it committed. A rejection is that call's outcome
* alone and does not stop the ones behind it.
* @param options - `reloadBundles` re-reads the profile manifest first, so a
* bundle enabled or installed since boot joins the stack.
* @throws when the root include is not mounted, or the Loader rejected the update.
+3
View File
@@ -880,6 +880,9 @@ userDisabledRowIds(): Set<string>
* its ownership, and its conflicts become the committed composition only
* once the update holds; until then, and after a rejection, `current`,
* `layers`, `originOf`, and `conflicts` keep describing the running tree.
* Calls queue: one that arrives while another is in flight starts after it
* settled and reads what it committed. A rejection is that call's outcome
* alone and does not stop the ones behind it.
* @param options - `reloadBundles` re-reads the profile manifest first, so a
* bundle enabled or installed since boot joins the stack.
* @throws when the root include is not mounted, or the Loader rejected the update.