Skip to content

Domain tags and topic families

Reference for the domain tag keys this package documents and for topic_family, which collapses topics into families (openspec change groups-and-topology: standard-tags, topology).

Domain tag keys

Workers, triggers and groups carry a free-form tag map. A tag is read only by people, clients and scripts and never changes what the platform or a worker does. Business concepts are tags or config, never properties. Where a value belongs is explained in the WorkManager docs: Properties, config and tags.

The domain keys are declared in naming/virtufin.tags.yaml, a naming fragment's tags: section (fragment format). The infra keys name, managed-by and endpoint are worker-devkit's. Any other key is free-form, but it must not reuse a standard key with another meaning.

Key Meaning Scope Value format Example
type The registry kind of the item: the atomic strategy a strategy worker runs, or the worker registry entry it was created from. workers, triggers, groups regex [A-Za-z0-9_]{1,32}, at least one letter (an identifier with lower case allowed) MA_CROSS, HttpGet
scenario The scenario the item belongs to, the id in sc.<SCENARIO>. Informational only: where the platform must act on a scenario, the scenario tooling maps it onto a group. workers, triggers, groups identifier, as {identifier: scenario} in virtufin.worlds LIVE
world The market-data world the item serves or reads. workers, triggers, groups the virtufin.worlds/world pattern: act or hyp.<WORLD> act, hyp.REPLAY
universe The market-data universe, as in the marketuniverse envelope extension. workers, triggers, groups regex [A-Z0-9_]{1,32} (openspec scenarios, Universe Naming) ALL
venue The venue the item talks to or about. workers, triggers, groups vocabulary: [a-z][a-z0-9-]* binance

The type format accepts every name the registries allow: strategy names are upper-case identifiers, and worker registry entries are mixed case, such as MovingAverageCrossoverPython.

The universe format is the scenarios spec's regex. Unlike an identifier, it allows a value made only of digits, such as 2024.

Names and checks

Take key names from the constants and never spell them. A check refuses a domain key with a value outside its format. Its error (NamingException / NamingError) names the key and leaves out the value. Any other key passes.

C# (Virtufin.Domain.DevKit) Python (virtufin.domain_devkit.tags) TypeScript (@virtufin/domain-devkit)
keys DomainTags.Type, Scenario, World, Universe, Venue, All TYPE, SCENARIO, WORLD, UNIVERSE, VENUE, DOMAIN_TAG_KEYS TAG_TYPE, TAG_SCENARIO, TAG_WORLD, TAG_UNIVERSE, TAG_VENUE, DOMAIN_TAG_KEYS
fragment id DomainTags.FragmentId TAGS_FRAGMENT_ID TAGS_FRAGMENT_ID
check one DomainTags.Validate(key, value) validate_tag(key, value) validateDomainTag(key, value)
check a map DomainTags.Validate(pairs) validate_tags(mapping) validateDomainTags(record or map)
meaning, scope, format DomainTags.Names.Tags names().tags domainNames().tags

A registry that composes more fragments checks every documented key it holds, infra keys included, with the naming library's ValidateTag / validate_tag / validateTag.

from virtufin.domain_devkit import tags

worker_tags = {tags.WORLD: "hyp.REPLAY", tags.UNIVERSE: "ALL", tags.VENUE: "binance"}
tags.validate_tags(worker_tags)          # passes
tags.validate_tag(tags.WORLD, "replay")  # NamingError: tag 'world': the value does not match ...

Topic families

A topic family is a topic with its identity segments (the pair, the worker id, the run id) replaced by *. A feed that publishes one topic per instrument is then one family. The structure comes from the naming fragments. The entity the registry recognizes the topic as says which trailing segments are its identity (scope.path.event.identity; see the derivation rules). Clients collapse topics with this function and copy no family logic.

Python TypeScript
virtufin.domain_devkit.topology.topic_family(topic: str, names: NameRegistry) -> str topicFamily(topic: string, names: NameRegistry): string

names must compose every fragment whose topics are shown. The market topics are market-data-devkit's fragments, and this package does not depend on them. Python's NameRegistry.load() composes every installed package. In TypeScript, compose the devkits' NAMING_FRAGMENTS.

Topic Family
act.exchange.binance.trade.update.BTC_USDT act.exchange.binance.trade.update.*
hyp.REPLAY.exchange.binance.trade.update.BTC_USDT hyp.REPLAY.exchange.binance.trade.update.*
act.exchange.binance.candle.closed.BTC_USDT.1m act.exchange.binance.candle.closed.*.*
wrk.httpget.command.<worker id> wrk.httpget.command.*
dlq.act.exchange.binance.trade.update.BTC_USDT dlq.act.exchange.binance.trade.update.*
wrk.httpget.metrics (unpartitioned) unchanged
x.demo.events, an unrecognized topic, "" unchanged: its own family

Every identity segment is replaced, so a candle family spans all pairs and intervals of one event. The world, venue, scenario and event stay in the family.

The shared vectors are in topology/topic-families.v1.json, with the fixture fragment test.market.yaml. Both the Python and the TypeScript tests run them, and the packages ship them (TOPOLOGY_VECTORS, clients.topology_vectors(name)). The Topology view built on the families is on the Topology page.