topology Specification
Purpose
The Topology view shows how a context's triggers, topics, workers, connections and external endpoints depend on each other, grouped by the groups scripts create, with each node's and group's health, in every client.
Requirements
Requirement: Topology Nodes and Links
A client's Topology view (Infra) SHALL show the active context's triggers, topic families, workers, connections (WebSocketFeed workers) and external endpoints (the distinct endpoint tags), linked only through topics: a trigger to its target topic, a topic to each worker whose input topics include it, a worker to each topic it is recorded to have published to, and a worker to its endpoint. No link SHALL join two workers, or a trigger and a worker, except through a topic.
Scenario: A trigger drives a strategy
- WHEN trigger
tick.1mtargets topicTand strategy workerslistens toT - THEN the view SHALL show
tick.1m→T→s
Scenario: A connection's endpoint
- WHEN feed
fcarriesendpoint=stream.binance.com - THEN the view SHALL show
f→stream.binance.com
Requirement: Topic Families
Topics SHALL be collapsed into families by the topic structure that domain-devkit's naming defines, so a feed publishing one topic per instrument shows one family node with the number of topics. A family SHALL expand to its topics on request.
Scenario: A feed with 300 instrument topics
- WHEN a feed has published to 300 trade topics of one venue
- THEN the view SHALL show one family node with a count of 300, linked to the feed
Requirement: Grouping in the Topology
The view SHALL group nodes by group membership, with groups nested by their parents. - Shared items and groups: an item in several groups, or a group under several parents, SHALL appear in each, marked shared. - Ungrouped items: items in no group SHALL appear under "Ungrouped". - Filter: the view SHALL filter to one group with its descendants.
Scenario: A shared trigger
- WHEN
tick.1mbelongs tomomentum-btcandmeanrev-eth - THEN it SHALL appear under both groups, marked shared
Requirement: Graph and Tree Representations
The web app SHALL offer the Topology view as a graph and as a tree, switchable, keeping the selection and filter when switching. The TUI SHALL offer it as a tree. - Graph: nodes, links and group frames, laid out automatically. - Tree: groups, then their members; a worker expands to its input and output topic families, a trigger to its target topic.
Scenario: Switch representation
- WHEN a user selects worker
sin the graph and switches to the tree - THEN the tree SHALL show
sselected, with its group path expanded
Requirement: Health Levels
Each worker, connection and trigger SHALL have one of four health levels: failing, degraded, idle or ok. A worker stopped or never started by intent SHALL be idle, never failing. A topic family SHALL have no health of its own; a family that workers listen to but that neither a worker is recorded to publish to nor a trigger targets SHALL be marked "no producer seen", as information.
Scenario: A paused worker
- WHEN an operator stops a worker on purpose
- THEN it SHALL show idle, not failing
Scenario: Worker levels
- WHEN a worker is
failed,load-failed, reportslease-lostor a failure status - THEN it SHALL be failing
- AND a worker that is
degraded, reports degraded or disconnected, had agapsince it last came online, or has outputs held by pacing SHALL be degraded, and anonlineworker with none of these SHALL be ok
Scenario: Trigger levels
- WHEN a scheduled trigger's target topic has no listening worker
- THEN it SHALL be degraded, and a scheduled trigger with a listener SHALL be ok
Requirement: Group Health
A group SHALL show the worst level among its non-idle members and its descendants' members, with the count per level (for example "2 of 14 failing"). A group whose members are all idle SHALL show idle.
Scenario: One failing member
- WHEN a group has 13 online workers and 1 failed worker
- THEN it SHALL show failing with "1 of 14 failing", and expanding it SHALL show the failed worker
Requirement: Derived Group Links
The graph SHALL offer collapsing items into their groups, showing a link from group A to group B when a member of A listens to a topic that a member of B is recorded to publish to. These links SHALL be derived, never stored.
Scenario: A strategy group fed by a feed group
- WHEN worker
sin groupmomentum-btclistens to a topic that feedfin groupfeed.binancepublishes to, and both groups are collapsed - THEN the graph SHALL show a link from
momentum-btctofeed.binance
Requirement: Upstream Failing
A worker SHALL be marked "upstream failing" when a worker recorded to publish to one of its input topics is failing. The mark SHALL be information shown next to its own health level and SHALL NOT change that level or its group's level.
Scenario: A feed fails
- WHEN feed
ffails and online strategyslistens to a topicfpublishes to - THEN
sSHALL show ok, marked "upstream failing", withfnamed
Requirement: Topology Data Is Pushed
The view SHALL read the workers, triggers and groups once and follow them through: - the worker lifecycle topic (including recorded output topics and status reports); - the trigger change events; - the group change events.
It SHALL NOT poll, and SHALL NOT subscribe to the topics it shows.
Scenario: A worker publishes to a new topic
- WHEN a worker publishes to a topic for the first time
- THEN the view SHALL add the link from the lifecycle event, without reading the list again
Requirement: No Silence Detection Yet
The view SHALL NOT mark a node as silent or stale for producing less often than expected; that waits until workers and triggers can declare an expected interval.
Scenario: A quiet worker
- WHEN an online worker has published nothing for an hour
- THEN its level SHALL be ok