declare_healthy_baseline
Declare measured points as a healthy reference so change assessments compare against a vetted baseline instead of the first acquisitions.
Instructions
Declare which recorded measurements are the healthy reference of a point.
Until a baseline is declared, assess_asset_change compares against the
first comparable acquisitions of the point and says so
(health_declared False); a declared baseline is the only reference
reported as declared healthy, and every assessment cites declared_by,
the date and the note verbatim. The ids come from load_signal or
get_asset_history (measurement_id); every member must be a recorded
measurement of THIS point, comparable or qualified against the point's
current declaration and against the other members (a contradicting
unit, direction or speed is refused with the reason), and no two may
share an acquisition slot. At least 3 members. An empty
measurement_ids withdraws the active baseline and requires a note;
later assessments fall back to the automatic window and name the
withdrawal. Each member records the declaration versions it was
validated against, so a later re-declaration excludes it with a
qualification instead of silently changing the reference.
Args:
ctx: MCP context. Unused, see this module's docstring on logging.
asset_id: The asset (ledger id).
measurement_point_id: The point (ledger id).
measurement_ids: measurement_id values of the members (at least 3,
at most 100), or an empty list to withdraw.
declared_by: Who declares (required, free text, at most 200
characters, one line); quoted verbatim in later assessments.
note: Free-text note (at most 200 characters); required for a
withdrawal.
Returns:
BaselineDeclarationResult with the baseline_id, the members with
their recorded versions, the superseded baseline and a summary.
Raises:
ValueError: Invalid ids or free text, an empty declared_by, an
asset without a ledger (naming the known assets), an id that is
not a measurement of the point (naming the valid ids), fewer
than 3 members, two members in one acquisition slot, a member
that is not comparable (naming the reason), a withdrawal
without a note or without an active baseline, or a ledger that
cannot be read or written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| asset_id | Yes | ||
| declared_by | Yes | ||
| measurement_ids | Yes | ||
| measurement_point_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Free-text note of the declarer, as given; None when absent | |
| members | Yes | One entry per member: measurement_id, declaration_version of the measurement and point_declaration_version it was validated against (a later re-declaration excludes the member at query time with a qualification, never silently) | |
| message | Yes | One-paragraph summary of the outcome | |
| asset_id | Yes | Asset the point belongs to (ledger id) | |
| event_id | Yes | Id of the appended ledger event | |
| withdrawn | Yes | True when this call withdrew the active baseline (empty list) | |
| baseline_id | Yes | Deterministic id of this baseline declaration (hash of the point, the sorted measurement ids and the declaration instant) | |
| declared_at | Yes | Declaration instant (ISO 8601, UTC) | |
| declared_by | Yes | Who declared the baseline, as given by the caller; quoted verbatim in every assessment that uses it | |
| measurement_ids | Yes | Members of the baseline in acquisition order; empty for a withdrawal | |
| measurement_point_id | Yes | The point (ledger id) | |
| superseded_baseline_id | No | Id of the baseline that was active before this call; None when the point had none |