Skip to content

fix(artifacts): keep reading KPI payloads frozen before contributor labels - #251

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/249-kpi-earlier-shape
Dec 1, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/249-kpi-earlier-shape

Conversation

@sophieships

Copy link
Copy Markdown
Owner

What changes

A kpi:v1 payload frozen before its contributors carried run_label, sample_role and block_label is supported again under artifact-payload-1 (option 1 of #249).

  • Backend. KpiContributor accepts a contributor without the three fields. It serializes without them, so the re-serialized payload still hashes to the stored payload_hash that a publication pin checks. A contributor written today still carries all three, including a null role.
  • Frontend. The Zod schema makes the three fields optional. The renderer names a contributor without run_label by its run ID. A contributor without sample_role gets no role line, because "No planned unit" would claim something the payload never recorded.
  • Shared fixture. kpi-v1-before-run-labels.json is the earlier shape, with a pinned digest. Both sides read it.
  • Contract. docs/contracts/artifacts.md states the rule and lists the fixture.

Tests

  • test_artifact_payload_fixtures.py: every supported fixture validates and now also re-serializes to its pinned digest. It fails if the earlier KPI shape is refused, or if it re-serializes with fields it never had.
  • artifacts.schema.test.ts accepts the new fixture through the shared inventory.
  • render-artifact.test.ts: the earlier shape goes through renderStoredPayload as supported, shows its value and labels each contributor by run ID.

Done-when from #249

The hosted demo's report "FP-510 methanol setpoint optimization: process review", edition 1, shows the three KPI items once this is deployed to alpha. The three stored payloads have the earlier shape, with values 1.717, 2.859 and 0.215 g/L. I will check the page as an anonymous visitor after the deploy.

Fixes #249

…abels

A kpi:v1 payload captured before its contributors carried run_label,
sample_role and block_label no longer validated under artifact-payload-1,
so the demo report showed three of its items as unsupported.

The three fields are optional on read on both sides. A contributor without
them re-serializes without them, so its stored payload hash still holds,
and the renderer names it by its run ID. A shared fixture of the earlier
shape pins it.

Fixes #249
@sophieships sophieships added the queue Land this pull request through the merge train label Dec 1, 2026
github-actions Bot added a commit that referenced this pull request Dec 1, 2026
@github-actions
github-actions Bot merged commit 497a844 into main Dec 1, 2026
11 checks passed
@github-actions github-actions Bot removed the queue Land this pull request through the merge train label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demo report: three KPI items show "cannot display this evidence" since the KPI contributor gained run_label

1 participant