Abc
pipelines.enrichment.tags.abc
Summary
Abstract contracts for the tags enrichment family (no implementation).
The tags family chains resolved entities into tags:
1 | |
It consumes the output of the entity family (entity.name + amount) and emits
tags. TagsPipeline is the hexa root; TagsFinalizePort dedupes tags and
defaults to ["misc"].
Classes
EntityFlagsPort
Bases: RegistryPort, ABC
entity.name + candidate.flags → entity_* flags via ENTITY_BASED_FLAG_MAPPING.
Attributes
config
property
Per-node config injected via set_config.
Returns:
| Type | Description |
|---|---|
|
dict | None: The per-node config, or None before injection. |
Functions
resolve
abstractmethod
Yield forks with entity_* flags appended from the entity name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Incoming dagpipe state carrying |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
Forked states carrying updated candidate flags. |
set_config
Inject the per-node config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
dict
|
Per-node config from the dagpipe spec. |
required |
set_registry
Inject the merged pattern registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
PatternRegistry
|
The merged pattern registry. |
required |
SetTagsPort
Bases: RegistryPort, ABC
candidate.flags → tags via FLAGS_BASED_TAGS_RULES.
Attributes
config
property
Per-node config injected via set_config.
Returns:
| Type | Description |
|---|---|
|
dict | None: The per-node config, or None before injection. |
Functions
resolve
abstractmethod
Yield forks with tags populated from candidate flags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state |
State
|
Incoming dagpipe state carrying candidate flags. |
required |
Yields:
| Name | Type | Description |
|---|---|---|
State |
Iterable[State]
|
Forked states carrying the emitted |
set_config
Inject the per-node config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config |
dict
|
Per-node config from the dagpipe spec. |
required |
set_registry
Inject the merged pattern registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry |
PatternRegistry
|
The merged pattern registry. |
required |
TagsFinalizePort
Bases: FinalizePort, ABC
terminal states → {"tags": [...]} (deduped, default ["misc"]).
Functions
process
abstractmethod
Build the tags result dict from the terminal states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
states |
List
|
Terminal states from the dagpipe graph. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The tags result dict. |
TagsPipeline
Bases: ABC
Root — wires amount_flags → entity_flags → set_tags, then runs the graph.
Attributes:
| Name | Type | Description |
|---|---|---|
amount_flags |
AmountFlagsPort
|
Amount-flags stage port. |
entity_flags |
EntityFlagsPort
|
Entity-flags stage port. |
set_tags |
SetTagsPort
|
Set-tags stage port. |
finalize |
TagsFinalizePort
|
Terminal finalize port. |
Functions
enrich
abstractmethod
Enrich an entity payload into a tags result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload |
dict
|
Payload carrying |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
The tags result dict. |