hyf

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

semantic-cases.json (12400B)


      1 {
      2   "schema_version": 1,
      3   "program": "hyf_http_v1",
      4   "revision": "hyf_ops_v2",
      5   "note": "Semantic obligations that JSON Schema alone cannot express. Each case is labelled with the enforcing owner and the C004 control that exercises it. No case is claimed enforced by a regex or by the reference validator; C008/C009/C023 own the full typed/semantic enforcement.",
      6   "cases": [
      7     {"id": "duplicate_key_identity", "path": "context/versions duplicate object keys", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "strict duplicate-key detection in hyf_core.operation_context and Mojo control test"},
      8     {"id": "input_duplicate_key_identity", "path": "input.* duplicate object keys", "expect": "reject", "wire": "invalid_request", "owner": "C008/C009", "enforced_by": "C004 keeps input as a Value; typed strict input decode is C008/C009"},
      9     {"id": "whitespace_only_identity_strings", "path": "blank-only actor_id/farm_id/version strings", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "runtime _require_nonblank is intentionally stricter than schema minLength:1; Mojo control test"},
     10     {"id": "escaped_duplicate_key_identity", "path": "context.actor_id vs context.\\u0061ctor_id", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "decoded key identity in duplicate detection"},
     11     {"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"},
     12     {"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"},
     13     {"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"},
     14     {"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-6/reference-schema-validate.v11.py.txt executes the paired accepting/rejecting control; C023 owns typed consistency"},
     15     {"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"},
     16     {"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"},
     17     {"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"},
     18     {"id": "negative_zero", "path": "quantity.value='-0' or '-0.00'", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "D23 grammar; labelled semantic script + C009 parse"},
     19     {"id": "fractional_width_10", "path": "quantity.value with 10 fractional digits", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema pattern; C009 int64/scale bound"},
     20     {"id": "ambiguous_leading_zero", "path": "quantity.value='080'", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema pattern"},
     21     {"id": "exponent_spelling", "path": "quantity.value='8e2'", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema pattern"},
     22     {"id": "leading_plus", "path": "quantity.value='+8'", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema pattern"},
     23     {"id": "int64_coefficient_overflow", "path": "quantity coefficient beyond int64 after removing the point", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "C009 checked int64 decode; labelled semantic script"},
     24     {"id": "span_end_before_start", "path": "evidence span end < start", "expect": "reject", "wire": "invalid_request", "owner": "C008/C009", "enforced_by": "hyf_core.domain.evidence.span_evidence; C004 labelled semantic script"},
     25     {"id": "span_revision_mismatch", "path": "evidence span revision differs from its source revision", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "validate_span_against_revision; C004 labelled semantic script"},
     26     {"id": "type_coercion_number_for_string", "path": "quantity.value as JSON number instead of string", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema type; C009 typed decode (no coercion)"},
     27     {"id": "present_null_optional_scalar", "path": "context.timezone=null", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "schema type string; parser rejects present null"},
     28     {"id": "missing_selector", "path": "context.versions absent", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "operation-context parse requires versions"},
     29     {"id": "unknown_selector", "path": "context.versions.schema is not hyf_ops_v2", "expect": "reject", "wire": "invalid_request", "owner": "C004", "enforced_by": "selector detection falls back to the legacy parser, which rejects versions"},
     30     {"id": "taxonomy_catalogue_id_duplicate", "path": "input.references.taxonomy.products[].catalogue_id unique", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"},
     31     {"id": "normalization_unit_duplicate", "path": "input.references.normalization.units[].unit unique", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 labelled semantic script; C023 typed consistency"},
     32     {"id": "coverage_count_disagreement", "path": "input.coverage evaluated/excluded counts disagree with actual inputs/results", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "supplied_only coverage accounting; C023 typed consistency"},
     33     {"id": "deterministic_path_reports_model_non_use", "path": "context.versions.model present with deterministic execution", "expect": "accepted_no_call", "wire": "capability_unavailable (pre-activation)", "owner": "C042-C046", "enforced_by": "C004 unavailability guard issues zero provider calls"},
     34     {"id": "prior_record_farm_ownership", "path": "input.prior_records[].farm_id equals context.farm_id", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 binds the required per-record farm_id and executes a labelled cross-reference script; C023 owns typed farm_id equality with context.farm_id"},
     35     {"id": "proposal_expected_revision_linkage", "path": "output.proposed_changes[].expected_revision ties to the supplied target record when target.id is non-null", "expect": "reject", "wire": "invalid_request", "owner": "C023", "enforced_by": "C004 schema conditional (non-null id requires non-null expected_revision; id null forbids an invented revision) and a labelled cross-reference script; C023 owns typed linkage"},
     36     {"id": "price_known_requires_scaled_facts", "path": "input.snapshots[].price state=known with null/absent amount, missing scale, decimal amount or out-of-range scale", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "ADR-0027 D47 BP01 schema conditional (canonical nonnegative integer amount, integer scale 0..9, nonblank currency, closed basis); C009 typed scaled-money decode"},
     37     {"id": "price_unknown_is_not_zero", "path": "input.snapshots[].price state=unknown carrying a value, or unknown read as a free/zero price", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "BP01 schema conditional (amount/scale/currency null and basis unknown); C009 maps the null wire fields mechanically to the existing explicit unknown alternative"},
     38     {"id": "price_coefficient_int64_bound", "path": "price amount coefficient beyond 9223372036854775807", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "checked scale/int64 decode; the schema bounds only the canonical form and the 19-character magnitude"},
     39     {"id": "price_basis_closed", "path": "price basis outside per_unit|per_pack|per_order|unknown", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "BP01 schema enum"},
     40     {"id": "price_fee_family_closed", "path": "price.fees entries not closed {kind,amount,scale,currency}", "expect": "reject", "wire": "invalid_request", "owner": "C009", "enforced_by": "BP01 schema; the legacy hyf_v1_jev money-schema fees family is retained unchanged as provenance"},
     41     {"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"},
     42     {"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"},
     43     {"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"},
     44     {"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-6/reference-schema-validate.v11.py.txt executes the paired accepting/rejecting never-copy-all-supplied controls; C023/C041 own runtime actual-use"},
     45     {"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-6/reference-schema-validate.v11.py.txt executes the paired uniqueness controls; C023 owns runtime uniqueness"},
     46     {"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-6/reference-schema-validate.v11.py.txt executes the paired assessed/allocation-agreement controls; C023/C041 own runtime consistency"},
     47     {"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-6/reference-schema-validate.v11.py.txt full-match oracle; C009 typed decode"},
     48     {"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-6/reference-schema-validate.v11.py.txt nonblank oracle; C009 typed decode"},
     49     {"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-6/reference-schema-validate.v11.py.txt int64/full-string/nonblank controls; C009 typed decode"}
     50   ]
     51 }