From cbaccdda507fb633cbad481e649cb1bf72bff3e8 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:29:26 +0000 Subject: [PATCH 01/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- src/v4/extdeps/formats/openapi.dag | 65 +++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 5 deletions(-) diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index 5731492890f..f03031c8bbb 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -2,13 +2,25 @@ // Scope: OpenAPI 3.1.0 document slice; Lane C (TASKS.md T-4.6). // Status: T-4.6 β€” parse/emit axes (gated T-6/T-7/T-10), numeric-lexeme profile (OAS Β§4.1 openapi semver), // unique-name profile (OAS Map-key uniqueness), OPENAPI-NETWORK-BRIDGE (HttpMethod + status-code), -// document/operation wire-contract facts. +// document/operation wire-contract facts (operation facts compose coordination WireContractFacts). // Anchor: https://spec.openapis.org/oas/v3.1.0 module v4.extdeps.formats.openapi -import v4.extdeps.coordination { ExchangePattern, RequestReply } +import v4.extdeps.coordination { + BindRef, + CoordinationBind, + CoordinationEffectKind, + EndpointRef, + ExchangePattern, + Http, + ImmediateSettlement, + NoReplicaConvergence, + WireContract, + WireContractFacts, + coordination_effect_obligation +} import v4.extdeps.formats.json { JsonDocument, JsonValue } import v4.extdeps.formats.json_schema { JsonSchema } import v4.extdeps.formats.yaml { YamlDocument } @@ -528,13 +540,56 @@ fn openapi_http_status_code_value( } -data openapi_operation_exchange_request_reply: ExchangePattern = RequestReply - type OpenApiOperationWireContractFacts { + coordination: WireContractFacts, admitted_method: OpenApiAdmittedHttpMethod, path_template: OpenApiPathTemplateKey, } +fn openapi_operation_exchange_authority() -> ExchangePattern { + coordination_effect_obligation(effect: Http).required_exchange +} + +fn openapi_http_wire_contract_facts(from: EndpointRef, to: EndpointRef) -> WireContractFacts { + WireContractFacts { + from: from, + to: to, + exchange: openapi_operation_exchange_authority(), + settlement: ImmediateSettlement, + consistency: NoReplicaConvergence + } +} + +fn openapi_operation_wire_contract_facts( + from: EndpointRef, + to: EndpointRef, + admitted_method: OpenApiAdmittedHttpMethod, + path_template: OpenApiPathTemplateKey +) -> OpenApiOperationWireContractFacts { + OpenApiOperationWireContractFacts { + coordination: openapi_http_wire_contract_facts(from: from, to: to), + admitted_method: admitted_method, + path_template: path_template + } +} + +fn openapi_operation_wire_contract( + facts: OpenApiOperationWireContractFacts, + bind: CoordinationBind +) -> WireContract { + WireContract { + facts: facts.coordination, + bind: bind + } +} + +fn openapi_http_coordination_bind(bind: BindRef) -> CoordinationBind { + CoordinationBind { + bind: bind, + effect: Http + } +} + type OpenApiDocumentWireContractFacts { openapi_version: OpenApiOpenapiField3_1, paths: Optional, @@ -546,4 +601,4 @@ type OpenApiDocumentWireContractFacts { // 🟑 gated β€” feature: T-10 emit pipeline-stage substrate (TASKS T-10) β€” SL-3229-T4-FORMAT-T6T7 (emit half). // 🟑 gated β€” feature: unique-name profile parse enforcement binding (OpenApiUniqueNameProfileFacts consumption at parse boundary) β€” SL-3229-OPENAPI-UNIQUE-NAME-PARSE. // 🟑 gated β€” feature: OPENAPI-NETWORK-BRIDGE consumer binding at emit boundary (openapi_admitted_to_http_method + openapi_response_key_wildcard_bridge_catalog) β€” SL-3229-OPENAPI-NETWORK-BRIDGE-EMIT. -// 🟑 gated β€” feature: operation WireContractFacts composition with coordination.dag WireContractFacts + ExchangePattern authority β€” SL-3229-OPENAPI-WIRECONTRACT-COORDINATION. +// 🟒 coproduct dissolution β€” SL-3229-OPENAPI-WIRECONTRACT-COORDINATION β€” OpenApiOperationWireContractFacts composes coordination WireContractFacts; exchange/settlement/consistency authority routes through coordination_effect_obligation(Http). From ca223845d4baf4a49fdd28bae804f0186d79e28b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:30:59 +0000 Subject: [PATCH 02/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- src/v3/compiler/tests/integration.rs | 2 + .../v4_extdeps_openapi_dag_smoke_test.rs | 94 +++++++++++++++++++ src/v4/extdeps/formats/openapi.dag | 1 - 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 61b008c268a..3470bd42e39 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -287,6 +287,8 @@ mod v4_compiler_emit_translate_smoke_test; mod v4_compiler_parse_table_dag_smoke_test; #[path = "integration/v4_extdeps_coordination_dag_smoke_test.rs"] mod v4_extdeps_coordination_dag_smoke_test; +#[path = "integration/v4_extdeps_openapi_dag_smoke_test.rs"] +mod v4_extdeps_openapi_dag_smoke_test; #[path = "integration/v4_extdeps_file_system_dag_smoke_test.rs"] mod v4_extdeps_file_system_dag_smoke_test; #[path = "integration/v4_extdeps_react_dag_smoke_test.rs"] diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs new file mode 100644 index 00000000000..547c5ed57a0 --- /dev/null +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -0,0 +1,94 @@ +//! **Layer:** integration +//! +//! T-4.6 / SL-3229-OPENAPI-WIRECONTRACT-COORDINATION ratchet for +//! `src/v4/extdeps/formats/openapi.dag`: `OpenApiOperationWireContractFacts` +//! composes `coordination.dag` `WireContractFacts`; exchange authority routes +//! through `coordination_effect_obligation(Http)`. + +use v3_compiler::parse_for_test; +use v3_compiler::parse_surface::{SurfaceField, SurfaceItem, SurfaceType, TypeAngleArg}; +use v3_compiler::tokenize_for_test; + +const OPENAPI_DAG: &str = include_str!("../../../../v4/extdeps/formats/openapi.dag"); +const OPENAPI_PATH: &str = "src/v4/extdeps/formats/openapi.dag"; + +fn openapi_surface_or_panic() -> v3_compiler::parse_surface::SurfaceModule { + let tokens = tokenize_for_test(OPENAPI_DAG, OPENAPI_PATH) + .unwrap_or_else(|e| panic!("{OPENAPI_PATH}: tokenize: {e:?}")); + parse_for_test(&tokens, OPENAPI_PATH).unwrap_or_else(|e| panic!("{OPENAPI_PATH}: parse: {e:?}")) +} + +fn type_record_fields<'a>( + module: &'a v3_compiler::parse_surface::SurfaceModule, + name: &str, +) -> &'a [SurfaceField] { + module + .items + .iter() + .find_map(|item| match item { + SurfaceItem::TypeRecord { + name: item_name, + fields, + .. + } if item_name == name => Some(fields.as_slice()), + _ => None, + }) + .unwrap_or_else(|| panic!("missing type record {name}")) +} + +fn surface_type_name(ty: &SurfaceType) -> String { + match ty { + SurfaceType::Named { name, .. } => name.clone(), + SurfaceType::Parameterized { name, args, .. } => { + let rendered = args + .iter() + .map(|arg| match arg { + TypeAngleArg::TypeExpr { ty } => surface_type_name(ty), + TypeAngleArg::WidthNatLiteral { decimal, .. } => decimal.clone(), + }) + .collect::>() + .join(", "); + format!("{name}<{rendered}>") + } + SurfaceType::Optional { inner, .. } => format!("?{}", surface_type_name(inner)), + SurfaceType::Arrow { .. } => "fn".to_string(), + } +} + +fn record_field_type(fields: &[SurfaceField], name: &str) -> String { + fields + .iter() + .find(|field| field.name == name) + .map(|field| surface_type_name(&field.ty)) + .unwrap_or_else(|| panic!("missing field {name}")) +} + +#[test] +fn v4_extdeps_openapi_dag_parses() { + let _module = openapi_surface_or_panic(); +} + +#[test] +fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { + let module = openapi_surface_or_panic(); + let facts = type_record_fields(&module, "OpenApiOperationWireContractFacts"); + assert_eq!(record_field_type(facts, "coordination"), "WireContractFacts"); + assert_eq!( + record_field_type(facts, "admitted_method"), + "OpenApiAdmittedHttpMethod" + ); + assert_eq!( + record_field_type(facts, "path_template"), + "OpenApiPathTemplateKey" + ); + assert!( + OPENAPI_DAG.contains("fn openapi_operation_exchange_authority() -> ExchangePattern") + && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_exchange"), + "OpenAPI operation exchange must route through Http obligation row, not a parallel RequestReply witness" + ); + assert!( + OPENAPI_DAG.contains("fn openapi_operation_wire_contract(") + && OPENAPI_DAG.contains("facts: facts.coordination"), + "OpenApiOperationWireContractFacts must lower to coordination WireContract via facts.coordination" + ); +} diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index f03031c8bbb..4bd894446de 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -11,7 +11,6 @@ module v4.extdeps.formats.openapi import v4.extdeps.coordination { BindRef, CoordinationBind, - CoordinationEffectKind, EndpointRef, ExchangePattern, Http, From 9bbdcd1559905fe49fad12503c032b5ecfe4f447 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:47:08 +0000 Subject: [PATCH 03/11] chore: apply cargo fmt for PR #3869 CI Co-authored-by: Cursor --- src/v3/compiler/tests/integration.rs | 4 ++-- .../tests/integration/v4_extdeps_openapi_dag_smoke_test.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 3470bd42e39..4bf6fc5fff7 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -287,10 +287,10 @@ mod v4_compiler_emit_translate_smoke_test; mod v4_compiler_parse_table_dag_smoke_test; #[path = "integration/v4_extdeps_coordination_dag_smoke_test.rs"] mod v4_extdeps_coordination_dag_smoke_test; -#[path = "integration/v4_extdeps_openapi_dag_smoke_test.rs"] -mod v4_extdeps_openapi_dag_smoke_test; #[path = "integration/v4_extdeps_file_system_dag_smoke_test.rs"] mod v4_extdeps_file_system_dag_smoke_test; +#[path = "integration/v4_extdeps_openapi_dag_smoke_test.rs"] +mod v4_extdeps_openapi_dag_smoke_test; #[path = "integration/v4_extdeps_react_dag_smoke_test.rs"] mod v4_extdeps_react_dag_smoke_test; #[path = "integration/v4_lens_affected_set_dag_smoke_test.rs"] diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs index 547c5ed57a0..45d25ec1e49 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -72,7 +72,10 @@ fn v4_extdeps_openapi_dag_parses() { fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { let module = openapi_surface_or_panic(); let facts = type_record_fields(&module, "OpenApiOperationWireContractFacts"); - assert_eq!(record_field_type(facts, "coordination"), "WireContractFacts"); + assert_eq!( + record_field_type(facts, "coordination"), + "WireContractFacts" + ); assert_eq!( record_field_type(facts, "admitted_method"), "OpenApiAdmittedHttpMethod" From 21efb622a066ce8b7a2d95c95cdde14ac65e2184 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:48:52 +0000 Subject: [PATCH 04/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- src/v4/extdeps/coordination.dag | 18 ++++++++++++++++++ src/v4/extdeps/formats/openapi.dag | 10 +++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/v4/extdeps/coordination.dag b/src/v4/extdeps/coordination.dag index d3d467e901f..bfeef6be37a 100644 --- a/src/v4/extdeps/coordination.dag +++ b/src/v4/extdeps/coordination.dag @@ -116,6 +116,24 @@ fn wire_contract_obligation_table_t4_8() -> List { ] } +fn wire_contract_settlement_from_obligation( + settlement: SettlementGuarantee +) -> SettlementGuarantee { + match settlement { + ImmediateSettlement => ImmediateSettlement + SettlesWithin { bound: _ } => SettlesWithin { bound: SettleBound { steps: 0 } } + } +} + +fn wire_contract_consistency_from_obligation( + consistency: ConsistencyGuarantee +) -> ConsistencyGuarantee { + match consistency { + NoReplicaConvergence => NoReplicaConvergence + EventuallyConsistent { bound: _ } => EventuallyConsistent { bound: ConvergeBound { steps: 0 } } + } +} + // coincides: src/v4/std/node.dag A1/K-1, operator-ratified 2026-05-15. type BindRef { identity: Symbol diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index 4bd894446de..cd04b9148b4 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -10,15 +10,19 @@ module v4.extdeps.formats.openapi import v4.extdeps.coordination { BindRef, + ConsistencyGuarantee, + ConvergeBound, CoordinationBind, EndpointRef, ExchangePattern, Http, - ImmediateSettlement, - NoReplicaConvergence, + SettlementGuarantee, + SettleBound, WireContract, WireContractFacts, - coordination_effect_obligation + coordination_effect_obligation, + wire_contract_consistency_from_obligation, + wire_contract_settlement_from_obligation } import v4.extdeps.formats.json { JsonDocument, JsonValue } import v4.extdeps.formats.json_schema { JsonSchema } From aa8af0cf9185a0c43787d6368c0a6706c2a6b079 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:50:34 +0000 Subject: [PATCH 05/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- .../v4_extdeps_coordination_dag_smoke_test.rs | 171 ------------------ .../v4_extdeps_openapi_dag_smoke_test.rs | 21 ++- src/v4/extdeps/formats/openapi.dag | 16 +- 3 files changed, 33 insertions(+), 175 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs index aa91ecd3a54..8b137891791 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs @@ -1,172 +1 @@ -//! **Layer:** integration -//! -//! T-4.8 ratchet for `src/v4/extdeps/coordination.dag`: the PR #3207 -//! decomposed shape is authoritative. `WireContractFacts` carries exchange / -//! settlement / consistency facts, `CoordinationBind` carries the closed -//! `CoordinationEffectKind`, and WIRECONTRACT-OBLIGATION-TABLE-T4.8 is visible -//! as executable per-effect obligation rows. -use v3_compiler::parse_for_test; -use v3_compiler::parse_surface::{SurfaceField, SurfaceItem, SurfaceType, TypeAngleArg}; -use v3_compiler::tokenize_for_test; - -const COORDINATION_DAG: &str = include_str!("../../../../v4/extdeps/coordination.dag"); -const COORDINATION_PATH: &str = "src/v4/extdeps/coordination.dag"; - -fn coordination_surface_or_panic() -> v3_compiler::parse_surface::SurfaceModule { - let tokens = tokenize_for_test(COORDINATION_DAG, COORDINATION_PATH) - .unwrap_or_else(|e| panic!("{COORDINATION_PATH}: tokenize: {e:?}")); - parse_for_test(&tokens, COORDINATION_PATH) - .unwrap_or_else(|e| panic!("{COORDINATION_PATH}: parse: {e:?}")) -} - -fn type_record_fields<'a>( - module: &'a v3_compiler::parse_surface::SurfaceModule, - name: &str, -) -> &'a [SurfaceField] { - module - .items - .iter() - .find_map(|item| match item { - SurfaceItem::TypeRecord { - name: item_name, - fields, - .. - } if item_name == name => Some(fields.as_slice()), - _ => None, - }) - .unwrap_or_else(|| panic!("missing type record {name}")) -} - -fn type_sum_variants( - module: &v3_compiler::parse_surface::SurfaceModule, - name: &str, -) -> Vec { - module - .items - .iter() - .find_map(|item| match item { - SurfaceItem::TypeSum { - name: item_name, - variants, - .. - } if item_name == name => Some(variants.iter().map(|v| v.name.clone()).collect()), - _ => None, - }) - .unwrap_or_else(|| panic!("missing type sum {name}")) -} - -fn surface_type_name(ty: &SurfaceType) -> String { - match ty { - SurfaceType::Named { name, .. } => name.clone(), - SurfaceType::Parameterized { name, args, .. } => { - let rendered = args - .iter() - .map(|arg| match arg { - TypeAngleArg::TypeExpr { ty } => surface_type_name(ty), - TypeAngleArg::WidthNatLiteral { decimal, .. } => decimal.clone(), - }) - .collect::>() - .join(", "); - format!("{name}<{rendered}>") - } - SurfaceType::Optional { inner, .. } => format!("?{}", surface_type_name(inner)), - SurfaceType::Arrow { .. } => "fn".to_string(), - } -} - -fn record_field_type(fields: &[SurfaceField], name: &str) -> String { - fields - .iter() - .find(|field| field.name == name) - .map(|field| surface_type_name(&field.ty)) - .unwrap_or_else(|| panic!("missing field {name}")) -} - -#[test] -fn v4_extdeps_coordination_dag_parses() { - let _module = coordination_surface_or_panic(); -} - -#[test] -fn v4_extdeps_coordination_wire_contract_uses_decomposed_facts() { - let module = coordination_surface_or_panic(); - let facts = type_record_fields(&module, "WireContractFacts"); - assert_eq!(record_field_type(facts, "exchange"), "ExchangePattern"); - assert_eq!( - record_field_type(facts, "settlement"), - "SettlementGuarantee" - ); - assert_eq!( - record_field_type(facts, "consistency"), - "ConsistencyGuarantee" - ); - - let wire = type_record_fields(&module, "WireContract"); - assert_eq!(record_field_type(wire, "facts"), "WireContractFacts"); - assert_eq!(record_field_type(wire, "bind"), "CoordinationBind"); -} - -#[test] -fn v4_extdeps_coordination_effect_kind_has_obligation_table() { - let module = coordination_surface_or_panic(); - assert_eq!( - type_sum_variants(&module, "CoordinationEffectKind"), - ["Http", "Queue", "Stream", "PubSub"] - ); - - let obligation = type_record_fields(&module, "CoordinationEffectObligation"); - assert_eq!( - record_field_type(obligation, "effect"), - "CoordinationEffectKind" - ); - assert_eq!( - record_field_type(obligation, "required_exchange"), - "ExchangePattern" - ); - assert_eq!( - record_field_type(obligation, "required_settlement"), - "SettlementGuarantee" - ); - assert_eq!( - record_field_type(obligation, "required_consistency"), - "ConsistencyGuarantee" - ); - - assert!( - COORDINATION_DAG.contains("type SettlementGuarantee") - && COORDINATION_DAG.contains("settlement: SettlementGuarantee") - && COORDINATION_DAG - .contains("required_settlement: SettlementGuarantee"), - "settlement obligations must share the guarantee discriminant while keeping requirement bounds out of WireContractFacts" - ); - assert!( - COORDINATION_DAG.contains("type ConsistencyGuarantee") - && COORDINATION_DAG.contains("consistency: ConsistencyGuarantee") - && COORDINATION_DAG - .contains("required_consistency: ConsistencyGuarantee"), - "consistency obligations must share the guarantee discriminant while keeping requirement bounds out of WireContractFacts" - ); - assert!( - COORDINATION_DAG.contains("fn wire_contract_obligation_table_t4_8") - && COORDINATION_DAG.contains("[\n coordination_effect_obligation(effect: Http),") - && COORDINATION_DAG.contains("coordination_effect_obligation(effect: Queue),") - && COORDINATION_DAG.contains("coordination_effect_obligation(effect: Stream),") - && COORDINATION_DAG.contains("coordination_effect_obligation(effect: PubSub)\n ]"), - "WIRECONTRACT-OBLIGATION-TABLE-T4.8 must use the v4 list literal surface and enumerate every effect arm" - ); - for (effect, exchange) in [ - ("Http", "RequestReply"), - ("Queue", "FireAndForget"), - ("Stream", "StreamExchange"), - ("PubSub", "PublishSubscribe"), - ] { - let expected = format!( - "{effect} => CoordinationEffectObligation {{\n effect: {effect},\n required_exchange: {exchange}," - ); - assert!( - COORDINATION_DAG.contains(&expected), - "CoordinationEffectKind arm {effect} must route through its executable obligation row with exchange fact {exchange}" - ); - } -} diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs index 45d25ec1e49..f4d9a2f4540 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -2,8 +2,8 @@ //! //! T-4.6 / SL-3229-OPENAPI-WIRECONTRACT-COORDINATION ratchet for //! `src/v4/extdeps/formats/openapi.dag`: `OpenApiOperationWireContractFacts` -//! composes `coordination.dag` `WireContractFacts`; exchange authority routes -//! through `coordination_effect_obligation(Http)`. +//! composes `coordination.dag` `WireContractFacts`; exchange / settlement / +//! consistency authority routes through `coordination_effect_obligation(Http)`. use v3_compiler::parse_for_test; use v3_compiler::parse_surface::{SurfaceField, SurfaceItem, SurfaceType, TypeAngleArg}; @@ -89,6 +89,23 @@ fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_exchange"), "OpenAPI operation exchange must route through Http obligation row, not a parallel RequestReply witness" ); + assert!( + OPENAPI_DAG.contains("fn openapi_operation_settlement_authority() -> SettlementGuarantee") + && OPENAPI_DAG.contains("wire_contract_settlement_from_obligation(") + && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_settlement"), + "OpenAPI operation settlement must route through Http obligation row via bound coercion, not inline ImmediateSettlement" + ); + assert!( + OPENAPI_DAG.contains("fn openapi_operation_consistency_authority() -> ConsistencyGuarantee") + && OPENAPI_DAG.contains("wire_contract_consistency_from_obligation(") + && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_consistency"), + "OpenAPI operation consistency must route through Http obligation row via bound coercion, not inline NoReplicaConvergence" + ); + assert!( + !OPENAPI_DAG.contains("settlement: ImmediateSettlement,") + && !OPENAPI_DAG.contains("consistency: NoReplicaConvergence"), + "openapi_http_wire_contract_facts must not restate Http obligation settlement/consistency as inline literals" + ); assert!( OPENAPI_DAG.contains("fn openapi_operation_wire_contract(") && OPENAPI_DAG.contains("facts: facts.coordination"), diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index cd04b9148b4..f147f17bb6e 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -553,13 +553,25 @@ fn openapi_operation_exchange_authority() -> ExchangePattern { coordination_effect_obligation(effect: Http).required_exchange } +fn openapi_operation_settlement_authority() -> SettlementGuarantee { + wire_contract_settlement_from_obligation( + settlement: coordination_effect_obligation(effect: Http).required_settlement + ) +} + +fn openapi_operation_consistency_authority() -> ConsistencyGuarantee { + wire_contract_consistency_from_obligation( + consistency: coordination_effect_obligation(effect: Http).required_consistency + ) +} + fn openapi_http_wire_contract_facts(from: EndpointRef, to: EndpointRef) -> WireContractFacts { WireContractFacts { from: from, to: to, exchange: openapi_operation_exchange_authority(), - settlement: ImmediateSettlement, - consistency: NoReplicaConvergence + settlement: openapi_operation_settlement_authority(), + consistency: openapi_operation_consistency_authority() } } From f598e8c016c42e3ae1ec4507248986ef174ecf07 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:59:05 +0000 Subject: [PATCH 06/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- .../tests/integration/sg0_census_test.rs | 2 + .../v4_extdeps_coordination_dag_smoke_test.rs | 171 ++++++++++++++++++ .../v4_extdeps_openapi_dag_smoke_test.rs | 39 ++-- src/v4/extdeps/coordination.dag | 18 -- src/v4/extdeps/formats/openapi.dag | 111 +++++++++--- 5 files changed, 282 insertions(+), 59 deletions(-) diff --git a/src/v3/compiler/tests/integration/sg0_census_test.rs b/src/v3/compiler/tests/integration/sg0_census_test.rs index 5d6475f7bd1..e5a2f7302bb 100644 --- a/src/v3/compiler/tests/integration/sg0_census_test.rs +++ b/src/v3/compiler/tests/integration/sg0_census_test.rs @@ -855,6 +855,8 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[ // T-4.8 coordination substrate: decomposed WireContractFacts + CoordinationBind shape, // with WIRECONTRACT-OBLIGATION-TABLE-T4.8 per-effect obligation rows. "src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs", + // T-4.6 openapi wire-contract composition with coordination.dag (SL-3229-OPENAPI-WIRECONTRACT-COORDINATION). + "src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs", // T-4.7 React framework substrate: `compile_to_dag` smoke on // `src/v4/extdeps/frameworks/react.dag` (zero module diagnostics). // SG-0 ratchet per INVARIANTS Β§P5(b) + typescript extdeps precedent. diff --git a/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs index 8b137891791..aa91ecd3a54 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs @@ -1 +1,172 @@ +//! **Layer:** integration +//! +//! T-4.8 ratchet for `src/v4/extdeps/coordination.dag`: the PR #3207 +//! decomposed shape is authoritative. `WireContractFacts` carries exchange / +//! settlement / consistency facts, `CoordinationBind` carries the closed +//! `CoordinationEffectKind`, and WIRECONTRACT-OBLIGATION-TABLE-T4.8 is visible +//! as executable per-effect obligation rows. +use v3_compiler::parse_for_test; +use v3_compiler::parse_surface::{SurfaceField, SurfaceItem, SurfaceType, TypeAngleArg}; +use v3_compiler::tokenize_for_test; + +const COORDINATION_DAG: &str = include_str!("../../../../v4/extdeps/coordination.dag"); +const COORDINATION_PATH: &str = "src/v4/extdeps/coordination.dag"; + +fn coordination_surface_or_panic() -> v3_compiler::parse_surface::SurfaceModule { + let tokens = tokenize_for_test(COORDINATION_DAG, COORDINATION_PATH) + .unwrap_or_else(|e| panic!("{COORDINATION_PATH}: tokenize: {e:?}")); + parse_for_test(&tokens, COORDINATION_PATH) + .unwrap_or_else(|e| panic!("{COORDINATION_PATH}: parse: {e:?}")) +} + +fn type_record_fields<'a>( + module: &'a v3_compiler::parse_surface::SurfaceModule, + name: &str, +) -> &'a [SurfaceField] { + module + .items + .iter() + .find_map(|item| match item { + SurfaceItem::TypeRecord { + name: item_name, + fields, + .. + } if item_name == name => Some(fields.as_slice()), + _ => None, + }) + .unwrap_or_else(|| panic!("missing type record {name}")) +} + +fn type_sum_variants( + module: &v3_compiler::parse_surface::SurfaceModule, + name: &str, +) -> Vec { + module + .items + .iter() + .find_map(|item| match item { + SurfaceItem::TypeSum { + name: item_name, + variants, + .. + } if item_name == name => Some(variants.iter().map(|v| v.name.clone()).collect()), + _ => None, + }) + .unwrap_or_else(|| panic!("missing type sum {name}")) +} + +fn surface_type_name(ty: &SurfaceType) -> String { + match ty { + SurfaceType::Named { name, .. } => name.clone(), + SurfaceType::Parameterized { name, args, .. } => { + let rendered = args + .iter() + .map(|arg| match arg { + TypeAngleArg::TypeExpr { ty } => surface_type_name(ty), + TypeAngleArg::WidthNatLiteral { decimal, .. } => decimal.clone(), + }) + .collect::>() + .join(", "); + format!("{name}<{rendered}>") + } + SurfaceType::Optional { inner, .. } => format!("?{}", surface_type_name(inner)), + SurfaceType::Arrow { .. } => "fn".to_string(), + } +} + +fn record_field_type(fields: &[SurfaceField], name: &str) -> String { + fields + .iter() + .find(|field| field.name == name) + .map(|field| surface_type_name(&field.ty)) + .unwrap_or_else(|| panic!("missing field {name}")) +} + +#[test] +fn v4_extdeps_coordination_dag_parses() { + let _module = coordination_surface_or_panic(); +} + +#[test] +fn v4_extdeps_coordination_wire_contract_uses_decomposed_facts() { + let module = coordination_surface_or_panic(); + let facts = type_record_fields(&module, "WireContractFacts"); + assert_eq!(record_field_type(facts, "exchange"), "ExchangePattern"); + assert_eq!( + record_field_type(facts, "settlement"), + "SettlementGuarantee" + ); + assert_eq!( + record_field_type(facts, "consistency"), + "ConsistencyGuarantee" + ); + + let wire = type_record_fields(&module, "WireContract"); + assert_eq!(record_field_type(wire, "facts"), "WireContractFacts"); + assert_eq!(record_field_type(wire, "bind"), "CoordinationBind"); +} + +#[test] +fn v4_extdeps_coordination_effect_kind_has_obligation_table() { + let module = coordination_surface_or_panic(); + assert_eq!( + type_sum_variants(&module, "CoordinationEffectKind"), + ["Http", "Queue", "Stream", "PubSub"] + ); + + let obligation = type_record_fields(&module, "CoordinationEffectObligation"); + assert_eq!( + record_field_type(obligation, "effect"), + "CoordinationEffectKind" + ); + assert_eq!( + record_field_type(obligation, "required_exchange"), + "ExchangePattern" + ); + assert_eq!( + record_field_type(obligation, "required_settlement"), + "SettlementGuarantee" + ); + assert_eq!( + record_field_type(obligation, "required_consistency"), + "ConsistencyGuarantee" + ); + + assert!( + COORDINATION_DAG.contains("type SettlementGuarantee") + && COORDINATION_DAG.contains("settlement: SettlementGuarantee") + && COORDINATION_DAG + .contains("required_settlement: SettlementGuarantee"), + "settlement obligations must share the guarantee discriminant while keeping requirement bounds out of WireContractFacts" + ); + assert!( + COORDINATION_DAG.contains("type ConsistencyGuarantee") + && COORDINATION_DAG.contains("consistency: ConsistencyGuarantee") + && COORDINATION_DAG + .contains("required_consistency: ConsistencyGuarantee"), + "consistency obligations must share the guarantee discriminant while keeping requirement bounds out of WireContractFacts" + ); + assert!( + COORDINATION_DAG.contains("fn wire_contract_obligation_table_t4_8") + && COORDINATION_DAG.contains("[\n coordination_effect_obligation(effect: Http),") + && COORDINATION_DAG.contains("coordination_effect_obligation(effect: Queue),") + && COORDINATION_DAG.contains("coordination_effect_obligation(effect: Stream),") + && COORDINATION_DAG.contains("coordination_effect_obligation(effect: PubSub)\n ]"), + "WIRECONTRACT-OBLIGATION-TABLE-T4.8 must use the v4 list literal surface and enumerate every effect arm" + ); + for (effect, exchange) in [ + ("Http", "RequestReply"), + ("Queue", "FireAndForget"), + ("Stream", "StreamExchange"), + ("PubSub", "PublishSubscribe"), + ] { + let expected = format!( + "{effect} => CoordinationEffectObligation {{\n effect: {effect},\n required_exchange: {exchange}," + ); + assert!( + COORDINATION_DAG.contains(&expected), + "CoordinationEffectKind arm {effect} must route through its executable obligation row with exchange fact {exchange}" + ); + } +} diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs index f4d9a2f4540..f03275509ff 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -4,6 +4,10 @@ //! `src/v4/extdeps/formats/openapi.dag`: `OpenApiOperationWireContractFacts` //! composes `coordination.dag` `WireContractFacts`; exchange / settlement / //! consistency authority routes through `coordination_effect_obligation(Http)`. +//! +//! **PR receipt (P5 Mechanism (b)):** this harness + matching +//! `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` + INVARIANTS table +//! row land in the same PR. use v3_compiler::parse_for_test; use v3_compiler::parse_surface::{SurfaceField, SurfaceItem, SurfaceType, TypeAngleArg}; @@ -85,30 +89,33 @@ fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { "OpenApiPathTemplateKey" ); assert!( - OPENAPI_DAG.contains("fn openapi_operation_exchange_authority() -> ExchangePattern") - && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_exchange"), - "OpenAPI operation exchange must route through Http obligation row, not a parallel RequestReply witness" + OPENAPI_DAG.contains("fn openapi_http_obligation() -> CoordinationEffectObligation") + && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http)"), + "OpenAPI wire-contract facts must source the Http obligation row from coordination.dag" ); assert!( - OPENAPI_DAG.contains("fn openapi_operation_settlement_authority() -> SettlementGuarantee") - && OPENAPI_DAG.contains("wire_contract_settlement_from_obligation(") - && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_settlement"), - "OpenAPI operation settlement must route through Http obligation row via bound coercion, not inline ImmediateSettlement" + OPENAPI_DAG.contains("fn openapi_http_settlement_from_obligation(") + && OPENAPI_DAG.contains("ImmediateSettlement => Accepted { value: ImmediateSettlement") + && OPENAPI_DAG.contains("openapi_http_bounded_settlement_not_admitted"), + "Http settlement must project ImmediateSettlement from the obligation row and fail-closed on bounded required settlement" ); assert!( - OPENAPI_DAG.contains("fn openapi_operation_consistency_authority() -> ConsistencyGuarantee") - && OPENAPI_DAG.contains("wire_contract_consistency_from_obligation(") - && OPENAPI_DAG.contains("coordination_effect_obligation(effect: Http).required_consistency"), - "OpenAPI operation consistency must route through Http obligation row via bound coercion, not inline NoReplicaConvergence" + OPENAPI_DAG.contains("fn openapi_http_consistency_from_obligation(") + && OPENAPI_DAG.contains("NoReplicaConvergence => Accepted { value: NoReplicaConvergence") + && OPENAPI_DAG.contains("openapi_http_bounded_consistency_not_admitted"), + "Http consistency must project NoReplicaConvergence from the obligation row and fail-closed on bounded required consistency" ); assert!( - !OPENAPI_DAG.contains("settlement: ImmediateSettlement,") - && !OPENAPI_DAG.contains("consistency: NoReplicaConvergence"), - "openapi_http_wire_contract_facts must not restate Http obligation settlement/consistency as inline literals" + !OPENAPI_DAG.contains("data openapi_operation_exchange_request_reply") + && !OPENAPI_DAG.contains("wire_contract_settlement_from_obligation") + && !OPENAPI_DAG.contains("SettleBound { steps: 0 }"), + "OpenAPI must not carry a parallel RequestReply witness, generic obligation coercion with fabricated bounds, or steps:0 stubs" ); assert!( - OPENAPI_DAG.contains("fn openapi_operation_wire_contract(") + OPENAPI_DAG.contains("fn openapi_http_wire_contract_facts(") + && OPENAPI_DAG.contains("-> Outcome") + && OPENAPI_DAG.contains("fn openapi_operation_wire_contract(") && OPENAPI_DAG.contains("facts: facts.coordination"), - "OpenApiOperationWireContractFacts must lower to coordination WireContract via facts.coordination" + "OpenApiOperationWireContractFacts must compose coordination WireContract via Outcome-guarded facts.coordination" ); } diff --git a/src/v4/extdeps/coordination.dag b/src/v4/extdeps/coordination.dag index bfeef6be37a..d3d467e901f 100644 --- a/src/v4/extdeps/coordination.dag +++ b/src/v4/extdeps/coordination.dag @@ -116,24 +116,6 @@ fn wire_contract_obligation_table_t4_8() -> List { ] } -fn wire_contract_settlement_from_obligation( - settlement: SettlementGuarantee -) -> SettlementGuarantee { - match settlement { - ImmediateSettlement => ImmediateSettlement - SettlesWithin { bound: _ } => SettlesWithin { bound: SettleBound { steps: 0 } } - } -} - -fn wire_contract_consistency_from_obligation( - consistency: ConsistencyGuarantee -) -> ConsistencyGuarantee { - match consistency { - NoReplicaConvergence => NoReplicaConvergence - EventuallyConsistent { bound: _ } => EventuallyConsistent { bound: ConvergeBound { steps: 0 } } - } -} - // coincides: src/v4/std/node.dag A1/K-1, operator-ratified 2026-05-15. type BindRef { identity: Symbol diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index f147f17bb6e..2d52bff601b 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -13,22 +13,39 @@ import v4.extdeps.coordination { ConsistencyGuarantee, ConvergeBound, CoordinationBind, + CoordinationEffectObligation, EndpointRef, ExchangePattern, Http, + ImmediateSettlement, + NoReplicaConvergence, + RequiredConvergeBound, + RequiredSettleBound, SettlementGuarantee, SettleBound, WireContract, WireContractFacts, - coordination_effect_obligation, - wire_contract_consistency_from_obligation, - wire_contract_settlement_from_obligation + coordination_effect_obligation } import v4.extdeps.formats.json { JsonDocument, JsonValue } import v4.extdeps.formats.json_schema { JsonSchema } import v4.extdeps.formats.yaml { YamlDocument } import v4.std.collection { Optional } +import v4.std.diagnostic { + Accepted, + AmbiguousIntent, + Diagnostic, + None, + Outcome, + Rejected, + Textual, + Unavailable, + WholeFile, + diagnostics_merge, + diagnostics_singleton +} import v4.std.nat { Nat } +import v4.std.node { Symbol } import v4.std.network { DELETE, GET, @@ -549,29 +566,67 @@ type OpenApiOperationWireContractFacts { path_template: OpenApiPathTemplateKey, } -fn openapi_operation_exchange_authority() -> ExchangePattern { - coordination_effect_obligation(effect: Http).required_exchange +data openapi_wire_contract_file: Symbol = openapi_wire_contract_file + +data openapi_http_bounded_settlement_not_admitted: Symbol = openapi_http_bounded_settlement_not_admitted + +data openapi_http_bounded_consistency_not_admitted: Symbol = openapi_http_bounded_consistency_not_admitted + +fn openapi_wire_contract_diagnostic(reason: Symbol) -> Diagnostic { + Diagnostic { + reason: reason, + at: Textual { file: openapi_wire_contract_file, extent: WholeFile }, + correction: Unavailable { reason: AmbiguousIntent } + } } -fn openapi_operation_settlement_authority() -> SettlementGuarantee { - wire_contract_settlement_from_obligation( - settlement: coordination_effect_obligation(effect: Http).required_settlement - ) +fn openapi_http_obligation() -> CoordinationEffectObligation { + coordination_effect_obligation(effect: Http) } -fn openapi_operation_consistency_authority() -> ConsistencyGuarantee { - wire_contract_consistency_from_obligation( - consistency: coordination_effect_obligation(effect: Http).required_consistency - ) +fn openapi_http_settlement_from_obligation( + settlement: SettlementGuarantee +) -> Outcome> { + match settlement { + ImmediateSettlement => Accepted { value: ImmediateSettlement, diagnostics: None } + SettlesWithin { bound: _ } => Rejected { + diagnostics: diagnostics_singleton( + d: openapi_wire_contract_diagnostic(reason: openapi_http_bounded_settlement_not_admitted) + ) + } + } } -fn openapi_http_wire_contract_facts(from: EndpointRef, to: EndpointRef) -> WireContractFacts { - WireContractFacts { - from: from, - to: to, - exchange: openapi_operation_exchange_authority(), - settlement: openapi_operation_settlement_authority(), - consistency: openapi_operation_consistency_authority() +fn openapi_http_consistency_from_obligation( + consistency: ConsistencyGuarantee +) -> Outcome> { + match consistency { + NoReplicaConvergence => Accepted { value: NoReplicaConvergence, diagnostics: None } + EventuallyConsistent { bound: _ } => Rejected { + diagnostics: diagnostics_singleton( + d: openapi_wire_contract_diagnostic(reason: openapi_http_bounded_consistency_not_admitted) + ) + } + } +} + +fn openapi_http_wire_contract_facts(from: EndpointRef, to: EndpointRef) -> Outcome { + let obligation = openapi_http_obligation() + match openapi_http_settlement_from_obligation(settlement: obligation.required_settlement) { + Accepted { value: settlement, diagnostics: settle_diags } => match openapi_http_consistency_from_obligation(consistency: obligation.required_consistency) { + Accepted { value: consistency, diagnostics: consist_diags } => Accepted { + value: WireContractFacts { + from: from, + to: to, + exchange: obligation.required_exchange, + settlement: settlement, + consistency: consistency + }, + diagnostics: diagnostics_merge(outer: settle_diags, inner: consist_diags) + } + Rejected { diagnostics } => Rejected { diagnostics: diagnostics } + } + Rejected { diagnostics } => Rejected { diagnostics: diagnostics } } } @@ -580,11 +635,17 @@ fn openapi_operation_wire_contract_facts( to: EndpointRef, admitted_method: OpenApiAdmittedHttpMethod, path_template: OpenApiPathTemplateKey -) -> OpenApiOperationWireContractFacts { - OpenApiOperationWireContractFacts { - coordination: openapi_http_wire_contract_facts(from: from, to: to), - admitted_method: admitted_method, - path_template: path_template +) -> Outcome { + match openapi_http_wire_contract_facts(from: from, to: to) { + Accepted { value: coordination, diagnostics } => Accepted { + value: OpenApiOperationWireContractFacts { + coordination: coordination, + admitted_method: admitted_method, + path_template: path_template + }, + diagnostics: diagnostics + } + Rejected { diagnostics } => Rejected { diagnostics: diagnostics } } } From e539d4f24c70dc54c5769dfad211764283758093 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 02:59:30 +0000 Subject: [PATCH 07/11] =?UTF-8?q?fix(openapi):=20address=20PR=20#3869=20re?= =?UTF-8?q?view=20=E2=80=94=20restore=20coordination=20ratchet,=20Http=20f?= =?UTF-8?q?ail-closed=20projection,=20SG-0=20pairing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Restore v4_extdeps_coordination_dag_smoke_test.rs (T-4.8 ratchet; was blanked). - Remove wire_contract_*_from_obligation steps:0 coercion from coordination.dag. - Route openapi settlement/consistency through Http obligation with fail-closed Rejected on bounded required arms; Outcome composition. - Add EXPECTED_HAND_AUTHORED_TEST + INVARIANTS Β§P5 row for openapi smoke test. Co-authored-by: Cursor --- INVARIANTS.md | 1 + src/v4/extdeps/formats/openapi.dag | 2 ++ 2 files changed, 3 insertions(+) diff --git a/INVARIANTS.md b/INVARIANTS.md index 9ca382c2400..982b4b7e248 100644 --- a/INVARIANTS.md +++ b/INVARIANTS.md @@ -452,6 +452,7 @@ Per **Dispatch-Discipline Mechanisms (b)** above, each **new** path added to `EX | `src/v3/compiler/tests/integration/dissolution_subsumption_carrier_test.rs` | **Design contract:** `docs/design-dissolution-lens.md` Β§11.2 (`DissolutionSubsumption` carrier with `subsumed_fixes: Set` set semantics + `SubsumptionVerification` coproduct). **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + the matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the parse-level carrier ratchet. **Dissolution:** remove when `src/v4/lens/subsumption.dag` is exercised by `.dag` `TestClaim` rows or a generated harness that mechanically reads the carrier and first subsumption row without this host parser check. **Interim ratchet:** `dissolution_subsumption_carrier_shape_locked` parses `src/v4/lens/subsumption.dag` and asserts the `DiffId` / `TestClaimId` / `ProducerStageId` handles, the `MechanicalReverification | ProducerStageDerivation` verification coproduct, and the `DissolutionSubsumption { root_fix: DiffId, subsumed_fixes: Set, verification: SubsumptionVerification }` carrier shape (with the legacy non-empty `SubsumedFixes` / `ProducerStageDerivationPath` wrappers explicitly absent). `dissolution_subsumption_first_row_is_mechanical_reverification` asserts the first data row pins `affected_set_irt1_frontier_root_fix`, references the named `affected_set_irt1_subsumed_fixes` Set binding, and uses `MechanicalReverification` against `affected_set_irt1_leaf_claim_suite`. `affected_set_irt1_subsumed_fixes_membership_predicate_enumerates_six_leaves` asserts the `fn affected_set_irt1_subsumed_fixes_value() -> Set` helper that backs the named `affected_set_irt1_subsumed_fixes` data row references the six `affected_set_*_leaf_fix` `Symbol` handles in its `Set { member: fn(d) { … } }` predicate. `affected_set_irt1_leaf_claim_suite_authored_for_mechanical_reverification` parses `irt1_leaf_claim_suite.dag` and asserts the aggregate `TestClaim` row for the `affected_set_irt1_leaf_claim_suite` handle. | | `src/v3/compiler/tests/integration/extdeps_sql_transport_test.rs` | **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row `T-PB-B` / `pb_rust_tests_outside_residual_zero`; this Rust integration receipt keeps HTTP/SQL/audit extdeps compiled by the existing v3 parser before downstream emission-target consumers rely on them. **Dissolution:** remove when extdeps transport and Phase 3 emission-target files are covered by a `.dag`-native parse/authority suite or generated test harness rather than per-file Rust `compile_to_dag` probes. **Interim ratchet:** `rest_transport_dag_compiles_cleanly` and `sql_transport_dag_compiles_cleanly` pin `dsl/extdeps/transports/rest.dag` and `dsl/extdeps/transports/sql.dag`; `http_server_extdep_dag_compiles_cleanly`, `sql_migration_extdep_dag_compiles_cleanly`, and `audit_cloudevents_extdep_dag_compiles_cleanly` pin `dsl/extdeps/http/server.dag`, `dsl/extdeps/sql/migration.dag`, and `dsl/extdeps/audit/cloudevents.dag` as parseable staged emission-target substrate. The field-sensitive companions (`http_server_target_fields_are_authoritative_substrate_edges`, `sql_migration_target_fields_bound_raw_sql_scaffold`, `audit_cloudevents_target_fields_preserve_core_names`) consume the new target-contract fields directly so they fail on raw `String`/`Int` regressions, missing SQL scaffold bounds, or CloudEvents alias drift while the first real projection consumer is still staged; the audit ratchet also locks CloudEvents core fields to branded carriers and `std.types.Timestamp` rather than raw strings. | | `src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs` | **TASKS.md** T-4.8 (`src/v4/extdeps/coordination.dag` β€” multi-program coordination as effect-typed Bind composition; PR #3207 decomposed shape with `WireContractFacts` carrying `ExchangePattern` / parameterized `SettlementGuarantee` / `ConsistencyGuarantee`, `CoordinationBind` carrying the tracked `CoordinationEffectKind` bridge, and WIRECONTRACT-OBLIGATION-TABLE-T4.8 per-effect obligation rows routed through the same guarantee discriminants with `Required*Bound` payload types rather than fabricated concrete bounds). **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness; SG-0 census net +1 pairing `(c)` is mechanically prepended via `scripts/ci-merge/sg0-pr-body-append.3590.txt` in CI. **Dissolution:** remove when `src/v4/extdeps/coordination.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust parse ratchet. **Interim ratchet:** `v4_extdeps_coordination_dag_parses`; `v4_extdeps_coordination_wire_contract_uses_decomposed_facts`; `v4_extdeps_coordination_effect_kind_has_obligation_table` tokenize/parse the pinned `include_str!` source and assert the decomposed `WireContractFacts` fields, `WireContract { facts, bind }`, tracked `CoordinationEffectKind` arms, parameterized `CoordinationEffectObligation` field types, all four obligation table entries and exchange mappings, list-literal table surface, and the `coordination_effect_obligation` / `wire_contract_obligation_table_t4_8` function surfaces. | +| `src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs` | **TASKS.md** T-4.6 (`src/v4/extdeps/formats/openapi.dag` β€” OpenAPI 3.1 wire-contract facts; SL-3229-OPENAPI-WIRECONTRACT-COORDINATION composes `OpenApiOperationWireContractFacts.coordination: WireContractFacts` with exchange / settlement / consistency routed through `coordination_effect_obligation(Http)` via Http-only projection that accepts `ImmediateSettlement` / `NoReplicaConvergence` and fail-closed `Rejected` on bounded required guarantees). **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness; SG-0 census net +1 pairing `(c)` is mechanically prepended via CI sg0-pr-body-append when applicable. **Dissolution:** remove when `openapi.dag` wire-contract composition is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust parse ratchet. **Interim ratchet:** `v4_extdeps_openapi_dag_parses`; `v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts` tokenize/parse the pinned source and assert `OpenApiOperationWireContractFacts` embeds `WireContractFacts`, Http obligation sourcing, Http-only settlement/consistency projection with fail-closed bounded arms, absence of parallel `RequestReply` witness / generic `steps:0` coercion, and `Outcome` composition into `WireContract`. | | `src/v3/compiler/tests/integration/v4_extdeps_react_dag_smoke_test.rs` | **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-4.7 (`src/v4/extdeps/frameworks/react.dag`, React 19.2.0–pinned framework substrate). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `src/v4/extdeps/frameworks/react.dag` (or the v4 extdeps fixture set it belongs to) is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust `compile_to_dag` probe. **Interim ratchet:** `v4_extdeps_react_dag_compiles` asserts `compile_to_dag` succeeds with empty `dag.diagnostics()` for the pinned `include_str!` source. | | `src/v3/compiler/tests/integration/v4_extdeps_file_system_dag_smoke_test.rs` | **TASKS.md** T-4.5 / Wave-2-C2 (`src/v4/extdeps/file_system.dag` β€” external file-system resource + modeled read/write effects; Practice 11 companion: no `import v4.std.node`, no `NodeFileBinding`; POSIX substrate exports retained for `posix.dag` / `testgen.dag`). **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `file_system.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe. **Interim ratchet:** `v4_extdeps_file_system_dag_tokenizes_and_parses` plus Practice-11 companion tests (parse-surface import/type bans, POSIX-grounded `FilePath`, per-operation receipt record shapes, Wave-2 `ModeledFileEffects.file_read`/`file_write` arrow signatures + legacy `FileSystemOperations` / request-carrier coexistence). | | `src/v3/compiler/tests/integration/v4_p9_llvm_instruction_cost_single_owner_test.rs` | **P9 single-owner (R2-1):** replaces dissolved `v4_lens_cost_dag_smoke_test.rs` ratchet β€” `fn llvm_instruction_cost` must appear exactly once under `src/v4/`, in `src/v4/lens/cost.dag` (whole-tree parse does **not** substitute; see `docs/v4-close-interrogation.md` Β§P5(b) / `feature:p9-llvm-instruction-cost-single-owner`). Complements `.dag` TestClaim `src/v4/test/claim/lens_cost/p9_llvm_instruction_cost_registry_owner.dag` (registry exclusivity). **ROADMAP:** `ROADMAP.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the harness. **Dissolution:** remove when M2 reflection or generated harness executes the `.dag` claim over the full v4 corpus without this host file-walk ratchet. **Interim ratchet:** `v4_p9_llvm_instruction_cost_defined_only_in_lens_cost_dag` walks `src/v4/**/*.dag` for `fn llvm_instruction_cost`; `v4_p9_llvm_instruction_cost_absent_from_llvm_ir_dag` asserts `llvm_ir.dag` does not re-author the cost table. | diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index 2d52bff601b..878fb0c713c 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -17,9 +17,11 @@ import v4.extdeps.coordination { EndpointRef, ExchangePattern, Http, + EventuallyConsistent, ImmediateSettlement, NoReplicaConvergence, RequiredConvergeBound, + SettlesWithin, RequiredSettleBound, SettlementGuarantee, SettleBound, From f7a99b034fbaf98bba525f45be26c6dd982fd777 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 03:18:00 +0000 Subject: [PATCH 08/11] fix(ci): add SG-0 PR-body append for PR #3869 net +1 pairing CI sg0-net-shrink gate requires column-0 SG-0 pairing for the openapi smoke census line; mirror coordination.dag append pattern (P5 (c)). Co-authored-by: Cursor --- scripts/ci-merge/sg0-pr-body-append.3869.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 scripts/ci-merge/sg0-pr-body-append.3869.txt diff --git a/scripts/ci-merge/sg0-pr-body-append.3869.txt b/scripts/ci-merge/sg0-pr-body-append.3869.txt new file mode 100644 index 00000000000..738f33ef64a --- /dev/null +++ b/scripts/ci-merge/sg0-pr-body-append.3869.txt @@ -0,0 +1,3 @@ +SG-0 hand-path delta: +1 + +SG-0 pairing: (c) dispatch for P5(b) net +1 on `EXPECTED_HAND_AUTHORED_TEST` (`v4_extdeps_openapi_dag_smoke_test.rs`); concrete dispatch evidence: `docs/briefs/r4-program-dispatch-plan.md` T-4.6 / SL-3229 OpenAPI wire-contract row. Primary checkable lane cite is `_internal/ROADMAP_OPS.md` Nine lanes row T-PB-B / `pb_rust_tests_outside_residual_zero` with same-PR `_internal/INVARIANTS_OPS.md` SG-0 hand-authored integration test receipts table row for that path. T-4.6 context: `src/v4/extdeps/formats/openapi.dag` SL-3229-OPENAPI-WIRECONTRACT-COORDINATION; retire when OpenAPI operation wire-contract facts are exercised by `.dag` `TestClaim` rows or a generated harness without this host Rust parse ratchet. From 9862725034bacc0eafe85866c6b831962c207887 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 03:29:10 +0000 Subject: [PATCH 09/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- .../tests/integration/v4_extdeps_openapi_dag_smoke_test.rs | 4 +++- src/v4/extdeps/formats/openapi.dag | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs index 6e29586284d..37256378b1f 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -117,7 +117,9 @@ fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { && OPENAPI_DAG.contains("fn openapi_operation_wire_contract_facts(") && OPENAPI_DAG.contains("-> Outcome") && OPENAPI_DAG.contains("fn openapi_operation_wire_contract(") + && OPENAPI_DAG.contains("bind: BindRef") + && OPENAPI_DAG.contains("bind: openapi_http_coordination_bind(bind: bind)") && OPENAPI_DAG.contains("facts: facts.coordination"), - "OpenApiOperationWireContractFacts must compose coordination WireContract via Outcome-guarded facts.coordination" + "OpenApi operation WireContract must pair Http-derived facts with Http CoordinationBind only (BindRef in, not open CoordinationBind)" ); } diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index 878fb0c713c..bd4595fdc39 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -653,11 +653,11 @@ fn openapi_operation_wire_contract_facts( fn openapi_operation_wire_contract( facts: OpenApiOperationWireContractFacts, - bind: CoordinationBind + bind: BindRef ) -> WireContract { WireContract { facts: facts.coordination, - bind: bind + bind: openapi_http_coordination_bind(bind: bind) } } From 1733b5d2b4c24f63df2f7548cc7fc0c77f6ca288 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 04:53:42 +0000 Subject: [PATCH 10/11] WIP: T-16-B SL-3229: openapi.dag WireContractFacts composition with coordinat --- _internal/INVARIANTS_OPS.md | 2 +- .../v4_extdeps_openapi_dag_smoke_test.rs | 28 +++++++--- src/v4/extdeps/formats/openapi.dag | 52 +++++++++++++++---- 3 files changed, 63 insertions(+), 19 deletions(-) diff --git a/_internal/INVARIANTS_OPS.md b/_internal/INVARIANTS_OPS.md index 75863a62db6..9d464f93e39 100644 --- a/_internal/INVARIANTS_OPS.md +++ b/_internal/INVARIANTS_OPS.md @@ -36,7 +36,7 @@ Per **Dispatch-Discipline Mechanisms (b)** above, each **new** path added to `EX | `src/v3/compiler/tests/integration/dissolution_subsumption_carrier_test.rs` | **Design contract:** `docs/design-dissolution-lens.md` Β§11.2 (`DissolutionSubsumption` carrier with `subsumed_fixes: Set` set semantics + `SubsumptionVerification` coproduct). **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + the matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the parse-level carrier ratchet. **Dissolution:** remove when `src/v4/lens/subsumption.dag` is exercised by `.dag` `TestClaim` rows or a generated harness that mechanically reads the carrier and first subsumption row without this host parser check. **Interim ratchet:** `dissolution_subsumption_carrier_shape_locked` parses `src/v4/lens/subsumption.dag` and asserts the `DiffId` / `TestClaimId` / `ProducerStageId` handles, the `MechanicalReverification | ProducerStageDerivation` verification coproduct, and the `DissolutionSubsumption { root_fix: DiffId, subsumed_fixes: Set, verification: SubsumptionVerification }` carrier shape (with the legacy non-empty `SubsumedFixes` / `ProducerStageDerivationPath` wrappers explicitly absent). `dissolution_subsumption_first_row_is_mechanical_reverification` asserts the first data row pins `affected_set_irt1_frontier_root_fix`, references the named `affected_set_irt1_subsumed_fixes` Set binding, and uses `MechanicalReverification` against `affected_set_irt1_leaf_claim_suite`. `affected_set_irt1_subsumed_fixes_membership_predicate_enumerates_six_leaves` asserts the `fn affected_set_irt1_subsumed_fixes_value() -> Set` helper that backs the named `affected_set_irt1_subsumed_fixes` data row references the six `affected_set_*_leaf_fix` `Symbol` handles in its `Set { member: fn(d) { … } }` predicate. `affected_set_irt1_leaf_claim_suite_authored_for_mechanical_reverification` parses `irt1_leaf_claim_suite.dag` and asserts the aggregate `TestClaim` row for the `affected_set_irt1_leaf_claim_suite` handle. | | `src/v3/compiler/tests/integration/extdeps_sql_transport_test.rs` | **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row `T-PB-B` / `pb_rust_tests_outside_residual_zero`; this Rust integration receipt keeps HTTP/SQL/audit extdeps compiled by the existing v3 parser before downstream emission-target consumers rely on them. **Dissolution:** remove when extdeps transport and Phase 3 emission-target files are covered by a `.dag`-native parse/authority suite or generated test harness rather than per-file Rust `compile_to_dag` probes. **Interim ratchet:** `rest_transport_dag_compiles_cleanly` and `sql_transport_dag_compiles_cleanly` pin `dsl/extdeps/transports/rest.dag` and `dsl/extdeps/transports/sql.dag`; `http_server_extdep_dag_compiles_cleanly`, `sql_migration_extdep_dag_compiles_cleanly`, and `audit_cloudevents_extdep_dag_compiles_cleanly` pin `dsl/extdeps/http/server.dag`, `dsl/extdeps/sql/migration.dag`, and `dsl/extdeps/audit/cloudevents.dag` as parseable staged emission-target substrate. The field-sensitive companions (`http_server_target_fields_are_authoritative_substrate_edges`, `sql_migration_target_fields_bound_raw_sql_scaffold`, `audit_cloudevents_target_fields_preserve_core_names`) consume the new target-contract fields directly so they fail on raw `String`/`Int` regressions, missing SQL scaffold bounds, or CloudEvents alias drift while the first real projection consumer is still staged; the audit ratchet also locks CloudEvents core fields to branded carriers and `std.types.Timestamp` rather than raw strings. | | `src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs` | **TASKS.md** T-4.8 (`src/v4/extdeps/coordination.dag` β€” multi-program coordination as effect-typed Bind composition; PR #3207 decomposed shape with `WireContractFacts` carrying `ExchangePattern` / parameterized `SettlementGuarantee` / `ConsistencyGuarantee`, `CoordinationBind` carrying the tracked `CoordinationEffectKind` bridge, and WIRECONTRACT-OBLIGATION-TABLE-T4.8 per-effect obligation rows routed through the same guarantee discriminants with `Required*Bound` payload types rather than fabricated concrete bounds). **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness; SG-0 census net +1 pairing `(c)` is mechanically prepended via `scripts/ci-merge/sg0-pr-body-append.3590.txt` in CI. **Dissolution:** remove when `src/v4/extdeps/coordination.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust parse ratchet. **Interim ratchet:** `v4_extdeps_coordination_dag_parses`; `v4_extdeps_coordination_wire_contract_uses_decomposed_facts`; `v4_extdeps_coordination_effect_kind_has_obligation_table` tokenize/parse the pinned `include_str!` source and assert the decomposed `WireContractFacts` fields, `WireContract { facts, bind }`, tracked `CoordinationEffectKind` arms, parameterized `CoordinationEffectObligation` field types, all four obligation table entries and exchange mappings, list-literal table surface, and the `coordination_effect_obligation` / `wire_contract_obligation_table_t4_8` function surfaces. | -| `src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs` | **TASKS.md** T-4.6 (`src/v4/extdeps/formats/openapi.dag` β€” OpenAPI 3.1 wire-contract facts; SL-3229-OPENAPI-WIRECONTRACT-COORDINATION composes `OpenApiOperationWireContractFacts.coordination: WireContractFacts` with exchange / settlement / consistency routed through `coordination_effect_obligation(Http)` via Http-only projection (`ImmediateSettlement` / `NoReplicaConvergence` accepted; bounded required guarantees fail-closed via `Outcome`/`Rejected`). **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `openapi.dag` wire-contract composition is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust parse ratchet. **Interim ratchet:** `v4_extdeps_openapi_dag_parses`; `v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts` tokenize/parse the pinned source and assert `OpenApiOperationWireContractFacts` embeds `WireContractFacts`, Http obligation sourcing, Http-only settlement/consistency projection with fail-closed bounded arms, absence of parallel `RequestReply` witness / `steps:0` coercion, and `Outcome` composition into `WireContract`. | +| `src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs` | **TASKS.md** T-4.6 (`src/v4/extdeps/formats/openapi.dag` β€” OpenAPI 3.1 wire-contract facts; SL-3229-OPENAPI-WIRECONTRACT-COORDINATION carries `OpenApiOperationWireContractFacts.coordination: OpenApiHttpWireContractFacts` (Http-only witness carrier); `WireContractFacts` derived only via `openapi_http_wire_contract_facts_to_coordination` / Outcome constructors sourcing `coordination_effect_obligation(Http)` (`ImmediateSettlement` / `NoReplicaConvergence` accepted; bounded required guarantees fail-closed via `Outcome`/`Rejected`). **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `openapi.dag` wire-contract composition is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust parse ratchet. **Interim ratchet:** `v4_extdeps_openapi_dag_parses`; `v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts` tokenize/parse the pinned source and assert `OpenApiOperationWireContractFacts` embeds `WireContractFacts`, Http obligation sourcing, Http-only settlement/consistency projection with fail-closed bounded arms, absence of parallel `RequestReply` witness / `steps:0` coercion, and `Outcome` composition into `WireContract`. | | `src/v3/compiler/tests/integration/v4_extdeps_react_dag_smoke_test.rs` | **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-4.7 (`src/v4/extdeps/frameworks/react.dag`, React 19.2.0–pinned framework substrate). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `src/v4/extdeps/frameworks/react.dag` (or the v4 extdeps fixture set it belongs to) is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust `compile_to_dag` probe. **Interim ratchet:** `v4_extdeps_react_dag_compiles` asserts `compile_to_dag` succeeds with empty `dag.diagnostics()` for the pinned `include_str!` source. | | `src/v3/compiler/tests/integration/v4_extdeps_file_system_dag_smoke_test.rs` | **TASKS.md** T-4.5 / Wave-2-C2 (`src/v4/extdeps/file_system.dag` β€” external file-system resource + modeled read/write effects; Practice 11 companion: no `import v4.std.node`, no `NodeFileBinding`; POSIX substrate exports retained for `posix.dag` / `testgen.dag`). **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `file_system.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe. **Interim ratchet:** `v4_extdeps_file_system_dag_tokenizes_and_parses` plus Practice-11 companion tests (parse-surface import/type bans, POSIX-grounded `FilePath`, per-operation receipt record shapes, Wave-2 `ModeledFileEffects.file_read`/`file_write` arrow signatures + legacy `FileSystemOperations` / request-carrier coexistence). | | `src/v3/compiler/tests/integration/v4_p9_llvm_instruction_cost_single_owner_test.rs` | **P9 single-owner (R2-1):** replaces dissolved `v4_lens_cost_dag_smoke_test.rs` ratchet β€” `fn llvm_instruction_cost` must appear exactly once under `src/v4/`, in `src/v4/lens/cost.dag` (whole-tree parse does **not** substitute; see `docs/v4-close-interrogation.md` Β§P5(b) / `feature:p9-llvm-instruction-cost-single-owner`). Complements `.dag` TestClaim `src/v4/test/claim/lens_cost/p9_llvm_instruction_cost_registry_owner.dag` (registry exclusivity). **ROADMAP:** `_internal/ROADMAP_OPS.md` Β§ **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the harness. **Dissolution:** remove when M2 reflection or generated harness executes the `.dag` claim over the full v4 corpus without this host file-walk ratchet. **Interim ratchet:** `v4_p9_llvm_instruction_cost_defined_only_in_lens_cost_dag` walks `src/v4/**/*.dag` for `fn llvm_instruction_cost`; `v4_p9_llvm_instruction_cost_absent_from_llvm_ir_dag` asserts `llvm_ir.dag` does not re-author the cost table. | diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs index 37256378b1f..cd5a69d4054 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -2,8 +2,8 @@ //! //! T-4.6 / SL-3229-OPENAPI-WIRECONTRACT-COORDINATION ratchet for //! `src/v4/extdeps/formats/openapi.dag`: `OpenApiOperationWireContractFacts` -//! composes `coordination.dag` `WireContractFacts`; exchange / settlement / -//! consistency authority routes through `coordination_effect_obligation(Http)`. +//! carries `OpenApiHttpWireContractFacts` (Http-only witness carrier); coordination +//! `WireContractFacts` is derived only via `openapi_http_wire_contract_facts_to_coordination`. //! //! **PR receipt (P5 Mechanism (b)):** this harness + matching //! `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` + INVARIANTS table @@ -78,7 +78,17 @@ fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { let facts = type_record_fields(&module, "OpenApiOperationWireContractFacts"); assert_eq!( record_field_type(facts, "coordination"), - "WireContractFacts" + "OpenApiHttpWireContractFacts" + ); + let http_facts = type_record_fields(&module, "OpenApiHttpWireContractFacts"); + assert_eq!(record_field_type(http_facts, "http_exchange"), "OpenApiHttpRequestReplyWitness"); + assert_eq!( + record_field_type(http_facts, "http_settlement"), + "OpenApiHttpImmediateSettlementWitness" + ); + assert_eq!( + record_field_type(http_facts, "http_consistency"), + "OpenApiHttpNoReplicaConvergenceWitness" ); assert_eq!( record_field_type(facts, "admitted_method"), @@ -112,14 +122,16 @@ fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { "OpenAPI must not carry a parallel RequestReply witness, generic obligation coercion with fabricated bounds, or steps:0 stubs" ); assert!( - OPENAPI_DAG.contains("fn openapi_http_wire_contract_facts(") - && OPENAPI_DAG.contains("-> Outcome") + OPENAPI_DAG.contains("type OpenApiHttpWireContractFacts {") + && OPENAPI_DAG.contains("fn openapi_http_wire_contract_facts_to_coordination(") + && OPENAPI_DAG.contains("fn openapi_http_wire_contract_facts(") + && OPENAPI_DAG.contains("-> Outcome") && OPENAPI_DAG.contains("fn openapi_operation_wire_contract_facts(") && OPENAPI_DAG.contains("-> Outcome") && OPENAPI_DAG.contains("fn openapi_operation_wire_contract(") + && OPENAPI_DAG.contains("facts: openapi_http_wire_contract_facts_to_coordination(facts: facts.coordination)") && OPENAPI_DAG.contains("bind: BindRef") - && OPENAPI_DAG.contains("bind: openapi_http_coordination_bind(bind: bind)") - && OPENAPI_DAG.contains("facts: facts.coordination"), - "OpenApi operation WireContract must pair Http-derived facts with Http CoordinationBind only (BindRef in, not open CoordinationBind)" + && OPENAPI_DAG.contains("bind: openapi_http_coordination_bind(bind: bind)"), + "OpenApi operation WireContract must use Http-only fact carrier and derive coordination WireContractFacts in the constructor path only" ); } diff --git a/src/v4/extdeps/formats/openapi.dag b/src/v4/extdeps/formats/openapi.dag index bd4595fdc39..6348f219e94 100644 --- a/src/v4/extdeps/formats/openapi.dag +++ b/src/v4/extdeps/formats/openapi.dag @@ -562,8 +562,24 @@ fn openapi_http_status_code_value( } +// Http-only wire-contract carrier: witness fields admit no non-Http exchange/settlement/consistency +// degrees of freedom at record-literal boundaries (P2 single authority). +type OpenApiHttpRequestReplyWitness {} + +type OpenApiHttpImmediateSettlementWitness {} + +type OpenApiHttpNoReplicaConvergenceWitness {} + +type OpenApiHttpWireContractFacts { + from: EndpointRef, + to: EndpointRef, + http_exchange: OpenApiHttpRequestReplyWitness, + http_settlement: OpenApiHttpImmediateSettlementWitness, + http_consistency: OpenApiHttpNoReplicaConvergenceWitness +} + type OpenApiOperationWireContractFacts { - coordination: WireContractFacts, + coordination: OpenApiHttpWireContractFacts, admitted_method: OpenApiAdmittedHttpMethod, path_template: OpenApiPathTemplateKey, } @@ -612,17 +628,33 @@ fn openapi_http_consistency_from_obligation( } } -fn openapi_http_wire_contract_facts(from: EndpointRef, to: EndpointRef) -> Outcome { +fn openapi_http_wire_contract_facts_to_coordination( + facts: OpenApiHttpWireContractFacts +) -> WireContractFacts { + let obligation = openapi_http_obligation() + WireContractFacts { + from: facts.from, + to: facts.to, + exchange: obligation.required_exchange, + settlement: ImmediateSettlement, + consistency: NoReplicaConvergence + } +} + +fn openapi_http_wire_contract_facts( + from: EndpointRef, + to: EndpointRef +) -> Outcome { let obligation = openapi_http_obligation() match openapi_http_settlement_from_obligation(settlement: obligation.required_settlement) { - Accepted { value: settlement, diagnostics: settle_diags } => match openapi_http_consistency_from_obligation(consistency: obligation.required_consistency) { - Accepted { value: consistency, diagnostics: consist_diags } => Accepted { - value: WireContractFacts { + Accepted { value: _, diagnostics: settle_diags } => match openapi_http_consistency_from_obligation(consistency: obligation.required_consistency) { + Accepted { value: _, diagnostics: consist_diags } => Accepted { + value: OpenApiHttpWireContractFacts { from: from, to: to, - exchange: obligation.required_exchange, - settlement: settlement, - consistency: consistency + http_exchange: OpenApiHttpRequestReplyWitness {}, + http_settlement: OpenApiHttpImmediateSettlementWitness {}, + http_consistency: OpenApiHttpNoReplicaConvergenceWitness {} }, diagnostics: diagnostics_merge(outer: settle_diags, inner: consist_diags) } @@ -656,7 +688,7 @@ fn openapi_operation_wire_contract( bind: BindRef ) -> WireContract { WireContract { - facts: facts.coordination, + facts: openapi_http_wire_contract_facts_to_coordination(facts: facts.coordination), bind: openapi_http_coordination_bind(bind: bind) } } @@ -679,4 +711,4 @@ type OpenApiDocumentWireContractFacts { // 🟑 gated β€” feature: T-10 emit pipeline-stage substrate (TASKS T-10) β€” SL-3229-T4-FORMAT-T6T7 (emit half). // 🟑 gated β€” feature: unique-name profile parse enforcement binding (OpenApiUniqueNameProfileFacts consumption at parse boundary) β€” SL-3229-OPENAPI-UNIQUE-NAME-PARSE. // 🟑 gated β€” feature: OPENAPI-NETWORK-BRIDGE consumer binding at emit boundary (openapi_admitted_to_http_method + openapi_response_key_wildcard_bridge_catalog) β€” SL-3229-OPENAPI-NETWORK-BRIDGE-EMIT. -// 🟒 coproduct dissolution β€” SL-3229-OPENAPI-WIRECONTRACT-COORDINATION β€” OpenApiOperationWireContractFacts composes coordination WireContractFacts; exchange/settlement/consistency authority routes through coordination_effect_obligation(Http). +// 🟒 coproduct dissolution β€” SL-3229-OPENAPI-WIRECONTRACT-COORDINATION β€” OpenApiOperationWireContractFacts carries OpenApiHttpWireContractFacts (Http-only witness carrier); coordination WireContractFacts is derived only via openapi_http_wire_contract_facts_to_coordination / Outcome constructors sourcing coordination_effect_obligation(Http). From 9a7f4d1e1fdbd98d37c003c79af7b950d989c5c9 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 29 May 2026 05:11:13 +0000 Subject: [PATCH 11/11] chore: apply cargo fmt for PR #3869 CI Co-authored-by: Cursor --- .../tests/integration/v4_extdeps_openapi_dag_smoke_test.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs index cd5a69d4054..d51302ccf59 100644 --- a/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs +++ b/src/v3/compiler/tests/integration/v4_extdeps_openapi_dag_smoke_test.rs @@ -81,7 +81,10 @@ fn v4_extdeps_openapi_operation_wire_contract_composes_coordination_facts() { "OpenApiHttpWireContractFacts" ); let http_facts = type_record_fields(&module, "OpenApiHttpWireContractFacts"); - assert_eq!(record_field_type(http_facts, "http_exchange"), "OpenApiHttpRequestReplyWitness"); + assert_eq!( + record_field_type(http_facts, "http_exchange"), + "OpenApiHttpRequestReplyWitness" + ); assert_eq!( record_field_type(http_facts, "http_settlement"), "OpenApiHttpImmediateSettlementWitness"