Rename planner and document rewrite: rewrite_documents moves qualified names of the renamed flow in every flow (ports, inputs, outputs) and dashboard binding (one key table, WIDGET_BINDINGS, shared with the WidgetDef accessors, legacy pages included), published and draft, as plain JSON with both variants above either version; plan_rename reports documents, counts, fingerprint, warnings and refusals; superuser plan routes for flows and dashboards; key residue classifies state as the mapper does; duplicate retargets inputs and outputs too; queue reports its Redis version and other consumers

This commit is contained in:
2026-11-02 21:06:39 +01:00
parent 81bd7c2724
commit fa2a213631
14 changed files with 1922 additions and 41 deletions
+30
View File
@@ -219,6 +219,36 @@ class WidgetFootprint(Placement):
type: WidgetType
#: Where a widget's config names a message, as paths into it
#: (`namespace.rebind`), each with the accessor of `WidgetDef` that reads it. A
#: rename rewrites exactly these, and leaves titles, labels and every other
#: config string alone, so a binding the accessors read and this does not list
#: would keep its old name. A registry test holds the two to each other.
WIDGET_BINDINGS: tuple[tuple[str, ...], ...] = (
("message",), # `messages`, and a bar's first row (`bar_rows`)
("target",), # `target`
("request",), # `target`, of a querying chart
("series", "*", "message"), # `messages`, of a chart
("rows", "*", "message"), # `bar_rows`
("inner",), # `inner_bindings`, as one name
("inner", "*", "message"), # `inner_bindings`, as a list
("reading", "message"), # `reading`
("runs", "metric"), # a chart of runs: a recorded series, named as a message
)
#: The same for a whole stored document: the bound settings
#: (`DashboardDef.setting_messages`), the widgets, and the widgets of a
#: document still written as pages and sections (`_flatten_pages`).
DASHBOARD_BINDINGS: tuple[tuple[str, ...], ...] = (
("settings", "*", "message"),
*(("widgets", "*", "config", *path) for path in WIDGET_BINDINGS),
*(
("pages", "*", "sections", "*", "widgets", "*", "config", *path)
for path in WIDGET_BINDINGS
),
)
class WidgetDef(BaseModel):
"""One tile: what it shows or does, and where it sits.