Add the connector contract, reusable nodes and per-port intervals

Connectors are the device-facing node class third parties write, so the
surface they build against is versioned and documented: ConnectorNode carries
a declared contract version, a polling loop that publishes only what changed
and reports health around it, and parameters whose credential fields are
marked x-secret so the editor offers the secrets store instead of a text box.
They are found through the fluksio.node_types entry point group, with the
package's own metadata as the manifest. docs/connectors/ has the contract and
the authoring guide; connector-skeleton/ is a working one to copy.

The controller no longer knows what any node type is: start, stop and
report_health are protocol methods on Node, and the built-ins were migrated to
them first, so the hooks a connector implements are the ones the engine has
been driving all along.

Marking a node reusable moves its source to _lib/ and points the node at it by
name. Other flows instantiate it with their own ports and settings, one fix
reaches all of them, and a shared source still in use cannot be deleted.

Ports gained an interval: an output publishes, and an input wakes its node, at
most every n seconds. State keeps the latest value, so only the delivery is
skipped, and pressing Run is never throttled.

Also fixes autosave sending no version on its first save of a session, which
made every flow saved more than once conflict with itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Melvin Strobl
2026-08-15 23:57:44 +02:00
co-authored by Claude Fable 5
parent 7344eac262
commit 3724b68f23
22 changed files with 1541 additions and 62 deletions
+8 -3
View File
@@ -27,9 +27,14 @@ Deferring because out of scope is fine, but don't mention deferring than.
- FEAT/UI: publishing and discarding are only reachable while no side panel is open, since the
floating chrome hides for the panel. Editing a node's code and publishing it is therefore
close-panel-then-publish.
- FEAT/UI: no way to point a node parameter at a stored secret. The store and the
`{"$secret": "name"}` reference both work, but the params form only produces literals, so a
webhook secret typed there lands in `flow.json`.
- FEAT/UI: there is no screen for managing the secrets store itself. A node parameter marked
`x-secret` offers the stored secrets, but they can only be created through the API.
- FEAT/FLOW: input discretization drops the trailing edge — if a producer goes quiet inside
the window, the consumer never sees the last value. Delivering it at the end of the window
needs a timer per (node, port).
- CHORE/FLOW: shared node sources bypass the draft/publish split. Editing one writes the
library copy and reloads immediately, since the code is not any single flow's to hold back.
Deliberate, but it means a shared node is the one thing publish does not gate.
- FEAT/UI: flow-level edits (title, inputs) go through `FlowPanel.onChange` and stay outside
the undo stack.
- CHORE/UI: `make test-backend` cannot reach Postgres while the integrated stack is up —