Capability and script contracts#

assess_measurements.py#

Run assess and pipe one JSON object containing:

  • current: a mapping of measure name to {value, unit?, method?};

  • history: exact-read baseline entries with artifact_id, optional subject, and measures;

  • optional subject, history_complete (defaults to false), minimum_samples (2–10,000), and deviation_sigma (0.1–20).

Only finite numeric values with exactly matching units and, when both are present, methods enter a baseline. The script reports arithmetic mean, sample standard deviation, z-score, sample IDs, and deviates, within_baseline, insufficient_baseline, or incomplete_baseline. Zero standard deviation yields z-score zero for an equal value and signed infinity for a different value; JSON represents the latter as null plus a direction field.

Host gkb_publish#

Accept a typed canonical artifact draft, justified relations, and an explicit idempotency key. The host validates and renders the artifact, derives project and execution identity from trusted context, and performs an immutable commit. A reused key with different canonical content is an idempotency conflict and must fail closed. GKB publication is unavailable unless the run was created with the gkb.write capability.