docs(chord): reload's failed option for plugins kept before staging

This commit is contained in:
Mario Zechner 2026-10-30 15:42:41 +00:00
parent 318d9add68
commit 26e05e64f0
2 changed files with 5 additions and 2 deletions

View file

@ -1843,7 +1843,9 @@ type ReloadReport = {
is missing) is kept old too, so a consumer edited together with a broken provider keeps working on its old code. At
startup the same holds: `load` leaves a failing plugin out and resolves with `{ failed: [{ plugin, error }] }`; its
consumers wait `failed { waiting }`; `load` never closes the host for a plugin (base code decides whether its core
failing is fatal). What no rule detects: a consumer relying on new behaviour of a kept provider whose contract did not
failing is fatal). A loader that kept a plugin on its loaded facet because its new code failed before staging (its
build, its evaluation) tells the host with `reload(facets, context, { failed })`: the host lists it and applies the
closure rule to it as to a plugin whose staging failed. What no rule detects: a consumer relying on new behaviour of a kept provider whose contract did not
change (as in a rollout across hosts). Runtime states (registry conflicts, failed opens, migrations) stay per object
after the commit (`onError` as always).
- **Staging** runs every facet's setup into a staged table beside the live one (types with their factory, `linger` and

View file

@ -105,7 +105,8 @@ Decision "Per plugin at startup and reload" changes `host.load` and `host.reload
records them with their contract versions) would not bind because the plugin they need was kept old, or is missing,
is kept old too (repeat until stable). The report gains `failed: [{ plugin, error }]` (the same list as `load`'s; an added plugin that fails is left out); the commit applies the rest.
- **The component** builds and evaluates per plugin: a plugin whose build fails or whose evaluation throws is passed to
the host as its loaded facet (kept) at a reload, left out at startup, and reported with the host's report.
the host as its loaded facet at a reload, with `reload(facets, context, { failed })` naming it (the host applies the
closure rule to it and lists it in `failed`), left out at startup and reported with the host's report.
`plugins.load(host, ctx)` and `plugins.reload(host, names, ctx)` keep, per host, the facet loaded for every plugin, so
`reload` always passes the complete set (unchanged plugins as the same facet object, removed ones left out) and never
restarts an unchanged plugin.