remote_termination
Normalized job-termination classification: value set and rendering.
When a remote job dies, why it died (Spot reclamation, OOM, timeout, node failure, ...) is a fact the backend knows with varying certainty. snakesee does not classify terminations itself — that happens upstream (the executor, which has the cloud context) and arrives on the event as a structured triple:
termination_category — what kind of death (this module's TERM_* values)
termination_source — where the classification came from (provenance)
termination_confidence — how sure the producer was (high / low)
snakesee's only job is to render that classification honestly: a high-confidence classification is stated firmly, a low-confidence (heuristic) one is phrased tentatively, so the UI never asserts something a lower layer merely guessed.
This module is the reader-side half of the contract; the executor defines the same value strings independently (the two packages can't share code).
Functions:¶
format_termination_marker ¶
Render a one-line termination marker, phrased by confidence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str | None
|
The termination category (a TERM_* value, or a forward-compat string). None or TERM_UNKNOWN yields no marker. |
required |
confidence
|
str | None
|
CONFIDENCE_HIGH renders a firm marker; anything else (including None) renders a tentative one. |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
A marker string, or None when there is nothing meaningful to assert. |
Source code in snakesee/remote_termination.py
format_termination_source ¶
Render the provenance of a termination classification as a "via ..." phrase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str | None
|
The classification provenance (a SOURCE_* value, or a forward-compat string). None or empty yields no phrase, so a missing source can't render a dangling "via ". |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
A "via |