Repository navigation
The kernel's operations are a file, and each field says which it is - #30
Merged
Merged
Conversation
spec/kernel.yaml lists the 76 operations of the seven primitives; kernel-op: on a field of spec/schema.yaml names the operations the field is, read into Field::kernel_ops. every_kernel_operation_is_written_somewhere.rs holds the two files to each other in both directions. pattern-coverage.py reads the operations from the file; primitive-coverage.py adds a keyword's operations' primitives to its own.
…ops-in-the-spec # Conflicts: # CHANGELOG.md # README.md # docs/90-REVIEW.md # site-docs/index.md # site-docs/status/verified.md # spec/schema.yaml
…ops-in-the-spec # Conflicts: # CHANGELOG.md # README.md # docs/90-REVIEW.md # site-docs/index.md # site-docs/status/verified.md
Contributor
Author
|
Merged master (0299680, after #29) into this branch. CI on the merged head: |
jithinAB
marked this pull request as ready for review
November 14, 2026 20:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A runtime that runs PACT one operation at a time has to know which fields reach each of the 76 operations of the seven primitives (97 §2, §5.4). That list lived in one place, the
OPStable insidescripts/pattern-coverage.py, and said it in keyword prose (limits, at-most, fuel, checks-at-most), which a runtime can only turn into fields by matching words. Bud Meta Harness did exactly that for its per-operation registry and got it wrong in both directions:shape.streampicked upbundle.fromandprovenance.harness, andshape.one-ofpicked up nothing. This puts the operations in a file and puts on each field the operations it is, so the mapping is data both sides read, held to each other by a test.Nothing changes in what an author writes or what
pact checkaccepts.What changes
spec/kernel.yaml: the 76 operations, each with its primitive, what it does and the keyword that is it today, copied fromOPSunchanged. An operation an author writes as syntax inside a value rather than as a field of its own says where withwritten-in:(six of them:one of a, b,list of,stream of, anagent-shaped answer, a binding, a list of conditions).kernel-op:on a field ofspec/schema.yaml: one operation or a list. 291 field lines, 295 fields once the anchoredinterface:/chosen-by:are counted onskillandtool, 347 field-operation pairs. Descriptions, names andbecause:carry none. Placed after each field'stier:line, so no run oftype:/names:/key-names:/surface:lines that a test anchors on is split. The header's attribute list describes it.Field::kernel_opsinpact-schema, read byfrom_docwith the same helper asnames:.crates/pact-schema/tests/every_kernel_operation_is_written_somewhere.rs(4 tests): every operation names one of the seven primitives, is named<prefix>.<what>, and says what it does and its keyword; everykernel-op:names an operation the kernel lists; every operation is named by a field or placed bywritten-in:; the attribute travels through an anchor. The last test runs the same check on the real files with one line changed each way (store.forkrenamed onstage.forks, andshape.one-of'swritten-in:removed) and requires both to fail with the sentence that names them.scripts/pattern-coverage.pyreadsOPSfromspec/kernel.yaml; its output is byte-identical to master's.--opsgains a column with each operation's fields.scripts/primitive-coverage.pyadds the primitive of each operation a keyword'skernel-op:names after the primitives its table gives it. The main ingredient never changes. 48 keywords gain a secondary primitive where the table had given them fewer than their operations have;agent.acceptsisactor.signaturebyOPS's own keyword list, so it is an Actor as well as a Shape. docs/97 §6's "any part" column, Appendix A (48 rows, each only appended to) and Appendix C (the new column) are regenerated; the §5.4 sentence points at the file.Evidence
cargo test --workspace --locked: 1652 passed, 0 failed (the headline count is synced to it).cargo clippy --workspace --all-targets --locked -- -D warnings: clean.python3 scripts/pattern-coverage.py: same output as master;--opslists fields for 75 operations and none forshape.one-of, which is placed bywritten-in:.python3 scripts/primitive-coverage.py: 569 keywords, 0 unmapped, main-ingredient counts unchanged.test_the_second_port_reports_a_spend_cap_it_cannot_price, which fails on master too on a machine without the TypeScript adapter's dependencies installed.Choices a reviewer may want to change
OPS's keyword column and the help text. Where a field is several operations it says so (stage.doesis six;when-this.in-shareisshape.digestandcheck.digest, asOPSlists it under both). Every placement is a line of YAML to move.written-in:is a sentence, not a list of types, because the six places are syntax a reader recognises, not fields a checker can resolve.spec/comparisons.yaml's row floor works.Downstream: Bud Meta Harness reads
kernel-op:at its next re-pin instead of matching keyword text (its PK-1 kernel registry and coverage dashboard).🤖 Generated with Claude Code