topmark.presentation.shared.outcomes¶
topmark / presentation / shared / outcomes
CLI-oriented outcome helpers.
This module layers CLI semantic styling concerns on top of the pure bucketing
logic in topmark.pipeline.outcomes.
It is Click-free by design, so it can be reused from tests and other frontends.
get_outcome_style_role ¶
Return the semantic style role used for a given outcome.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outcome
|
Outcome
|
The public outcome. |
required |
Returns:
| Type | Description |
|---|---|
StyleRole
|
The semantic |
Source code in src/topmark/presentation/shared/outcomes.py
get_outcome_styler ¶
Return the semantic text styler used for a given outcome.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outcome
|
Outcome
|
The public outcome. |
required |
Returns:
| Type | Description |
|---|---|
TextStyler
|
The CLI text styler resolved from the mapped semantic |
Source code in src/topmark/presentation/shared/outcomes.py
collect_outcome_counts_styled ¶
Return styled summary rows grouped by (outcome, reason).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
list[ProcessingContext]
|
Processing contexts to classify and count. |
required |
Returns:
| Type | Description |
|---|---|
list[tuple[OutcomeReasonCount, TextStyler]]
|
Stable summary rows paired with the CLI text styler for their semantic outcome role. |