assess_asset_change
Assess one measurement point's change against its declared or historical reference, classifying amplitude indicators and bearing evidence as no change, isolated, unconfirmed, or persistent.
Instructions
Assess the change of one measurement point against its reference.
Needs nothing but the asset and the point: the measurements, their
snapshots and the declarations are read from the ledger. The reference
is the active declared baseline when one exists (health_declared True,
declarer cited), else the first reference_measurements comparable
acquisitions of the point, reported as a relative comparison whose
health is not declared. For every amplitude indicator (rms, peak, 1x,
ISO velocity, envelope amplitude at each bearing fault frequency) the
reference band is mean plus or minus max(3 sigma, 25 percent) and the
post-reference acquisitions are classified as no_change,
isolated_episode, unconfirmed_single_acquisition or persistent_change
with the criterion spelled out; bearing evidence is counted over the
last_k acquisitions; the overall verdict is the most severe. Every
comparability qualification is reported and non-comparable
acquisitions are listed, never silently dropped. The result carries at
most one suggested_verification, no list of recommendations.
Snapshots are comparable only on one processing lineage. When no
lineage covers every evaluated acquisition the status is
processing_not_homogeneous and the remedy is this call with
reprocess=True, which first recomputes the stale snapshots with the
current lineage: idempotent (a repeated call recomputes nothing that
is already current), bounded to 10 measurements per call (reference
members first, then the most recent), verified against the recorded
file hash, and the reprocess block names the exact next call while
measurements remain. Old snapshots are never deleted.
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).
acquired_since: ISO 8601 lower bound of the assessed post-reference
acquisitions (the reference is always used), or None.
acquired_until: ISO 8601 upper bound, or None.
last_k: Acquisitions listed for drill-down and scanned for bearing
evidence (1 to 50).
reference_measurements: Size of the automatic reference window
when no baseline is declared (3 to 100).
reprocess: Recompute up to 10 stale snapshots with the current
lineage before assessing.
Returns:
AssetChangeAssessment with status 'assessed', 'not_found',
'insufficient_history' or 'processing_not_homogeneous'.
Raises:
ValueError: Invalid ids, last_k or reference_measurements outside
their range, a bound that is not ISO 8601, or a ledger that
cannot be read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| last_k | No | ||
| asset_id | Yes | ||
| reprocess | No | ||
| acquired_since | No | ||
| acquired_until | No | ||
| measurement_point_id | Yes | ||
| reference_measurements | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remedy | No | Concrete action for 'insufficient_history' or 'processing_not_homogeneous' (the exact re-processing call); None otherwise | |
| status | Yes | Outcome discriminator (see the class description) | |
| derived | No | Derived comparisons: deltas per indicator against the reference mean, exceedance_runs, drift regressions, iso_change (change against 25 percent of the ISO 20816-3 B/C boundary when group and support are known) and per_indicator classifications with their criterion; None unless assessed | |
| lineage | No | Processing lineage the assessment used: processing_id, algorithm_version, covered slots, candidates per lineage, current_processing_id, is_current, missing_for_current, stale_context; None unless assessed | |
| message | Yes | One-paragraph summary of the outcome | |
| assessed | No | The verdict: classification ('no_change', 'isolated_episode', 'unconfirmed_single_acquisition', 'persistent_change'), direction ('increase' or 'decrease'), sudden, criterion, indicators_driving, onset_measurement_id, onset_acquired_at, onset_coincides_with (qualifications of the onset acquisition) and evidence per bearing label; None unless assessed | |
| asset_id | Yes | The assessed asset (ledger id) | |
| lineages | No | Covered evaluated slots per processing lineage ('processing_not_homogeneous') | |
| observed | No | Observed values: reference_statistics per indicator (mean, std, n, band, unit), latest values, latest_measurement_id, latest_acquired_at, evidence_presence per bearing label over the last K acquisitions, indicators_unavailable with reasons, acquisitions_assessed, slots_assessed, measurement_ids_assessed; None unless assessed | |
| required | No | Slots required ('insufficient_history') | |
| available | No | Usable acquisition slots available ('insufficient_history') | |
| reference | No | The reference used: kind ('automatic_window' or 'declared_baseline'), health_declared (True only for a declared baseline), message (cites declared_by, declared_at and note of a baseline verbatim), measurement_ids, count, acquired_from, acquired_to, provisional, statistics_quality ('relative_only', 'provisional', 'full'), qualification_codes of the reference slots, outside_window, baseline, withdrawn_baseline, excluded_inside_span; None for a miss | |
| reprocess | No | Outcome of the re-processing run before the assessment when reprocess=True: processing_id, stale, reprocessed, not_reprocessable, up_to_date, remaining, results per attempted measurement, next_call (the exact call to continue, or None) and message; None when reprocess was False | |
| suggestion | No | Concrete next step on 'not_found'; None otherwise | |
| known_assets | Yes | Asset ids the ledger directory lists (for a miss); else empty | |
| known_points | Yes | Points of a known asset when the point is unknown; else empty | |
| comparability | No | Comparability of the point's acquisitions: counts per grade, qualifications (code, count, detail), excluded measurements with reasons and collapsed duplicates; None for a miss | |
| evaluated_slots | No | Evaluated slots, reference plus post-reference ('processing_not_homogeneous') | |
| missing_for_current | No | Evaluated slots without a snapshot on the current lineage ('processing_not_homogeneous') | |
| measurement_point_id | Yes | The assessed point (ledger id) | |
| current_processing_id | No | The current processing lineage ('processing_not_homogeneous') | |
| suggested_verification | No | At most ONE verification sentence the evidence calls for; None when no verification is needed or the point was not assessed |