hyf

Context-aware query service for Radroots
git clone https://radroots.dev/git/hyf.git
Log | Files | Refs | README | LICENSE

commit 8e2ef8804b9cac3ca9334e00106ae0ad11477e95
parent 6715b06330e429a4a5ee2c41a35167646f700f37
Author: triesap <tyson@radroots.org>
Date:   Thu, 24 Sep 2026 21:36:38 +0000

C004: reconcile provenance fixtures and owner mappings under ADR-0027 BP01/BP03

Diffstat:
Mschemas/hyf_ops_v2/domain_manifest.json | 6+++---
Mschemas/hyf_ops_v2/examples/corpus.json | 3++-
Aschemas/hyf_ops_v2/examples/valid/buyer_request_match.response.no_evaluation_empty_provenance.json | 40++++++++++++++++++++++++++++++++++++++++
Mschemas/hyf_ops_v2/examples/valid/buyer_request_match.response.zero_plan_with_provenance.json | 27++++++++++++++++++++++++++-
Mschemas/hyf_ops_v2/examples/valid/farm_update_interpret.response.json | 2+-
Mschemas/hyf_ops_v2/semantic-cases.json | 11+++++++----
6 files changed, 79 insertions(+), 10 deletions(-)

diff --git a/schemas/hyf_ops_v2/domain_manifest.json b/schemas/hyf_ops_v2/domain_manifest.json @@ -24,13 +24,13 @@ {"schema_path": "*.quantity.value", "domain": "hyf_core.domain.quantity.Quantity value/scale (D23 decimal-string grammar)", "owner": "C004/C009", "status": "schema_bound"}, {"schema_path": "*.evidence", "domain": "hyf_core.domain.evidence.EvidenceRef closed span|record_field union (UTF-8 byte span; trusted_record provenance)", "owner": "C008/C009/C023", "status": "schema_bound"}, {"schema_path": "output.claims/proposed_changes", "domain": "hyf_application.farm_review_output", "owner": "C008/C009/C030", "status": "schema_bound"}, - {"schema_path": "output.demand_lines", "domain": "hyf_application.buyer_needs", "owner": "C008/C009/C030", "status": "schema_bound"}, - {"schema_path": "output.assessments/plans/limitations", "domain": "hyf_application.match_checks / match_plan / match_index", "owner": "C008/C009/C038", "status": "schema_bound"}, + {"schema_path": "output.demand_lines", "domain": "hyf_application.buyer_needs", "owner": "C008/C009/C038", "status": "schema_bound"}, + {"schema_path": "output.assessments/plans/limitations", "domain": "hyf_application.match_checks / match_plan / match_index", "owner": "C008/C009/C041", "status": "schema_bound"}, {"schema_path": "output.execution", "domain": "hyf_core.domain.execution.execution_state", "owner": "C008/C009", "status": "schema_bound"}, {"schema_path": "input.snapshots[].price", "domain": "hyf_core.domain.price PriceCondition/known_price scaled amount/scale/currency/basis (D23 scaled money, distinct from the reported_quantity decimal projection)", "owner": "C009/C023", "status": "schema_bound; the wire state/amount/scale/currency/basis maps to the existing scaled money representation; no conversion, FX, minimum-order or fee inference"}, {"schema_path": "input.snapshots[].price.fees", "domain": "schemas/hyf_v1_jev/money.schema.json properties.fees closed {kind,amount,scale,currency} family", "owner": "C009", "status": "schema_bound; optional closed family, legacy money schema retained unchanged as provenance"}, {"schema_path": "output.provenance (farm_update.interpret)", "domain": "immutable source/clarification/prior-record identities actually used", "owner": "C009/C023/C030", "status": "schema_bound; required on every success independently of context.return_provenance"}, - {"schema_path": "output.provenance (buyer_request.interpret)", "domain": "immutable source/clarification identities actually used", "owner": "C009/C023/C030", "status": "schema_bound; required on every success; farm-only prior_records forbidden"}, + {"schema_path": "output.provenance (buyer_request.interpret)", "domain": "immutable source/clarification identities actually used", "owner": "C009/C023/C038", "status": "schema_bound; required on every success; farm-only prior_records forbidden"}, {"schema_path": "output.provenance (buyer_request.match)", "domain": "immutable need and evaluated snapshot identities actually used", "owner": "C009/C023/C041", "status": "schema_bound; required on every success, including no-match/zero-plan results; coverage/allocation identities must agree"} ], "authority_integration": "docs/spec/hyf_v1_jev/specs/AUTHORITY_INTEGRATION.md: HYF is read-only; supplied records are host-authorized preconditions, HYF validates consistency but performs no writes and claims no authentication.", diff --git a/schemas/hyf_ops_v2/examples/corpus.json b/schemas/hyf_ops_v2/examples/corpus.json @@ -71,6 +71,7 @@ {"file": "examples/invalid/farm_update_interpret.response.missing_provenance.json", "target": "farm_update.interpret.response", "schema_valid": false, "semantic": "provenance_required_on_success"}, {"file": "examples/invalid/buyer_request_interpret.response.missing_provenance.json", "target": "buyer_request.interpret.response", "schema_valid": false, "semantic": "provenance_required_on_success"}, {"file": "examples/invalid/buyer_request_match.response.missing_provenance.json", "target": "buyer_request.match.response", "schema_valid": false, "semantic": "provenance_required_on_success"}, - {"file": "examples/valid/buyer_request_match.response.zero_plan_with_provenance.json", "target": "buyer_request.match.response", "schema_valid": true} + {"file": "examples/valid/buyer_request_match.response.zero_plan_with_provenance.json", "target": "buyer_request.match.response", "schema_valid": true}, + {"file": "examples/valid/buyer_request_match.response.no_evaluation_empty_provenance.json", "target": "buyer_request.match.response", "schema_valid": true} ] } diff --git a/schemas/hyf_ops_v2/examples/valid/buyer_request_match.response.no_evaluation_empty_provenance.json b/schemas/hyf_ops_v2/examples/valid/buyer_request_match.response.no_evaluation_empty_provenance.json @@ -0,0 +1,40 @@ +{ + "version": 1, + "request_id": "buyer-match-req-1", + "ok": true, + "output": { + "versions": { + "schema": "hyf_ops_v2", + "taxonomy": "hyf_ops_v2.taxonomy.v1", + "normalization": "hyf_ops_v2.normalization.v1", + "review_policy": "hyf_ops_v2.review_policy.v1", + "ranking_policy": "hyf_ops_v2.ranking_policy.v1", + "question_bundle": "hyf_ops_v2.question_bundle.v1", + "model": "jev-1.13.0" + }, + "provenance": { + "need": { + "need_id": "need-1", + "revision": "rev-4" + }, + "snapshots": [] + }, + "assessments": [], + "plans": [], + "limitations": { + "scope": "supplied_only", + "truncated": false, + "supported_mode": "single_supplier_compatible_lots", + "unsupported": [ + "multi_supplier" + ] + }, + "execution": { + "status": "complete", + "provider_calls": 0, + "model": null, + "question_bundle": null, + "degraded_reason": null + } + } +} diff --git a/schemas/hyf_ops_v2/examples/valid/buyer_request_match.response.zero_plan_with_provenance.json b/schemas/hyf_ops_v2/examples/valid/buyer_request_match.response.zero_plan_with_provenance.json @@ -28,7 +28,32 @@ } ] }, - "assessments": [], + "assessments": [ + { + "candidate_id": "lot-1", + "eligibility": "ineligible", + "checks": [ + { + "kind": "product", + "result": "fail", + "reason": "product_mismatch", + "evidence": [] + } + ] + }, + { + "candidate_id": "lot-2", + "eligibility": "ineligible", + "checks": [ + { + "kind": "availability", + "result": "fail", + "reason": "availability_unknown", + "evidence": [] + } + ] + } + ], "plans": [], "limitations": { "scope": "supplied_only", diff --git a/schemas/hyf_ops_v2/examples/valid/farm_update_interpret.response.json b/schemas/hyf_ops_v2/examples/valid/farm_update_interpret.response.json @@ -32,7 +32,7 @@ ], "proposed_changes": [ { - "target": {"kind": "listing", "id": "listing-1"}, + "target": {"kind": "listing", "id": "record-100"}, "operation": "remaining", "expected_revision": "rev-2", "evidence": [ diff --git a/schemas/hyf_ops_v2/semantic-cases.json b/schemas/hyf_ops_v2/semantic-cases.json @@ -11,7 +11,7 @@ {"id": "taxonomy_version_mismatch", "path": "context.versions.taxonomy != input.references.taxonomy.version", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"}, {"id": "normalization_version_mismatch", "path": "context.versions.normalization != input.references.normalization.version", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"}, {"id": "source_actor_mismatch", "path": "input.source.actor_id != context.actor_id", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"}, - {"id": "match_need_actor_mismatch", "path": "input.need.actor_id != context.actor_id", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"}, + {"id": "match_need_actor_mismatch", "path": "input.need.actor_id != context.actor_id", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt executes the paired accepting/rejecting control; C023 owns typed consistency"}, {"id": "farm_source_farm_mismatch", "path": "input.source.farm_id != context.farm_id", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"}, {"id": "unknown_quantity_with_value", "path": "quantity.state=unknown with non-null value", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema if/then; C009 typed mapping"}, {"id": "known_quantity_without_value", "path": "quantity.state=known without value/unit", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema if/then; C009 typed mapping"}, @@ -41,8 +41,11 @@ {"id": "provenance_required_on_success", "path": "every successful output (including empty claims/lines and no-match/zero-plan results) without a closed provenance object", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "BP01 response schema requires provenance on every success independently of context.return_provenance; C009 typed decode"}, {"id": "provenance_identity_closed", "path": "provenance identity objects missing/blank revision or carrying unknown fields", "expect": "reject", "wire": "invalid_request", "owner": "C009/C023", "enforced_by": "BP01 closed identity objects with required nonblank identity strings; C023 equality"}, {"id": "provenance_farm_prior_records_only", "path": "buyer interpretation provenance carrying the farm-only prior_records field", "expect": "reject", "wire": "invalid_request", "owner": "C023/C030", "enforced_by": "BP01 buyer provenance is closed without prior_records; C030 owns farm prior-record provenance"}, - {"id": "provenance_actual_use_only", "path": "source/clarification/prior_records/need/snapshot identities not actually consulted", "expect": "reject", "wire": "invalid_request", "owner": "C023/C041", "enforced_by": "C023/C041 semantic actual-use checks; BP03 executes the paired accepting/rejecting controls"}, - {"id": "provenance_repeated_identity_pair", "path": "repeated identical identity/revision pair in provenance", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C023 semantic uniqueness; BP03 executes the paired controls"}, - {"id": "provenance_snapshot_scope_consistency", "path": "match provenance snapshots disagree with assessed/allocated lot revisions or with supplied scope", "expect": "reject", "wire": "invalid_request", "owner": "C023/C041", "enforced_by": "C023/C041 semantic consistency with the already-bound snapshot consistency policy"} + {"id": "provenance_actual_use_only", "path": "source/clarification/prior_records/need/snapshot identities not actually consulted", "expect": "reject", "wire": "invalid_request", "owner": "C023/C041", "enforced_by": "docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt executes the paired accepting/rejecting never-copy-all-supplied controls; C023/C041 own runtime actual-use"}, + {"id": "provenance_repeated_identity_pair", "path": "repeated identical identity/revision pair in provenance", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt executes the paired uniqueness controls; C023 owns runtime uniqueness"}, + {"id": "provenance_snapshot_scope_consistency", "path": "match provenance snapshots disagree with assessed/allocated lot revisions or with supplied scope", "expect": "reject", "wire": "invalid_request", "owner": "C023/C041", "enforced_by": "docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt executes the paired assessed/allocation-agreement controls; C023/C041 own runtime consistency"}, + {"id": "price_amount_full_string", "path": "snapshot.price/fee amount with a trailing newline or other unconsumed byte (schema pattern `$` is not full-string consumption)", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt full-match oracle; C009 typed decode"}, + {"id": "price_currency_nonblank", "path": "snapshot.price/fee currency that is whitespace-only (schema minLength:1 is not nonblank)", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt nonblank oracle; C009 typed decode"}, + {"id": "price_fee_amount_canonical", "path": "optional price.fees amount beyond int64, non-canonical, blank currency or wrong type", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "BP01 closed fee schema plus docs/execution/evidence/hyf_http_v1/C004-requalification-2/reference-schema-validate.v3.py.txt int64/full-string/nonblank controls; C009 typed decode"} ] }