Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ correction to the pipeline framing this file used to carry.
> result are bound by construction); `build_verdict`/`verdict.Build` is the
> low-level assembler and checks structure only -- see `docs/VERDICT-SCHEMA.md`.
>
> **A receipt verifier exists in both languages:** `engine/src/receipt.rs` and
> `go/receipt` check a materialization receipt (`docs/RECEIPT-SCHEMA.md`) for
> structural and content consistency against the materialized object, the
> authored input and an explicit path binding -- see `docs/RECEIPT-VERIFIER.md`
> for exactly what a success does and does not establish. No receipt producer
> exists in this crate; materialization is the environment's job.
>
> Nothing here is a stable API.

---
Expand Down
24 changes: 24 additions & 0 deletions conformance/differential/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ differential/
digest/ -- F9: digestprojection.*
materialized/ -- MaterializedObject::try_new / NewMaterializedObject
verdict/ -- the assembled five-field verdict artifact (build_verdict / verdict.Build)
receipt/ -- the receipt verifier (verify_receipt / receipt.Verify)
```

One group per primitive, landed incrementally — matching how F6
Expand Down Expand Up @@ -221,3 +222,26 @@ vector's `object`/`fields` must equal the same-named `plan/` vector's pin. A
second test per language applies eight deliberate divergences to a correct
artifact and requires the comparison to catch each.

### `receipt/`

```text
input.json: receipt the receipt document ({"materialization": {...}})
authored_input the processed authored input (any value)
object a materialized object, in the `digest/` group's
{"fields": [...]} fixture shape
path_binding optional: receipt path -> object key
expected.json: {accepted: true}
{accepted: false, error: {code, rule, path}}
```

Both languages must accept or reject identically, and a rejection must name
the same code, rule and location. Every digest in these vectors was computed
by an independent script over the documented canonical form (sorted keys, no
whitespace) and cross-checked against the already-pinned
`materialized_object_digest` vector before use; neither engine produced them.
A second test per language alters one field of each accepted receipt (an input
digest, an output digest, the version, a field's type) and requires the
verifier to reject it.

Documents are decoded so an integer stays an integer and `1.0` stays a float
(Go: `Decoder.UseNumber`), because the receipt's version is a bare integer.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"accepted": false,
"why": "one entry per defaulted field: a repeated path is not strictly ascending",
"error": {
"code": "E_INVALID_RECEIPT",
"rule": "R-RECEIPT-ORDER",
"path": "$.materialization.applied_defaults[1].path"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"receipt": {
"materialization": {
"receipt_schema_version": 1,
"grammar_sha256": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
"grammar_schema_sha256": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
"primitive_release": "primitives/@v0.2.0",
"primitive_source_commit": "960ee0f048d969a85ad20819bc0f2366ad91fa40",
"primitive_build_hash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
"schema_name": "cic:storage:StorageResource",
"schema_version": "v1.2.0",
"schema_digest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
"engine_identity": "environment-reference-fixture",
"engine_version": "0.0.0",
"input_digest": "sha256:7e6dbda8c11818a96d216350f13efb0edb5399b801e3ec054f1f2fab8d63324c",
"output_digest": "sha256:28a5a9b53b4239b38731bb401b23cacc18e38d3656275a8b62a6fecce95cb110",
"applied_defaults": [
{
"path": "$.b",
"rule": "schema-default",
"value_digest": "sha256:5555555555555555555555555555555555555555555555555555555555555555"
},
{
"path": "$.b",
"rule": "schema-default",
"value_digest": "sha256:5555555555555555555555555555555555555555555555555555555555555555"
}
],
"derived_values": []
}
},
"authored_input": {
"shape": "E4.Flex",
"memory_gb": 16
},
"object": {
"fields": [
{
"key": "memory_gb",
"capability": "implemented",
"provenance": "authored",
"value": 16
},
{
"key": "power_state",
"capability": "implemented",
"coverage": "observed",
"value": "running"
},
{
"key": "shape",
"capability": "implemented",
"provenance": "authored",
"value": "E4.Flex"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"accepted": false,
"why": "applied_defaults must be ascending by .path",
"error": {
"code": "E_INVALID_RECEIPT",
"rule": "R-RECEIPT-ORDER",
"path": "$.materialization.applied_defaults[1].path"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"receipt": {
"materialization": {
"receipt_schema_version": 1,
"grammar_sha256": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
"grammar_schema_sha256": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
"primitive_release": "primitives/@v0.2.0",
"primitive_source_commit": "960ee0f048d969a85ad20819bc0f2366ad91fa40",
"primitive_build_hash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
"schema_name": "cic:storage:StorageResource",
"schema_version": "v1.2.0",
"schema_digest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
"engine_identity": "environment-reference-fixture",
"engine_version": "0.0.0",
"input_digest": "sha256:7e6dbda8c11818a96d216350f13efb0edb5399b801e3ec054f1f2fab8d63324c",
"output_digest": "sha256:28a5a9b53b4239b38731bb401b23cacc18e38d3656275a8b62a6fecce95cb110",
"applied_defaults": [
{
"path": "$.b",
"rule": "schema-default",
"value_digest": "sha256:5555555555555555555555555555555555555555555555555555555555555555"
},
{
"path": "$.a",
"rule": "schema-default",
"value_digest": "sha256:6666666666666666666666666666666666666666666666666666666666666666"
}
],
"derived_values": []
}
},
"authored_input": {
"shape": "E4.Flex",
"memory_gb": 16
},
"object": {
"fields": [
{
"key": "memory_gb",
"capability": "implemented",
"provenance": "authored",
"value": 16
},
{
"key": "power_state",
"capability": "implemented",
"coverage": "observed",
"value": "running"
},
{
"key": "shape",
"capability": "implemented",
"provenance": "authored",
"value": "E4.Flex"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"accepted": false,
"why": "the derived entry's path is missing from the binding: no partial success",
"error": {
"code": "E_RECEIPT_UNBOUND",
"rule": "R-RECEIPT-PATH-BINDING",
"path": "$.materialization.derived_values[0].path"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"receipt": {
"materialization": {
"receipt_schema_version": 1,
"grammar_sha256": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
"grammar_schema_sha256": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
"primitive_release": "primitives/@v0.2.0",
"primitive_source_commit": "960ee0f048d969a85ad20819bc0f2366ad91fa40",
"primitive_build_hash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
"schema_name": "cic:storage:StorageResource",
"schema_version": "v1.2.0",
"schema_digest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
"engine_identity": "environment-reference-fixture",
"engine_version": "0.0.0",
"input_digest": "sha256:fa436f473bd3ca77dfd99e29b023038ddc8bfcc04cac2b16057c7b8aef65c4a7",
"output_digest": "sha256:1fe567ac0333d3a4d60162cce7e7c3f8a272ed8b63e02d9774c61dce94dea0c0",
"applied_defaults": [
{
"path": "$.config.replicas",
"rule": "schema-default",
"value_digest": "sha256:4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce"
}
],
"derived_values": [
{
"path": "$.state.effective_state",
"rule": "effective-state-v1",
"inputs": [
"$.state.admin_state",
"$.state.never_materialized"
],
"value_digest": "sha256:294bdbf9fed030b63703f2925091c2da3e4bf211b2b6b1b6ad3a3cfd9478353a"
}
]
}
},
"authored_input": {
"admin_state": "up"
},
"object": {
"fields": [
{
"key": "admin_state",
"capability": "implemented",
"provenance": "authored",
"value": "up"
},
{
"key": "effective_state",
"capability": "implemented",
"provenance": "derived",
"value": "RUNNING"
},
{
"key": "oper_state",
"capability": "implemented",
"coverage": "observed",
"value": "up"
},
{
"key": "replicas",
"capability": "implemented",
"provenance": "schema_default",
"value": 3
}
]
},
"path_binding": {
"$.config.replicas": "replicas"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"accepted": false,
"why": "the path is bound to a key the object does not have",
"error": {
"code": "E_RECEIPT_MISMATCH",
"rule": "R-RECEIPT-EVIDENCE-MEMBERSHIP",
"path": "$.materialization.applied_defaults[0].path"
}
}
72 changes: 72 additions & 0 deletions conformance/differential/receipt/binding_to_unknown_key/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"receipt": {
"materialization": {
"receipt_schema_version": 1,
"grammar_sha256": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
"grammar_schema_sha256": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
"primitive_release": "primitives/@v0.2.0",
"primitive_source_commit": "960ee0f048d969a85ad20819bc0f2366ad91fa40",
"primitive_build_hash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
"schema_name": "cic:storage:StorageResource",
"schema_version": "v1.2.0",
"schema_digest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
"engine_identity": "environment-reference-fixture",
"engine_version": "0.0.0",
"input_digest": "sha256:fa436f473bd3ca77dfd99e29b023038ddc8bfcc04cac2b16057c7b8aef65c4a7",
"output_digest": "sha256:1fe567ac0333d3a4d60162cce7e7c3f8a272ed8b63e02d9774c61dce94dea0c0",
"applied_defaults": [
{
"path": "$.config.replicas",
"rule": "schema-default",
"value_digest": "sha256:4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce"
}
],
"derived_values": [
{
"path": "$.state.effective_state",
"rule": "effective-state-v1",
"inputs": [
"$.state.admin_state",
"$.state.never_materialized"
],
"value_digest": "sha256:294bdbf9fed030b63703f2925091c2da3e4bf211b2b6b1b6ad3a3cfd9478353a"
}
]
}
},
"authored_input": {
"admin_state": "up"
},
"object": {
"fields": [
{
"key": "admin_state",
"capability": "implemented",
"provenance": "authored",
"value": "up"
},
{
"key": "effective_state",
"capability": "implemented",
"provenance": "derived",
"value": "RUNNING"
},
{
"key": "oper_state",
"capability": "implemented",
"coverage": "observed",
"value": "up"
},
{
"key": "replicas",
"capability": "implemented",
"provenance": "schema_default",
"value": 3
}
]
},
"path_binding": {
"$.config.replicas": "nope",
"$.state.effective_state": "effective_state"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"accepted": true,
"why": "one defaulted and one derived field, each bound through an explicit path binding; membership and both value digests are checked"
}
Loading
Loading