Skip to content

A copied catalogue row says which row it copied, and check says when that row moves on - #47

Merged
jithinAB merged 4 commits into
masterfrom
catalog/copied-from
Nov 17, 2026
Merged

jithinAB merged 4 commits into
masterfrom
catalog/copied-from

Conversation

@jithinAB

Copy link
Copy Markdown
Contributor

A copied catalogue row says which row it copied, and check says when that row moves on

Recording one benchmark figure for a shipped model first copies the distribution's whole row into the workspace's models/catalog.yaml, because a workspace row replaces the shipped one whole. The copy then kept the price, the window and the serving it was copied with. When the distribution later corrected that row, the workspace went on binding against the old facts and nothing said so.

  • copied-from: {digest} on a row of the workspace's own catalogue holds sha256: and the hex digest of the distribution's row as it was copied: its JSON as pact show prints it, keys sorted, no spaces. benchmarks.record writes it whenever it copies a row (row_digest), and does not copy again on a second figure.
  • pact check warns loader/a-copied-row-behind-the-distribution in two cases. When the distribution's row of that name (or alias) no longer has that digest, the warning names the fields where the copy and the shipped row now differ and gives the digest to write once they are reconciled. It also warns when the distribution no longer has the row. A row without copied-from is not judged. This is a warning, not an error: the workspace's copy is still the author's row.
  • Neither runtime canonicalises YAML numbers itself. The digest is taken over the spec's existing canonical JSON (what pact show --json prints), so the Rust checker and the Python writer agree because both read the same printed form.
  • spec/copied-rows.yaml holds the Rust checker and the Python writer to the same digests. Its rows include whole numbers, decimals, a share, a date and non-ASCII text, and one case shows that key order in the file does not move the digest while list order does.

Proof

  • Rust (crates/pact-loader/src/copies.rs): every_row_in_the_shared_table_digests_as_it_says, a_copy_of_the_current_row_is_quiet_and_a_stale_one_names_what_differs, a_row_without_copied_from_is_not_judged.
  • Python (test_a_copied_row_says_which_row_it_copied.py): the shared-table digests through the pact show route, recording a figure writes copied-from and check is quiet, a copy whose digest is not the shipped row's is reported, a second figure does not copy the row again.
  • tests/golden/schema-fields.txt re-blessed; docs/97-PRIMITIVES.md, site-docs/reference/kinds.md and counts synced.
  • scripts/test-all.sh on this branch (with A catalogue row says what a model needs of the machine that runs it #45 merged in) exits 0: Rust (1728 tests), the CLI on every shipped tree, WebAssembly, TypeScript, and the adapters (3625 passed, 30 skipped).

Purpose checklist (BMH PACT v97 §0.2)

  1. P1 Declared: where a copied row came from is written in the workspace's catalogue, beside the row.
  2. P2 No hidden divergence: a workspace bound against facts the distribution has since corrected is reported by pact check, naming each differing field.
  3. P3 Honest gaps: a vanished shipped row is reported too; nothing is merged silently.
  4. P4 Host choices recorded: not applicable.
  5. P5 Model-visible ⟺ logged: not applicable.
  6. P6 Cross-runtime evidence: spec/copied-rows.yaml digests match in Rust and Python.
  7. P7 Versioned and checked: a new field with a checker warning code.
  8. P8 Reusable: a workspace that records its own figures keeps receiving the distribution's corrections, with the differences named.
  9. P9 Platform rules: not applicable (upstream).
  10. P10 Justified: portability and accuracy. Figures recorded in one environment do not freeze prices, windows or serving that the distribution has since fixed (BMH budmh pact benchmark record --write-tree writes copied-from after the next re-pin).
  11. P11 Lane hygiene: one change, on master.

🤖 Generated with Claude Code

jithinAB and others added 4 commits November 17, 2026 06:43
…that row moves on

benchmarks.record copies the distribution's row before adding a figure and now
writes copied-from: {digest} beside it: sha256 over the row's JSON as pact show
prints it, keys sorted, no spaces. pact check warns
loader/a-copied-row-behind-the-distribution when the shipped row (by name or
alias) no longer has that digest, naming the fields that now differ, or when
the distribution no longer has the row. spec/copied-rows.yaml holds the Rust
checker and the Python writer to the same digests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	crates/pact-cli/src/main.rs
#	docs/97-PRIMITIVES.md
#	site-docs/index.md
#	site-docs/reference/kinds.md
#	spec/schema.yaml
@jithinAB
jithinAB marked this pull request as ready for review November 17, 2026 08:41
@jithinAB
jithinAB merged commit 932a660 into master Nov 17, 2026
4 of 5 checks passed
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.

1 participant