From 234e01e27d6935d213097b345d91d369f808af82 Mon Sep 17 00:00:00 2001 From: "sorokin.oleg.edu" Date: Fri, 11 Sep 2026 05:16:49 -0700 Subject: [PATCH] Preserve exact frozen authoring milestone input bytes --- .gitattributes | 9 + .../src/semantic_review/artifacts_view.rs | 294 +- .../src/semantic_review/attachments_view.rs | 158 +- .../oa-desktop/src/semantic_review/keyed.rs | 700 +- .../src/semantic_review/keyed_rows.rs | 690 +- .../src/semantic_review/keyed_tests.rs | 1584 +- .../oa-desktop/src/semantic_review/ordered.rs | 508 +- docs/openapi.json | 25674 ++++++++-------- 8 files changed, 14813 insertions(+), 14804 deletions(-) diff --git a/.gitattributes b/.gitattributes index d63e5123..e203e92e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -36,3 +36,12 @@ harness/behavior-creation-contract.rs -text whitespace=cr-at-eol scripts/windows-notices/GNOME-Cantarell-61362600e104-COPYING -text scripts/windows-notices/Fira-OFL.txt -text scripts/windows-notices/FiraSans-Regular-NOTICE.txt -text + +# Preserve exact inputs of the frozen D4D9 authoring milestone build. +crates/oa-desktop/src/semantic_review/artifacts_view.rs -text +crates/oa-desktop/src/semantic_review/attachments_view.rs -text +crates/oa-desktop/src/semantic_review/keyed_rows.rs -text +crates/oa-desktop/src/semantic_review/keyed_tests.rs -text +crates/oa-desktop/src/semantic_review/keyed.rs -text +crates/oa-desktop/src/semantic_review/ordered.rs -text +docs/openapi.json -text diff --git a/crates/oa-desktop/src/semantic_review/artifacts_view.rs b/crates/oa-desktop/src/semantic_review/artifacts_view.rs index ea186228..b4958928 100644 --- a/crates/oa-desktop/src/semantic_review/artifacts_view.rs +++ b/crates/oa-desktop/src/semantic_review/artifacts_view.rs @@ -1,147 +1,147 @@ -use super::artifacts::{Editor, Event, Raw}; -use super::*; -use iced::{ - Element as View, Fill, - widget::{button, checkbox, column, pick_list, row, text, text_editor, text_input}, -}; -pub(super) fn pairs<'a>(editor: &'a Editor, p: &'a Project, trace: &'a Trace) -> View<'a, Event> { - let mut content=column![text("Artifact links and metadata").size(16),text("Pair links attached to these reviewed owners. Presence is attachment to the owner; taking identified source absence deletes the destination link, while a destination-only link is retained.").size(12),text_input("Filter artifact identities",&editor.search).on_input(Event::Search).padding(7)].spacing(9); - for (layer, label, selected) in [ - (Layer::Oa, "Operational", editor.oa.clone()), - (Layer::Sa, "System", editor.sa.clone()), - ] { - content = content.push(text(label).size(12)).push( - row![ - pick_list(editor.choices(p, trace, layer), selected, move |v| { - Event::Pick(layer, Some(v)) - }) - .placeholder("Choose exact artifact identity") - .width(Fill) - .padding(7), - button("No identity") - .padding(7) - .on_press(Event::Pick(layer, None)) - ] - .spacing(7), - ); - } - content.push(row![button("Reserve a new destination counterpart").padding(7).on_press(Event::Reserve),button("Review this exact artifact pair").padding(7).on_press(Event::Stage)].spacing(7).wrap()).push(text("Reservation retains a fresh identity and seeds metadata from the source. It creates nothing until Presence and all seven metadata facets are explicitly reviewed and the combined Apply succeeds. New unrelated links use ordinary artifact creation.").size(11)).padding(iced::Padding::default().right(18)).into() -} -pub(super) fn candidate<'a>( - editor: &'a Editor, - p: &'a Project, - facet: &'a FacetSelector, -) -> Option> { - let value = editor.drafts.get(facet)?; - let (_, which) = artifacts::parts(facet)?; - let mut content = - column![text(format!("Final artifact {}", artifacts::field(which)?)).size(12)].spacing(7); - match value { - Raw::Text(_) if which == ArtifactFacet::Description => { - let draft = editor.descriptions.get(facet)?; - let facet = facet.clone(); - content = content.push( - text_editor(draft) - .height(110) - .on_action(move |action| Event::Description(facet.clone(), action)), - ); - } - Raw::Text(value) => { - let facet = facet.clone(); - content = content.push( - text_input("Exact text", value) - .on_input(move |value| Event::Input(facet.clone(), Raw::Text(value))) - .padding(7), - ); - } - Raw::Owner(value) => { - let mut choices: Vec<_> = p - .identities() - .into_iter() - .map(|(id, alias)| Choice { - id, - label: format!("{} · @{alias}", p.named(id)), - }) - .collect(); - choices.sort_by_cached_key(|c| c.label.to_lowercase()); - let selected = value.parse::().ok().map(|id| view::choice(p, id)); - let raw_facet = facet.clone(); - let pick_facet = facet.clone(); - content = content - .push( - pick_list(choices, selected, move |v: Choice| { - Event::Input(pick_facet.clone(), Raw::Owner(v.id.to_string())) - }) - .placeholder("Explicit final owner") - .width(Fill) - .padding(7), - ) - .push( - text_input("Owner identity (retains rejected input)", value) - .on_input(move |v| Event::Input(raw_facet.clone(), Raw::Owner(v))) - .padding(7), - ); - } - Raw::Relation(value) => { - let facet = facet.clone(); - let variants = [ - ArtifactRelation::References, - ArtifactRelation::Satisfies, - ArtifactRelation::Verifies, - ArtifactRelation::Implements, - ArtifactRelation::DerivedFrom, - ]; - let choices: Vec<_> = variants.into_iter().map(RelationChoice).collect(); - content = content.push( - pick_list(choices, Some(RelationChoice(*value)), move |v| { - Event::Input(facet.clone(), Raw::Relation(v.0)) - }) - .padding(7), - ); - } - Raw::Optional { - present, - text: value, - } => { - let toggle_facet = facet.clone(); - let retained = value.clone(); - let input_facet = facet.clone(); - let enabled = *present; - content = content - .push( - checkbox(*present) - .label("Present (checked with empty text means an explicit empty value)") - .on_toggle(move |present| { - Event::Input( - toggle_facet.clone(), - Raw::Optional { - present, - text: retained.clone(), - }, - ) - }), - ) - .push( - text_input("Retained optional text", value) - .on_input(move |text| { - Event::Input( - input_facet.clone(), - Raw::Optional { - present: enabled, - text, - }, - ) - }) - .padding(7), - ); - } - } - Some(content.into()) -} -#[derive(Clone, Copy, Debug, PartialEq, Eq)] -struct RelationChoice(ArtifactRelation); -impl std::fmt::Display for RelationChoice { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } -} +use super::artifacts::{Editor, Event, Raw}; +use super::*; +use iced::{ + Element as View, Fill, + widget::{button, checkbox, column, pick_list, row, text, text_editor, text_input}, +}; +pub(super) fn pairs<'a>(editor: &'a Editor, p: &'a Project, trace: &'a Trace) -> View<'a, Event> { + let mut content=column![text("Artifact links and metadata").size(16),text("Pair links attached to these reviewed owners. Presence is attachment to the owner; taking identified source absence deletes the destination link, while a destination-only link is retained.").size(12),text_input("Filter artifact identities",&editor.search).on_input(Event::Search).padding(7)].spacing(9); + for (layer, label, selected) in [ + (Layer::Oa, "Operational", editor.oa.clone()), + (Layer::Sa, "System", editor.sa.clone()), + ] { + content = content.push(text(label).size(12)).push( + row![ + pick_list(editor.choices(p, trace, layer), selected, move |v| { + Event::Pick(layer, Some(v)) + }) + .placeholder("Choose exact artifact identity") + .width(Fill) + .padding(7), + button("No identity") + .padding(7) + .on_press(Event::Pick(layer, None)) + ] + .spacing(7), + ); + } + content.push(row![button("Reserve a new destination counterpart").padding(7).on_press(Event::Reserve),button("Review this exact artifact pair").padding(7).on_press(Event::Stage)].spacing(7).wrap()).push(text("Reservation retains a fresh identity and seeds metadata from the source. It creates nothing until Presence and all seven metadata facets are explicitly reviewed and the combined Apply succeeds. New unrelated links use ordinary artifact creation.").size(11)).padding(iced::Padding::default().right(18)).into() +} +pub(super) fn candidate<'a>( + editor: &'a Editor, + p: &'a Project, + facet: &'a FacetSelector, +) -> Option> { + let value = editor.drafts.get(facet)?; + let (_, which) = artifacts::parts(facet)?; + let mut content = + column![text(format!("Final artifact {}", artifacts::field(which)?)).size(12)].spacing(7); + match value { + Raw::Text(_) if which == ArtifactFacet::Description => { + let draft = editor.descriptions.get(facet)?; + let facet = facet.clone(); + content = content.push( + text_editor(draft) + .height(110) + .on_action(move |action| Event::Description(facet.clone(), action)), + ); + } + Raw::Text(value) => { + let facet = facet.clone(); + content = content.push( + text_input("Exact text", value) + .on_input(move |value| Event::Input(facet.clone(), Raw::Text(value))) + .padding(7), + ); + } + Raw::Owner(value) => { + let mut choices: Vec<_> = p + .identities() + .into_iter() + .map(|(id, alias)| Choice { + id, + label: format!("{} · @{alias}", p.named(id)), + }) + .collect(); + choices.sort_by_cached_key(|c| c.label.to_lowercase()); + let selected = value.parse::().ok().map(|id| view::choice(p, id)); + let raw_facet = facet.clone(); + let pick_facet = facet.clone(); + content = content + .push( + pick_list(choices, selected, move |v: Choice| { + Event::Input(pick_facet.clone(), Raw::Owner(v.id.to_string())) + }) + .placeholder("Explicit final owner") + .width(Fill) + .padding(7), + ) + .push( + text_input("Owner identity (retains rejected input)", value) + .on_input(move |v| Event::Input(raw_facet.clone(), Raw::Owner(v))) + .padding(7), + ); + } + Raw::Relation(value) => { + let facet = facet.clone(); + let variants = [ + ArtifactRelation::References, + ArtifactRelation::Satisfies, + ArtifactRelation::Verifies, + ArtifactRelation::Implements, + ArtifactRelation::DerivedFrom, + ]; + let choices: Vec<_> = variants.into_iter().map(RelationChoice).collect(); + content = content.push( + pick_list(choices, Some(RelationChoice(*value)), move |v| { + Event::Input(facet.clone(), Raw::Relation(v.0)) + }) + .padding(7), + ); + } + Raw::Optional { + present, + text: value, + } => { + let toggle_facet = facet.clone(); + let retained = value.clone(); + let input_facet = facet.clone(); + let enabled = *present; + content = content + .push( + checkbox(*present) + .label("Present (checked with empty text means an explicit empty value)") + .on_toggle(move |present| { + Event::Input( + toggle_facet.clone(), + Raw::Optional { + present, + text: retained.clone(), + }, + ) + }), + ) + .push( + text_input("Retained optional text", value) + .on_input(move |text| { + Event::Input( + input_facet.clone(), + Raw::Optional { + present: enabled, + text, + }, + ) + }) + .padding(7), + ); + } + } + Some(content.into()) +} +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +struct RelationChoice(ArtifactRelation); +impl std::fmt::Display for RelationChoice { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } +} diff --git a/crates/oa-desktop/src/semantic_review/attachments_view.rs b/crates/oa-desktop/src/semantic_review/attachments_view.rs index e1351835..aad950de 100644 --- a/crates/oa-desktop/src/semantic_review/attachments_view.rs +++ b/crates/oa-desktop/src/semantic_review/attachments_view.rs @@ -1,79 +1,79 @@ -//! Explicit attachment pair and final destination field controls. -use super::{ - attachments::{Editor, Event, Family}, - *, -}; -use iced::{ - Element as View, Fill, - widget::{button, column, pick_list, row, text, text_input}, -}; - -pub(super) fn pairs<'a>( - editor: &'a Editor, - project: &'a Project, - trace: &'a Trace, -) -> View<'a, Event> { - let mut content = column![ - text("Existing children and relationship endpoints").size(16), - text("Choose explicit Operational and System identities. A child's final parent or a relationship's final endpoint is reviewed independently; opening another trace keeps this draft.").size(12), - pick_list([Family::Child, Family::Source, Family::Target], Some(editor.family), Event::Family).text_size(12).padding(7).width(Fill), - text_input("Filter attachment identities by name or alias", &editor.search).on_input(Event::Search).size(12).padding(7), - ].spacing(9); - for layer in [Layer::Oa, Layer::Sa] { - let label = if layer == Layer::Oa { - "Operational" - } else { - "System" - }; - let owner = if layer == Layer::Oa { - trace.oa - } else { - trace.sa - }; - content = content.push(text(format!("{label} owner: {}", project.named(owner))).size(12)); - content = content.push( - row![ - pick_list( - editor.choices(project, trace, layer), - editor.selection(layer).cloned(), - move |choice| Event::Pick(layer, Some(choice)) - ) - .placeholder(format!("Choose an existing {label} identity")) - .text_size(12) - .padding(7) - .width(Fill), - button(text("No identity on this side").size(11)) - .style(crate::style::nav) - .padding(7) - .on_press(Event::Pick(layer, None)), - ] - .spacing(7), - ); - } - content = content.push( - button(text("Use exact attachment pair").size(12)) - .padding(8) - .style(crate::style::nav) - .on_press(Event::Stage), - ); - content.push(text("Taking an absent relationship endpoint requires an explicit final replacement. New child and relationship creation uses a separate explicit transition mapping.").size(11)).padding(iced::Padding::default().right(18)).into() -} - -pub(super) fn candidate<'a>( - editor: &'a Editor, - project: &'a Project, - facet: &'a FacetSelector, - layer: Layer, -) -> Option> { - let draft = editor.drafts.get(facet)?; - let (id, _) = attachments::actual_slot(facet, layer)?; - let path = attachments::path(project, facet, layer)?; - Some( - column![ - text(format!("Destination record: {}", project.named(id))).size(12), - crate::forms::scoped(draft, project, &path, attachments::label(facet)), - ] - .spacing(7) - .into(), - ) -} +//! Explicit attachment pair and final destination field controls. +use super::{ + attachments::{Editor, Event, Family}, + *, +}; +use iced::{ + Element as View, Fill, + widget::{button, column, pick_list, row, text, text_input}, +}; + +pub(super) fn pairs<'a>( + editor: &'a Editor, + project: &'a Project, + trace: &'a Trace, +) -> View<'a, Event> { + let mut content = column![ + text("Existing children and relationship endpoints").size(16), + text("Choose explicit Operational and System identities. A child's final parent or a relationship's final endpoint is reviewed independently; opening another trace keeps this draft.").size(12), + pick_list([Family::Child, Family::Source, Family::Target], Some(editor.family), Event::Family).text_size(12).padding(7).width(Fill), + text_input("Filter attachment identities by name or alias", &editor.search).on_input(Event::Search).size(12).padding(7), + ].spacing(9); + for layer in [Layer::Oa, Layer::Sa] { + let label = if layer == Layer::Oa { + "Operational" + } else { + "System" + }; + let owner = if layer == Layer::Oa { + trace.oa + } else { + trace.sa + }; + content = content.push(text(format!("{label} owner: {}", project.named(owner))).size(12)); + content = content.push( + row![ + pick_list( + editor.choices(project, trace, layer), + editor.selection(layer).cloned(), + move |choice| Event::Pick(layer, Some(choice)) + ) + .placeholder(format!("Choose an existing {label} identity")) + .text_size(12) + .padding(7) + .width(Fill), + button(text("No identity on this side").size(11)) + .style(crate::style::nav) + .padding(7) + .on_press(Event::Pick(layer, None)), + ] + .spacing(7), + ); + } + content = content.push( + button(text("Use exact attachment pair").size(12)) + .padding(8) + .style(crate::style::nav) + .on_press(Event::Stage), + ); + content.push(text("Taking an absent relationship endpoint requires an explicit final replacement. New child and relationship creation uses a separate explicit transition mapping.").size(11)).padding(iced::Padding::default().right(18)).into() +} + +pub(super) fn candidate<'a>( + editor: &'a Editor, + project: &'a Project, + facet: &'a FacetSelector, + layer: Layer, +) -> Option> { + let draft = editor.drafts.get(facet)?; + let (id, _) = attachments::actual_slot(facet, layer)?; + let path = attachments::path(project, facet, layer)?; + Some( + column![ + text(format!("Destination record: {}", project.named(id))).size(12), + crate::forms::scoped(draft, project, &path, attachments::label(facet)), + ] + .spacing(7) + .into(), + ) +} diff --git a/crates/oa-desktop/src/semantic_review/keyed.rs b/crates/oa-desktop/src/semantic_review/keyed.rs index 5b4041c1..2cf59ec4 100644 --- a/crates/oa-desktop/src/semantic_review/keyed.rs +++ b/crates/oa-desktop/src/semantic_review/keyed.rs @@ -1,350 +1,350 @@ -//! Closed presence-only adapter. The core independently validates the full final record. -use super::*; - -#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] -pub enum Family { - Member(ReferenceCollection), - Literal, - Annotation, - Binding, -} -impl std::fmt::Display for Family { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(match self { - Self::Member(ReferenceCollection::FunctionInputItems) => "Function input items", - Self::Member(ReferenceCollection::FunctionOutputItems) => "Function output items", - Self::Member(ReferenceCollection::SignalItems) => "Signal items", - Self::Member(ReferenceCollection::CategoryExchanges) => "Category exchanges", - Self::Member(ReferenceCollection::ExchangeItems) => "Exchange items", - Self::Member(ReferenceCollection::TransitionTriggers) => "Transition triggers", - Self::Member(ReferenceCollection::TransitionEffects) => "Transition effects", - Self::Member(ReferenceCollection::Constrained) => "Constrained identities", - Self::Member(ReferenceCollection::Steps) => "Ordered steps", - Self::Member(ReferenceCollection::FragmentBranches) => "Fragment branches", - Self::Literal => "Enumeration literals", - Self::Annotation => "Message values", - Self::Binding => "Scenario lifeline bindings", - }) - } -} -pub(super) const FAMILIES: [Family; 13] = [ - Family::Member(ReferenceCollection::Steps), - Family::Member(ReferenceCollection::FragmentBranches), - Family::Member(ReferenceCollection::FunctionInputItems), - Family::Member(ReferenceCollection::FunctionOutputItems), - Family::Member(ReferenceCollection::SignalItems), - Family::Member(ReferenceCollection::ExchangeItems), - Family::Member(ReferenceCollection::CategoryExchanges), - Family::Member(ReferenceCollection::TransitionTriggers), - Family::Member(ReferenceCollection::TransitionEffects), - Family::Member(ReferenceCollection::Constrained), - Family::Literal, - Family::Annotation, - Family::Binding, -]; -pub(super) fn family(facet: &FacetSelector) -> Option { - let family = match facet { - FacetSelector::Member { collection, .. } => Family::Member(*collection), - FacetSelector::Literal(_) => Family::Literal, - FacetSelector::Annotation(_) => Family::Annotation, - FacetSelector::Binding(_) => Family::Binding, - _ => return None, - }; - FAMILIES.contains(&family).then_some(family) -} -pub(super) fn supported(facet: &FacetSelector) -> bool { - family(facet).is_some() -} - -// Fixed paths for the closed collections and the exact enum literal set. -// They are selected by the typed facet; callers cannot supply arbitrary paths. -pub(super) fn path(value: &Value, family: Family) -> Option { - let prefixes = ["/body/Oa/Shared", "/body/Sa/Shared"]; - let tails: &[&str] = match family { - Family::Member(ReferenceCollection::Steps) => { - return [ - "/body/Oa/Process/steps", - "/body/Sa/FunctionalChain/steps", - "/body/Oa/Shared/Scenario/steps", - "/body/Sa/Shared/Scenario/steps", - "/body/Oa/Shared/Occurrence/body/Branch/occurrences", - "/body/Sa/Shared/Occurrence/body/Branch/occurrences", - ] - .into_iter() - .find(|p| value.pointer(p).is_some_and(Value::is_array)) - .map(str::to_owned); - } - Family::Member(ReferenceCollection::FragmentBranches) => { - &["Occurrence/body/Fragment/branches"] - } - Family::Member(ReferenceCollection::FunctionInputItems) => { - &["Port/contract/FunctionInput/incoming_items"] - } - Family::Member(ReferenceCollection::FunctionOutputItems) => { - &["Port/contract/FunctionOutput/outgoing_items"] - } - Family::Member(ReferenceCollection::CategoryExchanges) => &["ExchangeCategory/exchanges"], - Family::Member(ReferenceCollection::SignalItems) => &["Event/body/Signal/items"], - Family::Member(ReferenceCollection::Constrained) => &["Constraint/constrained"], - Family::Literal => &["DataType/definition/Enumeration/literals"], - Family::Annotation => &["Occurrence/body/Exchange/values"], - Family::Binding => &["Occurrence/body/ScenarioUse/bindings"], - Family::Member(ReferenceCollection::ExchangeItems) => { - return [ - "Interaction", - "FunctionalExchange", - "BoundaryExchange", - "CommunicationMean", - ] - .iter() - .map(|kind| format!("/body/{kind}/items")) - .find(|p| value.pointer(p).is_some_and(Value::is_array)); - } - Family::Member(ReferenceCollection::TransitionTriggers) => { - return value - .pointer("/body/StateTransition/triggers") - .is_some_and(Value::is_array) - .then(|| "/body/StateTransition/triggers".into()); - } - Family::Member(ReferenceCollection::TransitionEffects) => { - return value - .pointer("/body/StateTransition/effects") - .is_some_and(Value::is_array) - .then(|| "/body/StateTransition/effects".into()); - } - }; - prefixes - .iter() - .flat_map(|prefix| tails.iter().map(move |tail| format!("{prefix}/{tail}"))) - .find(|p| value.pointer(p).is_some_and(Value::is_array)) -} -pub(super) fn key(facet: &FacetSelector, layer: Layer) -> Option { - match facet { - FacetSelector::Member { keys, .. } => if layer == Layer::Oa { keys.oa } else { keys.sa } - .map(|id| serde_json::to_value(id).expect("Id")), - FacetSelector::Literal(keys) => if layer == Layer::Oa { - keys.oa.as_ref() - } else { - keys.sa.as_ref() - } - .map(|v| Value::String(v.clone())), - FacetSelector::Annotation(keys) => if layer == Layer::Oa { - keys.oa.as_ref() - } else { - keys.sa.as_ref() - } - .map(|key| serde_json::to_value(key).expect("Annotation key")), - FacetSelector::Binding(keys) => if layer == Layer::Oa { keys.oa } else { keys.sa } - .map(|id| serde_json::to_value(id).expect("Binding key")), - _ => None, - } -} -pub(super) fn overlap(a: &FacetSelector, b: &FacetSelector) -> bool { - if family(a).is_none() || family(a) != family(b) { - return false; - } - [Layer::Oa, Layer::Sa] - .into_iter() - .any(|layer| key(a, layer).is_some() && key(a, layer) == key(b, layer)) -} -pub(super) fn project_presence( - value: &mut Value, - facet: &FacetSelector, - layer: Layer, - present: bool, -) -> Result<(), String> { - let family = family(facet).ok_or("This keyed family remains read-only.")?; - let key = key(facet, layer) - .ok_or("Choose the destination identity in Members before setting or taking presence.")?; - let path = - path(value, family).ok_or("This collection is not applicable to the destination kind.")?; - let list = value - .pointer_mut(&path) - .and_then(Value::as_array_mut) - .ok_or("Destination collection is unavailable.")?; - if present { - if !list.contains(&key) { - list.push(key); - } - } else { - list.retain(|v| v != &key); - } - Ok(()) -} - -impl ReviewRow { - pub(super) fn keyed_value( - &self, - project: &Project, - trace: &Trace, - value: &mut Value, - facet: &FacetSelector, - decision: SemanticDecision, - ) -> Result<(), String> { - if keyed_rows::supported(facet) { - return self.project_row(project, trace, value, facet, decision); - } - let present = match decision { - SemanticDecision::KeepTarget => return Ok(()), - SemanticDecision::TakeSource => { - // A missing source identity is a target-local row, not a removal. - if key(facet, self.direction.source_layer()).is_none() { - return Ok(()); - } - let fact = capture_facet(project, trace.oa, trace.sa, facet)?; - scalar::value(&fact, self.direction.source_layer()).and_then(|v| v.as_bool()).ok_or("Source collection is not applicable; choose an explicit final presence or Keep.")? - } - SemanticDecision::Candidate => *self - .presence - .get(facet) - .ok_or("Choose final membership presence.")?, - }; - project_presence(value, facet, self.direction.target_layer(), present) - } - - pub(super) fn member_families(&self, project: &Project) -> Vec { - let Some(trace) = self.effective_trace(project) else { - return vec![]; - }; - let values: Vec<_> = [trace.oa, trace.sa] - .into_iter() - .filter_map(|id| Draft::from_project(project, id).map(|d| d.value)) - .collect(); - FAMILIES - .into_iter() - .filter(|family| values.iter().any(|value| path(value, *family).is_some())) - .collect() - } - - pub(super) fn member_choices(&self, project: &Project, layer: Layer) -> Vec { - if self.member_family == Family::Binding { - return self.binding_choices(project, layer, true); - } - let Some(trace) = self.effective_trace(project) else { - return vec![]; - }; - let id = if layer == Layer::Oa { - trace.oa - } else { - trace.sa - }; - let Some(mut draft) = Draft::from_project(project, id) else { - return vec![]; - }; - if layer == self.direction.target_layer() { - draft.set_context(self.combined_value(project, true).ok()); - } - let selected = if layer == Layer::Oa { - &self.member_oa - } else { - &self.member_sa - }; - let Some(path) = path(&draft.context_value(), self.member_family) else { - return selected.iter().cloned().collect(); - }; - crate::forms::reference_choices( - &draft, - project, - &format!("{path}/0"), - selected.as_ref().map_or(Id::nil(), |c| c.id), - ) - .into_iter() - .filter(|c| !c.id.is_nil()) - .collect() - } - - pub(super) fn edit_pair( - &mut self, - project: &Project, - facet: FacetSelector, - ) -> Result<(), String> { - self.member_family = family(&facet).ok_or("This keyed family remains read-only.")?; - match facet { - FacetSelector::Annotation(keys) => { - self.annotation_oa.selected = keys.oa.map(|key| crate::data_values::FieldPathKey { - path: key.path, - field: key.field, - }); - self.annotation_sa.selected = keys.sa.map(|key| crate::data_values::FieldPathKey { - path: key.path, - field: key.field, - }); - } - FacetSelector::Binding(keys) => { - self.member_oa = keys.oa.map(|id| view::choice(project, id)); - self.member_sa = keys.sa.map(|id| view::choice(project, id)); - } - FacetSelector::Member { keys, .. } => { - self.member_oa = keys.oa.map(|id| view::choice(project, id)); - self.member_sa = keys.sa.map(|id| view::choice(project, id)); - } - FacetSelector::Literal(keys) => { - self.literal_oa = keys.oa.is_some(); - self.literal_sa = keys.sa.is_some(); - self.literal = keys.oa.or(keys.sa).unwrap_or_default(); - } - _ => unreachable!(), - } - self.tab = Tab::Members; - Ok(()) - } - - pub(super) fn stage_member(&mut self, project: &Project) -> Result<(), String> { - if !FAMILIES.contains(&self.member_family) { - return Err("This keyed family remains read-only.".into()); - } - let facet = match self.member_family { - Family::Member(collection) => FacetSelector::Member { - collection, - keys: KeyPair { - oa: self.member_oa.as_ref().map(|c| c.id), - sa: self.member_sa.as_ref().map(|c| c.id), - }, - }, - Family::Literal => FacetSelector::Literal(KeyPair { - oa: self.literal_oa.then(|| self.literal.clone()), - sa: self.literal_sa.then(|| self.literal.clone()), - }), - Family::Annotation => FacetSelector::Annotation(KeyPair { - oa: self - .annotation_oa - .selected - .as_ref() - .map(|key| AnnotationKey { - path: key.path.clone(), - field: key.field, - }), - sa: self - .annotation_sa - .selected - .as_ref() - .map(|key| AnnotationKey { - path: key.path.clone(), - field: key.field, - }), - }), - Family::Binding => FacetSelector::Binding(KeyPair { - oa: self.member_oa.as_ref().map(|c| c.id), - sa: self.member_sa.as_ref().map(|c| c.id), - }), - }; - let trace = self.effective_trace(project).ok_or("Choose a trace.")?; - capture_facet(project, trace.oa, trace.sa, &facet)?; - self.stage_row_references(&facet)?; - if let FacetSelector::Member { - keys: - KeyPair { - oa: Some(oa), - sa: Some(sa), - }, - .. - } = &facet - { - self.references.insert(*oa, *sa); - } - self.staged.insert(facet.clone()); - self.selected = Some(facet); - self.tab = Tab::Facts; - Ok(()) - } -} +//! Closed presence-only adapter. The core independently validates the full final record. +use super::*; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +pub enum Family { + Member(ReferenceCollection), + Literal, + Annotation, + Binding, +} +impl std::fmt::Display for Family { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + Self::Member(ReferenceCollection::FunctionInputItems) => "Function input items", + Self::Member(ReferenceCollection::FunctionOutputItems) => "Function output items", + Self::Member(ReferenceCollection::SignalItems) => "Signal items", + Self::Member(ReferenceCollection::CategoryExchanges) => "Category exchanges", + Self::Member(ReferenceCollection::ExchangeItems) => "Exchange items", + Self::Member(ReferenceCollection::TransitionTriggers) => "Transition triggers", + Self::Member(ReferenceCollection::TransitionEffects) => "Transition effects", + Self::Member(ReferenceCollection::Constrained) => "Constrained identities", + Self::Member(ReferenceCollection::Steps) => "Ordered steps", + Self::Member(ReferenceCollection::FragmentBranches) => "Fragment branches", + Self::Literal => "Enumeration literals", + Self::Annotation => "Message values", + Self::Binding => "Scenario lifeline bindings", + }) + } +} +pub(super) const FAMILIES: [Family; 13] = [ + Family::Member(ReferenceCollection::Steps), + Family::Member(ReferenceCollection::FragmentBranches), + Family::Member(ReferenceCollection::FunctionInputItems), + Family::Member(ReferenceCollection::FunctionOutputItems), + Family::Member(ReferenceCollection::SignalItems), + Family::Member(ReferenceCollection::ExchangeItems), + Family::Member(ReferenceCollection::CategoryExchanges), + Family::Member(ReferenceCollection::TransitionTriggers), + Family::Member(ReferenceCollection::TransitionEffects), + Family::Member(ReferenceCollection::Constrained), + Family::Literal, + Family::Annotation, + Family::Binding, +]; +pub(super) fn family(facet: &FacetSelector) -> Option { + let family = match facet { + FacetSelector::Member { collection, .. } => Family::Member(*collection), + FacetSelector::Literal(_) => Family::Literal, + FacetSelector::Annotation(_) => Family::Annotation, + FacetSelector::Binding(_) => Family::Binding, + _ => return None, + }; + FAMILIES.contains(&family).then_some(family) +} +pub(super) fn supported(facet: &FacetSelector) -> bool { + family(facet).is_some() +} + +// Fixed paths for the closed collections and the exact enum literal set. +// They are selected by the typed facet; callers cannot supply arbitrary paths. +pub(super) fn path(value: &Value, family: Family) -> Option { + let prefixes = ["/body/Oa/Shared", "/body/Sa/Shared"]; + let tails: &[&str] = match family { + Family::Member(ReferenceCollection::Steps) => { + return [ + "/body/Oa/Process/steps", + "/body/Sa/FunctionalChain/steps", + "/body/Oa/Shared/Scenario/steps", + "/body/Sa/Shared/Scenario/steps", + "/body/Oa/Shared/Occurrence/body/Branch/occurrences", + "/body/Sa/Shared/Occurrence/body/Branch/occurrences", + ] + .into_iter() + .find(|p| value.pointer(p).is_some_and(Value::is_array)) + .map(str::to_owned); + } + Family::Member(ReferenceCollection::FragmentBranches) => { + &["Occurrence/body/Fragment/branches"] + } + Family::Member(ReferenceCollection::FunctionInputItems) => { + &["Port/contract/FunctionInput/incoming_items"] + } + Family::Member(ReferenceCollection::FunctionOutputItems) => { + &["Port/contract/FunctionOutput/outgoing_items"] + } + Family::Member(ReferenceCollection::CategoryExchanges) => &["ExchangeCategory/exchanges"], + Family::Member(ReferenceCollection::SignalItems) => &["Event/body/Signal/items"], + Family::Member(ReferenceCollection::Constrained) => &["Constraint/constrained"], + Family::Literal => &["DataType/definition/Enumeration/literals"], + Family::Annotation => &["Occurrence/body/Exchange/values"], + Family::Binding => &["Occurrence/body/ScenarioUse/bindings"], + Family::Member(ReferenceCollection::ExchangeItems) => { + return [ + "Interaction", + "FunctionalExchange", + "BoundaryExchange", + "CommunicationMean", + ] + .iter() + .map(|kind| format!("/body/{kind}/items")) + .find(|p| value.pointer(p).is_some_and(Value::is_array)); + } + Family::Member(ReferenceCollection::TransitionTriggers) => { + return value + .pointer("/body/StateTransition/triggers") + .is_some_and(Value::is_array) + .then(|| "/body/StateTransition/triggers".into()); + } + Family::Member(ReferenceCollection::TransitionEffects) => { + return value + .pointer("/body/StateTransition/effects") + .is_some_and(Value::is_array) + .then(|| "/body/StateTransition/effects".into()); + } + }; + prefixes + .iter() + .flat_map(|prefix| tails.iter().map(move |tail| format!("{prefix}/{tail}"))) + .find(|p| value.pointer(p).is_some_and(Value::is_array)) +} +pub(super) fn key(facet: &FacetSelector, layer: Layer) -> Option { + match facet { + FacetSelector::Member { keys, .. } => if layer == Layer::Oa { keys.oa } else { keys.sa } + .map(|id| serde_json::to_value(id).expect("Id")), + FacetSelector::Literal(keys) => if layer == Layer::Oa { + keys.oa.as_ref() + } else { + keys.sa.as_ref() + } + .map(|v| Value::String(v.clone())), + FacetSelector::Annotation(keys) => if layer == Layer::Oa { + keys.oa.as_ref() + } else { + keys.sa.as_ref() + } + .map(|key| serde_json::to_value(key).expect("Annotation key")), + FacetSelector::Binding(keys) => if layer == Layer::Oa { keys.oa } else { keys.sa } + .map(|id| serde_json::to_value(id).expect("Binding key")), + _ => None, + } +} +pub(super) fn overlap(a: &FacetSelector, b: &FacetSelector) -> bool { + if family(a).is_none() || family(a) != family(b) { + return false; + } + [Layer::Oa, Layer::Sa] + .into_iter() + .any(|layer| key(a, layer).is_some() && key(a, layer) == key(b, layer)) +} +pub(super) fn project_presence( + value: &mut Value, + facet: &FacetSelector, + layer: Layer, + present: bool, +) -> Result<(), String> { + let family = family(facet).ok_or("This keyed family remains read-only.")?; + let key = key(facet, layer) + .ok_or("Choose the destination identity in Members before setting or taking presence.")?; + let path = + path(value, family).ok_or("This collection is not applicable to the destination kind.")?; + let list = value + .pointer_mut(&path) + .and_then(Value::as_array_mut) + .ok_or("Destination collection is unavailable.")?; + if present { + if !list.contains(&key) { + list.push(key); + } + } else { + list.retain(|v| v != &key); + } + Ok(()) +} + +impl ReviewRow { + pub(super) fn keyed_value( + &self, + project: &Project, + trace: &Trace, + value: &mut Value, + facet: &FacetSelector, + decision: SemanticDecision, + ) -> Result<(), String> { + if keyed_rows::supported(facet) { + return self.project_row(project, trace, value, facet, decision); + } + let present = match decision { + SemanticDecision::KeepTarget => return Ok(()), + SemanticDecision::TakeSource => { + // A missing source identity is a target-local row, not a removal. + if key(facet, self.direction.source_layer()).is_none() { + return Ok(()); + } + let fact = capture_facet(project, trace.oa, trace.sa, facet)?; + scalar::value(&fact, self.direction.source_layer()).and_then(|v| v.as_bool()).ok_or("Source collection is not applicable; choose an explicit final presence or Keep.")? + } + SemanticDecision::Candidate => *self + .presence + .get(facet) + .ok_or("Choose final membership presence.")?, + }; + project_presence(value, facet, self.direction.target_layer(), present) + } + + pub(super) fn member_families(&self, project: &Project) -> Vec { + let Some(trace) = self.effective_trace(project) else { + return vec![]; + }; + let values: Vec<_> = [trace.oa, trace.sa] + .into_iter() + .filter_map(|id| Draft::from_project(project, id).map(|d| d.value)) + .collect(); + FAMILIES + .into_iter() + .filter(|family| values.iter().any(|value| path(value, *family).is_some())) + .collect() + } + + pub(super) fn member_choices(&self, project: &Project, layer: Layer) -> Vec { + if self.member_family == Family::Binding { + return self.binding_choices(project, layer, true); + } + let Some(trace) = self.effective_trace(project) else { + return vec![]; + }; + let id = if layer == Layer::Oa { + trace.oa + } else { + trace.sa + }; + let Some(mut draft) = Draft::from_project(project, id) else { + return vec![]; + }; + if layer == self.direction.target_layer() { + draft.set_context(self.combined_value(project, true).ok()); + } + let selected = if layer == Layer::Oa { + &self.member_oa + } else { + &self.member_sa + }; + let Some(path) = path(&draft.context_value(), self.member_family) else { + return selected.iter().cloned().collect(); + }; + crate::forms::reference_choices( + &draft, + project, + &format!("{path}/0"), + selected.as_ref().map_or(Id::nil(), |c| c.id), + ) + .into_iter() + .filter(|c| !c.id.is_nil()) + .collect() + } + + pub(super) fn edit_pair( + &mut self, + project: &Project, + facet: FacetSelector, + ) -> Result<(), String> { + self.member_family = family(&facet).ok_or("This keyed family remains read-only.")?; + match facet { + FacetSelector::Annotation(keys) => { + self.annotation_oa.selected = keys.oa.map(|key| crate::data_values::FieldPathKey { + path: key.path, + field: key.field, + }); + self.annotation_sa.selected = keys.sa.map(|key| crate::data_values::FieldPathKey { + path: key.path, + field: key.field, + }); + } + FacetSelector::Binding(keys) => { + self.member_oa = keys.oa.map(|id| view::choice(project, id)); + self.member_sa = keys.sa.map(|id| view::choice(project, id)); + } + FacetSelector::Member { keys, .. } => { + self.member_oa = keys.oa.map(|id| view::choice(project, id)); + self.member_sa = keys.sa.map(|id| view::choice(project, id)); + } + FacetSelector::Literal(keys) => { + self.literal_oa = keys.oa.is_some(); + self.literal_sa = keys.sa.is_some(); + self.literal = keys.oa.or(keys.sa).unwrap_or_default(); + } + _ => unreachable!(), + } + self.tab = Tab::Members; + Ok(()) + } + + pub(super) fn stage_member(&mut self, project: &Project) -> Result<(), String> { + if !FAMILIES.contains(&self.member_family) { + return Err("This keyed family remains read-only.".into()); + } + let facet = match self.member_family { + Family::Member(collection) => FacetSelector::Member { + collection, + keys: KeyPair { + oa: self.member_oa.as_ref().map(|c| c.id), + sa: self.member_sa.as_ref().map(|c| c.id), + }, + }, + Family::Literal => FacetSelector::Literal(KeyPair { + oa: self.literal_oa.then(|| self.literal.clone()), + sa: self.literal_sa.then(|| self.literal.clone()), + }), + Family::Annotation => FacetSelector::Annotation(KeyPair { + oa: self + .annotation_oa + .selected + .as_ref() + .map(|key| AnnotationKey { + path: key.path.clone(), + field: key.field, + }), + sa: self + .annotation_sa + .selected + .as_ref() + .map(|key| AnnotationKey { + path: key.path.clone(), + field: key.field, + }), + }), + Family::Binding => FacetSelector::Binding(KeyPair { + oa: self.member_oa.as_ref().map(|c| c.id), + sa: self.member_sa.as_ref().map(|c| c.id), + }), + }; + let trace = self.effective_trace(project).ok_or("Choose a trace.")?; + capture_facet(project, trace.oa, trace.sa, &facet)?; + self.stage_row_references(&facet)?; + if let FacetSelector::Member { + keys: + KeyPair { + oa: Some(oa), + sa: Some(sa), + }, + .. + } = &facet + { + self.references.insert(*oa, *sa); + } + self.staged.insert(facet.clone()); + self.selected = Some(facet); + self.tab = Tab::Facts; + Ok(()) + } +} diff --git a/crates/oa-desktop/src/semantic_review/keyed_rows.rs b/crates/oa-desktop/src/semantic_review/keyed_rows.rs index 1962431a..d33d4985 100644 --- a/crates/oa-desktop/src/semantic_review/keyed_rows.rs +++ b/crates/oa-desktop/src/semantic_review/keyed_rows.rs @@ -1,345 +1,345 @@ -//! Atomic message-value and lifeline-binding rows with exact, immutable keys. -use super::*; -use crate::data_values::{FieldPathChoice, FieldPathKey}; - -#[derive(Default)] -pub struct AddressDraft { - pub selected: Option, - pub scope: Option, - pub page: usize, -} - -#[derive(Default)] -pub struct RowDraft { - pub expression: String, - pub editor: text_editor::Content, - pub local: Option, -} - -pub(super) fn supported(facet: &FacetSelector) -> bool { - matches!( - facet, - FacetSelector::Annotation(_) | FacetSelector::Binding(_) - ) -} - -pub(super) fn target_selector(facet: &FacetSelector, layer: Layer) -> FacetSelector { - match facet { - FacetSelector::Annotation(keys) => FacetSelector::Annotation(KeyPair { - oa: (layer == Layer::Oa).then(|| keys.oa.clone()).flatten(), - sa: (layer == Layer::Sa).then(|| keys.sa.clone()).flatten(), - }), - FacetSelector::Binding(keys) => FacetSelector::Binding(KeyPair { - oa: if layer == Layer::Oa { keys.oa } else { None }, - sa: if layer == Layer::Sa { keys.sa } else { None }, - }), - _ => facet.clone(), - } -} - -impl ReviewRow { - pub(super) fn annotation_address(&self, layer: Layer) -> &AddressDraft { - if layer == Layer::Oa { - &self.annotation_oa - } else { - &self.annotation_sa - } - } - - pub(super) fn annotation_address_mut(&mut self, layer: Layer) -> &mut AddressDraft { - if layer == Layer::Oa { - &mut self.annotation_oa - } else { - &mut self.annotation_sa - } - } - - fn row_owner(&self, project: &Project, layer: Layer) -> Option { - let trace = self.effective_trace(project)?; - let id = if layer == Layer::Oa { - trace.oa - } else { - trace.sa - }; - if layer == self.direction.target_layer() - && let Ok(value) = self.combined_value(project, true) - && let Ok(element) = serde_json::from_value(value) - { - return Some(element); - } - project.elements.get(&id).cloned() - } - - pub(super) fn annotation_choices( - &self, - project: &Project, - layer: Layer, - ) -> Result, String> { - let element = self.row_owner(project, layer).ok_or("Choose a trace.")?; - let Some(SharedBody::Occurrence { - body: - OccurrenceBody::Exchange { - exchange: Some(exchange), - message_kind, - .. - }, - .. - }) = element.shared() - else { - return Err( - "Choose an exchange on this message before selecting a carried field.".into(), - ); - }; - let exchange = project - .relations - .get(exchange) - .ok_or("The message exchange is unavailable.")?; - crate::data_values::at_scope( - project, - exchange, - message_kind, - self.annotation_address(layer).scope.as_ref(), - ) - } - - pub(super) fn binding_choices( - &self, - project: &Project, - layer: Layer, - referenced: bool, - ) -> Vec { - let Some(element) = self.row_owner(project, layer) else { - return vec![]; - }; - let scenario = if referenced { - match element.shared() { - Some(SharedBody::Occurrence { - body: OccurrenceBody::ScenarioUse { scenario, .. }, - .. - }) => *scenario, - _ => None, - } - } else { - element - .parent - .and_then(|parent| validation::ancestor_of_kind(project, parent, Kind::Scenario)) - }; - let mut choices: Vec<_> = project - .elements - .values() - .filter(|e| { - e.kind() == Kind::Lifeline - && e.layer() == layer - && scenario.is_some() - && e.parent == scenario - }) - .map(|e| view::choice(project, e.id)) - .collect(); - choices.sort_by_cached_key(|c| c.label.to_lowercase()); - choices - } - - pub(super) fn stage_row_references(&mut self, facet: &FacetSelector) -> Result<(), String> { - let pairs: Vec<_> = match facet { - FacetSelector::Annotation(KeyPair { - oa: Some(oa), - sa: Some(sa), - }) => { - if oa.path.len() != sa.path.len() { - return Err("Paired annotation paths must have the same depth; review distinct addresses separately.".into()); - } - oa.path - .iter() - .chain(std::iter::once(&oa.field)) - .copied() - .zip(sa.path.iter().chain(std::iter::once(&sa.field)).copied()) - .collect() - } - FacetSelector::Binding(KeyPair { - oa: Some(oa), - sa: Some(sa), - }) => vec![(*oa, *sa)], - _ => vec![], - }; - // A repeated recursive field may occur several times in one address. - // Never let the last occurrence silently replace a conflicting pair. - let mut supplied = BTreeMap::new(); - for (oa, sa) in pairs { - if supplied.insert(oa, sa).is_some_and(|prior| prior != sa) { - return Err( - "This address pairs the same Operational field with different System fields." - .into(), - ); - } - } - self.references.extend(supplied); - Ok(()) - } - - pub(super) fn initialize_row(&mut self, project: &Project, facet: &FacetSelector) { - if self.row_drafts.contains_key(facet) { - return; - } - let value = self - .effective_trace(project) - .and_then(|t| capture_facet(project, t.oa, t.sa, facet).ok()) - .and_then(|f| scalar::value(&f, self.direction.target_layer())); - let present = value.as_ref().is_some_and(|v| !v.is_null()); - let mut draft = RowDraft::default(); - if let Some(value) = value { - draft.expression = value["expression"].as_str().unwrap_or_default().into(); - draft.editor = text_editor::Content::with_text(&draft.expression); - draft.local = value["local"] - .as_str() - .and_then(|v| v.parse().ok()) - .map(|id| view::choice(project, id)); - } - self.presence.entry(facet.clone()).or_insert(present); - self.row_drafts.insert(facet.clone(), draft); - } - - pub(super) fn edit_row( - &mut self, - facet: &FacetSelector, - action: impl FnOnce(&mut RowDraft), - ) -> Result<(), String> { - if !supported(facet) - || self.selected.as_ref() != Some(facet) - || self.decisions.get(facet) != Some(&SemanticDecision::Candidate) - { - return Err("Select this row and choose Set final value before editing it.".into()); - } - action( - self.row_drafts - .get_mut(facet) - .ok_or("The row draft is unavailable.")?, - ); - Ok(()) - } - - pub(super) fn project_row( - &self, - project: &Project, - trace: &Trace, - value: &mut Value, - facet: &FacetSelector, - decision: SemanticDecision, - ) -> Result<(), String> { - if decision == SemanticDecision::KeepTarget { - return Ok(()); - } - let source_layer = self.direction.source_layer(); - let target_layer = self.direction.target_layer(); - if decision == SemanticDecision::TakeSource && keyed::key(facet, source_layer).is_none() { - return Ok(()); - } - let target_key = keyed::key(facet, target_layer) - .ok_or("Choose the destination row address before setting or taking its value.")?; - let row = if decision == SemanticDecision::Candidate { - if !self.presence.get(facet).copied().unwrap_or(false) { - Value::Null - } else { - let draft = self - .row_drafts - .get(facet) - .ok_or("Set the final row value.")?; - match facet { - FacetSelector::Annotation(_) => { - let key: AnnotationKey = serde_json::from_value(target_key.clone()) - .map_err(|e| e.to_string())?; - serde_json::to_value(MessageValue { - path: key.path, - field: key.field, - expression: draft.expression.clone(), - }) - .expect("Message value") - } - FacetSelector::Binding(_) => { - serde_json::json!({"referenced": target_key, "local": draft.local.as_ref().ok_or("Choose the destination scenario's local lifeline.")?.id}) - } - _ => return Err("Unsupported row.".into()), - } - } - } else { - let fact = capture_facet(project, trace.oa, trace.sa, facet)?; - let row = scalar::value(&fact, source_layer) - .ok_or("Source row collection is not applicable; review its constructor first.")?; - if row.is_null() { - row - } else { - let map = |id: Id| -> Result { - if source_layer == Layer::Oa { - self.references.get(&id).copied().ok_or_else(|| { - format!("Choose a reference counterpart for {}.", project.named(id)) - }) - } else { - let matches: Vec<_> = self - .references - .iter() - .filter(|(_, sa)| **sa == id) - .map(|(oa, _)| *oa) - .collect(); - if matches.len() == 1 { - Ok(matches[0]) - } else { - Err(format!( - "Choose one unambiguous reference counterpart for {}.", - project.named(id) - )) - } - } - }; - match facet { - FacetSelector::Annotation(_) => { - let mut row: MessageValue = - serde_json::from_value(row).map_err(|e| e.to_string())?; - row.path = row.path.into_iter().map(map).collect::>()?; - row.field = map(row.field)?; - if serde_json::to_value(AnnotationKey::from(&row)).expect("key") - != target_key - { - return Err("Mapped annotation address disagrees with the selected destination address.".into()); - } - serde_json::to_value(row).expect("row") - } - FacetSelector::Binding(_) => { - let row: LifelineBinding = - serde_json::from_value(row).map_err(|e| e.to_string())?; - let mapped = LifelineBinding { - referenced: map(row.referenced)?, - local: map(row.local)?, - }; - if serde_json::to_value(mapped.referenced).expect("Id") != target_key { - return Err("Mapped binding key disagrees with the selected destination lifeline.".into()); - } - serde_json::to_value(mapped).expect("row") - } - _ => return Err("Unsupported row.".into()), - } - } - }; - let family = keyed::family(facet).ok_or("Unsupported row.")?; - let path = keyed::path(value, family) - .ok_or("The destination constructor has no collection for this row.")?; - let rows = value - .pointer_mut(&path) - .and_then(Value::as_array_mut) - .ok_or("Destination rows are unavailable.")?; - let position = rows.iter().position(|row| match facet { - FacetSelector::Annotation(_) => { - serde_json::json!({"path": row["path"], "field": row["field"]}) == target_key - } - FacetSelector::Binding(_) => row["referenced"] == target_key, - _ => false, - }); - match (position, row.is_null()) { - (Some(index), false) => rows[index] = row, - (Some(index), true) => { - rows.remove(index); - } - (None, false) => rows.push(row), - (None, true) => {} - } - Ok(()) - } -} +//! Atomic message-value and lifeline-binding rows with exact, immutable keys. +use super::*; +use crate::data_values::{FieldPathChoice, FieldPathKey}; + +#[derive(Default)] +pub struct AddressDraft { + pub selected: Option, + pub scope: Option, + pub page: usize, +} + +#[derive(Default)] +pub struct RowDraft { + pub expression: String, + pub editor: text_editor::Content, + pub local: Option, +} + +pub(super) fn supported(facet: &FacetSelector) -> bool { + matches!( + facet, + FacetSelector::Annotation(_) | FacetSelector::Binding(_) + ) +} + +pub(super) fn target_selector(facet: &FacetSelector, layer: Layer) -> FacetSelector { + match facet { + FacetSelector::Annotation(keys) => FacetSelector::Annotation(KeyPair { + oa: (layer == Layer::Oa).then(|| keys.oa.clone()).flatten(), + sa: (layer == Layer::Sa).then(|| keys.sa.clone()).flatten(), + }), + FacetSelector::Binding(keys) => FacetSelector::Binding(KeyPair { + oa: if layer == Layer::Oa { keys.oa } else { None }, + sa: if layer == Layer::Sa { keys.sa } else { None }, + }), + _ => facet.clone(), + } +} + +impl ReviewRow { + pub(super) fn annotation_address(&self, layer: Layer) -> &AddressDraft { + if layer == Layer::Oa { + &self.annotation_oa + } else { + &self.annotation_sa + } + } + + pub(super) fn annotation_address_mut(&mut self, layer: Layer) -> &mut AddressDraft { + if layer == Layer::Oa { + &mut self.annotation_oa + } else { + &mut self.annotation_sa + } + } + + fn row_owner(&self, project: &Project, layer: Layer) -> Option { + let trace = self.effective_trace(project)?; + let id = if layer == Layer::Oa { + trace.oa + } else { + trace.sa + }; + if layer == self.direction.target_layer() + && let Ok(value) = self.combined_value(project, true) + && let Ok(element) = serde_json::from_value(value) + { + return Some(element); + } + project.elements.get(&id).cloned() + } + + pub(super) fn annotation_choices( + &self, + project: &Project, + layer: Layer, + ) -> Result, String> { + let element = self.row_owner(project, layer).ok_or("Choose a trace.")?; + let Some(SharedBody::Occurrence { + body: + OccurrenceBody::Exchange { + exchange: Some(exchange), + message_kind, + .. + }, + .. + }) = element.shared() + else { + return Err( + "Choose an exchange on this message before selecting a carried field.".into(), + ); + }; + let exchange = project + .relations + .get(exchange) + .ok_or("The message exchange is unavailable.")?; + crate::data_values::at_scope( + project, + exchange, + message_kind, + self.annotation_address(layer).scope.as_ref(), + ) + } + + pub(super) fn binding_choices( + &self, + project: &Project, + layer: Layer, + referenced: bool, + ) -> Vec { + let Some(element) = self.row_owner(project, layer) else { + return vec![]; + }; + let scenario = if referenced { + match element.shared() { + Some(SharedBody::Occurrence { + body: OccurrenceBody::ScenarioUse { scenario, .. }, + .. + }) => *scenario, + _ => None, + } + } else { + element + .parent + .and_then(|parent| validation::ancestor_of_kind(project, parent, Kind::Scenario)) + }; + let mut choices: Vec<_> = project + .elements + .values() + .filter(|e| { + e.kind() == Kind::Lifeline + && e.layer() == layer + && scenario.is_some() + && e.parent == scenario + }) + .map(|e| view::choice(project, e.id)) + .collect(); + choices.sort_by_cached_key(|c| c.label.to_lowercase()); + choices + } + + pub(super) fn stage_row_references(&mut self, facet: &FacetSelector) -> Result<(), String> { + let pairs: Vec<_> = match facet { + FacetSelector::Annotation(KeyPair { + oa: Some(oa), + sa: Some(sa), + }) => { + if oa.path.len() != sa.path.len() { + return Err("Paired annotation paths must have the same depth; review distinct addresses separately.".into()); + } + oa.path + .iter() + .chain(std::iter::once(&oa.field)) + .copied() + .zip(sa.path.iter().chain(std::iter::once(&sa.field)).copied()) + .collect() + } + FacetSelector::Binding(KeyPair { + oa: Some(oa), + sa: Some(sa), + }) => vec![(*oa, *sa)], + _ => vec![], + }; + // A repeated recursive field may occur several times in one address. + // Never let the last occurrence silently replace a conflicting pair. + let mut supplied = BTreeMap::new(); + for (oa, sa) in pairs { + if supplied.insert(oa, sa).is_some_and(|prior| prior != sa) { + return Err( + "This address pairs the same Operational field with different System fields." + .into(), + ); + } + } + self.references.extend(supplied); + Ok(()) + } + + pub(super) fn initialize_row(&mut self, project: &Project, facet: &FacetSelector) { + if self.row_drafts.contains_key(facet) { + return; + } + let value = self + .effective_trace(project) + .and_then(|t| capture_facet(project, t.oa, t.sa, facet).ok()) + .and_then(|f| scalar::value(&f, self.direction.target_layer())); + let present = value.as_ref().is_some_and(|v| !v.is_null()); + let mut draft = RowDraft::default(); + if let Some(value) = value { + draft.expression = value["expression"].as_str().unwrap_or_default().into(); + draft.editor = text_editor::Content::with_text(&draft.expression); + draft.local = value["local"] + .as_str() + .and_then(|v| v.parse().ok()) + .map(|id| view::choice(project, id)); + } + self.presence.entry(facet.clone()).or_insert(present); + self.row_drafts.insert(facet.clone(), draft); + } + + pub(super) fn edit_row( + &mut self, + facet: &FacetSelector, + action: impl FnOnce(&mut RowDraft), + ) -> Result<(), String> { + if !supported(facet) + || self.selected.as_ref() != Some(facet) + || self.decisions.get(facet) != Some(&SemanticDecision::Candidate) + { + return Err("Select this row and choose Set final value before editing it.".into()); + } + action( + self.row_drafts + .get_mut(facet) + .ok_or("The row draft is unavailable.")?, + ); + Ok(()) + } + + pub(super) fn project_row( + &self, + project: &Project, + trace: &Trace, + value: &mut Value, + facet: &FacetSelector, + decision: SemanticDecision, + ) -> Result<(), String> { + if decision == SemanticDecision::KeepTarget { + return Ok(()); + } + let source_layer = self.direction.source_layer(); + let target_layer = self.direction.target_layer(); + if decision == SemanticDecision::TakeSource && keyed::key(facet, source_layer).is_none() { + return Ok(()); + } + let target_key = keyed::key(facet, target_layer) + .ok_or("Choose the destination row address before setting or taking its value.")?; + let row = if decision == SemanticDecision::Candidate { + if !self.presence.get(facet).copied().unwrap_or(false) { + Value::Null + } else { + let draft = self + .row_drafts + .get(facet) + .ok_or("Set the final row value.")?; + match facet { + FacetSelector::Annotation(_) => { + let key: AnnotationKey = serde_json::from_value(target_key.clone()) + .map_err(|e| e.to_string())?; + serde_json::to_value(MessageValue { + path: key.path, + field: key.field, + expression: draft.expression.clone(), + }) + .expect("Message value") + } + FacetSelector::Binding(_) => { + serde_json::json!({"referenced": target_key, "local": draft.local.as_ref().ok_or("Choose the destination scenario's local lifeline.")?.id}) + } + _ => return Err("Unsupported row.".into()), + } + } + } else { + let fact = capture_facet(project, trace.oa, trace.sa, facet)?; + let row = scalar::value(&fact, source_layer) + .ok_or("Source row collection is not applicable; review its constructor first.")?; + if row.is_null() { + row + } else { + let map = |id: Id| -> Result { + if source_layer == Layer::Oa { + self.references.get(&id).copied().ok_or_else(|| { + format!("Choose a reference counterpart for {}.", project.named(id)) + }) + } else { + let matches: Vec<_> = self + .references + .iter() + .filter(|(_, sa)| **sa == id) + .map(|(oa, _)| *oa) + .collect(); + if matches.len() == 1 { + Ok(matches[0]) + } else { + Err(format!( + "Choose one unambiguous reference counterpart for {}.", + project.named(id) + )) + } + } + }; + match facet { + FacetSelector::Annotation(_) => { + let mut row: MessageValue = + serde_json::from_value(row).map_err(|e| e.to_string())?; + row.path = row.path.into_iter().map(map).collect::>()?; + row.field = map(row.field)?; + if serde_json::to_value(AnnotationKey::from(&row)).expect("key") + != target_key + { + return Err("Mapped annotation address disagrees with the selected destination address.".into()); + } + serde_json::to_value(row).expect("row") + } + FacetSelector::Binding(_) => { + let row: LifelineBinding = + serde_json::from_value(row).map_err(|e| e.to_string())?; + let mapped = LifelineBinding { + referenced: map(row.referenced)?, + local: map(row.local)?, + }; + if serde_json::to_value(mapped.referenced).expect("Id") != target_key { + return Err("Mapped binding key disagrees with the selected destination lifeline.".into()); + } + serde_json::to_value(mapped).expect("row") + } + _ => return Err("Unsupported row.".into()), + } + } + }; + let family = keyed::family(facet).ok_or("Unsupported row.")?; + let path = keyed::path(value, family) + .ok_or("The destination constructor has no collection for this row.")?; + let rows = value + .pointer_mut(&path) + .and_then(Value::as_array_mut) + .ok_or("Destination rows are unavailable.")?; + let position = rows.iter().position(|row| match facet { + FacetSelector::Annotation(_) => { + serde_json::json!({"path": row["path"], "field": row["field"]}) == target_key + } + FacetSelector::Binding(_) => row["referenced"] == target_key, + _ => false, + }); + match (position, row.is_null()) { + (Some(index), false) => rows[index] = row, + (Some(index), true) => { + rows.remove(index); + } + (None, false) => rows.push(row), + (None, true) => {} + } + Ok(()) + } +} diff --git a/crates/oa-desktop/src/semantic_review/keyed_tests.rs b/crates/oa-desktop/src/semantic_review/keyed_tests.rs index c28714f8..5b3429fd 100644 --- a/crates/oa-desktop/src/semantic_review/keyed_tests.rs +++ b/crates/oa-desktop/src/semantic_review/keyed_tests.rs @@ -1,792 +1,792 @@ -use super::{tests::*, *}; -use crate::{app::App, document::Document}; - -fn errors(s: &State) -> String { - s.error - .iter() - .chain(s.plan.iter().flat_map(|p| &p.conflicts)) - .cloned() - .collect::>() - .join("; ") -} -fn put(p: &mut Project, owner: Id, facet: &FacetSelector, present: bool) { - let layer = p.layer_of(owner).unwrap(); - let mut value = Draft::from_project(p, owner).unwrap().value; - keyed::project_presence(&mut value, facet, layer, present).unwrap(); - if let Some(element) = p.elements.get_mut(&owner) { - *element = serde_json::from_value(value).unwrap(); - } else { - p.relations - .insert(owner, serde_json::from_value(value).unwrap()); - } -} -fn contains(p: &Project, owner: Id, facet: &FacetSelector, oa: Id, sa: Id) -> bool { - scalar::value( - &capture_facet(p, oa, sa, facet).unwrap(), - p.layer_of(owner).unwrap(), - ) - .unwrap() - .as_bool() - .unwrap() -} -fn history(p: &mut Project, trace: Id, selectors: &[FacetSelector]) { - let t = &p.traces[&trace]; - let baseline = TraceBaseline { - oa: p.properties(t.oa).unwrap(), - sa: p.properties(t.sa).unwrap(), - semantic: Some(SemanticBaseline { - facets: selectors - .iter() - .map(|s| capture_facet(p, t.oa, t.sa, s).unwrap()) - .collect(), - }), - }; - p.traces.get_mut(&trace).unwrap().baseline = Some(baseline); -} -fn literal(name: &str) -> FacetSelector { - FacetSelector::Literal(KeyPair { - oa: Some(name.into()), - sa: Some(name.into()), - }) -} -fn enum_pair() -> (Project, Id, Id, Id) { - let mut p = Project::empty(); - let mut ids = vec![]; - for layer in [Layer::Oa, Layer::Sa] { - let id = p.add_element(Kind::DataType, layer, "Enum", None).unwrap(); - *p.elements.get_mut(&id).unwrap().shared_mut().unwrap() = SharedBody::DataType { - definition: DataTypeDefinition::Enumeration { - literals: vec!["retained".into()], - }, - default: Some(DataValue::Enumeration("retained".into())), - unit: String::new(), - }; - ids.push(id); - } - let trace = add_trace(&mut p, ids[0], ids[1], "Literal review"); - (p, ids[0], ids[1], trace) -} -fn member_pair(collection: ReferenceCollection) -> (Project, Id, Id, Id, FacetSelector, [Id; 2]) { - let mut p = Project::empty(); - let mut owners = vec![]; - let mut keys = vec![]; - let mut locals = vec![]; - for layer in [Layer::Oa, Layer::Sa] { - let work = if layer == Layer::Oa { - Kind::Activity - } else { - Kind::Function - }; - let kind = match collection { - ReferenceCollection::TransitionTriggers => Kind::Event, - ReferenceCollection::TransitionEffects | ReferenceCollection::Constrained => work, - _ => Kind::ExchangeItem, - }; - let key = p.add_element(kind, layer, "Mapped member", None).unwrap(); - let local = p.add_element(kind, layer, "Local member", None).unwrap(); - let owner = match collection { - ReferenceCollection::SignalItems => { - let id = p.add_element(Kind::Event, layer, "Signal", None).unwrap(); - *p.elements.get_mut(&id).unwrap().shared_mut().unwrap() = SharedBody::Event { - body: EventBody::Signal { items: vec![] }, - }; - id - } - ReferenceCollection::Constrained => p - .add_element(Kind::Constraint, layer, "Constraint", None) - .unwrap(), - ReferenceCollection::ExchangeItems => { - let a = p.add_element(work, layer, "From", None).unwrap(); - let b = p.add_element(work, layer, "To", None).unwrap(); - let id = p.relate( - if layer == Layer::Oa { - RelationKind::Interaction - } else { - RelationKind::FunctionalExchange - }, - "Exchange", - a, - b, - ); - if let RelationBody::FunctionalExchange { - source_port, - target_port, - .. - } = p.relations[&id].body - { - for port in [source_port, target_port] { - if let Some(SharedBody::Port { contract, .. }) = - p.elements.get_mut(&port).unwrap().shared_mut() - { - match contract { - PortContract::FunctionInput { incoming_items } => { - *incoming_items = vec![key, local] - } - PortContract::FunctionOutput { outgoing_items } => { - *outgoing_items = vec![key, local] - } - _ => unreachable!(), - } - } - } - } - id - } - ReferenceCollection::TransitionTriggers | ReferenceCollection::TransitionEffects => { - let machine = p - .add_element(Kind::StateMachine, layer, "Machine", None) - .unwrap(); - let region = p - .add_element(Kind::Region, layer, "Region", Some(machine)) - .unwrap(); - let state = p - .add_element(Kind::State, layer, "State", Some(region)) - .unwrap(); - p.relate(RelationKind::StateTransition, "Transition", state, state) - } - ReferenceCollection::FunctionInputItems | ReferenceCollection::FunctionOutputItems => { - let parent = p.add_element(work, layer, "Owner", None).unwrap(); - let id = Id::new_v4(); - let contract = if layer == Layer::Oa { - PortContract::Legacy - } else if collection == ReferenceCollection::FunctionInputItems { - PortContract::FunctionInput { - incoming_items: vec![], - } - } else { - PortContract::FunctionOutput { - outgoing_items: vec![], - } - }; - let mut port = ports::make_port(&p, id, parent, "Port", contract).unwrap(); - if layer == Layer::Oa - && let Some(SharedBody::Port { legacy, .. }) = port.shared_mut() - { - *legacy = Some(LegacyPortContract { - direction: PortDirection::InOut, - interface: None, - }); - } - p.elements.insert(id, port); - id - } - _ => unreachable!(), - }; - owners.push(owner); - keys.push(key); - locals.push(local); - } - let trace = add_trace(&mut p, owners[0], owners[1], "Membership review"); - let facet = FacetSelector::Member { - collection, - keys: KeyPair { - oa: Some(keys[0]), - sa: Some(keys[1]), - }, - }; - ( - p, - owners[0], - owners[1], - trace, - facet, - [locals[0], locals[1]], - ) -} -fn stage(app: &mut App, facet: &FacetSelector) { - send(app, RowEvent::EditPair(facet.clone())); - send(app, RowEvent::StageMember); - assert_eq!( - state(app).selected.as_ref(), - Some(facet), - "{}", - errors(state(app)) - ); -} - -#[test] -fn unordered_members_keep_take_candidate_preserve_other_rows_both_directions() { - for collection in [ - ReferenceCollection::SignalItems, - ReferenceCollection::ExchangeItems, - ReferenceCollection::TransitionTriggers, - ReferenceCollection::TransitionEffects, - ReferenceCollection::Constrained, - ] { - for reverse in [false, true] { - for decision in [ - SemanticDecision::KeepTarget, - SemanticDecision::TakeSource, - SemanticDecision::Candidate, - ] { - let (mut p, oa, sa, trace, facet, locals) = member_pair(collection); - let (source, target, local) = if reverse { - (sa, oa, locals[0]) - } else { - (oa, sa, locals[1]) - }; - put(&mut p, source, &facet, true); - let local_facet = FacetSelector::Member { - collection, - keys: KeyPair { - oa: reverse.then_some(local), - sa: (!reverse).then_some(local), - }, - }; - put(&mut p, target, &local_facet, true); - let mut app = App::with_project(p); - let before = app.document.snapshot(); - start(&mut app, source); - stage(&mut app, &facet); - decide(&mut app, facet.clone(), decision); - if decision == SemanticDecision::Candidate { - send(&mut app, RowEvent::Presence(facet.clone(), true)); - } - // A target-only Take is an explicit acknowledgment, never implicit removal. - decide(&mut app, local_facet.clone(), SemanticDecision::TakeSource); - assert!( - state(&app).can_apply(), - "{collection:?} reverse={reverse} {decision:?}: {}", - errors(state(&app)) - ); - let proposed = state(&app).proposed.clone().unwrap(); - assert_eq!(app.document.bundle(), &before.bundle); - apply(&mut app); - assert!(app.workflow.is_none(), "{}", app.status); - assert_eq!(app.project(), &proposed); - assert_eq!( - contains(app.project(), target, &facet, oa, sa), - decision != SemanticDecision::KeepTarget - ); - assert!(contains(app.project(), target, &local_facet, oa, sa)); - assert!(app.project().elements.contains_key(&local)); - assert_eq!( - app.project().traces[&trace] - .baseline - .as_ref() - .unwrap() - .semantic - .as_ref() - .unwrap() - .facets - .len(), - 2 - ); - let _ = app.update(Message::Undo); - assert_eq!(app.document.bundle(), &before.bundle); - } - } - } -} - -#[test] -fn function_port_members_use_existing_typed_choices_and_preserve_oa_legacy() { - for collection in [ - ReferenceCollection::FunctionInputItems, - ReferenceCollection::FunctionOutputItems, - ] { - let (p, oa, sa, _, facet, _) = member_pair(collection); - let FacetSelector::Member { keys, .. } = &facet else { - unreachable!() - }; - let mut app = App::with_project(p); - start(&mut app, oa); - assert_eq!( - state(&app).member_families(app.project()), - vec![keyed::Family::Member(collection)] - ); - send(&mut app, RowEvent::EditPair(facet.clone())); - assert!( - state(&app) - .member_choices(app.project(), Layer::Sa) - .iter() - .any(|c| Some(c.id) == keys.sa) - ); - send(&mut app, RowEvent::StageMember); - decide(&mut app, facet.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(facet.clone(), true)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - apply(&mut app); - assert!(contains(app.project(), sa, &facet, oa, sa)); - assert!(matches!( - app.project().elements[&oa].shared(), - Some(SharedBody::Port { - contract: PortContract::Legacy, - .. - }) - )); - start(&mut app, sa); - stage(&mut app, &facet); - decide(&mut app, facet.clone(), SemanticDecision::KeepTarget); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - decide(&mut app, facet.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(facet, true)); - assert!( - !state(&app).can_apply(), - "OA typed membership must remain inapplicable" - ); - } -} - -#[test] -fn exact_literal_new_rows_and_removals_commit_both_directions_without_default_loss() { - for reverse in [false, true] { - let (mut p, oa, sa, _) = enum_pair(); - let (source, target) = if reverse { (sa, oa) } else { (oa, sa) }; - let incoming = literal(" New value "); - put(&mut p, source, &incoming, true); - let removed = literal("old"); - put(&mut p, target, &removed, true); - let created = literal("new value"); - let mut app = App::with_project(p); - start(&mut app, source); - for (facet, decision) in [ - (&incoming, SemanticDecision::TakeSource), - (&removed, SemanticDecision::Candidate), - (&created, SemanticDecision::Candidate), - ] { - stage(&mut app, facet); - decide(&mut app, facet.clone(), decision); - if decision == SemanticDecision::Candidate { - send( - &mut app, - RowEvent::Presence(facet.clone(), facet == &created), - ); - } - } - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - apply(&mut app); - assert!(contains(app.project(), target, &incoming, oa, sa)); - assert!(contains(app.project(), target, &created, oa, sa)); - assert!(!contains(app.project(), target, &removed, oa, sa)); - assert!( - matches!(app.project().elements[&target].shared(),Some(SharedBody::DataType { default: Some(DataValue::Enumeration(value)), .. }) if value=="retained") - ); - let reopened = Document::from_bundle( - app.document.bundle().clone(), - source_project::ProjectLimits::default(), - ) - .unwrap(); - assert_eq!(reopened.project(), app.project()); - } -} - -#[test] -fn exact_reset_only_is_one_history_source_transaction_and_undo_redo_both_directions() { - for reverse in [false, true] { - let (mut p, oa, sa, trace) = enum_pair(); - let reset = literal("retained"); - let kept = FacetSelector::Header(HeaderFacet::Name); - history(&mut p, trace, &[reset.clone(), kept.clone()]); - let previous = p.traces[&trace].baseline.clone().unwrap(); - let mut app = App::with_project(p); - let mut bundle = app.document.bundle().clone(); - bundle - .files - .get_mut(&bundle.entry) - .unwrap() - .insert_str(0, "// Exact review rationale survives reset.\n"); - app.document.apply_bundle(bundle).unwrap(); - let before = app.document.snapshot(); - let revision = app.document.revision(); - start(&mut app, if reverse { sa } else { oa }); - send(&mut app, RowEvent::Reset(reset.clone(), true)); - assert!(state(&app).decisions.is_empty()); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - assert_eq!( - state(&app) - .facts - .iter() - .find(|f| f.selector == reset) - .unwrap() - .drift, - Drift::Unreviewed - ); - send(&mut app, RowEvent::Reset(reset.clone(), false)); - assert!(!state(&app).can_apply()); - assert_eq!( - state(&app) - .facts - .iter() - .find(|f| f.selector == reset) - .unwrap() - .drift, - Drift::Unchanged - ); - send(&mut app, RowEvent::Reset(reset, true)); - apply(&mut app); - assert_eq!(app.document.revision(), revision + 1); - assert_eq!(app.project().elements, before.decoded.project.elements); - let after = &app.project().traces[&trace].baseline.as_ref().unwrap(); - assert_eq!(after.oa, previous.oa); - assert_eq!(after.sa, previous.sa); - assert_eq!( - after - .semantic - .as_ref() - .unwrap() - .facets - .iter() - .map(FacetReview::selector) - .collect::>(), - vec![kept] - ); - assert!( - app.document.bundle().files[&app.document.bundle().entry] - .contains("// Exact review rationale survives reset.") - ); - let accepted = app.document.snapshot(); - let _ = app.update(Message::Undo); - assert_eq!(app.document.bundle(), &before.bundle); - let _ = app.update(Message::Redo); - assert_eq!(app.document.bundle(), &accepted.bundle); - } -} - -#[test] -fn historical_one_sided_pair_migration_requires_exact_reset_and_explicit_overlap_resolution() { - for reverse in [false, true] { - let (mut p, oa, sa, trace, paired, _) = member_pair(ReferenceCollection::SignalItems); - let FacetSelector::Member { collection, keys } = &paired else { - unreachable!() - }; - let (source, target) = if reverse { (sa, oa) } else { (oa, sa) }; - let previous = FacetSelector::Member { - collection: *collection, - keys: KeyPair { - oa: if reverse { None } else { keys.oa }, - sa: if reverse { keys.sa } else { None }, - }, - }; - put(&mut p, source, &paired, true); - history(&mut p, trace, std::slice::from_ref(&previous)); - let mut app = App::with_project(p); - start(&mut app, source); - decide(&mut app, previous.clone(), SemanticDecision::KeepTarget); - stage(&mut app, &paired); - decide(&mut app, paired.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(paired.clone(), true)); - assert!(!state(&app).can_apply()); - assert_eq!(state(&app).decisions.len(), 2); - send(&mut app, RowEvent::Decide(previous.clone(), None)); - assert!( - !state(&app).can_apply(), - "Historic pair cannot silently migrate" - ); - send(&mut app, RowEvent::Reset(previous.clone(), true)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - send(&mut app, RowEvent::Reset(previous, false)); - assert!(!state(&app).can_apply()); - assert!(state(&app).presence[&paired]); - let old = state(&app).resets.clone(); - assert!(old.is_empty()); - let historic = app.project().traces[&trace] - .baseline - .as_ref() - .unwrap() - .semantic - .as_ref() - .unwrap() - .facets[0] - .selector(); - send(&mut app, RowEvent::Reset(historic, true)); - apply(&mut app); - assert!(contains(app.project(), target, &paired, oa, sa)); - assert_eq!( - app.project().traces[&trace] - .baseline - .as_ref() - .unwrap() - .semantic - .as_ref() - .unwrap() - .facets[0] - .selector(), - paired - ); - } -} - -#[test] -fn reset_precedes_equal_constructor_candidate_and_preserves_independent_literal_draft() { - for reverse in [false, true] { - let (mut p, oa, sa, trace) = enum_pair(); - let ctor = FacetSelector::Data(DataFacet::Constructor); - history(&mut p, trace, std::slice::from_ref(&ctor)); - let mut app = App::with_project(p); - start(&mut app, if reverse { sa } else { oa }); - let created = literal("separate"); - stage(&mut app, &created); - decide(&mut app, created.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(created.clone(), true)); - send(&mut app, RowEvent::Reset(ctor.clone(), true)); - decide(&mut app, ctor.clone(), SemanticDecision::Candidate); - assert!(state(&app).can_acknowledge_constructor(app.project(), &ctor)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - let reviewed = &state(&app).plan.as_ref().unwrap().reviews[0]; - assert_eq!( - reviewed - .acknowledged - .iter() - .cloned() - .collect::>(), - BTreeSet::from([ctor.clone(), created.clone()]) - ); - assert!(reviewed.retired.is_empty()); - send(&mut app, RowEvent::Reset(ctor.clone(), false)); - assert!(!state(&app).can_apply()); - assert!(state(&app).presence[&created]); - send(&mut app, RowEvent::Reset(ctor, true)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - } -} - -#[test] -fn invalid_literal_removal_and_unselected_scalar_buffers_are_retained_and_repairable() { - let (p, oa, _, _) = enum_pair(); - let mut app = App::with_project(p); - start(&mut app, oa); - let unit = FacetSelector::Data(DataFacet::Unit); - decide(&mut app, unit.clone(), SemanticDecision::Candidate); - send( - &mut app, - RowEvent::Input( - "/body/Sa/Shared/DataType/unit".into(), - " untouched unit ".into(), - ), - ); - decide(&mut app, unit.clone(), SemanticDecision::KeepTarget); - let retained = literal("retained"); - decide(&mut app, retained.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(retained.clone(), false)); - assert!( - !state(&app).can_apply(), - "Existing default must prevent removal" - ); - assert!(!state(&app).presence[&retained]); - send(&mut app, RowEvent::Presence(retained.clone(), true)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - assert_eq!( - state(&app).draft.as_ref().unwrap().inputs["/body/Sa/Shared/DataType/unit"].raw, - " untouched unit " - ); - decide(&mut app, unit, SemanticDecision::Candidate); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); -} - -#[test] -fn unsupported_independent_families_and_missing_identities_do_not_gain_edit_authority() { - let (p, oa, _, _) = enum_pair(); - let mut app = App::with_project(p); - start(&mut app, oa); - let unsupported = FacetSelector::Member { - collection: ReferenceCollection::Steps, - keys: KeyPair { - oa: Some(oa), - sa: None, - }, - }; - decide(&mut app, unsupported.clone(), SemanticDecision::Candidate); - assert!(!state(&app).decisions.contains_key(&unsupported)); - send(&mut app, RowEvent::MemberFamily(keyed::Family::Literal)); - send(&mut app, RowEvent::Literal("unpaired".into())); - send(&mut app, RowEvent::LiteralSide(Layer::Sa, false)); - send(&mut app, RowEvent::StageMember); - let facet = state(&app).selected.clone().unwrap(); - decide(&mut app, facet.clone(), SemanticDecision::Candidate); - assert!(!state(&app).can_apply()); - send(&mut app, RowEvent::LiteralSide(Layer::Oa, false)); - send(&mut app, RowEvent::StageMember); - assert!(state(&app).error.is_some()); - assert_eq!( - state(&app).decisions.get(&facet), - Some(&SemanticDecision::Candidate) - ); -} - -#[test] -fn deleted_member_source_observation_removes_only_mapped_membership_both_directions() { - for reverse in [false, true] { - let (mut p, oa, sa, trace, facet, locals) = member_pair(ReferenceCollection::SignalItems); - let FacetSelector::Member { keys, .. } = &facet else { - unreachable!() - }; - let (source, target, deleted, local) = if reverse { - (sa, oa, keys.sa.unwrap(), locals[0]) - } else { - (oa, sa, keys.oa.unwrap(), locals[1]) - }; - let target_only = FacetSelector::Member { - collection: ReferenceCollection::SignalItems, - keys: KeyPair { - oa: reverse.then_some(local), - sa: (!reverse).then_some(local), - }, - }; - put(&mut p, source, &facet, true); - put(&mut p, target, &facet, true); - put(&mut p, target, &target_only, true); - history(&mut p, trace, std::slice::from_ref(&facet)); - p = prepare_command(&p, &Command::Delete(deleted)) - .unwrap() - .project; - let mut app = App::with_project(p); - start(&mut app, source); - stage(&mut app, &facet); - decide(&mut app, facet.clone(), SemanticDecision::TakeSource); - // Force mixed final-record composition, as well as the core Take projection. - let name = FacetSelector::Header(HeaderFacet::Name); - decide(&mut app, name, SemanticDecision::Candidate); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - apply(&mut app); - assert!(!contains(app.project(), target, &facet, oa, sa)); - assert!(contains(app.project(), target, &target_only, oa, sa)); - let retained = if reverse { - keys.oa.unwrap() - } else { - keys.sa.unwrap() - }; - assert!(app.project().elements.contains_key(&retained)); - } -} - -#[test] -fn stale_or_source_failed_reset_and_membership_apply_retain_exact_choices() { - let (mut p, oa, _, trace) = enum_pair(); - let reset = FacetSelector::Header(HeaderFacet::Name); - history(&mut p, trace, std::slice::from_ref(&reset)); - let mut app = App::with_project(p.clone()); - start(&mut app, oa); - send(&mut app, RowEvent::Reset(reset.clone(), true)); - app.document - .execute(Command::Rename(oa, "Changed after preview".into())) - .unwrap(); - let before = app.document.snapshot(); - apply(&mut app); - assert!(state(&app).error.as_ref().unwrap().contains("stale")); - assert!(state(&app).resets.contains(&reset)); - assert_eq!(app.document.bundle(), &before.bundle); - let mut app = App::with_project(p); - let bundle = app.document.bundle().clone(); - let mut limits = source_project::ProjectLimits::default(); - limits.model.max_source_bytes = bundle.files.values().map(String::len).sum::() + 10; - app.document = Document::from_bundle(bundle, limits).unwrap(); - start(&mut app, oa); - send(&mut app, RowEvent::Reset(reset.clone(), true)); - let added = literal(&" exact long literal ".repeat(100)); - stage(&mut app, &added); - decide(&mut app, added.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(added.clone(), true)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - let before = app.document.snapshot(); - apply(&mut app); - assert!(state(&app).error.is_some()); - assert!(state(&app).resets.contains(&reset)); - assert_eq!( - state(&app).decisions.get(&added), - Some(&SemanticDecision::Candidate) - ); - assert!(state(&app).presence[&added]); - assert_eq!(app.document.bundle(), &before.bundle); - assert!(!app.document.can_undo()); -} - -#[test] -fn member_identity_labels_and_new_tabs_preserve_exact_names_and_deleted_keys() { - let (mut p, oa, _, trace, facet, _) = member_pair(ReferenceCollection::SignalItems); - let FacetSelector::Member { collection, keys } = &facet else { - unreachable!() - }; - p.elements.get_mut(&keys.oa.unwrap()).unwrap().name = "Absent intentionally in name".into(); - let name = view::title(&p, &facet); - assert!(name.contains("Absent intentionally in name")); - let deleted1 = Id::new_v4(); - let deleted2 = Id::new_v4(); - let old1 = FacetSelector::Member { - collection: *collection, - keys: KeyPair { - oa: Some(deleted1), - sa: None, - }, - }; - let old2 = FacetSelector::Member { - collection: *collection, - keys: KeyPair { - oa: Some(deleted2), - sa: None, - }, - }; - history(&mut p, trace, &[old1.clone(), old2.clone()]); - assert!(view::title(&p, &old1).contains(&deleted1.to_string())); - assert_ne!(view::title(&p, &old1), view::title(&p, &old2)); - assert_ne!( - view::title(&p, &literal("Absent")), - view::title( - &p, - &FacetSelector::Literal(KeyPair { - oa: None, - sa: Some("Absent".into()) - }) - ) - ); - let mut app = App::with_project(p); - start(&mut app, oa); - for tab in [Tab::History, Tab::Members, Tab::Facts] { - send(&mut app, RowEvent::Tab(tab)); - let _ = state(&app).view(app.project()); - } - send(&mut app, RowEvent::Reset(old1.clone(), true)); - assert!(state(&app).can_apply(), "{}", errors(state(&app))); - assert!(!state(&app).facts.iter().any(|f| f.selector == old1)); - assert!(state(&app).facts.iter().any(|f| f.selector == old2)); -} - -#[test] -fn staging_removal_and_obsolete_reset_recovery_keep_other_decisions_and_raw_presence() { - let (mut p, oa, _, trace) = enum_pair(); - let reset = FacetSelector::Header(HeaderFacet::Name); - history(&mut p, trace, std::slice::from_ref(&reset)); - let mut app = App::with_project(p.clone()); - start(&mut app, oa); - send(&mut app, RowEvent::Reset(reset.clone(), true)); - let added = literal("staged draft"); - stage(&mut app, &added); - decide(&mut app, added.clone(), SemanticDecision::Candidate); - send(&mut app, RowEvent::Presence(added.clone(), true)); - send(&mut app, RowEvent::DropStaged(added.clone())); - assert!(state(&app).decisions.is_empty()); - assert!(!state(&app).staged.contains(&added)); - assert!(state(&app).presence[&added]); - assert!(state(&app).can_apply()); - stage(&mut app, &added); - decide(&mut app, added.clone(), SemanticDecision::Candidate); - assert!(state(&app).presence[&added]); - p.traces - .get_mut(&trace) - .unwrap() - .baseline - .as_mut() - .unwrap() - .semantic - .as_mut() - .unwrap() - .facets - .clear(); - let crate::workflow::Workflow::Semantic(s) = app.workflow.as_mut().unwrap() else { - unreachable!() - }; - s.refresh(&p); - assert!(!s.can_apply()); - s.tab = Tab::History; - let _ = s.view(&p); - s.update(&p, RowEvent::Reset(reset.clone(), false)); - // The old single-row test implicitly adopted externally changed history on - // refresh. A batch has one frozen accepted base: withdrawing raw reset intent - // survives, while application requires an explicitly reopened review. - assert!(!s.resets.contains(&reset)); - assert!(!s.can_apply()); - assert!(s.error.as_ref().unwrap().contains("stale")); - assert!(s.plan.is_none() && s.proposed.is_none()); - assert_eq!(s.decisions.get(&added), Some(&SemanticDecision::Candidate)); - assert!(s.presence[&added]); -} +use super::{tests::*, *}; +use crate::{app::App, document::Document}; + +fn errors(s: &State) -> String { + s.error + .iter() + .chain(s.plan.iter().flat_map(|p| &p.conflicts)) + .cloned() + .collect::>() + .join("; ") +} +fn put(p: &mut Project, owner: Id, facet: &FacetSelector, present: bool) { + let layer = p.layer_of(owner).unwrap(); + let mut value = Draft::from_project(p, owner).unwrap().value; + keyed::project_presence(&mut value, facet, layer, present).unwrap(); + if let Some(element) = p.elements.get_mut(&owner) { + *element = serde_json::from_value(value).unwrap(); + } else { + p.relations + .insert(owner, serde_json::from_value(value).unwrap()); + } +} +fn contains(p: &Project, owner: Id, facet: &FacetSelector, oa: Id, sa: Id) -> bool { + scalar::value( + &capture_facet(p, oa, sa, facet).unwrap(), + p.layer_of(owner).unwrap(), + ) + .unwrap() + .as_bool() + .unwrap() +} +fn history(p: &mut Project, trace: Id, selectors: &[FacetSelector]) { + let t = &p.traces[&trace]; + let baseline = TraceBaseline { + oa: p.properties(t.oa).unwrap(), + sa: p.properties(t.sa).unwrap(), + semantic: Some(SemanticBaseline { + facets: selectors + .iter() + .map(|s| capture_facet(p, t.oa, t.sa, s).unwrap()) + .collect(), + }), + }; + p.traces.get_mut(&trace).unwrap().baseline = Some(baseline); +} +fn literal(name: &str) -> FacetSelector { + FacetSelector::Literal(KeyPair { + oa: Some(name.into()), + sa: Some(name.into()), + }) +} +fn enum_pair() -> (Project, Id, Id, Id) { + let mut p = Project::empty(); + let mut ids = vec![]; + for layer in [Layer::Oa, Layer::Sa] { + let id = p.add_element(Kind::DataType, layer, "Enum", None).unwrap(); + *p.elements.get_mut(&id).unwrap().shared_mut().unwrap() = SharedBody::DataType { + definition: DataTypeDefinition::Enumeration { + literals: vec!["retained".into()], + }, + default: Some(DataValue::Enumeration("retained".into())), + unit: String::new(), + }; + ids.push(id); + } + let trace = add_trace(&mut p, ids[0], ids[1], "Literal review"); + (p, ids[0], ids[1], trace) +} +fn member_pair(collection: ReferenceCollection) -> (Project, Id, Id, Id, FacetSelector, [Id; 2]) { + let mut p = Project::empty(); + let mut owners = vec![]; + let mut keys = vec![]; + let mut locals = vec![]; + for layer in [Layer::Oa, Layer::Sa] { + let work = if layer == Layer::Oa { + Kind::Activity + } else { + Kind::Function + }; + let kind = match collection { + ReferenceCollection::TransitionTriggers => Kind::Event, + ReferenceCollection::TransitionEffects | ReferenceCollection::Constrained => work, + _ => Kind::ExchangeItem, + }; + let key = p.add_element(kind, layer, "Mapped member", None).unwrap(); + let local = p.add_element(kind, layer, "Local member", None).unwrap(); + let owner = match collection { + ReferenceCollection::SignalItems => { + let id = p.add_element(Kind::Event, layer, "Signal", None).unwrap(); + *p.elements.get_mut(&id).unwrap().shared_mut().unwrap() = SharedBody::Event { + body: EventBody::Signal { items: vec![] }, + }; + id + } + ReferenceCollection::Constrained => p + .add_element(Kind::Constraint, layer, "Constraint", None) + .unwrap(), + ReferenceCollection::ExchangeItems => { + let a = p.add_element(work, layer, "From", None).unwrap(); + let b = p.add_element(work, layer, "To", None).unwrap(); + let id = p.relate( + if layer == Layer::Oa { + RelationKind::Interaction + } else { + RelationKind::FunctionalExchange + }, + "Exchange", + a, + b, + ); + if let RelationBody::FunctionalExchange { + source_port, + target_port, + .. + } = p.relations[&id].body + { + for port in [source_port, target_port] { + if let Some(SharedBody::Port { contract, .. }) = + p.elements.get_mut(&port).unwrap().shared_mut() + { + match contract { + PortContract::FunctionInput { incoming_items } => { + *incoming_items = vec![key, local] + } + PortContract::FunctionOutput { outgoing_items } => { + *outgoing_items = vec![key, local] + } + _ => unreachable!(), + } + } + } + } + id + } + ReferenceCollection::TransitionTriggers | ReferenceCollection::TransitionEffects => { + let machine = p + .add_element(Kind::StateMachine, layer, "Machine", None) + .unwrap(); + let region = p + .add_element(Kind::Region, layer, "Region", Some(machine)) + .unwrap(); + let state = p + .add_element(Kind::State, layer, "State", Some(region)) + .unwrap(); + p.relate(RelationKind::StateTransition, "Transition", state, state) + } + ReferenceCollection::FunctionInputItems | ReferenceCollection::FunctionOutputItems => { + let parent = p.add_element(work, layer, "Owner", None).unwrap(); + let id = Id::new_v4(); + let contract = if layer == Layer::Oa { + PortContract::Legacy + } else if collection == ReferenceCollection::FunctionInputItems { + PortContract::FunctionInput { + incoming_items: vec![], + } + } else { + PortContract::FunctionOutput { + outgoing_items: vec![], + } + }; + let mut port = ports::make_port(&p, id, parent, "Port", contract).unwrap(); + if layer == Layer::Oa + && let Some(SharedBody::Port { legacy, .. }) = port.shared_mut() + { + *legacy = Some(LegacyPortContract { + direction: PortDirection::InOut, + interface: None, + }); + } + p.elements.insert(id, port); + id + } + _ => unreachable!(), + }; + owners.push(owner); + keys.push(key); + locals.push(local); + } + let trace = add_trace(&mut p, owners[0], owners[1], "Membership review"); + let facet = FacetSelector::Member { + collection, + keys: KeyPair { + oa: Some(keys[0]), + sa: Some(keys[1]), + }, + }; + ( + p, + owners[0], + owners[1], + trace, + facet, + [locals[0], locals[1]], + ) +} +fn stage(app: &mut App, facet: &FacetSelector) { + send(app, RowEvent::EditPair(facet.clone())); + send(app, RowEvent::StageMember); + assert_eq!( + state(app).selected.as_ref(), + Some(facet), + "{}", + errors(state(app)) + ); +} + +#[test] +fn unordered_members_keep_take_candidate_preserve_other_rows_both_directions() { + for collection in [ + ReferenceCollection::SignalItems, + ReferenceCollection::ExchangeItems, + ReferenceCollection::TransitionTriggers, + ReferenceCollection::TransitionEffects, + ReferenceCollection::Constrained, + ] { + for reverse in [false, true] { + for decision in [ + SemanticDecision::KeepTarget, + SemanticDecision::TakeSource, + SemanticDecision::Candidate, + ] { + let (mut p, oa, sa, trace, facet, locals) = member_pair(collection); + let (source, target, local) = if reverse { + (sa, oa, locals[0]) + } else { + (oa, sa, locals[1]) + }; + put(&mut p, source, &facet, true); + let local_facet = FacetSelector::Member { + collection, + keys: KeyPair { + oa: reverse.then_some(local), + sa: (!reverse).then_some(local), + }, + }; + put(&mut p, target, &local_facet, true); + let mut app = App::with_project(p); + let before = app.document.snapshot(); + start(&mut app, source); + stage(&mut app, &facet); + decide(&mut app, facet.clone(), decision); + if decision == SemanticDecision::Candidate { + send(&mut app, RowEvent::Presence(facet.clone(), true)); + } + // A target-only Take is an explicit acknowledgment, never implicit removal. + decide(&mut app, local_facet.clone(), SemanticDecision::TakeSource); + assert!( + state(&app).can_apply(), + "{collection:?} reverse={reverse} {decision:?}: {}", + errors(state(&app)) + ); + let proposed = state(&app).proposed.clone().unwrap(); + assert_eq!(app.document.bundle(), &before.bundle); + apply(&mut app); + assert!(app.workflow.is_none(), "{}", app.status); + assert_eq!(app.project(), &proposed); + assert_eq!( + contains(app.project(), target, &facet, oa, sa), + decision != SemanticDecision::KeepTarget + ); + assert!(contains(app.project(), target, &local_facet, oa, sa)); + assert!(app.project().elements.contains_key(&local)); + assert_eq!( + app.project().traces[&trace] + .baseline + .as_ref() + .unwrap() + .semantic + .as_ref() + .unwrap() + .facets + .len(), + 2 + ); + let _ = app.update(Message::Undo); + assert_eq!(app.document.bundle(), &before.bundle); + } + } + } +} + +#[test] +fn function_port_members_use_existing_typed_choices_and_preserve_oa_legacy() { + for collection in [ + ReferenceCollection::FunctionInputItems, + ReferenceCollection::FunctionOutputItems, + ] { + let (p, oa, sa, _, facet, _) = member_pair(collection); + let FacetSelector::Member { keys, .. } = &facet else { + unreachable!() + }; + let mut app = App::with_project(p); + start(&mut app, oa); + assert_eq!( + state(&app).member_families(app.project()), + vec![keyed::Family::Member(collection)] + ); + send(&mut app, RowEvent::EditPair(facet.clone())); + assert!( + state(&app) + .member_choices(app.project(), Layer::Sa) + .iter() + .any(|c| Some(c.id) == keys.sa) + ); + send(&mut app, RowEvent::StageMember); + decide(&mut app, facet.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(facet.clone(), true)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + apply(&mut app); + assert!(contains(app.project(), sa, &facet, oa, sa)); + assert!(matches!( + app.project().elements[&oa].shared(), + Some(SharedBody::Port { + contract: PortContract::Legacy, + .. + }) + )); + start(&mut app, sa); + stage(&mut app, &facet); + decide(&mut app, facet.clone(), SemanticDecision::KeepTarget); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + decide(&mut app, facet.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(facet, true)); + assert!( + !state(&app).can_apply(), + "OA typed membership must remain inapplicable" + ); + } +} + +#[test] +fn exact_literal_new_rows_and_removals_commit_both_directions_without_default_loss() { + for reverse in [false, true] { + let (mut p, oa, sa, _) = enum_pair(); + let (source, target) = if reverse { (sa, oa) } else { (oa, sa) }; + let incoming = literal(" New value "); + put(&mut p, source, &incoming, true); + let removed = literal("old"); + put(&mut p, target, &removed, true); + let created = literal("new value"); + let mut app = App::with_project(p); + start(&mut app, source); + for (facet, decision) in [ + (&incoming, SemanticDecision::TakeSource), + (&removed, SemanticDecision::Candidate), + (&created, SemanticDecision::Candidate), + ] { + stage(&mut app, facet); + decide(&mut app, facet.clone(), decision); + if decision == SemanticDecision::Candidate { + send( + &mut app, + RowEvent::Presence(facet.clone(), facet == &created), + ); + } + } + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + apply(&mut app); + assert!(contains(app.project(), target, &incoming, oa, sa)); + assert!(contains(app.project(), target, &created, oa, sa)); + assert!(!contains(app.project(), target, &removed, oa, sa)); + assert!( + matches!(app.project().elements[&target].shared(),Some(SharedBody::DataType { default: Some(DataValue::Enumeration(value)), .. }) if value=="retained") + ); + let reopened = Document::from_bundle( + app.document.bundle().clone(), + source_project::ProjectLimits::default(), + ) + .unwrap(); + assert_eq!(reopened.project(), app.project()); + } +} + +#[test] +fn exact_reset_only_is_one_history_source_transaction_and_undo_redo_both_directions() { + for reverse in [false, true] { + let (mut p, oa, sa, trace) = enum_pair(); + let reset = literal("retained"); + let kept = FacetSelector::Header(HeaderFacet::Name); + history(&mut p, trace, &[reset.clone(), kept.clone()]); + let previous = p.traces[&trace].baseline.clone().unwrap(); + let mut app = App::with_project(p); + let mut bundle = app.document.bundle().clone(); + bundle + .files + .get_mut(&bundle.entry) + .unwrap() + .insert_str(0, "// Exact review rationale survives reset.\n"); + app.document.apply_bundle(bundle).unwrap(); + let before = app.document.snapshot(); + let revision = app.document.revision(); + start(&mut app, if reverse { sa } else { oa }); + send(&mut app, RowEvent::Reset(reset.clone(), true)); + assert!(state(&app).decisions.is_empty()); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + assert_eq!( + state(&app) + .facts + .iter() + .find(|f| f.selector == reset) + .unwrap() + .drift, + Drift::Unreviewed + ); + send(&mut app, RowEvent::Reset(reset.clone(), false)); + assert!(!state(&app).can_apply()); + assert_eq!( + state(&app) + .facts + .iter() + .find(|f| f.selector == reset) + .unwrap() + .drift, + Drift::Unchanged + ); + send(&mut app, RowEvent::Reset(reset, true)); + apply(&mut app); + assert_eq!(app.document.revision(), revision + 1); + assert_eq!(app.project().elements, before.decoded.project.elements); + let after = &app.project().traces[&trace].baseline.as_ref().unwrap(); + assert_eq!(after.oa, previous.oa); + assert_eq!(after.sa, previous.sa); + assert_eq!( + after + .semantic + .as_ref() + .unwrap() + .facets + .iter() + .map(FacetReview::selector) + .collect::>(), + vec![kept] + ); + assert!( + app.document.bundle().files[&app.document.bundle().entry] + .contains("// Exact review rationale survives reset.") + ); + let accepted = app.document.snapshot(); + let _ = app.update(Message::Undo); + assert_eq!(app.document.bundle(), &before.bundle); + let _ = app.update(Message::Redo); + assert_eq!(app.document.bundle(), &accepted.bundle); + } +} + +#[test] +fn historical_one_sided_pair_migration_requires_exact_reset_and_explicit_overlap_resolution() { + for reverse in [false, true] { + let (mut p, oa, sa, trace, paired, _) = member_pair(ReferenceCollection::SignalItems); + let FacetSelector::Member { collection, keys } = &paired else { + unreachable!() + }; + let (source, target) = if reverse { (sa, oa) } else { (oa, sa) }; + let previous = FacetSelector::Member { + collection: *collection, + keys: KeyPair { + oa: if reverse { None } else { keys.oa }, + sa: if reverse { keys.sa } else { None }, + }, + }; + put(&mut p, source, &paired, true); + history(&mut p, trace, std::slice::from_ref(&previous)); + let mut app = App::with_project(p); + start(&mut app, source); + decide(&mut app, previous.clone(), SemanticDecision::KeepTarget); + stage(&mut app, &paired); + decide(&mut app, paired.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(paired.clone(), true)); + assert!(!state(&app).can_apply()); + assert_eq!(state(&app).decisions.len(), 2); + send(&mut app, RowEvent::Decide(previous.clone(), None)); + assert!( + !state(&app).can_apply(), + "Historic pair cannot silently migrate" + ); + send(&mut app, RowEvent::Reset(previous.clone(), true)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + send(&mut app, RowEvent::Reset(previous, false)); + assert!(!state(&app).can_apply()); + assert!(state(&app).presence[&paired]); + let old = state(&app).resets.clone(); + assert!(old.is_empty()); + let historic = app.project().traces[&trace] + .baseline + .as_ref() + .unwrap() + .semantic + .as_ref() + .unwrap() + .facets[0] + .selector(); + send(&mut app, RowEvent::Reset(historic, true)); + apply(&mut app); + assert!(contains(app.project(), target, &paired, oa, sa)); + assert_eq!( + app.project().traces[&trace] + .baseline + .as_ref() + .unwrap() + .semantic + .as_ref() + .unwrap() + .facets[0] + .selector(), + paired + ); + } +} + +#[test] +fn reset_precedes_equal_constructor_candidate_and_preserves_independent_literal_draft() { + for reverse in [false, true] { + let (mut p, oa, sa, trace) = enum_pair(); + let ctor = FacetSelector::Data(DataFacet::Constructor); + history(&mut p, trace, std::slice::from_ref(&ctor)); + let mut app = App::with_project(p); + start(&mut app, if reverse { sa } else { oa }); + let created = literal("separate"); + stage(&mut app, &created); + decide(&mut app, created.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(created.clone(), true)); + send(&mut app, RowEvent::Reset(ctor.clone(), true)); + decide(&mut app, ctor.clone(), SemanticDecision::Candidate); + assert!(state(&app).can_acknowledge_constructor(app.project(), &ctor)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + let reviewed = &state(&app).plan.as_ref().unwrap().reviews[0]; + assert_eq!( + reviewed + .acknowledged + .iter() + .cloned() + .collect::>(), + BTreeSet::from([ctor.clone(), created.clone()]) + ); + assert!(reviewed.retired.is_empty()); + send(&mut app, RowEvent::Reset(ctor.clone(), false)); + assert!(!state(&app).can_apply()); + assert!(state(&app).presence[&created]); + send(&mut app, RowEvent::Reset(ctor, true)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + } +} + +#[test] +fn invalid_literal_removal_and_unselected_scalar_buffers_are_retained_and_repairable() { + let (p, oa, _, _) = enum_pair(); + let mut app = App::with_project(p); + start(&mut app, oa); + let unit = FacetSelector::Data(DataFacet::Unit); + decide(&mut app, unit.clone(), SemanticDecision::Candidate); + send( + &mut app, + RowEvent::Input( + "/body/Sa/Shared/DataType/unit".into(), + " untouched unit ".into(), + ), + ); + decide(&mut app, unit.clone(), SemanticDecision::KeepTarget); + let retained = literal("retained"); + decide(&mut app, retained.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(retained.clone(), false)); + assert!( + !state(&app).can_apply(), + "Existing default must prevent removal" + ); + assert!(!state(&app).presence[&retained]); + send(&mut app, RowEvent::Presence(retained.clone(), true)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + assert_eq!( + state(&app).draft.as_ref().unwrap().inputs["/body/Sa/Shared/DataType/unit"].raw, + " untouched unit " + ); + decide(&mut app, unit, SemanticDecision::Candidate); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); +} + +#[test] +fn unsupported_independent_families_and_missing_identities_do_not_gain_edit_authority() { + let (p, oa, _, _) = enum_pair(); + let mut app = App::with_project(p); + start(&mut app, oa); + let unsupported = FacetSelector::Member { + collection: ReferenceCollection::Steps, + keys: KeyPair { + oa: Some(oa), + sa: None, + }, + }; + decide(&mut app, unsupported.clone(), SemanticDecision::Candidate); + assert!(!state(&app).decisions.contains_key(&unsupported)); + send(&mut app, RowEvent::MemberFamily(keyed::Family::Literal)); + send(&mut app, RowEvent::Literal("unpaired".into())); + send(&mut app, RowEvent::LiteralSide(Layer::Sa, false)); + send(&mut app, RowEvent::StageMember); + let facet = state(&app).selected.clone().unwrap(); + decide(&mut app, facet.clone(), SemanticDecision::Candidate); + assert!(!state(&app).can_apply()); + send(&mut app, RowEvent::LiteralSide(Layer::Oa, false)); + send(&mut app, RowEvent::StageMember); + assert!(state(&app).error.is_some()); + assert_eq!( + state(&app).decisions.get(&facet), + Some(&SemanticDecision::Candidate) + ); +} + +#[test] +fn deleted_member_source_observation_removes_only_mapped_membership_both_directions() { + for reverse in [false, true] { + let (mut p, oa, sa, trace, facet, locals) = member_pair(ReferenceCollection::SignalItems); + let FacetSelector::Member { keys, .. } = &facet else { + unreachable!() + }; + let (source, target, deleted, local) = if reverse { + (sa, oa, keys.sa.unwrap(), locals[0]) + } else { + (oa, sa, keys.oa.unwrap(), locals[1]) + }; + let target_only = FacetSelector::Member { + collection: ReferenceCollection::SignalItems, + keys: KeyPair { + oa: reverse.then_some(local), + sa: (!reverse).then_some(local), + }, + }; + put(&mut p, source, &facet, true); + put(&mut p, target, &facet, true); + put(&mut p, target, &target_only, true); + history(&mut p, trace, std::slice::from_ref(&facet)); + p = prepare_command(&p, &Command::Delete(deleted)) + .unwrap() + .project; + let mut app = App::with_project(p); + start(&mut app, source); + stage(&mut app, &facet); + decide(&mut app, facet.clone(), SemanticDecision::TakeSource); + // Force mixed final-record composition, as well as the core Take projection. + let name = FacetSelector::Header(HeaderFacet::Name); + decide(&mut app, name, SemanticDecision::Candidate); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + apply(&mut app); + assert!(!contains(app.project(), target, &facet, oa, sa)); + assert!(contains(app.project(), target, &target_only, oa, sa)); + let retained = if reverse { + keys.oa.unwrap() + } else { + keys.sa.unwrap() + }; + assert!(app.project().elements.contains_key(&retained)); + } +} + +#[test] +fn stale_or_source_failed_reset_and_membership_apply_retain_exact_choices() { + let (mut p, oa, _, trace) = enum_pair(); + let reset = FacetSelector::Header(HeaderFacet::Name); + history(&mut p, trace, std::slice::from_ref(&reset)); + let mut app = App::with_project(p.clone()); + start(&mut app, oa); + send(&mut app, RowEvent::Reset(reset.clone(), true)); + app.document + .execute(Command::Rename(oa, "Changed after preview".into())) + .unwrap(); + let before = app.document.snapshot(); + apply(&mut app); + assert!(state(&app).error.as_ref().unwrap().contains("stale")); + assert!(state(&app).resets.contains(&reset)); + assert_eq!(app.document.bundle(), &before.bundle); + let mut app = App::with_project(p); + let bundle = app.document.bundle().clone(); + let mut limits = source_project::ProjectLimits::default(); + limits.model.max_source_bytes = bundle.files.values().map(String::len).sum::() + 10; + app.document = Document::from_bundle(bundle, limits).unwrap(); + start(&mut app, oa); + send(&mut app, RowEvent::Reset(reset.clone(), true)); + let added = literal(&" exact long literal ".repeat(100)); + stage(&mut app, &added); + decide(&mut app, added.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(added.clone(), true)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + let before = app.document.snapshot(); + apply(&mut app); + assert!(state(&app).error.is_some()); + assert!(state(&app).resets.contains(&reset)); + assert_eq!( + state(&app).decisions.get(&added), + Some(&SemanticDecision::Candidate) + ); + assert!(state(&app).presence[&added]); + assert_eq!(app.document.bundle(), &before.bundle); + assert!(!app.document.can_undo()); +} + +#[test] +fn member_identity_labels_and_new_tabs_preserve_exact_names_and_deleted_keys() { + let (mut p, oa, _, trace, facet, _) = member_pair(ReferenceCollection::SignalItems); + let FacetSelector::Member { collection, keys } = &facet else { + unreachable!() + }; + p.elements.get_mut(&keys.oa.unwrap()).unwrap().name = "Absent intentionally in name".into(); + let name = view::title(&p, &facet); + assert!(name.contains("Absent intentionally in name")); + let deleted1 = Id::new_v4(); + let deleted2 = Id::new_v4(); + let old1 = FacetSelector::Member { + collection: *collection, + keys: KeyPair { + oa: Some(deleted1), + sa: None, + }, + }; + let old2 = FacetSelector::Member { + collection: *collection, + keys: KeyPair { + oa: Some(deleted2), + sa: None, + }, + }; + history(&mut p, trace, &[old1.clone(), old2.clone()]); + assert!(view::title(&p, &old1).contains(&deleted1.to_string())); + assert_ne!(view::title(&p, &old1), view::title(&p, &old2)); + assert_ne!( + view::title(&p, &literal("Absent")), + view::title( + &p, + &FacetSelector::Literal(KeyPair { + oa: None, + sa: Some("Absent".into()) + }) + ) + ); + let mut app = App::with_project(p); + start(&mut app, oa); + for tab in [Tab::History, Tab::Members, Tab::Facts] { + send(&mut app, RowEvent::Tab(tab)); + let _ = state(&app).view(app.project()); + } + send(&mut app, RowEvent::Reset(old1.clone(), true)); + assert!(state(&app).can_apply(), "{}", errors(state(&app))); + assert!(!state(&app).facts.iter().any(|f| f.selector == old1)); + assert!(state(&app).facts.iter().any(|f| f.selector == old2)); +} + +#[test] +fn staging_removal_and_obsolete_reset_recovery_keep_other_decisions_and_raw_presence() { + let (mut p, oa, _, trace) = enum_pair(); + let reset = FacetSelector::Header(HeaderFacet::Name); + history(&mut p, trace, std::slice::from_ref(&reset)); + let mut app = App::with_project(p.clone()); + start(&mut app, oa); + send(&mut app, RowEvent::Reset(reset.clone(), true)); + let added = literal("staged draft"); + stage(&mut app, &added); + decide(&mut app, added.clone(), SemanticDecision::Candidate); + send(&mut app, RowEvent::Presence(added.clone(), true)); + send(&mut app, RowEvent::DropStaged(added.clone())); + assert!(state(&app).decisions.is_empty()); + assert!(!state(&app).staged.contains(&added)); + assert!(state(&app).presence[&added]); + assert!(state(&app).can_apply()); + stage(&mut app, &added); + decide(&mut app, added.clone(), SemanticDecision::Candidate); + assert!(state(&app).presence[&added]); + p.traces + .get_mut(&trace) + .unwrap() + .baseline + .as_mut() + .unwrap() + .semantic + .as_mut() + .unwrap() + .facets + .clear(); + let crate::workflow::Workflow::Semantic(s) = app.workflow.as_mut().unwrap() else { + unreachable!() + }; + s.refresh(&p); + assert!(!s.can_apply()); + s.tab = Tab::History; + let _ = s.view(&p); + s.update(&p, RowEvent::Reset(reset.clone(), false)); + // The old single-row test implicitly adopted externally changed history on + // refresh. A batch has one frozen accepted base: withdrawing raw reset intent + // survives, while application requires an explicitly reopened review. + assert!(!s.resets.contains(&reset)); + assert!(!s.can_apply()); + assert!(s.error.as_ref().unwrap().contains("stale")); + assert!(s.plan.is_none() && s.proposed.is_none()); + assert_eq!(s.decisions.get(&added), Some(&SemanticDecision::Candidate)); + assert!(s.presence[&added]); +} diff --git a/crates/oa-desktop/src/semantic_review/ordered.rs b/crates/oa-desktop/src/semantic_review/ordered.rs index 2674c335..050af2aa 100644 --- a/crates/oa-desktop/src/semantic_review/ordered.rs +++ b/crates/oa-desktop/src/semantic_review/ordered.rs @@ -1,254 +1,254 @@ -//! Independent membership and complete final order; the core validates every proposal. -use super::*; - -pub(super) fn collection(which: OrderedCollection) -> ReferenceCollection { - match which { - OrderedCollection::Steps => ReferenceCollection::Steps, - OrderedCollection::FragmentBranches => ReferenceCollection::FragmentBranches, - } -} -pub(super) fn ordered(which: ReferenceCollection) -> Option { - match which { - ReferenceCollection::Steps => Some(OrderedCollection::Steps), - ReferenceCollection::FragmentBranches => Some(OrderedCollection::FragmentBranches), - _ => None, - } -} -pub(super) fn read(value: &Value, which: OrderedCollection) -> Result, String> { - let path = keyed::path(value, keyed::Family::Member(collection(which))) - .ok_or("This ordered collection is unavailable on the destination.")?; - serde_json::from_value(value.pointer(&path).unwrap().clone()).map_err(|e| e.to_string()) -} -fn write(value: &mut Value, which: OrderedCollection, ids: Vec) -> Result<(), String> { - let path = keyed::path(value, keyed::Family::Member(collection(which))) - .ok_or("This ordered collection is unavailable on the destination.")?; - *value.pointer_mut(&path).unwrap() = serde_json::to_value(ids).expect("Ordered identities"); - Ok(()) -} - -impl ReviewRow { - pub(super) fn ordered_members( - &self, - project: &Project, - which: OrderedCollection, - ) -> Result, String> { - read(&self.combine(project, true, true)?, which) - } - - pub(super) fn initialize_order( - &mut self, - project: &Project, - which: OrderedCollection, - ) -> Result<(), String> { - if !self.order_drafts.contains_key(&which) { - let ids = self.ordered_members(project, which)?; - self.order_drafts.insert(which, ids); - } - Ok(()) - } - - pub(super) fn reconcile_order( - &mut self, - project: &Project, - which: OrderedCollection, - ) -> Result<(), String> { - self.require_order_candidate(which)?; - let members = self.ordered_members(project, which)?; - let draft = self - .order_drafts - .get_mut(&which) - .ok_or("Choose a final order first.")?; - // This is an explicit user action. Ordinary refresh never discards an authored order. - let mut seen = BTreeSet::new(); - draft.retain(|id| members.contains(id) && seen.insert(*id)); - for id in members { - if seen.insert(id) { - draft.push(id); - } - } - Ok(()) - } - - fn require_order_candidate(&self, which: OrderedCollection) -> Result<(), String> { - let facet = FacetSelector::Order(which); - if self.selected.as_ref() != Some(&facet) - || self.decisions.get(&facet) != Some(&SemanticDecision::Candidate) - { - return Err("Select Set final value for this order before changing it.".into()); - } - Ok(()) - } - - pub(super) fn move_order( - &mut self, - which: OrderedCollection, - index: usize, - delta: i32, - ) -> Result<(), String> { - self.require_order_candidate(which)?; - let ids = self - .order_drafts - .get_mut(&which) - .ok_or("Choose a final order first.")?; - let destination = match delta { - -1 => index.checked_sub(1), - 1 => index.checked_add(1), - _ => None, - }; - let destination = destination - .filter(|i| index < ids.len() && *i < ids.len()) - .ok_or("Choose an existing adjacent position in the final order.")?; - ids.swap(index, destination); - Ok(()) - } - - pub(super) fn project_order( - &self, - project: &Project, - trace: &Trace, - value: &mut Value, - which: OrderedCollection, - decision: SemanticDecision, - ) -> Result<(), String> { - let current = read(value, which)?; - let supplied = match decision { - SemanticDecision::KeepTarget => return Ok(()), - SemanticDecision::Candidate => self - .order_drafts - .get(&which) - .cloned() - .ok_or("Choose a final order.")?, - SemanticDecision::TakeSource => { - let fact = - capture_facet(project, trace.oa, trace.sa, &FacetSelector::Order(which))?; - let source: Vec = serde_json::from_value( - scalar::value(&fact, self.direction.source_layer()) - .ok_or("The source has no applicable order.")?, - ) - .map_err(|e| e.to_string())?; - let map = self.order_reference_map()?; - source - .into_iter() - .map(|id| { - map.get(&id).copied().ok_or_else(|| { - format!( - "Pair source order member {} explicitly in Reference pairs.", - project.named(id) - ) - }) - }) - .collect::, _>>()? - } - }; - let actual: BTreeSet<_> = current.iter().copied().collect(); - let desired: BTreeSet<_> = supplied.iter().copied().collect(); - if desired.len() != supplied.len() { - return Err( - "The final order contains a duplicate identity; reconcile its members explicitly." - .into(), - ); - } - if desired != actual { - if decision == SemanticDecision::TakeSource - && desired.is_subset(&actual) - && current - .iter() - .filter(|id| desired.contains(id)) - .copied() - .collect::>() - == supplied - { - return Ok(()); - } - return Err("Final order must contain every surviving destination member exactly once. Reconcile members, then choose their positions; membership is reviewed separately.".into()); - } - write(value, which, supplied) - } - - fn order_reference_map(&self) -> Result, String> { - let mut map = BTreeMap::new(); - for (oa, sa) in &self.references { - let (a, b) = if self.direction == TransitionDirection::OaToSa { - (*oa, *sa) - } else { - (*sa, *oa) - }; - if map.insert(a, b).is_some_and(|old| old != b) { - return Err("Reverse reference correspondence is ambiguous.".into()); - } - } - Ok(map) - } - - pub(super) fn project_ordered_member( - &self, - project: &Project, - trace: &Trace, - value: &mut Value, - facet: &FacetSelector, - decision: SemanticDecision, - form_context: bool, - ) -> Result<(), String> { - let FacetSelector::Member { - collection: member_collection, - keys, - } = facet - else { - unreachable!() - }; - let which = ordered(*member_collection).expect("Ordered member"); - let before = read(value, which)?; - self.keyed_value(project, trace, value, facet, decision)?; - let after = read(value, which)?; - let explicit = self - .decisions - .get(&FacetSelector::Order(which)) - .is_some_and(|d| *d != SemanticDecision::KeepTarget); - if decision != SemanticDecision::TakeSource || explicit || after.len() <= before.len() { - return Ok(()); - } - let (source_key, target_key) = if self.direction == TransitionDirection::OaToSa { - (keys.oa, keys.sa) - } else { - (keys.sa, keys.oa) - }; - let (Some(source_key), Some(target_key)) = (source_key, target_key) else { - return Ok(()); - }; - let fact = capture_facet(project, trace.oa, trace.sa, &FacetSelector::Order(which))?; - let source: Vec = serde_json::from_value( - scalar::value(&fact, self.direction.source_layer()) - .ok_or("Source order is unavailable.")?, - ) - .map_err(|e| e.to_string())?; - let position = source - .iter() - .position(|id| *id == source_key) - .ok_or("Source member is absent.")?; - let map = self.order_reference_map()?; - let anchor = |id: &Id| { - map.get(id) - .and_then(|mapped| before.iter().position(|id| id == mapped)) - }; - let left = source[..position].iter().rev().find_map(anchor); - let right = source[position + 1..].iter().find_map(anchor); - let at = match (left, right) { - (Some(a), Some(b)) if a + 1 == b => Some(b), - (Some(a), None) if a + 1 == before.len() => Some(a + 1), - (None, Some(0)) => Some(0), - (None, None) if before.is_empty() => Some(0), - _ => None, - }; - if let Some(at) = at { - let mut ordered = before; - ordered.insert(at, target_key); - write(value, which, ordered) - } else if form_context { - // An uncommitted membership list lets the user author a final order. - // The actual request still rejects ambiguous placement until explicitly decided. - Ok(()) - } else { - Err("Ordered member insertion has no unique unchanged anchor; select an explicit final Order in Properties.".into()) - } - } -} +//! Independent membership and complete final order; the core validates every proposal. +use super::*; + +pub(super) fn collection(which: OrderedCollection) -> ReferenceCollection { + match which { + OrderedCollection::Steps => ReferenceCollection::Steps, + OrderedCollection::FragmentBranches => ReferenceCollection::FragmentBranches, + } +} +pub(super) fn ordered(which: ReferenceCollection) -> Option { + match which { + ReferenceCollection::Steps => Some(OrderedCollection::Steps), + ReferenceCollection::FragmentBranches => Some(OrderedCollection::FragmentBranches), + _ => None, + } +} +pub(super) fn read(value: &Value, which: OrderedCollection) -> Result, String> { + let path = keyed::path(value, keyed::Family::Member(collection(which))) + .ok_or("This ordered collection is unavailable on the destination.")?; + serde_json::from_value(value.pointer(&path).unwrap().clone()).map_err(|e| e.to_string()) +} +fn write(value: &mut Value, which: OrderedCollection, ids: Vec) -> Result<(), String> { + let path = keyed::path(value, keyed::Family::Member(collection(which))) + .ok_or("This ordered collection is unavailable on the destination.")?; + *value.pointer_mut(&path).unwrap() = serde_json::to_value(ids).expect("Ordered identities"); + Ok(()) +} + +impl ReviewRow { + pub(super) fn ordered_members( + &self, + project: &Project, + which: OrderedCollection, + ) -> Result, String> { + read(&self.combine(project, true, true)?, which) + } + + pub(super) fn initialize_order( + &mut self, + project: &Project, + which: OrderedCollection, + ) -> Result<(), String> { + if !self.order_drafts.contains_key(&which) { + let ids = self.ordered_members(project, which)?; + self.order_drafts.insert(which, ids); + } + Ok(()) + } + + pub(super) fn reconcile_order( + &mut self, + project: &Project, + which: OrderedCollection, + ) -> Result<(), String> { + self.require_order_candidate(which)?; + let members = self.ordered_members(project, which)?; + let draft = self + .order_drafts + .get_mut(&which) + .ok_or("Choose a final order first.")?; + // This is an explicit user action. Ordinary refresh never discards an authored order. + let mut seen = BTreeSet::new(); + draft.retain(|id| members.contains(id) && seen.insert(*id)); + for id in members { + if seen.insert(id) { + draft.push(id); + } + } + Ok(()) + } + + fn require_order_candidate(&self, which: OrderedCollection) -> Result<(), String> { + let facet = FacetSelector::Order(which); + if self.selected.as_ref() != Some(&facet) + || self.decisions.get(&facet) != Some(&SemanticDecision::Candidate) + { + return Err("Select Set final value for this order before changing it.".into()); + } + Ok(()) + } + + pub(super) fn move_order( + &mut self, + which: OrderedCollection, + index: usize, + delta: i32, + ) -> Result<(), String> { + self.require_order_candidate(which)?; + let ids = self + .order_drafts + .get_mut(&which) + .ok_or("Choose a final order first.")?; + let destination = match delta { + -1 => index.checked_sub(1), + 1 => index.checked_add(1), + _ => None, + }; + let destination = destination + .filter(|i| index < ids.len() && *i < ids.len()) + .ok_or("Choose an existing adjacent position in the final order.")?; + ids.swap(index, destination); + Ok(()) + } + + pub(super) fn project_order( + &self, + project: &Project, + trace: &Trace, + value: &mut Value, + which: OrderedCollection, + decision: SemanticDecision, + ) -> Result<(), String> { + let current = read(value, which)?; + let supplied = match decision { + SemanticDecision::KeepTarget => return Ok(()), + SemanticDecision::Candidate => self + .order_drafts + .get(&which) + .cloned() + .ok_or("Choose a final order.")?, + SemanticDecision::TakeSource => { + let fact = + capture_facet(project, trace.oa, trace.sa, &FacetSelector::Order(which))?; + let source: Vec = serde_json::from_value( + scalar::value(&fact, self.direction.source_layer()) + .ok_or("The source has no applicable order.")?, + ) + .map_err(|e| e.to_string())?; + let map = self.order_reference_map()?; + source + .into_iter() + .map(|id| { + map.get(&id).copied().ok_or_else(|| { + format!( + "Pair source order member {} explicitly in Reference pairs.", + project.named(id) + ) + }) + }) + .collect::, _>>()? + } + }; + let actual: BTreeSet<_> = current.iter().copied().collect(); + let desired: BTreeSet<_> = supplied.iter().copied().collect(); + if desired.len() != supplied.len() { + return Err( + "The final order contains a duplicate identity; reconcile its members explicitly." + .into(), + ); + } + if desired != actual { + if decision == SemanticDecision::TakeSource + && desired.is_subset(&actual) + && current + .iter() + .filter(|id| desired.contains(id)) + .copied() + .collect::>() + == supplied + { + return Ok(()); + } + return Err("Final order must contain every surviving destination member exactly once. Reconcile members, then choose their positions; membership is reviewed separately.".into()); + } + write(value, which, supplied) + } + + fn order_reference_map(&self) -> Result, String> { + let mut map = BTreeMap::new(); + for (oa, sa) in &self.references { + let (a, b) = if self.direction == TransitionDirection::OaToSa { + (*oa, *sa) + } else { + (*sa, *oa) + }; + if map.insert(a, b).is_some_and(|old| old != b) { + return Err("Reverse reference correspondence is ambiguous.".into()); + } + } + Ok(map) + } + + pub(super) fn project_ordered_member( + &self, + project: &Project, + trace: &Trace, + value: &mut Value, + facet: &FacetSelector, + decision: SemanticDecision, + form_context: bool, + ) -> Result<(), String> { + let FacetSelector::Member { + collection: member_collection, + keys, + } = facet + else { + unreachable!() + }; + let which = ordered(*member_collection).expect("Ordered member"); + let before = read(value, which)?; + self.keyed_value(project, trace, value, facet, decision)?; + let after = read(value, which)?; + let explicit = self + .decisions + .get(&FacetSelector::Order(which)) + .is_some_and(|d| *d != SemanticDecision::KeepTarget); + if decision != SemanticDecision::TakeSource || explicit || after.len() <= before.len() { + return Ok(()); + } + let (source_key, target_key) = if self.direction == TransitionDirection::OaToSa { + (keys.oa, keys.sa) + } else { + (keys.sa, keys.oa) + }; + let (Some(source_key), Some(target_key)) = (source_key, target_key) else { + return Ok(()); + }; + let fact = capture_facet(project, trace.oa, trace.sa, &FacetSelector::Order(which))?; + let source: Vec = serde_json::from_value( + scalar::value(&fact, self.direction.source_layer()) + .ok_or("Source order is unavailable.")?, + ) + .map_err(|e| e.to_string())?; + let position = source + .iter() + .position(|id| *id == source_key) + .ok_or("Source member is absent.")?; + let map = self.order_reference_map()?; + let anchor = |id: &Id| { + map.get(id) + .and_then(|mapped| before.iter().position(|id| id == mapped)) + }; + let left = source[..position].iter().rev().find_map(anchor); + let right = source[position + 1..].iter().find_map(anchor); + let at = match (left, right) { + (Some(a), Some(b)) if a + 1 == b => Some(b), + (Some(a), None) if a + 1 == before.len() => Some(a + 1), + (None, Some(0)) => Some(0), + (None, None) if before.is_empty() => Some(0), + _ => None, + }; + if let Some(at) = at { + let mut ordered = before; + ordered.insert(at, target_key); + write(value, which, ordered) + } else if form_context { + // An uncommitted membership list lets the user author a final order. + // The actual request still rejects ambiguous placement until explicitly decided. + Ok(()) + } else { + Err("Ordered member insertion has no unique unchanged anchor; select an explicit final Order in Properties.".into()) + } + } +} diff --git a/docs/openapi.json b/docs/openapi.json index 0fd0be3a..715de45a 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1,12837 +1,12837 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Arcadia Studio model API", - "version": "1.0.0", - "description": "Current schema-7 snapshots and conditional atomic writes. Request body limit: 8 MiB; at most 200 nested commands; no retained revisions, request receipts, automatic retries or persistent transition plans. See docs/api.rst. Fixed store capacity: 128 models / 256 MiB serialized envelopes. Stateless transition preview/apply. Artifact URI/revision strings remain opaque core fields. Model admission before structural validation: 5,000 graph objects, 20,000 total records and 50,000 ordered references. Preparation uses snapshots outside the catalog lock; final commits recheck the exact ETag. Each accepted envelope couples model and authored source under one revision. Source-only edits advance the shared ETag. Source bundles resolve logical paths only, preserve authored files/comments, and have a stabilized JSON cap of 8 MiB, 256 files, 32 include edges along a path and 1,024 include edges overall." - }, - "servers": [ - { - "url": "http://127.0.0.1:8787" - } - ], - "security": [ - { - "bearerAuth": [] - } - ], - "paths": { - "/health": { - "get": { - "operationId": "_health", - "summary": "Store was opened and HTTP service is responding", - "parameters": [], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "const": "ok" - } - }, - "required": [ - "status" - ], - "additionalProperties": false - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "security": [] - } - }, - "/health/live": { - "get": { - "operationId": "_health_live", - "summary": "Store was opened and HTTP service is responding", - "parameters": [], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "const": "ok" - } - }, - "required": [ - "status" - ], - "additionalProperties": false - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "security": [] - } - }, - "/health/ready": { - "get": { - "operationId": "_health_ready", - "summary": "Store was opened and HTTP service is responding", - "parameters": [], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "const": "ok" - } - }, - "required": [ - "status" - ], - "additionalProperties": false - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "security": [] - } - }, - "/openapi.json": { - "get": { - "operationId": "_openapi_json", - "summary": "OpenAPI contract", - "parameters": [], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "security": [] - } - }, - "/api/v1/openapi.json": { - "get": { - "operationId": "_api_v1_openapi_json", - "summary": "OpenAPI contract", - "parameters": [], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "security": [] - } - }, - "/api/v1/projects": { - "get": { - "operationId": "listProjects", - "summary": "List current hosted projects in UUID order", - "parameters": [ - { - "name": "limit", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 1000, - "default": 100 - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "q", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectPage" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - }, - "post": { - "operationId": "createProject", - "summary": "Create and persist an empty model", - "parameters": [], - "responses": { - "201": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectSummary" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NameRequest" - } - } - } - } - } - }, - "/api/v1/projects/import": { - "post": { - "operationId": "importProject", - "summary": "Import JSON or UTF-8 Arcadia source as a new hosted resource", - "parameters": [], - "responses": { - "201": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectSummary" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project" - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "description": "Schema-7 native JSON is described below. Schema-1/2/3/4/5/6 JSON and source are accepted through explicit frozen readers and migration, also on replacement and candidate validation. Earlier versions reject later constructors, fields and semantic facets, including explicit null. Prior prose and typed reviews remain intact; absent semantic review stays Unreviewed. Export emits schema 7 / arcadia 7. See docs/language.rst." - } - }, - "/api/v1/projects/{id}": { - "get": { - "operationId": "getProject", - "summary": "Get complete current envelope", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "description": "Return 304 when the current representation's revision matches.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/StoredProject" - } - } - } - }, - "304": { - "description": "Unchanged; empty body." - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - }, - "patch": { - "operationId": "renameProject", - "summary": "Rename the project atomically", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MutationResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NameRequest" - } - } - } - } - }, - "delete": { - "operationId": "deleteProject", - "summary": "Permanently delete the current hosted envelope", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - } - }, - "/api/v1/projects/{id}/model": { - "get": { - "operationId": "getModel", - "summary": "Export native model JSON", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "description": "Return 304 when the current representation's revision matches.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project" - } - } - } - }, - "304": { - "description": "Unchanged; empty body." - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - }, - "put": { - "operationId": "replaceModel", - "summary": "Conditionally replace model JSON", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MutationResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Project" - } - } - } - }, - "description": "Replace semantics while preserving the accepted authored source layout and comments, using common UUIDs as identity correspondence. Model and source commit together. Use source-project PUT to replace authored files." - } - }, - "/api/v1/projects/{id}/source": { - "get": { - "operationId": "getSource", - "summary": "Export canonical Arcadia source", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "description": "Return 304 when the current representation's revision matches.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "304": { - "description": "Unchanged; empty body." - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "description": "Canonical single-file interchange view of the current model. Use source-project GET to export exact authored files and comments." - }, - "put": { - "operationId": "replaceSource", - "summary": "Conditionally replace from UTF-8 Arcadia source", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MutationResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "description": "Replace semantics from canonical single-file interchange while preserving the existing authored source bundle using common UUIDs. Submitted formatting/comments do not replace the authored workspace. Use source-project PUT for that purpose." - } - }, - "/api/v1/projects/{id}/elements": { - "get": { - "operationId": "listElements", - "summary": "Filter current elements; AND semantics", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 1000, - "default": 100 - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "revision", - "in": "query", - "required": false, - "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", - "schema": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - } - }, - { - "name": "kind", - "in": "query", - "required": false, - "description": "", - "schema": { - "$ref": "#/components/schemas/Kind" - } - }, - { - "name": "layer", - "in": "query", - "required": false, - "description": "", - "schema": { - "$ref": "#/components/schemas/Layer" - } - }, - { - "name": "alias", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string" - } - }, - { - "name": "q", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ElementPage" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - } - }, - "/api/v1/projects/{id}/relations": { - "get": { - "operationId": "listRelations", - "summary": "Filter relations by typed kind and endpoints", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 1000, - "default": 100 - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "revision", - "in": "query", - "required": false, - "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", - "schema": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - } - }, - { - "name": "kind", - "in": "query", - "required": false, - "description": "", - "schema": { - "$ref": "#/components/schemas/RelationKind" - } - }, - { - "name": "source", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "target", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "incident_to", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RelationPage" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - } - }, - "/api/v1/projects/{id}/artifact-links": { - "get": { - "operationId": "listArtifacts", - "summary": "List model artifact links without fetching URIs", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 1000, - "default": 100 - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "revision", - "in": "query", - "required": false, - "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", - "schema": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - } - }, - { - "name": "object", - "in": "query", - "required": false, - "description": "Owner ID.", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ArtifactPage" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - } - }, - "/api/v1/projects/{id}/traces": { - "get": { - "operationId": "listTraces", - "summary": "List OA/SA traces", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "integer", - "minimum": 1, - "maximum": 1000, - "default": 100 - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "revision", - "in": "query", - "required": false, - "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", - "schema": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - } - }, - { - "name": "object", - "in": "query", - "required": false, - "description": "OA or SA endpoint ID.", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TracePage" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - } - }, - "/api/v1/projects/{id}/query": { - "post": { - "operationId": "queryNeighborhood", - "summary": "Bounded graph neighborhood including relation endpoint closure", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NeighborhoodResult" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NeighborhoodRequest" - } - } - } - } - } - }, - "/api/v1/projects/{id}/validation": { - "get": { - "operationId": "validateCurrent", - "summary": "Shared core validation of current snapshot", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationResult" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - } - }, - "post": { - "operationId": "validateCandidate", - "summary": "Check submitted model/source without mutation", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationResult" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ValidationRequest" - } - } - } - }, - "description": "Validate native model JSON, canonical Arcadia source, or a complete source-project bundle without adoption. Source-project diagnostics refer to submitted file paths and positions. Stabilized source/model byte limits are also checked." - } - }, - "/api/v1/projects/{id}/transactions": { - "post": { - "operationId": "executeTransaction", - "summary": "Atomic shared typed commands; optional dry run", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransactionRequest" - } - } - } - }, - "description": "Command identity correspondence drives source writeback, including UUID swaps and delete/recreate operations even when final models compare equal. Dry runs return both proposed representations and validate writeback. Failure preserves the accepted pair." - } - }, - "/api/v1/projects/{id}/transitions/preview": { - "post": { - "operationId": "previewTransition", - "summary": "Preview a shared core transition without persisting a plan", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Validated result; preview may include unresolved conflicts.", - "headers": { - "ETag": { - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransitionEnvelope" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransitionRequest" - } - } - } - }, - "description": "Conflict-free previews also validate authored-source writeback and stabilized model/source capacities." - } - }, - "/api/v1/projects/{id}/transitions/apply": { - "post": { - "operationId": "applyTransition", - "summary": "Apply client-held transition plan against its original revision", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Validated result; preview may include unresolved conflicts.", - "headers": { - "ETag": { - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MutationResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TransitionEnvelope" - } - } - } - } - } - }, - "/api/v1/projects/import-source-project": { - "post": { - "operationId": "importSourceProject", - "summary": "Import an authored source bundle as a new hosted resource", - "parameters": [], - "responses": { - "201": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - }, - "Location": { - "schema": { - "type": "string" - }, - "description": "Path to the created hosted resource." - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectSummary" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceBundle" - } - } - } - }, - "description": "Compile all logical source files, stabilize missing IDs, and persist the accepted model and bundle together. Importing source3 bundles never reads the service filesystem. Export the accepted bundle after import to retain inserted IDs." - } - }, - "/api/v1/projects/{id}/source-project": { - "get": { - "operationId": "getSourceProject", - "summary": "Export the exact accepted authored source bundle", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-None-Match", - "in": "header", - "required": false, - "description": "Return 304 when the current representation's revision matches.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceBundle" - } - } - } - }, - "304": { - "description": "Unchanged; empty body." - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "description": "Returns entry and all files with stable IDs, original comments, line endings and module layout. Shares the model ETag; comment-only changes advance that revision." - }, - "put": { - "operationId": "replaceSourceProject", - "summary": "Conditionally replace the complete authored source bundle", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success", - "headers": { - "ETag": { - "schema": { - "type": "string" - }, - "description": "Project revision validator when scoped to a project." - }, - "X-Request-ID": { - "schema": { - "type": "string", - "format": "uuid" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceProjectMutationResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SourceBundle" - } - } - } - }, - "description": "Compile and validate the full submitted bundle; return accepted text with missing UUIDs inserted. Model and source persist together under the exact If-Match precondition. Comment-only or file-layout edits advance revision; an exact pair no-op retains it. Rejected candidates preserve both representations." - } - }, - "/api/v1/projects/{id}/semantic-transitions/query": { - "post": { - "operationId": "querySemanticTransition", - "summary": "Query typed trace drift and linked impacts without mutation", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - } - ], - "responses": { - "200": { - "description": "Validated result; preview may include unresolved conflicts.", - "headers": { - "ETag": { - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SemanticQueryResult" - } - } - } - }, - "default": { - "$ref": "#/components/responses/Problem" - }, - "409": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SemanticQueryRequest" - } - } - } - }, - "description": "Read one immutable snapshot. Optional revision mismatch returns409; missing trace returns404; duplicate/empty trace selection returns400. References are canonical OA-to-SA correspondence. No write, baseline refresh or external artifact fetch." - } - }, - "/api/v1/projects/{id}/semantic-transitions/preview": { - "post": { - "operationId": "previewSemanticTransition", - "summary": "Preview and source-validate a typed semantic transition without writing", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Validated result; preview may include unresolved conflicts.", - "headers": { - "ETag": { - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SemanticTransitionEnvelope" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SemanticTransitionRequest" - } - } - } - }, - "description": "Uses the frozen core typed semantic contract. A supplied plan is a client-owned candidate, not a signed receipt; fingerprints check consistency, not original review authorship. Preview validates source writeback when conflict-free. Apply preserves preview-generated IDs and does not replan random identities." - } - }, - "/api/v1/projects/{id}/semantic-transitions/apply": { - "post": { - "operationId": "applySemanticTransition", - "summary": "Conditionally apply a prepared semantic candidate in one model/source revision", - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "description": "Hosted resource UUID; distinct from editable model ID.", - "schema": { - "type": "string", - "format": "uuid" - } - }, - { - "name": "If-Match", - "in": "header", - "required": true, - "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Validated result; preview may include unresolved conflicts.", - "headers": { - "ETag": { - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MutationResult" - } - } - } - }, - "412": { - "$ref": "#/components/responses/Problem" - }, - "428": { - "$ref": "#/components/responses/Problem" - }, - "default": { - "$ref": "#/components/responses/Problem" - } - }, - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SemanticTransitionEnvelope" - } - } - } - }, - "description": "Uses the frozen core typed semantic contract. A supplied plan is a client-owned candidate, not a signed receipt; fingerprints check consistency, not original review authorship. Preview validates source writeback when conflict-free. Apply preserves preview-generated IDs and does not replan random identities." - } - } - }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "description": "Optional for unconfigured loopback; required on non-loopback." - } - }, - "responses": { - "Problem": { - "description": "Structured problem response. See code/detail and docs/api.rst status mapping.", - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/Problem" - } - } - } - } - }, - "schemas": { - "Id": { - "type": "string", - "format": "uuid" - }, - "Revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "Layer": { - "type": "string", - "enum": [ - "Oa", - "Sa" - ] - }, - "Kind": { - "type": "string", - "enum": [ - "Entity", - "Actor", - "Role", - "Activity", - "Capability", - "OperationalMission", - "Process", - "System", - "SystemActor", - "Function", - "SystemCapability", - "Mission", - "FunctionalChain", - "ExchangeItem", - "ExchangeCategory", - "DataType", - "DataField", - "Interface", - "Port", - "Scenario", - "Lifeline", - "Occurrence", - "StateMachine", - "Region", - "State", - "Mode", - "Initial", - "Final", - "Choice", - "Junction", - "Fork", - "Join", - "ShallowHistory", - "DeepHistory", - "EntryPoint", - "ExitPoint", - "Terminate", - "Event", - "Constraint" - ] - }, - "RelationKind": { - "type": "string", - "enum": [ - "InterfaceItemAllocation", - "DataAssociation", - "Allocation", - "PortAllocation", - "Interaction", - "CapabilityInvolvement", - "ChainInvolvement", - "RoleRealization", - "RoleAssignment", - "FunctionalExchange", - "BoundaryExchange", - "CommunicationMean", - "MissionCapability", - "CapabilityInclude", - "CapabilityExtend", - "CapabilityGeneralization", - "MissionInvolvement", - "SequenceLink", - "ContextualLink", - "StateTransition", - "Availability", - "ExchangeAllocation", - "InterfaceProvision", - "InterfaceRequirement", - "StateAction" - ] - }, - "Position": { - "type": "object", - "properties": { - "x": { - "type": "number", - "minimum": -1000000, - "maximum": 1000000 - }, - "y": { - "type": "number", - "minimum": -1000000, - "maximum": 1000000 - } - }, - "required": [ - "x", - "y" - ], - "additionalProperties": false - }, - "EdgeLabel": { - "type": "object", - "description": "Authored label placement relative to the computed polyline. Both fields are required.", - "properties": { - "fraction": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Fraction of source-to-target polyline arc length." - }, - "offset": { - "$ref": "#/components/schemas/Position", - "description": "Relative diagram-space displacement." - } - }, - "required": [ - "fraction", - "offset" - ], - "additionalProperties": false - }, - "EdgeRoute": { - "type": "object", - "description": "One diagram's authored route for an existing Relation or Trace, including currently hidden edges. No separate identity. Only pinned points are stored; explicit empty routes are retained.", - "properties": { - "edge": { - "type": "string", - "format": "uuid", - "description": "Existing Relation or Trace identity, never a node placement." - }, - "waypoints": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Position" - }, - "maxItems": 128, - "default": [], - "description": "Absolute diagram positions in traversal order." - }, - "label": { - "oneOf": [ - { - "$ref": "#/components/schemas/EdgeLabel" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "edge" - ], - "additionalProperties": false - }, - "Size": { - "type": "object", - "properties": { - "width": { - "type": "number", - "exclusiveMinimum": 0 - }, - "height": { - "type": "number", - "exclusiveMinimum": 0 - } - }, - "required": [ - "width", - "height" - ], - "additionalProperties": false - }, - "DataTypeDefinition": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Boolean" - ] - }, - { - "type": "object", - "properties": { - "Integer": { - "type": "object", - "properties": { - "minimum": { - "anyOf": [ - { - "type": "integer", - "format": "int64", - "minimum": -9223372036854775808, - "maximum": 9223372036854775807 - }, - { - "type": "null" - } - ] - }, - "maximum": { - "anyOf": [ - { - "type": "integer", - "format": "int64", - "minimum": -9223372036854775808, - "maximum": 9223372036854775807 - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "minimum", - "maximum" - ], - "additionalProperties": false - } - }, - "required": [ - "Integer" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Real": { - "type": "object", - "properties": { - "minimum": { - "anyOf": [ - { - "type": "number", - "format": "double", - "description": "Finite IEEE-754 binary64; no coercion from typed Integer values." - }, - { - "type": "null" - } - ] - }, - "maximum": { - "anyOf": [ - { - "type": "number", - "format": "double", - "description": "Finite IEEE-754 binary64; no coercion from typed Integer values." - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "minimum", - "maximum" - ], - "additionalProperties": false - } - }, - "required": [ - "Real" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "String": { - "type": "object", - "properties": { - "minimum_length": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "maximum_length": { - "anyOf": [ - { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "minimum_length", - "maximum_length" - ], - "additionalProperties": false - } - }, - "required": [ - "String" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Enumeration": { - "type": "object", - "properties": { - "literals": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "literals" - ], - "additionalProperties": false - } - }, - "required": [ - "Enumeration" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Record": { - "type": "object", - "properties": { - "supertype": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "supertype" - ], - "additionalProperties": false - } - }, - "required": [ - "Record" - ], - "additionalProperties": false - } - ] - }, - "TypeRef": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Boolean", - "Integer", - "Real", - "String" - ] - }, - { - "oneOf": [ - { - "type": "object", - "properties": { - "Named": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "Named" - ], - "additionalProperties": false - } - ] - } - ] - }, - "OccurrenceBody": { - "oneOf": [ - { - "type": "object", - "properties": { - "Exchange": { - "type": "object", - "properties": { - "exchange": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "sender": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "receiver": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "message_kind": { - "$ref": "#/components/schemas/MessageKind", - "default": "Asynchronous" - }, - "reply_to": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ], - "default": null - }, - "values": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MessageValue" - }, - "default": [] - }, - "operation": { - "anyOf": [ - { - "$ref": "#/components/schemas/OperationUse" - }, - { - "type": "null" - } - ], - "default": null - } - }, - "required": [ - "exchange", - "sender", - "receiver" - ], - "additionalProperties": false, - "description": "Absent/null operation retains ordinary channel semantics and is omitted on output. Present operation is allowed only on SA BoundaryInterface Call/Asynchronous messages. Reply stores no operation and derives its exact Call's selection. Existing message defaults remain unchanged." - } - }, - "required": [ - "Exchange" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Action": { - "type": "object", - "properties": { - "action": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "lifeline": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "action", - "lifeline" - ], - "additionalProperties": false - } - }, - "required": [ - "Action" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "State": { - "type": "object", - "properties": { - "state": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "lifeline": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "state", - "lifeline" - ], - "additionalProperties": false - } - }, - "required": [ - "State" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Fragment": { - "type": "object", - "properties": { - "operator": { - "type": "string", - "enum": [ - "Alternative", - "Parallel", - "Loop", - "Optional" - ] - }, - "branches": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "operator", - "branches" - ], - "additionalProperties": false - } - }, - "required": [ - "Fragment" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Branch": { - "type": "object", - "properties": { - "guard": { - "type": "string" - }, - "occurrences": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "guard", - "occurrences" - ], - "additionalProperties": false - } - }, - "required": [ - "Branch" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Control": { - "type": "object", - "properties": { - "kind": { - "$ref": "#/components/schemas/ControlKind" - } - }, - "required": [ - "kind" - ], - "additionalProperties": false - } - }, - "required": [ - "Control" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SequenceReference": { - "type": "object", - "properties": { - "sequence": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "sequence" - ], - "additionalProperties": false - } - }, - "required": [ - "SequenceReference" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ScenarioUse": { - "type": "object", - "properties": { - "scenario": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "bindings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LifelineBinding" - } - } - }, - "required": [ - "scenario", - "bindings" - ], - "additionalProperties": false - } - }, - "required": [ - "ScenarioUse" - ], - "additionalProperties": false - } - ] - }, - "SharedBody": { - "oneOf": [ - { - "type": "string", - "enum": [ - "StateMachine", - "Region" - ] - }, - { - "oneOf": [ - { - "type": "object", - "properties": { - "ExchangeItem": { - "type": "object", - "properties": { - "kind": { - "$ref": "#/components/schemas/ExchangeItemKind" - }, - "mechanism": { - "$ref": "#/components/schemas/ExchangeMechanism" - }, - "supertype": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "kind", - "mechanism", - "supertype" - ], - "additionalProperties": false - } - }, - "required": [ - "ExchangeItem" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "DataType": { - "type": "object", - "properties": { - "definition": { - "$ref": "#/components/schemas/DataTypeDefinition" - }, - "default": { - "anyOf": [ - { - "$ref": "#/components/schemas/DataValue" - }, - { - "type": "null" - } - ] - }, - "unit": { - "type": "string" - } - }, - "required": [ - "definition", - "default", - "unit" - ], - "additionalProperties": false - } - }, - "required": [ - "DataType" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "DataField": { - "type": "object", - "properties": { - "type_ref": { - "$ref": "#/components/schemas/TypeRef" - }, - "minimum": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "maximum": { - "anyOf": [ - { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - { - "type": "null" - } - ] - }, - "unit": { - "type": "string" - }, - "direction": { - "$ref": "#/components/schemas/ParameterDirection" - }, - "storage": { - "$ref": "#/components/schemas/FieldStorage" - }, - "default": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataValue" - } - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "type_ref", - "minimum", - "maximum", - "unit", - "direction", - "storage", - "default" - ], - "additionalProperties": false - } - }, - "required": [ - "DataField" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Interface": { - "type": "object", - "properties": { - "supertype": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "supertype" - ], - "additionalProperties": false - } - }, - "required": [ - "Interface" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Port": { - "type": "object", - "properties": { - "contract": { - "$ref": "#/components/schemas/PortContract" - }, - "legacy": { - "anyOf": [ - { - "$ref": "#/components/schemas/LegacyPortContract" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "contract", - "legacy" - ], - "additionalProperties": false - } - }, - "required": [ - "Port" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Scenario": { - "type": "object", - "properties": { - "context": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "precondition": { - "type": "string" - }, - "postcondition": { - "type": "string" - }, - "steps": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - }, - "viewpoint": { - "$ref": "#/components/schemas/ScenarioViewpoint", - "default": "MixedLegacy", - "description": "Omitted schema-2 viewpoint retains legacy mixed lifelines. New graphical factories select OperationalActivity or Functional explicitly." - } - }, - "required": [ - "context", - "precondition", - "postcondition", - "steps" - ], - "additionalProperties": false - } - }, - "required": [ - "Scenario" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Lifeline": { - "type": "object", - "properties": { - "represented": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "represented" - ], - "additionalProperties": false - } - }, - "required": [ - "Lifeline" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Occurrence": { - "type": "object", - "properties": { - "body": { - "$ref": "#/components/schemas/OccurrenceBody" - }, - "precondition": { - "type": "string" - }, - "postcondition": { - "type": "string" - } - }, - "required": [ - "body", - "precondition", - "postcondition" - ], - "additionalProperties": false - } - }, - "required": [ - "Occurrence" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "State": { - "type": "object", - "properties": { - "kind": { - "$ref": "#/components/schemas/StateKind" - }, - "entry": { - "type": "string" - }, - "exit": { - "type": "string" - }, - "do_activity": { - "type": "string" - } - }, - "required": [ - "kind", - "entry", - "exit", - "do_activity" - ], - "additionalProperties": false - } - }, - "required": [ - "State" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Constraint": { - "type": "object", - "properties": { - "expression": { - "type": "string" - }, - "constrained": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "expression", - "constrained" - ], - "additionalProperties": false - } - }, - "required": [ - "Constraint" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Event": { - "type": "object", - "properties": { - "body": { - "$ref": "#/components/schemas/EventBody" - } - }, - "required": [ - "body" - ], - "additionalProperties": false - } - }, - "required": [ - "Event" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ExchangeCategory": { - "type": "object", - "properties": { - "family": { - "$ref": "#/components/schemas/ExchangeFamily" - }, - "exchanges": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - } - }, - "required": [ - "family", - "exchanges" - ], - "additionalProperties": false - } - }, - "required": [ - "ExchangeCategory" - ], - "additionalProperties": false - } - ] - } - ] - }, - "OaBody": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Entity", - "Actor", - "Role", - "Activity", - "Capability", - "Mission" - ] - }, - { - "oneOf": [ - { - "type": "object", - "properties": { - "Process": { - "type": "object", - "properties": { - "steps": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "steps" - ], - "additionalProperties": false - } - }, - "required": [ - "Process" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Shared": { - "$ref": "#/components/schemas/SharedBody" - } - }, - "required": [ - "Shared" - ], - "additionalProperties": false - } - ] - } - ] - }, - "SaBody": { - "oneOf": [ - { - "type": "string", - "enum": [ - "System", - "Actor", - "Function", - "Capability", - "Mission" - ] - }, - { - "oneOf": [ - { - "type": "object", - "properties": { - "FunctionalChain": { - "type": "object", - "properties": { - "steps": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "steps" - ], - "additionalProperties": false - } - }, - "required": [ - "FunctionalChain" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Shared": { - "$ref": "#/components/schemas/SharedBody" - } - }, - "required": [ - "Shared" - ], - "additionalProperties": false - } - ] - } - ] - }, - "ElementBody": { - "oneOf": [ - { - "type": "object", - "properties": { - "Oa": { - "$ref": "#/components/schemas/OaBody" - } - }, - "required": [ - "Oa" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Sa": { - "$ref": "#/components/schemas/SaBody" - } - }, - "required": [ - "Sa" - ], - "additionalProperties": false - } - ] - }, - "Element": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "parent": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - }, - "body": { - "$ref": "#/components/schemas/ElementBody" - } - }, - "required": [ - "id", - "alias", - "name", - "description", - "parent", - "body" - ], - "additionalProperties": false - }, - "RelationBody": { - "oneOf": [ - { - "type": "object", - "properties": { - "Allocation": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "Allocation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CapabilityInvolvement": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "CapabilityInvolvement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ChainInvolvement": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "ChainInvolvement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RoleRealization": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "RoleRealization" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RoleAssignment": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "RoleAssignment" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "MissionCapability": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "MissionCapability" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Availability": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "Availability" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ExchangeAllocation": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "ExchangeAllocation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "InterfaceProvision": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "InterfaceProvision" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "InterfaceRequirement": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "InterfaceRequirement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Interaction": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "source", - "target", - "items" - ], - "additionalProperties": false - } - }, - "required": [ - "Interaction" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "BoundaryExchange": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - }, - "oriented": { - "type": "boolean", - "description": "Independent of component port kind/orientation. Old V2 exchanges migrate to true." - } - }, - "required": [ - "source", - "target", - "items", - "oriented" - ], - "additionalProperties": false - } - }, - "required": [ - "BoundaryExchange" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "FunctionalExchange": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "source_port": { - "type": "string", - "format": "uuid" - }, - "target_port": { - "type": "string", - "format": "uuid" - }, - "items": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "source", - "target", - "source_port", - "target_port", - "items" - ], - "additionalProperties": false - } - }, - "required": [ - "FunctionalExchange" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StateTransition": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "trigger": { - "type": "string" - }, - "guard": { - "type": "string" - }, - "effect": { - "type": "string" - }, - "transition_kind": { - "$ref": "#/components/schemas/TransitionKind", - "default": "External", - "description": "Omitted legacy schema-2 value is External." - }, - "triggers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "uniqueItems": true, - "description": "Same-layer Event or Activity/Function references; alternatives, not implicit conjunction.", - "default": [] - }, - "effects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "uniqueItems": true, - "description": "Same-layer Activity/Function references describing transition effects.", - "default": [] - } - }, - "required": [ - "source", - "target", - "trigger", - "guard", - "effect" - ], - "additionalProperties": false, - "description": "Existing trigger, guard and effect prose is preserved exactly. New typed properties are optional only for staged schema-2 compatibility. Removing the last typed trigger retains a descriptive unresolved-trigger placeholder instead of silently introducing completion semantics." - } - }, - "required": [ - "StateTransition" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StateAction": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "phase": { - "type": "string", - "enum": [ - "Entry", - "Do", - "Exit" - ] - } - }, - "required": [ - "source", - "target", - "phase" - ], - "additionalProperties": false - } - }, - "required": [ - "StateAction" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CapabilityInclude": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "CapabilityInclude" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CapabilityExtend": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "condition": { - "type": "string", - "description": "Engineering condition under which the extending capability adds behavior." - } - }, - "required": [ - "source", - "target", - "condition" - ], - "additionalProperties": false - } - }, - "required": [ - "CapabilityExtend" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CapabilityGeneralization": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "CapabilityGeneralization" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "MissionInvolvement": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "MissionInvolvement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SequenceLink": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "guard": { - "type": "string", - "description": "Condition for a contextual process/chain path. Choice and loop paths should use explicit conditions or else." - } - }, - "required": [ - "source", - "target", - "guard" - ], - "additionalProperties": false - } - }, - "required": [ - "SequenceLink" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "PortAllocation": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "source", - "target" - ], - "additionalProperties": false - } - }, - "required": [ - "PortAllocation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "InterfaceItemAllocation": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "order": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "transmission": { - "$ref": "#/components/schemas/TransmissionProtocol" - }, - "acquisition": { - "$ref": "#/components/schemas/AcquisitionProtocol" - } - }, - "required": [ - "source", - "target", - "order", - "transmission", - "acquisition" - ], - "additionalProperties": false - } - }, - "required": [ - "InterfaceItemAllocation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "DataAssociation": { - "type": "object", - "properties": { - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "source_role": { - "type": "string" - }, - "target_role": { - "type": "string" - }, - "source_minimum": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "source_maximum": { - "anyOf": [ - { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - { - "type": "null" - } - ] - }, - "target_minimum": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - "target_maximum": { - "anyOf": [ - { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - { - "type": "null" - } - ] - }, - "source_navigable": { - "type": "boolean" - }, - "target_navigable": { - "type": "boolean" - } - }, - "required": [ - "source", - "target", - "source_role", - "target_role", - "source_minimum", - "source_maximum", - "target_minimum", - "target_maximum", - "source_navigable", - "target_navigable" - ], - "additionalProperties": false - } - }, - "required": [ - "DataAssociation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CommunicationMean": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "target": { - "$ref": "#/components/schemas/Id" - }, - "oriented": { - "type": "boolean" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - } - }, - "required": [ - "source", - "target", - "oriented", - "items" - ], - "additionalProperties": false - } - }, - "required": [ - "CommunicationMean" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ContextualLink": { - "type": "object", - "properties": { - "owner": { - "$ref": "#/components/schemas/Id" - }, - "source": { - "$ref": "#/components/schemas/OccurrenceEndpoint" - }, - "target": { - "$ref": "#/components/schemas/OccurrenceEndpoint" - }, - "purpose": { - "$ref": "#/components/schemas/ContextualLinkPurpose" - } - }, - "required": [ - "owner", - "source", - "target", - "purpose" - ], - "additionalProperties": false - } - }, - "required": [ - "ContextualLink" - ], - "additionalProperties": false - } - ] - }, - "Relation": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "body": { - "$ref": "#/components/schemas/RelationBody" - } - }, - "required": [ - "id", - "alias", - "name", - "description", - "body" - ], - "additionalProperties": false - }, - "PortAnchorSide": { - "type": "string", - "enum": [ - "Left", - "Right", - "Top", - "Bottom" - ], - "description": "Presentation side of the owner placement; independent of semantic port direction." - }, - "PortAnchor": { - "type": "object", - "description": "Manual position of a direct child Port on one owner placement. Each port occurs at most once per placement; this record has no separate identity.", - "properties": { - "port": { - "type": "string", - "format": "uuid" - }, - "side": { - "$ref": "#/components/schemas/PortAnchorSide" - }, - "offset": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "Finite binary32 fraction of the complete owner edge, measured from top on Left/Right and from left on Top/Bottom." - } - }, - "required": [ - "port", - "side", - "offset" - ], - "additionalProperties": false - }, - "NodePlacement": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "element": { - "type": "string", - "format": "uuid" - }, - "position": { - "$ref": "#/components/schemas/Position" - }, - "size": { - "$ref": "#/components/schemas/Size" - }, - "collapsed": { - "type": "boolean" - }, - "port_anchors": { - "type": "array", - "items": { - "$ref": "#/components/schemas/PortAnchor" - }, - "default": [], - "description": "Per-placement manual port positions. Omitted and empty both select automatic positioning; empty lists are omitted on serialization. Duplicate port references are invalid." - } - }, - "required": [ - "id", - "alias", - "element", - "position", - "size", - "collapsed" - ], - "additionalProperties": false - }, - "ProjectionKind": { - "description": "Existing projections remain strings. StateMachine carries one required UUID reference to an existing StateMachine in the diagram layer (state_diagram_context). Its placements may contain only that machine and its regions/state vertices, including nested members (state_diagram_member). Empty and partial views are valid. Incompatible placements must be removed or relocated in the same transaction when changing context; accepting or reading a view does not synthesize semantic records or placements.", - "oneOf": [ - { - "type": "string", - "enum": [ - "FunctionalDataflow", - "Capabilities", - "Overview", - "Decomposition", - "Allocation", - "Traceability" - ] - }, - { - "type": "object", - "properties": { - "StateMachine": { - "type": "object", - "properties": { - "machine": { - "type": "string", - "format": "uuid", - "description": "Required identity of the same-layer StateMachine that owns this view's members." - } - }, - "required": [ - "machine" - ], - "additionalProperties": false - } - }, - "required": [ - "StateMachine" - ], - "additionalProperties": false - } - ], - "examples": [ - "Overview", - { - "StateMachine": { - "machine": "11111111-1111-4111-8111-111111111111" - } - } - ] - }, - "Diagram": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "layer": { - "$ref": "#/components/schemas/Layer" - }, - "projection": { - "$ref": "#/components/schemas/ProjectionKind" - }, - "nodes": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/NodePlacement" - } - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EdgeRoute" - }, - "default": [], - "description": "Unique by edge identity within this diagram. Stored order is retained. Each entry counts against the total model record admission limit. Missing routes in earlier schema-3 models default to empty." - }, - "view_options": { - "$ref": "#/components/schemas/ViewOptions", - "default": {} - } - }, - "required": [ - "id", - "alias", - "name", - "description", - "layer", - "projection", - "nodes" - ], - "additionalProperties": false - }, - "ArtifactLink": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "owner": { - "type": "string", - "format": "uuid" - }, - "relation": { - "type": "string", - "enum": [ - "References", - "Satisfies", - "Verifies", - "Implements", - "DerivedFrom" - ] - }, - "uri": { - "type": "string", - "description": "Opaque external artifact reference. Server never fetches or executes it." - }, - "revision": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "fragment": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "id", - "alias", - "name", - "description", - "owner", - "relation", - "uri", - "revision", - "fragment" - ], - "additionalProperties": false - }, - "TracedProperties": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "name", - "description" - ], - "additionalProperties": false - }, - "TraceBaseline": { - "type": "object", - "properties": { - "oa": { - "$ref": "#/components/schemas/TracedProperties" - }, - "sa": { - "$ref": "#/components/schemas/TracedProperties" - }, - "semantic": { - "anyOf": [ - { - "$ref": "#/components/schemas/SemanticBaseline" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Absent/null means Unreviewed. Historical typed facts never become live graph references." - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "Trace": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "oa": { - "type": "string", - "format": "uuid" - }, - "sa": { - "type": "string", - "format": "uuid" - }, - "kind": { - "type": "string", - "enum": [ - "Refinement", - "Participant", - "Capability", - "Mission", - "Exchange", - "Sequence", - "Item", - "Scenario", - "State", - "Manual" - ] - }, - "baseline": { - "anyOf": [ - { - "$ref": "#/components/schemas/TraceBaseline" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "id", - "alias", - "name", - "description", - "oa", - "sa", - "kind", - "baseline" - ], - "additionalProperties": false - }, - "Project": { - "type": "object", - "properties": { - "schema_version": { - "type": "integer", - "const": 7 - }, - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "elements": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Element" - } - }, - "relations": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Relation" - } - }, - "diagrams": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Diagram" - } - }, - "artifact_links": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/ArtifactLink" - } - }, - "traces": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Trace" - } - } - }, - "required": [ - "schema_version", - "id", - "alias", - "name", - "description", - "elements", - "relations", - "diagrams", - "artifact_links", - "traces" - ], - "additionalProperties": false - }, - "StoredProject": { - "type": "object", - "properties": { - "resource_id": { - "type": "string", - "format": "uuid" - }, - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "model": { - "$ref": "#/components/schemas/Project" - }, - "migration": { - "anyOf": [ - { - "$ref": "#/components/schemas/MigrationReport" - }, - { - "type": "null" - } - ], - "description": "Present after legacy import/reopen; excluded from persisted envelopes. Resource identity and revision are unchanged by reopening." - }, - "source_project": { - "$ref": "#/components/schemas/SourceBundle" - } - }, - "required": [ - "resource_id", - "revision", - "model", - "source_project" - ], - "additionalProperties": false, - "description": "Accepted coupled model/source snapshot. Compiling source_project reproduces model; revision changes once if either representation changes. Older model-only or schema3 coupled envelopes migrate in memory without a write or revision change; both representations must independently migrate to the same graph." - }, - "ProjectSummary": { - "type": "object", - "properties": { - "resource_id": { - "type": "string", - "format": "uuid" - }, - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "model_id": { - "type": "string", - "format": "uuid" - }, - "schema_version": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "elements": { - "type": "integer", - "minimum": 0 - }, - "relations": { - "type": "integer", - "minimum": 0 - }, - "migration": { - "anyOf": [ - { - "$ref": "#/components/schemas/MigrationReport" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "resource_id", - "revision", - "model_id", - "schema_version", - "name", - "elements", - "relations" - ], - "additionalProperties": false - }, - "Issue": { - "type": "object", - "properties": { - "severity": { - "type": "string", - "enum": [ - "error", - "warning" - ] - }, - "message": { - "type": "string" - }, - "object_id": { - "type": "string", - "format": "uuid" - }, - "line": { - "type": "integer", - "minimum": 1 - }, - "column": { - "type": "integer", - "minimum": 1, - "description": "One-based Unicode scalar column." - }, - "code": { - "type": "string" - }, - "field": { - "type": "string" - }, - "path": { - "type": "string", - "description": "Logical source file path, when a source project supplied the diagnostic." - }, - "span": { - "$ref": "#/components/schemas/SourceSpan" - }, - "related": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SourceLocation" - } - } - }, - "required": [ - "severity", - "message", - "code" - ], - "additionalProperties": false - }, - "Problem": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "status": { - "type": "integer" - }, - "code": { - "type": "string" - }, - "detail": { - "type": "string" - }, - "current_revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "issues": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issue" - } - } - }, - "required": [ - "type", - "title", - "status", - "code", - "detail" - ], - "additionalProperties": false - }, - "NameRequest": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ], - "additionalProperties": false - }, - "Command": { - "oneOf": [ - { - "type": "object", - "properties": { - "Replace": { - "$ref": "#/components/schemas/Project" - } - }, - "required": [ - "Replace" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Batch": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - } - } - }, - "required": [ - "Batch" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Add": { - "$ref": "#/components/schemas/Kind" - } - }, - "required": [ - "Add" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "AddElement": { - "type": "object", - "properties": { - "kind": { - "$ref": "#/components/schemas/Kind" - }, - "layer": { - "$ref": "#/components/schemas/Layer" - }, - "name": { - "type": "string" - }, - "parent": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "kind", - "layer", - "name", - "parent" - ], - "additionalProperties": false - } - }, - "required": [ - "AddElement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Connect": { - "type": "array", - "prefixItems": [ - { - "$ref": "#/components/schemas/RelationKind" - }, - { - "type": "string" - }, - { - "type": "string", - "format": "uuid" - }, - { - "type": "string", - "format": "uuid" - } - ], - "minItems": 4, - "maxItems": 4 - } - }, - "required": [ - "Connect" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditProject": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string", - "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", - "description": "Unique persistent alias; core reserved words are forbidden." - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "id", - "alias", - "name", - "description" - ], - "additionalProperties": false - } - }, - "required": [ - "EditProject" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Reparent": { - "type": "object", - "properties": { - "element": { - "type": "string", - "format": "uuid" - }, - "parent": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "element", - "parent" - ], - "additionalProperties": false - } - }, - "required": [ - "Reparent" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Reidentify": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "string", - "format": "uuid" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "Reidentify" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Rename": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "string" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "Rename" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Describe": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "string" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "Describe" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SetAlias": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "string" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "SetAlias" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Delete": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "Delete" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "AddStep": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "string", - "format": "uuid" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "AddStep" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RemoveStep": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "integer", - "minimum": 0 - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "RemoveStep" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "MoveStep": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "integer", - "minimum": 0 - }, - { - "type": "integer", - "minimum": 0 - } - ], - "minItems": 3, - "maxItems": 3 - } - }, - "required": [ - "MoveStep" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SetSteps": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "SetSteps" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Layout": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "Layout" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CreateNode": { - "type": "object", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "node": { - "$ref": "#/components/schemas/NodePlacement" - } - }, - "required": [ - "diagram", - "node" - ], - "additionalProperties": false - } - }, - "required": [ - "CreateNode" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditNode": { - "type": "object", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "original": { - "type": "string", - "format": "uuid" - }, - "node": { - "$ref": "#/components/schemas/NodePlacement" - } - }, - "required": [ - "diagram", - "original", - "node" - ], - "additionalProperties": false - } - }, - "required": [ - "EditNode" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RelocateNode": { - "type": "object", - "description": "Move an existing placement to another diagram while preserving its UUID, alias, geometry, collapse state and dependent artifact references. The target diagram must accept the element and must not already contain its placement.", - "properties": { - "node": { - "type": "string", - "format": "uuid" - }, - "diagram": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "node", - "diagram" - ], - "additionalProperties": false - } - }, - "required": [ - "RelocateNode" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "MoveNode": { - "type": "object", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "node": { - "type": "string", - "format": "uuid" - }, - "position": { - "$ref": "#/components/schemas/Position" - }, - "with_descendants": { - "type": "boolean" - } - }, - "required": [ - "diagram", - "node", - "position", - "with_descendants" - ], - "additionalProperties": false - } - }, - "required": [ - "MoveNode" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SetEdgeRoute": { - "type": "object", - "description": "Upsert by edge identity; preserves unrelated route entries and order. Uses existing transaction validation and ETag checks.", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "route": { - "$ref": "#/components/schemas/EdgeRoute" - } - }, - "required": [ - "diagram", - "route" - ], - "additionalProperties": false - } - }, - "required": [ - "SetEdgeRoute" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RemoveEdgeRoute": { - "type": "object", - "description": "Reset to automatic routing. No-op if this existing diagram has no route for the existing edge.", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "edge": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "diagram", - "edge" - ], - "additionalProperties": false - } - }, - "required": [ - "RemoveEdgeRoute" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SetPortAnchor": { - "type": "object", - "description": "Upsert manual port position by port identity on an existing owner placement, preserving unrelated entries. Port must be a direct child of the placement's semantic element.", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "node": { - "type": "string", - "format": "uuid" - }, - "anchor": { - "$ref": "#/components/schemas/PortAnchor" - } - }, - "required": [ - "diagram", - "node", - "anchor" - ], - "additionalProperties": false - } - }, - "required": [ - "SetPortAnchor" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RemovePortAnchor": { - "type": "object", - "description": "Restore automatic positioning for an existing direct child Port. No-op when that valid owner placement has no manual anchor for the port; wrong or stale ownership is rejected.", - "properties": { - "diagram": { - "type": "string", - "format": "uuid" - }, - "node": { - "type": "string", - "format": "uuid" - }, - "port": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "diagram", - "node", - "port" - ], - "additionalProperties": false - } - }, - "required": [ - "RemovePortAnchor" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CreateElement": { - "$ref": "#/components/schemas/Element" - } - }, - "required": [ - "CreateElement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditElement": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Element" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "EditElement" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CreateRelation": { - "$ref": "#/components/schemas/Relation" - } - }, - "required": [ - "CreateRelation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditRelation": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Relation" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "EditRelation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CreateDiagram": { - "$ref": "#/components/schemas/Diagram" - } - }, - "required": [ - "CreateDiagram" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditDiagram": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Diagram" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "EditDiagram" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CreateArtifact": { - "$ref": "#/components/schemas/ArtifactLink" - } - }, - "required": [ - "CreateArtifact" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditArtifact": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/ArtifactLink" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "EditArtifact" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CreateTrace": { - "$ref": "#/components/schemas/Trace" - } - }, - "required": [ - "CreateTrace" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "EditTrace": { - "type": "array", - "prefixItems": [ - { - "type": "string", - "format": "uuid" - }, - { - "$ref": "#/components/schemas/Trace" - } - ], - "minItems": 2, - "maxItems": 2 - } - }, - "required": [ - "EditTrace" - ], - "additionalProperties": false - } - ] - }, - "TransactionRequest": { - "type": "object", - "properties": { - "commands": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - }, - "minItems": 1, - "maxItems": 200 - }, - "dry_run": { - "type": "boolean", - "default": false - } - }, - "required": [ - "commands" - ], - "additionalProperties": false - }, - "TransactionResult": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "dry_run": { - "type": "boolean" - }, - "changed": { - "type": "boolean" - }, - "issues": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issue" - } - }, - "model": { - "$ref": "#/components/schemas/Project", - "description": "Proposed model, present only for a dry run." - }, - "source_project": { - "$ref": "#/components/schemas/SourceBundle", - "description": "Proposed accepted bundle, present only for a dry run. Source writeback is validated before returning a successful candidate." - } - }, - "required": [ - "revision", - "dry_run", - "changed", - "issues" - ], - "additionalProperties": false - }, - "MutationResult": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "changed": { - "type": "boolean" - }, - "issues": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issue" - } - }, - "migration": { - "anyOf": [ - { - "$ref": "#/components/schemas/MigrationReport" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "changed" - ], - "additionalProperties": false - }, - "ValidationRequest": { - "oneOf": [ - { - "type": "object", - "properties": { - "format": { - "const": "json" - }, - "model": { - "$ref": "#/components/schemas/Project" - } - }, - "required": [ - "format", - "model" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "format": { - "const": "arcadia" - }, - "source": { - "type": "string" - } - }, - "required": [ - "format", - "source" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "format": { - "const": "source-project" - }, - "source_project": { - "$ref": "#/components/schemas/SourceBundle" - } - }, - "required": [ - "format", - "source_project" - ], - "additionalProperties": false - } - ] - }, - "ValidationResult": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "valid": { - "type": "boolean" - }, - "issues": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issue" - } - }, - "migration": { - "anyOf": [ - { - "$ref": "#/components/schemas/MigrationReport" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "valid", - "issues" - ], - "additionalProperties": false - }, - "NeighborhoodRequest": { - "type": "object", - "properties": { - "roots": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "minItems": 1, - "maxItems": 100 - }, - "direction": { - "type": "string", - "enum": [ - "incoming", - "outgoing", - "both" - ], - "default": "both" - }, - "relation_kinds": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RelationKind" - } - }, - "max_depth": { - "type": "integer", - "minimum": 0, - "maximum": 4, - "default": 1 - }, - "max_objects": { - "type": "integer", - "minimum": 1, - "maximum": 1000, - "default": 200 - }, - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - } - }, - "required": [ - "roots" - ], - "additionalProperties": false - }, - "NeighborhoodResult": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "elements": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Element" - } - }, - "relations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Relation" - } - }, - "truncated": { - "type": "boolean" - } - }, - "required": [ - "revision", - "elements", - "relations", - "truncated" - ], - "additionalProperties": false - }, - "ElementPage": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Element" - } - }, - "next_after": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "items", - "next_after" - ], - "additionalProperties": false - }, - "RelationPage": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Relation" - } - }, - "next_after": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "items", - "next_after" - ], - "additionalProperties": false - }, - "ArtifactPage": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ArtifactLink" - } - }, - "next_after": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "items", - "next_after" - ], - "additionalProperties": false - }, - "TracePage": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Trace" - } - }, - "next_after": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "items", - "next_after" - ], - "additionalProperties": false - }, - "ProjectPage": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProjectSummary" - } - }, - "next_after": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "items", - "next_after" - ], - "additionalProperties": false - }, - "TransitionDirection": { - "type": "string", - "enum": [ - "OaToSa", - "SaToOa" - ] - }, - "TransitionField": { - "type": "string", - "enum": [ - "Name", - "Description" - ] - }, - "TransitionMapping": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "target": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - }, - "target_kind": { - "anyOf": [ - { - "$ref": "#/components/schemas/Kind" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "source", - "target", - "target_kind" - ], - "additionalProperties": false - }, - "FieldDecision": { - "oneOf": [ - { - "type": "string", - "enum": [ - "TakeSource", - "KeepTarget" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "string" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "FieldResolution": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "field": { - "$ref": "#/components/schemas/TransitionField" - }, - "decision": { - "$ref": "#/components/schemas/FieldDecision" - } - }, - "required": [ - "source", - "field", - "decision" - ], - "additionalProperties": false - }, - "TransitionRequest": { - "type": "object", - "properties": { - "direction": { - "$ref": "#/components/schemas/TransitionDirection" - }, - "sources": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "maxItems": 100 - }, - "scope": { - "type": "string", - "enum": [ - "SelectedOnly", - "Required", - "Subtree" - ] - }, - "mappings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransitionMapping" - }, - "maxItems": 200 - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransitionField" - } - }, - "resolutions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FieldResolution" - }, - "maxItems": 400 - }, - "destination_diagram": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - }, - "communication_endpoints": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CommunicationEndpointDecision" - }, - "maxItems": 200, - "default": [], - "description": "Explicit SA component-port pair per selected OA CommunicationMean. Reuse or Create only. Owners follow reviewed participant mappings; no participant-to-port substitution or automatic interface allocation." - }, - "operation_omissions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OperationOmission" - }, - "maxItems": 200, - "default": [], - "description": "Explicit SA-to-OA abstraction per selected invocation with operation intent. Nonempty rationale required by core; duplicates, irrelevant sources, and other directions are refused. Replies derive the Call abstraction. Source operation identities and values are preserved." - } - }, - "required": [ - "direction", - "sources", - "scope", - "mappings", - "fields", - "resolutions", - "destination_diagram" - ], - "additionalProperties": false - }, - "FieldChange": { - "type": "object", - "properties": { - "field": { - "$ref": "#/components/schemas/TransitionField" - }, - "before": { - "type": "string" - }, - "after": { - "type": "string" - } - }, - "required": [ - "field", - "before", - "after" - ], - "additionalProperties": false - }, - "TransitionChange": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "target": { - "$ref": "#/components/schemas/Id" - }, - "action": { - "type": "string", - "enum": [ - "Create", - "Update", - "Reuse" - ] - }, - "fields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FieldChange" - } - } - }, - "required": [ - "source", - "target", - "action", - "fields" - ], - "additionalProperties": false - }, - "TransitionConflict": { - "type": "object", - "properties": { - "source": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - }, - "target": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - }, - "field": { - "anyOf": [ - { - "$ref": "#/components/schemas/TransitionField" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - } - }, - "required": [ - "source", - "target", - "field", - "message" - ], - "additionalProperties": false - }, - "TransitionPlan": { - "type": "object", - "properties": { - "base_fingerprint": { - "type": "string" - }, - "request": { - "$ref": "#/components/schemas/TransitionRequest" - }, - "changes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransitionChange" - } - }, - "conflicts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/TransitionConflict" - } - }, - "warnings": { - "type": "array", - "items": { - "type": "string" - } - }, - "commands": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - } - } - }, - "required": [ - "base_fingerprint", - "request", - "changes", - "conflicts", - "warnings", - "commands" - ], - "additionalProperties": false - }, - "TransitionEnvelope": { - "type": "object", - "properties": { - "base_revision": { - "$ref": "#/components/schemas/Revision" - }, - "plan": { - "$ref": "#/components/schemas/TransitionPlan" - } - }, - "required": [ - "base_revision", - "plan" - ], - "additionalProperties": false - }, - "ControlKind": { - "type": "string", - "enum": [ - "Choice", - "Merge", - "Fork", - "Join", - "Loop" - ] - }, - "ScenarioViewpoint": { - "type": "string", - "enum": [ - "OperationalActivity", - "ParticipantInteraction", - "Functional", - "BoundaryInterface", - "MixedLegacy" - ] - }, - "MessageKind": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Asynchronous", - "Call", - "Reply", - "Create", - "Delete" - ] - }, - { - "type": "object", - "properties": { - "Timer": { - "type": "object", - "properties": { - "expression": { - "type": "string" - } - }, - "required": [ - "expression" - ], - "additionalProperties": false - } - }, - "required": [ - "Timer" - ], - "additionalProperties": false - } - ] - }, - "MessageValue": { - "type": "object", - "properties": { - "path": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "default": [] - }, - "field": { - "type": "string", - "format": "uuid" - }, - "expression": { - "type": "string" - } - }, - "required": [ - "field", - "expression" - ], - "additionalProperties": false, - "description": "Identity is (path, field). Path lists enclosing DataField UUIDs, excluding the terminal field. Value storage traverses named Records; Reference storage stops traversal. Operation Call accepts In/InOut and Reply accepts Out/InOut/Return. Unspecified direction and retained ambiguous legacy empty paths warn. Expressions are descriptive, never executed." - }, - "LifelineBinding": { - "type": "object", - "properties": { - "referenced": { - "type": "string", - "format": "uuid" - }, - "local": { - "type": "string", - "format": "uuid" - } - }, - "required": [ - "referenced", - "local" - ], - "additionalProperties": false - }, - "StateKind": { - "type": "string", - "enum": [ - "State", - "Mode", - "Initial", - "Final", - "Choice", - "Junction", - "Fork", - "Join", - "ShallowHistory", - "DeepHistory", - "EntryPoint", - "ExitPoint", - "Terminate" - ] - }, - "TimeEventKind": { - "type": "string", - "enum": [ - "After", - "At" - ], - "description": "After is relative to source-state activation; At describes an absolute instant. Expressions are descriptive, not executed." - }, - "TransitionKind": { - "type": "string", - "enum": [ - "External", - "Local", - "Internal" - ] - }, - "EventBody": { - "oneOf": [ - { - "type": "object", - "properties": { - "Signal": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "uniqueItems": true, - "description": "Same-layer ExchangeItem identities carried by the signal." - } - }, - "required": [ - "items" - ], - "additionalProperties": false - } - }, - "required": [ - "Signal" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Time": { - "type": "object", - "properties": { - "kind": { - "$ref": "#/components/schemas/TimeEventKind" - }, - "expression": { - "type": "string" - } - }, - "required": [ - "kind", - "expression" - ], - "additionalProperties": false - } - }, - "required": [ - "Time" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Change": { - "type": "object", - "properties": { - "expression": { - "type": "string" - } - }, - "required": [ - "expression" - ], - "additionalProperties": false - } - }, - "required": [ - "Change" - ], - "additionalProperties": false - } - ] - }, - "PortContract": { - "oneOf": [ - { - "type": "object", - "properties": { - "FunctionInput": { - "type": "object", - "properties": { - "incoming_items": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "incoming_items" - ], - "additionalProperties": false - } - }, - "required": [ - "FunctionInput" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "FunctionOutput": { - "type": "object", - "properties": { - "outgoing_items": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - }, - "required": [ - "outgoing_items" - ], - "additionalProperties": false - } - }, - "required": [ - "FunctionOutput" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Component": { - "type": "object", - "properties": { - "kind": { - "type": "string", - "enum": [ - "Standard", - "Flow" - ] - }, - "orientation": { - "type": "string", - "enum": [ - "Unset", - "In", - "Out", - "InOut" - ] - } - }, - "required": [ - "kind", - "orientation" - ], - "additionalProperties": false - } - }, - "required": [ - "Component" - ], - "additionalProperties": false - }, - { - "type": "string", - "enum": [ - "Legacy" - ] - } - ], - "description": "FunctionInput/Output are SA Function-owned item contracts. Component is SA System/SystemActor-owned; Standard requires Unset. Legacy requires a preserved legacy record and emits compatibility warnings. Mixed Standard/Flow component connections are invalid." - }, - "LegacyPortContract": { - "type": "object", - "properties": { - "direction": { - "type": "string", - "enum": [ - "In", - "Out", - "InOut" - ] - }, - "interface": { - "anyOf": [ - { - "type": "string", - "format": "uuid" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "direction", - "interface" - ], - "additionalProperties": false - }, - "MigrationReport": { - "type": "object", - "properties": { - "from_schema": { - "type": "integer", - "enum": [ - 1, - 2, - 3, - 4, - 5, - 6 - ] - }, - "to_schema": { - "type": "integer", - "const": 7 - }, - "preserved_ports": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string" - }, - "required_resolution": { - "type": "string" - } - }, - "required": [ - "id", - "alias", - "required_resolution" - ], - "additionalProperties": false - } - }, - "generated_endpoints": { - "type": "array", - "items": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "format": "uuid" - }, - "side": { - "type": "string", - "enum": [ - "source", - "target" - ] - }, - "port": { - "type": "string", - "format": "uuid" - }, - "owner": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string" - } - }, - "required": [ - "exchange", - "side", - "port", - "owner", - "alias" - ], - "additionalProperties": false - } - }, - "orientation_defaults": { - "type": "array", - "items": { - "type": "object", - "properties": { - "exchange": { - "type": "string", - "format": "uuid" - }, - "oriented": { - "type": "boolean", - "const": true - } - }, - "required": [ - "exchange", - "oriented" - ], - "additionalProperties": false - } - }, - "required_resolutions": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - }, - "semantic_defaults": { - "type": "array", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "format": "uuid" - }, - "field": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "object", - "field", - "description" - ], - "additionalProperties": false - } - }, - "generated_interface_allocations": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - }, - "source": { - "type": "string", - "format": "uuid" - }, - "target": { - "type": "string", - "format": "uuid" - }, - "alias": { - "type": "string" - }, - "order": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - } - }, - "required": [ - "id", - "source", - "target", - "alias", - "order" - ], - "additionalProperties": false - } - }, - "unresolved_message_values": { - "type": "array", - "items": { - "type": "object", - "properties": { - "occurrence": { - "type": "string", - "format": "uuid" - }, - "field": { - "type": "string", - "format": "uuid" - }, - "reason": { - "type": "string" - } - }, - "required": [ - "occurrence", - "field", - "reason" - ], - "additionalProperties": false - } - } - }, - "required": [ - "from_schema", - "to_schema", - "preserved_ports", - "generated_endpoints", - "orientation_defaults", - "required_resolutions" - ], - "additionalProperties": false, - "description": "Transient observations from explicit V1/V2/V3/V4/V5/V6 to V7 migration. New report lists default to empty when reading older responses. Reading an old envelope neither saves nor changes its revision. Allocation UUIDv5 uses project namespace and v2-interface-item::." - }, - "SourceBundle": { - "type": "object", - "description": "Complete source7 workspace (source3/4/5/6 migrate explicitly). The entry is a root filename. Files use canonical portable slash-separated relative .arcadia paths and all must be reachable. Includes resolve only against this map, never the service filesystem. Up to 256 files, 32 include edges along a path and 1,024 include edges overall. Serialized bundle JSON is at most 8 MiB, checked again after missing UUIDs are inserted. GET returns exact accepted stable text.", - "properties": { - "entry": { - "type": "string" - }, - "files": { - "type": "object", - "maxProperties": 256, - "additionalProperties": { - "type": "string" - } - } - }, - "required": [ - "entry", - "files" - ], - "additionalProperties": false - }, - "SourceSpan": { - "type": "object", - "description": "Half-open UTF-8 byte offsets [start,end) in the named source file.", - "properties": { - "start": { - "type": "integer", - "minimum": 0 - }, - "end": { - "type": "integer", - "minimum": 0 - } - }, - "required": [ - "start", - "end" - ], - "additionalProperties": false - }, - "SourceLocation": { - "type": "object", - "properties": { - "path": { - "type": "string" - }, - "span": { - "$ref": "#/components/schemas/SourceSpan" - } - }, - "required": [ - "path", - "span" - ], - "additionalProperties": false - }, - "SourceProjectMutationResult": { - "type": "object", - "properties": { - "revision": { - "type": "integer", - "minimum": 1, - "description": "Current revision counter; use ETag as the opaque write validator." - }, - "changed": { - "type": "boolean" - }, - "issues": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Issue" - } - }, - "source_project": { - "$ref": "#/components/schemas/SourceBundle" - }, - "migration": { - "anyOf": [ - { - "$ref": "#/components/schemas/MigrationReport" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "revision", - "changed", - "issues", - "source_project", - "migration" - ], - "additionalProperties": false - }, - "ExchangeItemKind": { - "type": "string", - "enum": [ - "Information", - "Material", - "Energy" - ] - }, - "ExchangeMechanism": { - "type": "string", - "enum": [ - "Unspecified", - "Flow", - "Event", - "Operation", - "SharedData" - ] - }, - "ParameterDirection": { - "type": "string", - "enum": [ - "Unspecified", - "In", - "Out", - "InOut", - "Return" - ] - }, - "FieldStorage": { - "type": "string", - "enum": [ - "Value", - "Reference" - ] - }, - "TransmissionProtocol": { - "type": "string", - "enum": [ - "Unspecified", - "Synchronous", - "Asynchronous", - "Unicast", - "Multicast", - "Broadcast" - ] - }, - "AcquisitionProtocol": { - "type": "string", - "enum": [ - "Unspecified", - "Read", - "Accept" - ] - }, - "DataValue": { - "oneOf": [ - { - "type": "object", - "properties": { - "Boolean": { - "type": "boolean" - } - }, - "required": [ - "Boolean" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Integer": { - "type": "integer", - "format": "int64", - "minimum": -9223372036854775808, - "maximum": 9223372036854775807 - } - }, - "required": [ - "Integer" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Real": { - "type": "number", - "format": "double", - "description": "Finite IEEE-754 binary64; no coercion from typed Integer values." - } - }, - "required": [ - "Real" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "String": { - "type": "string" - } - }, - "required": [ - "String" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Enumeration": { - "type": "string" - } - }, - "required": [ - "Enumeration" - ], - "additionalProperties": false - } - ] - }, - "DataConstructor": { - "type": "string", - "enum": [ - "Boolean", - "Integer", - "Real", - "String", - "Enumeration", - "Record" - ] - }, - "PortConstructor": { - "type": "string", - "enum": [ - "FunctionInput", - "FunctionOutput", - "Component", - "Legacy" - ] - }, - "OccurrenceConstructor": { - "type": "string", - "enum": [ - "Exchange", - "Action", - "Control", - "SequenceReference", - "ScenarioUse", - "State", - "Fragment", - "Branch" - ] - }, - "EventConstructor": { - "type": "string", - "enum": [ - "Signal", - "Time", - "Change" - ] - }, - "MessageConstructor": { - "type": "string", - "enum": [ - "Asynchronous", - "Call", - "Reply", - "Create", - "Delete", - "Timer" - ] - }, - "ReferenceCollection": { - "type": "string", - "enum": [ - "Steps", - "FragmentBranches", - "FunctionInputItems", - "FunctionOutputItems", - "SignalItems", - "ExchangeItems", - "CategoryExchanges", - "TransitionTriggers", - "TransitionEffects", - "Constrained" - ] - }, - "OrderedCollection": { - "type": "string", - "enum": [ - "Steps", - "FragmentBranches" - ] - }, - "IncidentEnd": { - "type": "string", - "enum": [ - "Source", - "Target" - ] - }, - "ArtifactFacet": { - "type": "string", - "enum": [ - "Presence", - "Name", - "Description", - "Owner", - "Relation", - "Uri", - "Revision", - "Fragment" - ] - }, - "ComponentPortKind": { - "type": "string", - "enum": [ - "Standard", - "Flow" - ] - }, - "ComponentPortOrientation": { - "type": "string", - "enum": [ - "Unset", - "In", - "Out", - "InOut" - ] - }, - "PortDirection": { - "type": "string", - "enum": [ - "In", - "Out", - "InOut" - ] - }, - "FragmentOperator": { - "type": "string", - "enum": [ - "Alternative", - "Parallel", - "Loop", - "Optional" - ] - }, - "StateActionKind": { - "type": "string", - "enum": [ - "Entry", - "Do", - "Exit" - ] - }, - "ArtifactRelation": { - "type": "string", - "enum": [ - "References", - "Satisfies", - "Verifies", - "Implements", - "DerivedFrom" - ] - }, - "HeaderFacet": { - "type": "string", - "enum": [ - "Name", - "Description", - "Parent" - ] - }, - "ReviewedString": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "string" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "string" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionId": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "HeaderReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Name": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Name" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Description": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Description" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Parent": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Parent" - ], - "additionalProperties": false - } - ] - }, - "ExchangeItemFacet": { - "type": "string", - "enum": [ - "Nature", - "Mechanism", - "Supertype" - ] - }, - "ReviewedExchangeItemKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ExchangeItemKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ExchangeItemKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedExchangeMechanism": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ExchangeMechanism" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ExchangeMechanism" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ExchangeItemReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Nature": { - "$ref": "#/components/schemas/ReviewedExchangeItemKind" - } - }, - "required": [ - "Nature" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Mechanism": { - "$ref": "#/components/schemas/ReviewedExchangeMechanism" - } - }, - "required": [ - "Mechanism" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Supertype": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Supertype" - ], - "additionalProperties": false - } - ] - }, - "InterfaceFacet": { - "type": "string", - "enum": [ - "Supertype" - ] - }, - "InterfaceReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Supertype": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Supertype" - ], - "additionalProperties": false - } - ] - }, - "DataFacet": { - "type": "string", - "enum": [ - "Constructor", - "IntegerMinimum", - "IntegerMaximum", - "RealMinimum", - "RealMaximum", - "StringMinimumLength", - "StringMaximumLength", - "RecordSupertype", - "Default", - "Unit" - ] - }, - "ReviewedDataConstructor": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/DataConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/DataConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptioni64": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "integer", - "minimum": -9223372036854775808, - "maximum": 9223372036854775807 - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "integer", - "minimum": -9223372036854775808, - "maximum": 9223372036854775807 - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionf64": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "Reviewedu32": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionu32": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "integer", - "minimum": 0, - "maximum": 4294967295 - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionDataValue": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/DataValue" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/DataValue" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "DataReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Constructor": { - "$ref": "#/components/schemas/ReviewedDataConstructor" - } - }, - "required": [ - "Constructor" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "IntegerMinimum": { - "$ref": "#/components/schemas/ReviewedOptioni64" - } - }, - "required": [ - "IntegerMinimum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "IntegerMaximum": { - "$ref": "#/components/schemas/ReviewedOptioni64" - } - }, - "required": [ - "IntegerMaximum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RealMinimum": { - "$ref": "#/components/schemas/ReviewedOptionf64" - } - }, - "required": [ - "RealMinimum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RealMaximum": { - "$ref": "#/components/schemas/ReviewedOptionf64" - } - }, - "required": [ - "RealMaximum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StringMinimumLength": { - "$ref": "#/components/schemas/Reviewedu32" - } - }, - "required": [ - "StringMinimumLength" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StringMaximumLength": { - "$ref": "#/components/schemas/ReviewedOptionu32" - } - }, - "required": [ - "StringMaximumLength" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "RecordSupertype": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "RecordSupertype" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Default": { - "$ref": "#/components/schemas/ReviewedOptionDataValue" - } - }, - "required": [ - "Default" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Unit": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Unit" - ], - "additionalProperties": false - } - ] - }, - "FieldFacet": { - "type": "string", - "enum": [ - "Type", - "Minimum", - "Maximum", - "Unit", - "Direction", - "Storage", - "Default" - ] - }, - "ReviewedTypeRef": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TypeRef" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TypeRef" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedParameterDirection": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ParameterDirection" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ParameterDirection" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedFieldStorage": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/FieldStorage" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/FieldStorage" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionVecDataValue": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataValue" - } - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/DataValue" - } - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "FieldReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Type": { - "$ref": "#/components/schemas/ReviewedTypeRef" - } - }, - "required": [ - "Type" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Minimum": { - "$ref": "#/components/schemas/Reviewedu32" - } - }, - "required": [ - "Minimum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Maximum": { - "$ref": "#/components/schemas/ReviewedOptionu32" - } - }, - "required": [ - "Maximum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Unit": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Unit" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Direction": { - "$ref": "#/components/schemas/ReviewedParameterDirection" - } - }, - "required": [ - "Direction" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Storage": { - "$ref": "#/components/schemas/ReviewedFieldStorage" - } - }, - "required": [ - "Storage" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Default": { - "$ref": "#/components/schemas/ReviewedOptionVecDataValue" - } - }, - "required": [ - "Default" - ], - "additionalProperties": false - } - ] - }, - "PortFacet": { - "type": "string", - "enum": [ - "Constructor", - "ComponentKind", - "Orientation", - "LegacyDirection", - "LegacyInterface" - ] - }, - "ReviewedPortConstructor": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/PortConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/PortConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedComponentPortKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ComponentPortKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ComponentPortKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedComponentPortOrientation": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ComponentPortOrientation" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ComponentPortOrientation" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedPortDirection": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/PortDirection" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/PortDirection" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "PortReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Constructor": { - "$ref": "#/components/schemas/ReviewedPortConstructor" - } - }, - "required": [ - "Constructor" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ComponentKind": { - "$ref": "#/components/schemas/ReviewedComponentPortKind" - } - }, - "required": [ - "ComponentKind" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Orientation": { - "$ref": "#/components/schemas/ReviewedComponentPortOrientation" - } - }, - "required": [ - "Orientation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "LegacyDirection": { - "$ref": "#/components/schemas/ReviewedPortDirection" - } - }, - "required": [ - "LegacyDirection" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "LegacyInterface": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "LegacyInterface" - ], - "additionalProperties": false - } - ] - }, - "ScenarioFacet": { - "type": "string", - "enum": [ - "Viewpoint", - "Context", - "Precondition", - "Postcondition" - ] - }, - "ReviewedScenarioViewpoint": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ScenarioViewpoint" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ScenarioViewpoint" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ScenarioReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Viewpoint": { - "$ref": "#/components/schemas/ReviewedScenarioViewpoint" - } - }, - "required": [ - "Viewpoint" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Context": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Context" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Precondition": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Precondition" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Postcondition": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Postcondition" - ], - "additionalProperties": false - } - ] - }, - "LifelineFacet": { - "type": "string", - "enum": [ - "Represented" - ] - }, - "LifelineReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Represented": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Represented" - ], - "additionalProperties": false - } - ] - }, - "OccurrenceFacet": { - "type": "string", - "enum": [ - "Constructor", - "Precondition", - "Postcondition", - "Exchange", - "Sender", - "Receiver", - "MessageKind", - "TimerExpression", - "ReplyTo", - "Operation", - "Action", - "ActionLifeline", - "ControlKind", - "Sequence", - "Scenario", - "State", - "StateLifeline", - "FragmentOperator", - "BranchGuard" - ] - }, - "ReviewedOccurrenceConstructor": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/OccurrenceConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/OccurrenceConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedMessageConstructor": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/MessageConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/MessageConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedControlKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ControlKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ControlKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedFragmentOperator": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/FragmentOperator" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/FragmentOperator" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "OccurrenceReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Constructor": { - "$ref": "#/components/schemas/ReviewedOccurrenceConstructor" - } - }, - "required": [ - "Constructor" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Precondition": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Precondition" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Postcondition": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Postcondition" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Exchange": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Exchange" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Sender": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Sender" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Receiver": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Receiver" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "MessageKind": { - "$ref": "#/components/schemas/ReviewedMessageConstructor" - } - }, - "required": [ - "MessageKind" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TimerExpression": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "TimerExpression" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ReplyTo": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "ReplyTo" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Operation": { - "$ref": "#/components/schemas/ReviewedOptionOperationUse" - } - }, - "required": [ - "Operation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Action": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Action" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ActionLifeline": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "ActionLifeline" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ControlKind": { - "$ref": "#/components/schemas/ReviewedControlKind" - } - }, - "required": [ - "ControlKind" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Sequence": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Sequence" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Scenario": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "Scenario" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "State": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "State" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StateLifeline": { - "$ref": "#/components/schemas/ReviewedOptionId" - } - }, - "required": [ - "StateLifeline" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "FragmentOperator": { - "$ref": "#/components/schemas/ReviewedFragmentOperator" - } - }, - "required": [ - "FragmentOperator" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "BranchGuard": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "BranchGuard" - ], - "additionalProperties": false - } - ] - }, - "EventFacet": { - "type": "string", - "enum": [ - "Constructor", - "TimeKind", - "TimeExpression", - "ChangeExpression" - ] - }, - "ReviewedEventConstructor": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/EventConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/EventConstructor" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedTimeEventKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TimeEventKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TimeEventKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "EventReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Constructor": { - "$ref": "#/components/schemas/ReviewedEventConstructor" - } - }, - "required": [ - "Constructor" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TimeKind": { - "$ref": "#/components/schemas/ReviewedTimeEventKind" - } - }, - "required": [ - "TimeKind" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TimeExpression": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "TimeExpression" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ChangeExpression": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "ChangeExpression" - ], - "additionalProperties": false - } - ] - }, - "StateFacet": { - "type": "string", - "enum": [ - "Kind", - "Entry", - "Exit", - "DoActivity" - ] - }, - "ReviewedStateKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/StateKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/StateKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "StateReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Kind": { - "$ref": "#/components/schemas/ReviewedStateKind" - } - }, - "required": [ - "Kind" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Entry": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Entry" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Exit": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Exit" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "DoActivity": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "DoActivity" - ], - "additionalProperties": false - } - ] - }, - "ConstraintFacet": { - "type": "string", - "enum": [ - "Expression" - ] - }, - "ConstraintReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Expression": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Expression" - ], - "additionalProperties": false - } - ] - }, - "RelationFacet": { - "type": "string", - "enum": [ - "Source", - "Target", - "AllocationOrder", - "Transmission", - "Acquisition", - "SourceRole", - "TargetRole", - "SourceMinimum", - "SourceMaximum", - "TargetMinimum", - "TargetMaximum", - "SourceNavigable", - "TargetNavigable", - "SourcePort", - "TargetPort", - "Oriented", - "ExtendCondition", - "SequenceGuard", - "TransitionKind", - "Trigger", - "Guard", - "Effect", - "StateActionPhase", - "ContextOwner", - "ContextSource", - "ContextTarget", - "ContextPurpose" - ] - }, - "ReviewedId": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedTransmissionProtocol": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TransmissionProtocol" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TransmissionProtocol" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedAcquisitionProtocol": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/AcquisitionProtocol" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/AcquisitionProtocol" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "Reviewedbool": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "boolean" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "boolean" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedTransitionKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TransitionKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/TransitionKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedStateActionKind": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/StateActionKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/StateActionKind" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "RelationReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Source": { - "$ref": "#/components/schemas/ReviewedId" - } - }, - "required": [ - "Source" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Target": { - "$ref": "#/components/schemas/ReviewedId" - } - }, - "required": [ - "Target" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "AllocationOrder": { - "$ref": "#/components/schemas/Reviewedu32" - } - }, - "required": [ - "AllocationOrder" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Transmission": { - "$ref": "#/components/schemas/ReviewedTransmissionProtocol" - } - }, - "required": [ - "Transmission" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Acquisition": { - "$ref": "#/components/schemas/ReviewedAcquisitionProtocol" - } - }, - "required": [ - "Acquisition" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SourceRole": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "SourceRole" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TargetRole": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "TargetRole" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SourceMinimum": { - "$ref": "#/components/schemas/Reviewedu32" - } - }, - "required": [ - "SourceMinimum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SourceMaximum": { - "$ref": "#/components/schemas/ReviewedOptionu32" - } - }, - "required": [ - "SourceMaximum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TargetMinimum": { - "$ref": "#/components/schemas/Reviewedu32" - } - }, - "required": [ - "TargetMinimum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TargetMaximum": { - "$ref": "#/components/schemas/ReviewedOptionu32" - } - }, - "required": [ - "TargetMaximum" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SourceNavigable": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "SourceNavigable" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TargetNavigable": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "TargetNavigable" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SourcePort": { - "$ref": "#/components/schemas/ReviewedId" - } - }, - "required": [ - "SourcePort" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TargetPort": { - "$ref": "#/components/schemas/ReviewedId" - } - }, - "required": [ - "TargetPort" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Oriented": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "Oriented" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ExtendCondition": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "ExtendCondition" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "SequenceGuard": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "SequenceGuard" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "TransitionKind": { - "$ref": "#/components/schemas/ReviewedTransitionKind" - } - }, - "required": [ - "TransitionKind" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Trigger": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Trigger" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Guard": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Guard" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Effect": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Effect" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "StateActionPhase": { - "$ref": "#/components/schemas/ReviewedStateActionKind" - } - }, - "required": [ - "StateActionPhase" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ContextOwner": { - "$ref": "#/components/schemas/ReviewedId" - } - }, - "required": [ - "ContextOwner" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ContextSource": { - "$ref": "#/components/schemas/ReviewedOccurrenceEndpoint" - } - }, - "required": [ - "ContextSource" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ContextTarget": { - "$ref": "#/components/schemas/ReviewedOccurrenceEndpoint" - } - }, - "required": [ - "ContextTarget" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ContextPurpose": { - "$ref": "#/components/schemas/ReviewedContextualLinkPurpose" - } - }, - "required": [ - "ContextPurpose" - ], - "additionalProperties": false - } - ] - }, - "AnnotationKey": { - "type": "object", - "properties": { - "path": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - }, - "field": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "path", - "field" - ], - "additionalProperties": false - }, - "KeyPairId": { - "type": "object", - "properties": { - "oa": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - }, - "sa": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - } - }, - "required": [], - "additionalProperties": false - }, - "KeyPairString": { - "type": "object", - "properties": { - "oa": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "sa": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": [], - "additionalProperties": false - }, - "KeyPairAnnotationKey": { - "type": "object", - "properties": { - "oa": { - "anyOf": [ - { - "$ref": "#/components/schemas/AnnotationKey" - }, - { - "type": "null" - } - ] - }, - "sa": { - "anyOf": [ - { - "$ref": "#/components/schemas/AnnotationKey" - }, - { - "type": "null" - } - ] - } - }, - "required": [], - "additionalProperties": false - }, - "ReviewedArtifactRelation": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ArtifactRelation" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ArtifactRelation" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionString": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ArtifactReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Presence": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "Presence" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Name": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Name" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Description": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Description" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Owner": { - "$ref": "#/components/schemas/ReviewedId" - } - }, - "required": [ - "Owner" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Relation": { - "$ref": "#/components/schemas/ReviewedArtifactRelation" - } - }, - "required": [ - "Relation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Uri": { - "$ref": "#/components/schemas/ReviewedString" - } - }, - "required": [ - "Uri" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Revision": { - "$ref": "#/components/schemas/ReviewedOptionString" - } - }, - "required": [ - "Revision" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Fragment": { - "$ref": "#/components/schemas/ReviewedOptionString" - } - }, - "required": [ - "Fragment" - ], - "additionalProperties": false - } - ] - }, - "ReviewedVecId": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionMessageValue": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/MessageValue" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/MessageValue" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOptionLifelineBinding": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/LifelineBinding" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/LifelineBinding" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "FacetSelector": { - "oneOf": [ - { - "type": "object", - "properties": { - "Header": { - "$ref": "#/components/schemas/HeaderFacet" - } - }, - "required": [ - "Header" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ExchangeItem": { - "$ref": "#/components/schemas/ExchangeItemFacet" - } - }, - "required": [ - "ExchangeItem" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Category": { - "$ref": "#/components/schemas/CategoryFacet" - } - }, - "required": [ - "Category" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Interface": { - "$ref": "#/components/schemas/InterfaceFacet" - } - }, - "required": [ - "Interface" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/components/schemas/DataFacet" - } - }, - "required": [ - "Data" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Field": { - "$ref": "#/components/schemas/FieldFacet" - } - }, - "required": [ - "Field" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Port": { - "$ref": "#/components/schemas/PortFacet" - } - }, - "required": [ - "Port" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Scenario": { - "$ref": "#/components/schemas/ScenarioFacet" - } - }, - "required": [ - "Scenario" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Lifeline": { - "$ref": "#/components/schemas/LifelineFacet" - } - }, - "required": [ - "Lifeline" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Occurrence": { - "$ref": "#/components/schemas/OccurrenceFacet" - } - }, - "required": [ - "Occurrence" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Event": { - "$ref": "#/components/schemas/EventFacet" - } - }, - "required": [ - "Event" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "State": { - "$ref": "#/components/schemas/StateFacet" - } - }, - "required": [ - "State" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Constraint": { - "$ref": "#/components/schemas/ConstraintFacet" - } - }, - "required": [ - "Constraint" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Relation": { - "$ref": "#/components/schemas/RelationFacet" - } - }, - "required": [ - "Relation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Member": { - "type": "object", - "properties": { - "collection": { - "$ref": "#/components/schemas/ReferenceCollection" - }, - "keys": { - "$ref": "#/components/schemas/KeyPairId" - } - }, - "required": [ - "collection", - "keys" - ], - "additionalProperties": false - } - }, - "required": [ - "Member" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Order": { - "$ref": "#/components/schemas/OrderedCollection" - } - }, - "required": [ - "Order" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Literal": { - "$ref": "#/components/schemas/KeyPairString" - } - }, - "required": [ - "Literal" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Annotation": { - "$ref": "#/components/schemas/KeyPairAnnotationKey" - } - }, - "required": [ - "Annotation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Binding": { - "$ref": "#/components/schemas/KeyPairId" - } - }, - "required": [ - "Binding" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Child": { - "$ref": "#/components/schemas/KeyPairId" - } - }, - "required": [ - "Child" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Incident": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "end": { - "$ref": "#/components/schemas/IncidentEnd" - } - }, - "required": [ - "keys", - "end" - ], - "additionalProperties": false - } - }, - "required": [ - "Incident" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Artifact": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "facet": { - "$ref": "#/components/schemas/ArtifactFacet" - } - }, - "required": [ - "keys", - "facet" - ], - "additionalProperties": false - } - }, - "required": [ - "Artifact" - ], - "additionalProperties": false - } - ] - }, - "FacetReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Header": { - "$ref": "#/components/schemas/HeaderReview" - } - }, - "required": [ - "Header" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "ExchangeItem": { - "$ref": "#/components/schemas/ExchangeItemReview" - } - }, - "required": [ - "ExchangeItem" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Category": { - "$ref": "#/components/schemas/CategoryReview" - } - }, - "required": [ - "Category" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Interface": { - "$ref": "#/components/schemas/InterfaceReview" - } - }, - "required": [ - "Interface" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Data": { - "$ref": "#/components/schemas/DataReview" - } - }, - "required": [ - "Data" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Field": { - "$ref": "#/components/schemas/FieldReview" - } - }, - "required": [ - "Field" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Port": { - "$ref": "#/components/schemas/PortReview" - } - }, - "required": [ - "Port" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Scenario": { - "$ref": "#/components/schemas/ScenarioReview" - } - }, - "required": [ - "Scenario" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Lifeline": { - "$ref": "#/components/schemas/LifelineReview" - } - }, - "required": [ - "Lifeline" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Occurrence": { - "$ref": "#/components/schemas/OccurrenceReview" - } - }, - "required": [ - "Occurrence" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Event": { - "$ref": "#/components/schemas/EventReview" - } - }, - "required": [ - "Event" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "State": { - "$ref": "#/components/schemas/StateReview" - } - }, - "required": [ - "State" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Constraint": { - "$ref": "#/components/schemas/ConstraintReview" - } - }, - "required": [ - "Constraint" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Relation": { - "$ref": "#/components/schemas/RelationReview" - } - }, - "required": [ - "Relation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Member": { - "type": "object", - "properties": { - "collection": { - "$ref": "#/components/schemas/ReferenceCollection" - }, - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "review": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "collection", - "keys", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Member" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Order": { - "type": "object", - "properties": { - "collection": { - "$ref": "#/components/schemas/OrderedCollection" - }, - "review": { - "$ref": "#/components/schemas/ReviewedVecId" - } - }, - "required": [ - "collection", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Order" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Literal": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairString" - }, - "review": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "keys", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Literal" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Annotation": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairAnnotationKey" - }, - "review": { - "$ref": "#/components/schemas/ReviewedOptionMessageValue" - } - }, - "required": [ - "keys", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Annotation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Binding": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "review": { - "$ref": "#/components/schemas/ReviewedOptionLifelineBinding" - } - }, - "required": [ - "keys", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Binding" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Child": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "review": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "keys", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Child" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Incident": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "end": { - "$ref": "#/components/schemas/IncidentEnd" - }, - "review": { - "$ref": "#/components/schemas/Reviewedbool" - } - }, - "required": [ - "keys", - "end", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Incident" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Artifact": { - "type": "object", - "properties": { - "keys": { - "$ref": "#/components/schemas/KeyPairId" - }, - "review": { - "$ref": "#/components/schemas/ArtifactReview" - } - }, - "required": [ - "keys", - "review" - ], - "additionalProperties": false - } - }, - "required": [ - "Artifact" - ], - "additionalProperties": false - } - ] - }, - "SemanticBaseline": { - "type": "object", - "properties": { - "facets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetReview" - } - } - }, - "required": [ - "facets" - ], - "additionalProperties": false - }, - "Drift": { - "type": "string", - "enum": [ - "Unreviewed", - "Unchanged", - "OaChanged", - "SaChanged", - "BothChanged" - ] - }, - "FacetDrift": { - "type": "object", - "properties": { - "selector": { - "$ref": "#/components/schemas/FacetSelector" - }, - "current": { - "$ref": "#/components/schemas/FacetReview" - }, - "drift": { - "$ref": "#/components/schemas/Drift" - } - }, - "required": [ - "selector", - "current", - "drift" - ], - "additionalProperties": false - }, - "SemanticDrift": { - "type": "object", - "properties": { - "own": { - "$ref": "#/components/schemas/Drift" - }, - "linked": { - "$ref": "#/components/schemas/Drift" - }, - "own_unreviewed": { - "type": "boolean" - }, - "linked_unreviewed": { - "type": "boolean" - } - }, - "required": [ - "own", - "linked", - "own_unreviewed", - "linked_unreviewed" - ], - "additionalProperties": false - }, - "LinkedSemanticImpact": { - "type": "object", - "properties": { - "objects": { - "$ref": "#/components/schemas/KeyPairId" - }, - "traces": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - }, - "drift": { - "$ref": "#/components/schemas/Drift" - }, - "unreviewed": { - "type": "boolean" - } - }, - "required": [ - "objects", - "traces", - "drift", - "unreviewed" - ], - "additionalProperties": false - }, - "SemanticRecord": { - "oneOf": [ - { - "type": "object", - "properties": { - "Element": { - "$ref": "#/components/schemas/Element" - } - }, - "required": [ - "Element" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Relation": { - "$ref": "#/components/schemas/Relation" - } - }, - "required": [ - "Relation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Artifact": { - "$ref": "#/components/schemas/ArtifactLink" - } - }, - "required": [ - "Artifact" - ], - "additionalProperties": false - } - ] - }, - "ImpactRecord": { - "oneOf": [ - { - "type": "object", - "properties": { - "Element": { - "$ref": "#/components/schemas/Element" - } - }, - "required": [ - "Element" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Relation": { - "$ref": "#/components/schemas/Relation" - } - }, - "required": [ - "Relation" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Artifact": { - "$ref": "#/components/schemas/ArtifactLink" - } - }, - "required": [ - "Artifact" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Diagram": { - "$ref": "#/components/schemas/Diagram" - } - }, - "required": [ - "Diagram" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Trace": { - "$ref": "#/components/schemas/Trace" - } - }, - "required": [ - "Trace" - ], - "additionalProperties": false - } - ] - }, - "SemanticImpact": { - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/Id" - }, - "before": { - "anyOf": [ - { - "$ref": "#/components/schemas/ImpactRecord" - }, - { - "type": "null" - } - ] - }, - "after": { - "anyOf": [ - { - "$ref": "#/components/schemas/ImpactRecord" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "object" - ], - "additionalProperties": false - }, - "SemanticDecision": { - "type": "string", - "enum": [ - "KeepTarget", - "TakeSource", - "Candidate" - ] - }, - "FacetResolution": { - "type": "object", - "properties": { - "facet": { - "$ref": "#/components/schemas/FacetSelector" - }, - "decision": { - "$ref": "#/components/schemas/SemanticDecision" - } - }, - "required": [ - "facet", - "decision" - ], - "additionalProperties": false - }, - "SemanticReviewRequest": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "resolutions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetResolution" - }, - "maxItems": 5000 - }, - "reset": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetSelector" - }, - "maxItems": 5000, - "default": [] - } - }, - "required": [ - "source", - "resolutions" - ], - "additionalProperties": false - }, - "SemanticTransitionRequest": { - "type": "object", - "properties": { - "transition": { - "$ref": "#/components/schemas/TransitionRequest" - }, - "traces": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Id" - }, - "maxProperties": 100, - "default": {} - }, - "references": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Id" - }, - "maxProperties": 5000, - "default": {} - }, - "reviews": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SemanticReviewRequest" - }, - "maxItems": 100, - "default": [] - }, - "candidates": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SemanticRecord" - }, - "maxItems": 200, - "default": [] - }, - "accepted_impacts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SemanticImpact" - }, - "maxItems": 200, - "default": [] - } - }, - "required": [ - "transition" - ], - "additionalProperties": false, - "description": "Canonical OA-to-SA references include historical UUIDs. Traces map selected source IDs to trace IDs. Combined resolutions/reset limit: 5,000. Candidates must equal exactly the result of their selected facets; accepted_impacts explicitly acknowledge exact induced changes." - }, - "SemanticReviewPreview": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "target": { - "$ref": "#/components/schemas/Id" - }, - "facets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetDrift" - } - }, - "acknowledged": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetSelector" - } - }, - "retired": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetSelector" - } - }, - "linked_impacts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LinkedSemanticImpact" - } - } - }, - "required": [ - "source", - "target", - "facets", - "acknowledged", - "retired", - "linked_impacts" - ], - "additionalProperties": false - }, - "SemanticTransitionPlan": { - "type": "object", - "properties": { - "base_fingerprint": { - "type": "string" - }, - "request": { - "$ref": "#/components/schemas/SemanticTransitionRequest" - }, - "transition": { - "$ref": "#/components/schemas/TransitionPlan" - }, - "reviews": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SemanticReviewPreview" - } - }, - "impacts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SemanticImpact" - } - }, - "conflicts": { - "type": "array", - "items": { - "type": "string" - } - }, - "commands": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Command" - }, - "maxItems": 200 - }, - "prepared_fingerprint": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "base_fingerprint", - "request", - "transition", - "reviews", - "impacts", - "conflicts", - "commands" - ], - "additionalProperties": false - }, - "SemanticTransitionEnvelope": { - "type": "object", - "properties": { - "base_revision": { - "$ref": "#/components/schemas/Revision" - }, - "plan": { - "$ref": "#/components/schemas/SemanticTransitionPlan" - } - }, - "required": [ - "base_revision", - "plan" - ], - "additionalProperties": false - }, - "SemanticQueryRequest": { - "type": "object", - "properties": { - "traces": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "maxItems": 100, - "minItems": 1, - "uniqueItems": true - }, - "references": { - "type": "object", - "propertyNames": { - "format": "uuid" - }, - "additionalProperties": { - "$ref": "#/components/schemas/Id" - }, - "maxProperties": 5000, - "default": {} - }, - "revision": { - "anyOf": [ - { - "$ref": "#/components/schemas/Revision" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "traces" - ], - "additionalProperties": false - }, - "SemanticQueryItem": { - "type": "object", - "properties": { - "trace": { - "$ref": "#/components/schemas/Id" - }, - "oa": { - "$ref": "#/components/schemas/Id" - }, - "sa": { - "$ref": "#/components/schemas/Id" - }, - "facets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FacetDrift" - } - }, - "drift": { - "$ref": "#/components/schemas/SemanticDrift" - }, - "linked_impacts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LinkedSemanticImpact" - } - } - }, - "required": [ - "trace", - "oa", - "sa", - "facets", - "drift", - "linked_impacts" - ], - "additionalProperties": false - }, - "SemanticQueryResult": { - "type": "object", - "properties": { - "revision": { - "$ref": "#/components/schemas/Revision" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SemanticQueryItem" - }, - "maxItems": 100 - } - }, - "required": [ - "revision", - "items" - ], - "additionalProperties": false - }, - "ExchangeFamily": { - "type": "string", - "enum": [ - "Work", - "Participant" - ] - }, - "Coverage": { - "type": "string", - "enum": [ - "All", - "InBehavior", - "OutsideBehavior" - ] - }, - "ExchangeLabels": { - "type": "string", - "enum": [ - "Name", - "Items", - "NameAndItems" - ] - }, - "CategoryFacet": { - "type": "string", - "enum": [ - "Family" - ] - }, - "ReviewedExchangeFamily": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ExchangeFamily" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ExchangeFamily" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "CategoryReview": { - "oneOf": [ - { - "type": "object", - "properties": { - "Family": { - "$ref": "#/components/schemas/ReviewedExchangeFamily" - } - }, - "required": [ - "Family" - ], - "additionalProperties": false - } - ] - }, - "EdgeKind": { - "oneOf": [ - { - "type": "string", - "enum": [ - "Trace" - ] - }, - { - "type": "object", - "properties": { - "Relation": { - "$ref": "#/components/schemas/RelationKind" - } - }, - "required": [ - "Relation" - ], - "additionalProperties": false - } - ] - }, - "RelationKinds": { - "oneOf": [ - { - "type": "string", - "enum": [ - "All" - ] - }, - { - "type": "object", - "properties": { - "Only": { - "type": "array", - "items": { - "$ref": "#/components/schemas/EdgeKind" - } - } - }, - "required": [ - "Only" - ], - "additionalProperties": false - } - ] - }, - "CategorySelection": { - "oneOf": [ - { - "type": "string", - "enum": [ - "All" - ] - }, - { - "type": "object", - "properties": { - "Any": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - } - }, - "required": [ - "Any" - ], - "additionalProperties": false - } - ] - }, - "ContextSelection": { - "oneOf": [ - { - "type": "string", - "enum": [ - "All" - ] - }, - { - "type": "object", - "properties": { - "Any": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - } - } - }, - "required": [ - "Any" - ], - "additionalProperties": false - } - ] - }, - "ViewOptions": { - "type": "object", - "properties": { - "hidden_edges": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "default": [] - }, - "relation_kinds": { - "$ref": "#/components/schemas/RelationKinds", - "default": "All" - }, - "work_categories": { - "$ref": "#/components/schemas/CategorySelection", - "default": "All" - }, - "participant_categories": { - "$ref": "#/components/schemas/CategorySelection", - "default": "All" - }, - "coverage": { - "$ref": "#/components/schemas/Coverage", - "default": "All" - }, - "work_contexts": { - "$ref": "#/components/schemas/ContextSelection", - "default": "All" - }, - "exchange_labels": { - "$ref": "#/components/schemas/ExchangeLabels", - "default": "Name" - } - }, - "required": [], - "additionalProperties": false, - "description": "Presentation only. Independent predicates intersect; category members union within a family. Only([]) hides all relations and traces. Any([]) remains an explicit empty selection. Traceability permits both-layer hidden/category/context references; ordinary projections require the diagram layer. Filtering preserves unfiltered automatic port positions." - }, - "CommunicationPortChoice": { - "oneOf": [ - { - "type": "object", - "properties": { - "Reuse": { - "type": "object", - "properties": { - "port": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "port" - ], - "additionalProperties": false - } - }, - "required": [ - "Reuse" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Create": { - "type": "object", - "properties": { - "id": { - "$ref": "#/components/schemas/Id" - }, - "alias": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "kind": { - "$ref": "#/components/schemas/ComponentPortKind" - }, - "orientation": { - "$ref": "#/components/schemas/ComponentPortOrientation" - } - }, - "required": [ - "id", - "alias", - "name", - "description", - "kind", - "orientation" - ], - "additionalProperties": false - } - }, - "required": [ - "Create" - ], - "additionalProperties": false - } - ] - }, - "CommunicationEndpointDecision": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "source_port": { - "$ref": "#/components/schemas/CommunicationPortChoice" - }, - "target_port": { - "$ref": "#/components/schemas/CommunicationPortChoice" - } - }, - "required": [ - "source", - "source_port", - "target_port" - ], - "additionalProperties": false - }, - "ReviewedOptionOperationUse": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/OperationUse" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "anyOf": [ - { - "$ref": "#/components/schemas/OperationUse" - }, - { - "type": "null" - } - ] - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedOccurrenceEndpoint": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/OccurrenceEndpoint" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/OccurrenceEndpoint" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "ReviewedContextualLinkPurpose": { - "type": "object", - "properties": { - "oa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ContextualLinkPurpose" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - }, - "sa": { - "oneOf": [ - { - "type": "string", - "enum": [ - "NotApplicable" - ] - }, - { - "type": "object", - "properties": { - "Value": { - "$ref": "#/components/schemas/ContextualLinkPurpose" - } - }, - "required": [ - "Value" - ], - "additionalProperties": false - } - ] - } - }, - "required": [ - "oa", - "sa" - ], - "additionalProperties": false - }, - "OccurrenceEndpoint": { - "type": "object", - "properties": { - "references": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Id" - }, - "maxItems": 64 - }, - "occurrence": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "references", - "occurrence" - ], - "additionalProperties": false, - "description": "Ordered reference-occurrence IDs in an explicit caller owner, followed by the leaf contribution ID. Empty references means a direct contribution; sequence definition IDs are not path components." - }, - "ContextualLinkPurpose": { - "oneOf": [ - { - "type": "object", - "properties": { - "Precedence": { - "type": "object", - "properties": { - "guard": { - "type": "string" - } - }, - "required": [ - "guard" - ], - "additionalProperties": false - } - }, - "required": [ - "Precedence" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "Exchange": { - "type": "object", - "properties": { - "exchange": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "exchange" - ], - "additionalProperties": false - } - }, - "required": [ - "Exchange" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "CommonWork": { - "type": "object", - "properties": { - "work": { - "$ref": "#/components/schemas/Id" - } - }, - "required": [ - "work" - ], - "additionalProperties": false - } - }, - "required": [ - "CommonWork" - ], - "additionalProperties": false - } - ] - }, - "OperationUse": { - "type": "object", - "properties": { - "allocation": { - "anyOf": [ - { - "$ref": "#/components/schemas/Id" - }, - { - "type": "null" - } - ] - } - }, - "required": [], - "additionalProperties": false, - "description": "Present with absent/null allocation retains unresolved operation intent. A selected UUID identifies exactly an InterfaceItemAllocation, never an item, port, or name. Reply derives operation from its exact correlated Call." - }, - "OperationOmission": { - "type": "object", - "properties": { - "source": { - "$ref": "#/components/schemas/Id" - }, - "rationale": { - "type": "string" - } - }, - "required": [ - "source", - "rationale" - ], - "additionalProperties": false - } - } - } -} +{ + "openapi": "3.1.0", + "info": { + "title": "Arcadia Studio model API", + "version": "1.0.0", + "description": "Current schema-7 snapshots and conditional atomic writes. Request body limit: 8 MiB; at most 200 nested commands; no retained revisions, request receipts, automatic retries or persistent transition plans. See docs/api.rst. Fixed store capacity: 128 models / 256 MiB serialized envelopes. Stateless transition preview/apply. Artifact URI/revision strings remain opaque core fields. Model admission before structural validation: 5,000 graph objects, 20,000 total records and 50,000 ordered references. Preparation uses snapshots outside the catalog lock; final commits recheck the exact ETag. Each accepted envelope couples model and authored source under one revision. Source-only edits advance the shared ETag. Source bundles resolve logical paths only, preserve authored files/comments, and have a stabilized JSON cap of 8 MiB, 256 files, 32 include edges along a path and 1,024 include edges overall." + }, + "servers": [ + { + "url": "http://127.0.0.1:8787" + } + ], + "security": [ + { + "bearerAuth": [] + } + ], + "paths": { + "/health": { + "get": { + "operationId": "_health", + "summary": "Store was opened and HTTP service is responding", + "parameters": [], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "const": "ok" + } + }, + "required": [ + "status" + ], + "additionalProperties": false + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "security": [] + } + }, + "/health/live": { + "get": { + "operationId": "_health_live", + "summary": "Store was opened and HTTP service is responding", + "parameters": [], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "const": "ok" + } + }, + "required": [ + "status" + ], + "additionalProperties": false + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "security": [] + } + }, + "/health/ready": { + "get": { + "operationId": "_health_ready", + "summary": "Store was opened and HTTP service is responding", + "parameters": [], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "const": "ok" + } + }, + "required": [ + "status" + ], + "additionalProperties": false + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "security": [] + } + }, + "/openapi.json": { + "get": { + "operationId": "_openapi_json", + "summary": "OpenAPI contract", + "parameters": [], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "security": [] + } + }, + "/api/v1/openapi.json": { + "get": { + "operationId": "_api_v1_openapi_json", + "summary": "OpenAPI contract", + "parameters": [], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "security": [] + } + }, + "/api/v1/projects": { + "get": { + "operationId": "listProjects", + "summary": "List current hosted projects in UUID order", + "parameters": [ + { + "name": "limit", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100 + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "q", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectPage" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + }, + "post": { + "operationId": "createProject", + "summary": "Create and persist an empty model", + "parameters": [], + "responses": { + "201": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectSummary" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NameRequest" + } + } + } + } + } + }, + "/api/v1/projects/import": { + "post": { + "operationId": "importProject", + "summary": "Import JSON or UTF-8 Arcadia source as a new hosted resource", + "parameters": [], + "responses": { + "201": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectSummary" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "description": "Schema-7 native JSON is described below. Schema-1/2/3/4/5/6 JSON and source are accepted through explicit frozen readers and migration, also on replacement and candidate validation. Earlier versions reject later constructors, fields and semantic facets, including explicit null. Prior prose and typed reviews remain intact; absent semantic review stays Unreviewed. Export emits schema 7 / arcadia 7. See docs/language.rst." + } + }, + "/api/v1/projects/{id}": { + "get": { + "operationId": "getProject", + "summary": "Get complete current envelope", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "Return 304 when the current representation's revision matches.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StoredProject" + } + } + } + }, + "304": { + "description": "Unchanged; empty body." + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + }, + "patch": { + "operationId": "renameProject", + "summary": "Rename the project atomically", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MutationResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NameRequest" + } + } + } + } + }, + "delete": { + "operationId": "deleteProject", + "summary": "Permanently delete the current hosted envelope", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + } + }, + "/api/v1/projects/{id}/model": { + "get": { + "operationId": "getModel", + "summary": "Export native model JSON", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "Return 304 when the current representation's revision matches.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "304": { + "description": "Unchanged; empty body." + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + }, + "put": { + "operationId": "replaceModel", + "summary": "Conditionally replace model JSON", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MutationResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Project" + } + } + } + }, + "description": "Replace semantics while preserving the accepted authored source layout and comments, using common UUIDs as identity correspondence. Model and source commit together. Use source-project PUT to replace authored files." + } + }, + "/api/v1/projects/{id}/source": { + "get": { + "operationId": "getSource", + "summary": "Export canonical Arcadia source", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "Return 304 when the current representation's revision matches.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "304": { + "description": "Unchanged; empty body." + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "description": "Canonical single-file interchange view of the current model. Use source-project GET to export exact authored files and comments." + }, + "put": { + "operationId": "replaceSource", + "summary": "Conditionally replace from UTF-8 Arcadia source", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MutationResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "description": "Replace semantics from canonical single-file interchange while preserving the existing authored source bundle using common UUIDs. Submitted formatting/comments do not replace the authored workspace. Use source-project PUT for that purpose." + } + }, + "/api/v1/projects/{id}/elements": { + "get": { + "operationId": "listElements", + "summary": "Filter current elements; AND semantics", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100 + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "revision", + "in": "query", + "required": false, + "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", + "schema": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + } + }, + { + "name": "kind", + "in": "query", + "required": false, + "description": "", + "schema": { + "$ref": "#/components/schemas/Kind" + } + }, + { + "name": "layer", + "in": "query", + "required": false, + "description": "", + "schema": { + "$ref": "#/components/schemas/Layer" + } + }, + { + "name": "alias", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string" + } + }, + { + "name": "q", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ElementPage" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + } + }, + "/api/v1/projects/{id}/relations": { + "get": { + "operationId": "listRelations", + "summary": "Filter relations by typed kind and endpoints", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100 + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "revision", + "in": "query", + "required": false, + "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", + "schema": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + } + }, + { + "name": "kind", + "in": "query", + "required": false, + "description": "", + "schema": { + "$ref": "#/components/schemas/RelationKind" + } + }, + { + "name": "source", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "target", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "incident_to", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelationPage" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + } + }, + "/api/v1/projects/{id}/artifact-links": { + "get": { + "operationId": "listArtifacts", + "summary": "List model artifact links without fetching URIs", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100 + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "revision", + "in": "query", + "required": false, + "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", + "schema": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + } + }, + { + "name": "object", + "in": "query", + "required": false, + "description": "Owner ID.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ArtifactPage" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + } + }, + "/api/v1/projects/{id}/traces": { + "get": { + "operationId": "listTraces", + "summary": "List OA/SA traces", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 100 + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "revision", + "in": "query", + "required": false, + "description": "For project lists, pin current revision across pages; 409 if it changed. No historical snapshots.", + "schema": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + } + }, + { + "name": "object", + "in": "query", + "required": false, + "description": "OA or SA endpoint ID.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TracePage" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + } + }, + "/api/v1/projects/{id}/query": { + "post": { + "operationId": "queryNeighborhood", + "summary": "Bounded graph neighborhood including relation endpoint closure", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NeighborhoodResult" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NeighborhoodRequest" + } + } + } + } + } + }, + "/api/v1/projects/{id}/validation": { + "get": { + "operationId": "validateCurrent", + "summary": "Shared core validation of current snapshot", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationResult" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + } + }, + "post": { + "operationId": "validateCandidate", + "summary": "Check submitted model/source without mutation", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationResult" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValidationRequest" + } + } + } + }, + "description": "Validate native model JSON, canonical Arcadia source, or a complete source-project bundle without adoption. Source-project diagnostics refer to submitted file paths and positions. Stabilized source/model byte limits are also checked." + } + }, + "/api/v1/projects/{id}/transactions": { + "post": { + "operationId": "executeTransaction", + "summary": "Atomic shared typed commands; optional dry run", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransactionRequest" + } + } + } + }, + "description": "Command identity correspondence drives source writeback, including UUID swaps and delete/recreate operations even when final models compare equal. Dry runs return both proposed representations and validate writeback. Failure preserves the accepted pair." + } + }, + "/api/v1/projects/{id}/transitions/preview": { + "post": { + "operationId": "previewTransition", + "summary": "Preview a shared core transition without persisting a plan", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Validated result; preview may include unresolved conflicts.", + "headers": { + "ETag": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransitionEnvelope" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransitionRequest" + } + } + } + }, + "description": "Conflict-free previews also validate authored-source writeback and stabilized model/source capacities." + } + }, + "/api/v1/projects/{id}/transitions/apply": { + "post": { + "operationId": "applyTransition", + "summary": "Apply client-held transition plan against its original revision", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Validated result; preview may include unresolved conflicts.", + "headers": { + "ETag": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MutationResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransitionEnvelope" + } + } + } + } + } + }, + "/api/v1/projects/import-source-project": { + "post": { + "operationId": "importSourceProject", + "summary": "Import an authored source bundle as a new hosted resource", + "parameters": [], + "responses": { + "201": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + }, + "Location": { + "schema": { + "type": "string" + }, + "description": "Path to the created hosted resource." + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProjectSummary" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SourceBundle" + } + } + } + }, + "description": "Compile all logical source files, stabilize missing IDs, and persist the accepted model and bundle together. Importing source3 bundles never reads the service filesystem. Export the accepted bundle after import to retain inserted IDs." + } + }, + "/api/v1/projects/{id}/source-project": { + "get": { + "operationId": "getSourceProject", + "summary": "Export the exact accepted authored source bundle", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-None-Match", + "in": "header", + "required": false, + "description": "Return 304 when the current representation's revision matches.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SourceBundle" + } + } + } + }, + "304": { + "description": "Unchanged; empty body." + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "description": "Returns entry and all files with stable IDs, original comments, line endings and module layout. Shares the model ETag; comment-only changes advance that revision." + }, + "put": { + "operationId": "replaceSourceProject", + "summary": "Conditionally replace the complete authored source bundle", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "schema": { + "type": "string" + }, + "description": "Project revision validator when scoped to a project." + }, + "X-Request-ID": { + "schema": { + "type": "string", + "format": "uuid" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SourceProjectMutationResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SourceBundle" + } + } + } + }, + "description": "Compile and validate the full submitted bundle; return accepted text with missing UUIDs inserted. Model and source persist together under the exact If-Match precondition. Comment-only or file-layout edits advance revision; an exact pair no-op retains it. Rejected candidates preserve both representations." + } + }, + "/api/v1/projects/{id}/semantic-transitions/query": { + "post": { + "operationId": "querySemanticTransition", + "summary": "Query typed trace drift and linked impacts without mutation", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Validated result; preview may include unresolved conflicts.", + "headers": { + "ETag": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SemanticQueryResult" + } + } + } + }, + "default": { + "$ref": "#/components/responses/Problem" + }, + "409": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SemanticQueryRequest" + } + } + } + }, + "description": "Read one immutable snapshot. Optional revision mismatch returns409; missing trace returns404; duplicate/empty trace selection returns400. References are canonical OA-to-SA correspondence. No write, baseline refresh or external artifact fetch." + } + }, + "/api/v1/projects/{id}/semantic-transitions/preview": { + "post": { + "operationId": "previewSemanticTransition", + "summary": "Preview and source-validate a typed semantic transition without writing", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Validated result; preview may include unresolved conflicts.", + "headers": { + "ETag": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SemanticTransitionEnvelope" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SemanticTransitionRequest" + } + } + } + }, + "description": "Uses the frozen core typed semantic contract. A supplied plan is a client-owned candidate, not a signed receipt; fingerprints check consistency, not original review authorship. Preview validates source writeback when conflict-free. Apply preserves preview-generated IDs and does not replan random identities." + } + }, + "/api/v1/projects/{id}/semantic-transitions/apply": { + "post": { + "operationId": "applySemanticTransition", + "summary": "Conditionally apply a prepared semantic candidate in one model/source revision", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "description": "Hosted resource UUID; distinct from editable model ID.", + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "If-Match", + "in": "header", + "required": true, + "description": "One exact strong project ETag. Missing: 428; stale: 412. Weak/list/wildcard unsupported.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Validated result; preview may include unresolved conflicts.", + "headers": { + "ETag": { + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MutationResult" + } + } + } + }, + "412": { + "$ref": "#/components/responses/Problem" + }, + "428": { + "$ref": "#/components/responses/Problem" + }, + "default": { + "$ref": "#/components/responses/Problem" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SemanticTransitionEnvelope" + } + } + } + }, + "description": "Uses the frozen core typed semantic contract. A supplied plan is a client-owned candidate, not a signed receipt; fingerprints check consistency, not original review authorship. Preview validates source writeback when conflict-free. Apply preserves preview-generated IDs and does not replan random identities." + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "description": "Optional for unconfigured loopback; required on non-loopback." + } + }, + "responses": { + "Problem": { + "description": "Structured problem response. See code/detail and docs/api.rst status mapping.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + } + } + }, + "schemas": { + "Id": { + "type": "string", + "format": "uuid" + }, + "Revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "Layer": { + "type": "string", + "enum": [ + "Oa", + "Sa" + ] + }, + "Kind": { + "type": "string", + "enum": [ + "Entity", + "Actor", + "Role", + "Activity", + "Capability", + "OperationalMission", + "Process", + "System", + "SystemActor", + "Function", + "SystemCapability", + "Mission", + "FunctionalChain", + "ExchangeItem", + "ExchangeCategory", + "DataType", + "DataField", + "Interface", + "Port", + "Scenario", + "Lifeline", + "Occurrence", + "StateMachine", + "Region", + "State", + "Mode", + "Initial", + "Final", + "Choice", + "Junction", + "Fork", + "Join", + "ShallowHistory", + "DeepHistory", + "EntryPoint", + "ExitPoint", + "Terminate", + "Event", + "Constraint" + ] + }, + "RelationKind": { + "type": "string", + "enum": [ + "InterfaceItemAllocation", + "DataAssociation", + "Allocation", + "PortAllocation", + "Interaction", + "CapabilityInvolvement", + "ChainInvolvement", + "RoleRealization", + "RoleAssignment", + "FunctionalExchange", + "BoundaryExchange", + "CommunicationMean", + "MissionCapability", + "CapabilityInclude", + "CapabilityExtend", + "CapabilityGeneralization", + "MissionInvolvement", + "SequenceLink", + "ContextualLink", + "StateTransition", + "Availability", + "ExchangeAllocation", + "InterfaceProvision", + "InterfaceRequirement", + "StateAction" + ] + }, + "Position": { + "type": "object", + "properties": { + "x": { + "type": "number", + "minimum": -1000000, + "maximum": 1000000 + }, + "y": { + "type": "number", + "minimum": -1000000, + "maximum": 1000000 + } + }, + "required": [ + "x", + "y" + ], + "additionalProperties": false + }, + "EdgeLabel": { + "type": "object", + "description": "Authored label placement relative to the computed polyline. Both fields are required.", + "properties": { + "fraction": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Fraction of source-to-target polyline arc length." + }, + "offset": { + "$ref": "#/components/schemas/Position", + "description": "Relative diagram-space displacement." + } + }, + "required": [ + "fraction", + "offset" + ], + "additionalProperties": false + }, + "EdgeRoute": { + "type": "object", + "description": "One diagram's authored route for an existing Relation or Trace, including currently hidden edges. No separate identity. Only pinned points are stored; explicit empty routes are retained.", + "properties": { + "edge": { + "type": "string", + "format": "uuid", + "description": "Existing Relation or Trace identity, never a node placement." + }, + "waypoints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Position" + }, + "maxItems": 128, + "default": [], + "description": "Absolute diagram positions in traversal order." + }, + "label": { + "oneOf": [ + { + "$ref": "#/components/schemas/EdgeLabel" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "edge" + ], + "additionalProperties": false + }, + "Size": { + "type": "object", + "properties": { + "width": { + "type": "number", + "exclusiveMinimum": 0 + }, + "height": { + "type": "number", + "exclusiveMinimum": 0 + } + }, + "required": [ + "width", + "height" + ], + "additionalProperties": false + }, + "DataTypeDefinition": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Boolean" + ] + }, + { + "type": "object", + "properties": { + "Integer": { + "type": "object", + "properties": { + "minimum": { + "anyOf": [ + { + "type": "integer", + "format": "int64", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + }, + { + "type": "null" + } + ] + }, + "maximum": { + "anyOf": [ + { + "type": "integer", + "format": "int64", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "minimum", + "maximum" + ], + "additionalProperties": false + } + }, + "required": [ + "Integer" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Real": { + "type": "object", + "properties": { + "minimum": { + "anyOf": [ + { + "type": "number", + "format": "double", + "description": "Finite IEEE-754 binary64; no coercion from typed Integer values." + }, + { + "type": "null" + } + ] + }, + "maximum": { + "anyOf": [ + { + "type": "number", + "format": "double", + "description": "Finite IEEE-754 binary64; no coercion from typed Integer values." + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "minimum", + "maximum" + ], + "additionalProperties": false + } + }, + "required": [ + "Real" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "String": { + "type": "object", + "properties": { + "minimum_length": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "maximum_length": { + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "minimum_length", + "maximum_length" + ], + "additionalProperties": false + } + }, + "required": [ + "String" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Enumeration": { + "type": "object", + "properties": { + "literals": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "literals" + ], + "additionalProperties": false + } + }, + "required": [ + "Enumeration" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Record": { + "type": "object", + "properties": { + "supertype": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "supertype" + ], + "additionalProperties": false + } + }, + "required": [ + "Record" + ], + "additionalProperties": false + } + ] + }, + "TypeRef": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Boolean", + "Integer", + "Real", + "String" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "Named": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "Named" + ], + "additionalProperties": false + } + ] + } + ] + }, + "OccurrenceBody": { + "oneOf": [ + { + "type": "object", + "properties": { + "Exchange": { + "type": "object", + "properties": { + "exchange": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "sender": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "receiver": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "message_kind": { + "$ref": "#/components/schemas/MessageKind", + "default": "Asynchronous" + }, + "reply_to": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ], + "default": null + }, + "values": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageValue" + }, + "default": [] + }, + "operation": { + "anyOf": [ + { + "$ref": "#/components/schemas/OperationUse" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "exchange", + "sender", + "receiver" + ], + "additionalProperties": false, + "description": "Absent/null operation retains ordinary channel semantics and is omitted on output. Present operation is allowed only on SA BoundaryInterface Call/Asynchronous messages. Reply stores no operation and derives its exact Call's selection. Existing message defaults remain unchanged." + } + }, + "required": [ + "Exchange" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Action": { + "type": "object", + "properties": { + "action": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "lifeline": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "action", + "lifeline" + ], + "additionalProperties": false + } + }, + "required": [ + "Action" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "State": { + "type": "object", + "properties": { + "state": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "lifeline": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "state", + "lifeline" + ], + "additionalProperties": false + } + }, + "required": [ + "State" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Fragment": { + "type": "object", + "properties": { + "operator": { + "type": "string", + "enum": [ + "Alternative", + "Parallel", + "Loop", + "Optional" + ] + }, + "branches": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "operator", + "branches" + ], + "additionalProperties": false + } + }, + "required": [ + "Fragment" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Branch": { + "type": "object", + "properties": { + "guard": { + "type": "string" + }, + "occurrences": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "guard", + "occurrences" + ], + "additionalProperties": false + } + }, + "required": [ + "Branch" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Control": { + "type": "object", + "properties": { + "kind": { + "$ref": "#/components/schemas/ControlKind" + } + }, + "required": [ + "kind" + ], + "additionalProperties": false + } + }, + "required": [ + "Control" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SequenceReference": { + "type": "object", + "properties": { + "sequence": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "sequence" + ], + "additionalProperties": false + } + }, + "required": [ + "SequenceReference" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ScenarioUse": { + "type": "object", + "properties": { + "scenario": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "bindings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LifelineBinding" + } + } + }, + "required": [ + "scenario", + "bindings" + ], + "additionalProperties": false + } + }, + "required": [ + "ScenarioUse" + ], + "additionalProperties": false + } + ] + }, + "SharedBody": { + "oneOf": [ + { + "type": "string", + "enum": [ + "StateMachine", + "Region" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "ExchangeItem": { + "type": "object", + "properties": { + "kind": { + "$ref": "#/components/schemas/ExchangeItemKind" + }, + "mechanism": { + "$ref": "#/components/schemas/ExchangeMechanism" + }, + "supertype": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "kind", + "mechanism", + "supertype" + ], + "additionalProperties": false + } + }, + "required": [ + "ExchangeItem" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "DataType": { + "type": "object", + "properties": { + "definition": { + "$ref": "#/components/schemas/DataTypeDefinition" + }, + "default": { + "anyOf": [ + { + "$ref": "#/components/schemas/DataValue" + }, + { + "type": "null" + } + ] + }, + "unit": { + "type": "string" + } + }, + "required": [ + "definition", + "default", + "unit" + ], + "additionalProperties": false + } + }, + "required": [ + "DataType" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "DataField": { + "type": "object", + "properties": { + "type_ref": { + "$ref": "#/components/schemas/TypeRef" + }, + "minimum": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "maximum": { + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "type": "null" + } + ] + }, + "unit": { + "type": "string" + }, + "direction": { + "$ref": "#/components/schemas/ParameterDirection" + }, + "storage": { + "$ref": "#/components/schemas/FieldStorage" + }, + "default": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataValue" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "type_ref", + "minimum", + "maximum", + "unit", + "direction", + "storage", + "default" + ], + "additionalProperties": false + } + }, + "required": [ + "DataField" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Interface": { + "type": "object", + "properties": { + "supertype": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "supertype" + ], + "additionalProperties": false + } + }, + "required": [ + "Interface" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Port": { + "type": "object", + "properties": { + "contract": { + "$ref": "#/components/schemas/PortContract" + }, + "legacy": { + "anyOf": [ + { + "$ref": "#/components/schemas/LegacyPortContract" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "contract", + "legacy" + ], + "additionalProperties": false + } + }, + "required": [ + "Port" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Scenario": { + "type": "object", + "properties": { + "context": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "precondition": { + "type": "string" + }, + "postcondition": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "viewpoint": { + "$ref": "#/components/schemas/ScenarioViewpoint", + "default": "MixedLegacy", + "description": "Omitted schema-2 viewpoint retains legacy mixed lifelines. New graphical factories select OperationalActivity or Functional explicitly." + } + }, + "required": [ + "context", + "precondition", + "postcondition", + "steps" + ], + "additionalProperties": false + } + }, + "required": [ + "Scenario" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Lifeline": { + "type": "object", + "properties": { + "represented": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "represented" + ], + "additionalProperties": false + } + }, + "required": [ + "Lifeline" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Occurrence": { + "type": "object", + "properties": { + "body": { + "$ref": "#/components/schemas/OccurrenceBody" + }, + "precondition": { + "type": "string" + }, + "postcondition": { + "type": "string" + } + }, + "required": [ + "body", + "precondition", + "postcondition" + ], + "additionalProperties": false + } + }, + "required": [ + "Occurrence" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "State": { + "type": "object", + "properties": { + "kind": { + "$ref": "#/components/schemas/StateKind" + }, + "entry": { + "type": "string" + }, + "exit": { + "type": "string" + }, + "do_activity": { + "type": "string" + } + }, + "required": [ + "kind", + "entry", + "exit", + "do_activity" + ], + "additionalProperties": false + } + }, + "required": [ + "State" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Constraint": { + "type": "object", + "properties": { + "expression": { + "type": "string" + }, + "constrained": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "expression", + "constrained" + ], + "additionalProperties": false + } + }, + "required": [ + "Constraint" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Event": { + "type": "object", + "properties": { + "body": { + "$ref": "#/components/schemas/EventBody" + } + }, + "required": [ + "body" + ], + "additionalProperties": false + } + }, + "required": [ + "Event" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ExchangeCategory": { + "type": "object", + "properties": { + "family": { + "$ref": "#/components/schemas/ExchangeFamily" + }, + "exchanges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + } + }, + "required": [ + "family", + "exchanges" + ], + "additionalProperties": false + } + }, + "required": [ + "ExchangeCategory" + ], + "additionalProperties": false + } + ] + } + ] + }, + "OaBody": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Entity", + "Actor", + "Role", + "Activity", + "Capability", + "Mission" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "Process": { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "steps" + ], + "additionalProperties": false + } + }, + "required": [ + "Process" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Shared": { + "$ref": "#/components/schemas/SharedBody" + } + }, + "required": [ + "Shared" + ], + "additionalProperties": false + } + ] + } + ] + }, + "SaBody": { + "oneOf": [ + { + "type": "string", + "enum": [ + "System", + "Actor", + "Function", + "Capability", + "Mission" + ] + }, + { + "oneOf": [ + { + "type": "object", + "properties": { + "FunctionalChain": { + "type": "object", + "properties": { + "steps": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "steps" + ], + "additionalProperties": false + } + }, + "required": [ + "FunctionalChain" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Shared": { + "$ref": "#/components/schemas/SharedBody" + } + }, + "required": [ + "Shared" + ], + "additionalProperties": false + } + ] + } + ] + }, + "ElementBody": { + "oneOf": [ + { + "type": "object", + "properties": { + "Oa": { + "$ref": "#/components/schemas/OaBody" + } + }, + "required": [ + "Oa" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Sa": { + "$ref": "#/components/schemas/SaBody" + } + }, + "required": [ + "Sa" + ], + "additionalProperties": false + } + ] + }, + "Element": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "parent": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + }, + "body": { + "$ref": "#/components/schemas/ElementBody" + } + }, + "required": [ + "id", + "alias", + "name", + "description", + "parent", + "body" + ], + "additionalProperties": false + }, + "RelationBody": { + "oneOf": [ + { + "type": "object", + "properties": { + "Allocation": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "Allocation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CapabilityInvolvement": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "CapabilityInvolvement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ChainInvolvement": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "ChainInvolvement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RoleRealization": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "RoleRealization" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RoleAssignment": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "RoleAssignment" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "MissionCapability": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "MissionCapability" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Availability": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "Availability" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ExchangeAllocation": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "ExchangeAllocation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "InterfaceProvision": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "InterfaceProvision" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "InterfaceRequirement": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "InterfaceRequirement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Interaction": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "source", + "target", + "items" + ], + "additionalProperties": false + } + }, + "required": [ + "Interaction" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "BoundaryExchange": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "oriented": { + "type": "boolean", + "description": "Independent of component port kind/orientation. Old V2 exchanges migrate to true." + } + }, + "required": [ + "source", + "target", + "items", + "oriented" + ], + "additionalProperties": false + } + }, + "required": [ + "BoundaryExchange" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "FunctionalExchange": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "source_port": { + "type": "string", + "format": "uuid" + }, + "target_port": { + "type": "string", + "format": "uuid" + }, + "items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "source", + "target", + "source_port", + "target_port", + "items" + ], + "additionalProperties": false + } + }, + "required": [ + "FunctionalExchange" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "StateTransition": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "trigger": { + "type": "string" + }, + "guard": { + "type": "string" + }, + "effect": { + "type": "string" + }, + "transition_kind": { + "$ref": "#/components/schemas/TransitionKind", + "default": "External", + "description": "Omitted legacy schema-2 value is External." + }, + "triggers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "uniqueItems": true, + "description": "Same-layer Event or Activity/Function references; alternatives, not implicit conjunction.", + "default": [] + }, + "effects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "uniqueItems": true, + "description": "Same-layer Activity/Function references describing transition effects.", + "default": [] + } + }, + "required": [ + "source", + "target", + "trigger", + "guard", + "effect" + ], + "additionalProperties": false, + "description": "Existing trigger, guard and effect prose is preserved exactly. New typed properties are optional only for staged schema-2 compatibility. Removing the last typed trigger retains a descriptive unresolved-trigger placeholder instead of silently introducing completion semantics." + } + }, + "required": [ + "StateTransition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "StateAction": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "phase": { + "type": "string", + "enum": [ + "Entry", + "Do", + "Exit" + ] + } + }, + "required": [ + "source", + "target", + "phase" + ], + "additionalProperties": false + } + }, + "required": [ + "StateAction" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CapabilityInclude": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "CapabilityInclude" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CapabilityExtend": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "condition": { + "type": "string", + "description": "Engineering condition under which the extending capability adds behavior." + } + }, + "required": [ + "source", + "target", + "condition" + ], + "additionalProperties": false + } + }, + "required": [ + "CapabilityExtend" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CapabilityGeneralization": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "CapabilityGeneralization" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "MissionInvolvement": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "MissionInvolvement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SequenceLink": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "guard": { + "type": "string", + "description": "Condition for a contextual process/chain path. Choice and loop paths should use explicit conditions or else." + } + }, + "required": [ + "source", + "target", + "guard" + ], + "additionalProperties": false + } + }, + "required": [ + "SequenceLink" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "PortAllocation": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "source", + "target" + ], + "additionalProperties": false + } + }, + "required": [ + "PortAllocation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "InterfaceItemAllocation": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "order": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "transmission": { + "$ref": "#/components/schemas/TransmissionProtocol" + }, + "acquisition": { + "$ref": "#/components/schemas/AcquisitionProtocol" + } + }, + "required": [ + "source", + "target", + "order", + "transmission", + "acquisition" + ], + "additionalProperties": false + } + }, + "required": [ + "InterfaceItemAllocation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "DataAssociation": { + "type": "object", + "properties": { + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "source_role": { + "type": "string" + }, + "target_role": { + "type": "string" + }, + "source_minimum": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "source_maximum": { + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "type": "null" + } + ] + }, + "target_minimum": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "target_maximum": { + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "type": "null" + } + ] + }, + "source_navigable": { + "type": "boolean" + }, + "target_navigable": { + "type": "boolean" + } + }, + "required": [ + "source", + "target", + "source_role", + "target_role", + "source_minimum", + "source_maximum", + "target_minimum", + "target_maximum", + "source_navigable", + "target_navigable" + ], + "additionalProperties": false + } + }, + "required": [ + "DataAssociation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CommunicationMean": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "target": { + "$ref": "#/components/schemas/Id" + }, + "oriented": { + "type": "boolean" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + } + }, + "required": [ + "source", + "target", + "oriented", + "items" + ], + "additionalProperties": false + } + }, + "required": [ + "CommunicationMean" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ContextualLink": { + "type": "object", + "properties": { + "owner": { + "$ref": "#/components/schemas/Id" + }, + "source": { + "$ref": "#/components/schemas/OccurrenceEndpoint" + }, + "target": { + "$ref": "#/components/schemas/OccurrenceEndpoint" + }, + "purpose": { + "$ref": "#/components/schemas/ContextualLinkPurpose" + } + }, + "required": [ + "owner", + "source", + "target", + "purpose" + ], + "additionalProperties": false + } + }, + "required": [ + "ContextualLink" + ], + "additionalProperties": false + } + ] + }, + "Relation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "body": { + "$ref": "#/components/schemas/RelationBody" + } + }, + "required": [ + "id", + "alias", + "name", + "description", + "body" + ], + "additionalProperties": false + }, + "PortAnchorSide": { + "type": "string", + "enum": [ + "Left", + "Right", + "Top", + "Bottom" + ], + "description": "Presentation side of the owner placement; independent of semantic port direction." + }, + "PortAnchor": { + "type": "object", + "description": "Manual position of a direct child Port on one owner placement. Each port occurs at most once per placement; this record has no separate identity.", + "properties": { + "port": { + "type": "string", + "format": "uuid" + }, + "side": { + "$ref": "#/components/schemas/PortAnchorSide" + }, + "offset": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "Finite binary32 fraction of the complete owner edge, measured from top on Left/Right and from left on Top/Bottom." + } + }, + "required": [ + "port", + "side", + "offset" + ], + "additionalProperties": false + }, + "NodePlacement": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "element": { + "type": "string", + "format": "uuid" + }, + "position": { + "$ref": "#/components/schemas/Position" + }, + "size": { + "$ref": "#/components/schemas/Size" + }, + "collapsed": { + "type": "boolean" + }, + "port_anchors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PortAnchor" + }, + "default": [], + "description": "Per-placement manual port positions. Omitted and empty both select automatic positioning; empty lists are omitted on serialization. Duplicate port references are invalid." + } + }, + "required": [ + "id", + "alias", + "element", + "position", + "size", + "collapsed" + ], + "additionalProperties": false + }, + "ProjectionKind": { + "description": "Existing projections remain strings. StateMachine carries one required UUID reference to an existing StateMachine in the diagram layer (state_diagram_context). Its placements may contain only that machine and its regions/state vertices, including nested members (state_diagram_member). Empty and partial views are valid. Incompatible placements must be removed or relocated in the same transaction when changing context; accepting or reading a view does not synthesize semantic records or placements.", + "oneOf": [ + { + "type": "string", + "enum": [ + "FunctionalDataflow", + "Capabilities", + "Overview", + "Decomposition", + "Allocation", + "Traceability" + ] + }, + { + "type": "object", + "properties": { + "StateMachine": { + "type": "object", + "properties": { + "machine": { + "type": "string", + "format": "uuid", + "description": "Required identity of the same-layer StateMachine that owns this view's members." + } + }, + "required": [ + "machine" + ], + "additionalProperties": false + } + }, + "required": [ + "StateMachine" + ], + "additionalProperties": false + } + ], + "examples": [ + "Overview", + { + "StateMachine": { + "machine": "11111111-1111-4111-8111-111111111111" + } + } + ] + }, + "Diagram": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "layer": { + "$ref": "#/components/schemas/Layer" + }, + "projection": { + "$ref": "#/components/schemas/ProjectionKind" + }, + "nodes": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/NodePlacement" + } + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeRoute" + }, + "default": [], + "description": "Unique by edge identity within this diagram. Stored order is retained. Each entry counts against the total model record admission limit. Missing routes in earlier schema-3 models default to empty." + }, + "view_options": { + "$ref": "#/components/schemas/ViewOptions", + "default": {} + } + }, + "required": [ + "id", + "alias", + "name", + "description", + "layer", + "projection", + "nodes" + ], + "additionalProperties": false + }, + "ArtifactLink": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "owner": { + "type": "string", + "format": "uuid" + }, + "relation": { + "type": "string", + "enum": [ + "References", + "Satisfies", + "Verifies", + "Implements", + "DerivedFrom" + ] + }, + "uri": { + "type": "string", + "description": "Opaque external artifact reference. Server never fetches or executes it." + }, + "revision": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "fragment": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "alias", + "name", + "description", + "owner", + "relation", + "uri", + "revision", + "fragment" + ], + "additionalProperties": false + }, + "TracedProperties": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "name", + "description" + ], + "additionalProperties": false + }, + "TraceBaseline": { + "type": "object", + "properties": { + "oa": { + "$ref": "#/components/schemas/TracedProperties" + }, + "sa": { + "$ref": "#/components/schemas/TracedProperties" + }, + "semantic": { + "anyOf": [ + { + "$ref": "#/components/schemas/SemanticBaseline" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Absent/null means Unreviewed. Historical typed facts never become live graph references." + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "Trace": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "oa": { + "type": "string", + "format": "uuid" + }, + "sa": { + "type": "string", + "format": "uuid" + }, + "kind": { + "type": "string", + "enum": [ + "Refinement", + "Participant", + "Capability", + "Mission", + "Exchange", + "Sequence", + "Item", + "Scenario", + "State", + "Manual" + ] + }, + "baseline": { + "anyOf": [ + { + "$ref": "#/components/schemas/TraceBaseline" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "id", + "alias", + "name", + "description", + "oa", + "sa", + "kind", + "baseline" + ], + "additionalProperties": false + }, + "Project": { + "type": "object", + "properties": { + "schema_version": { + "type": "integer", + "const": 7 + }, + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "elements": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Element" + } + }, + "relations": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Relation" + } + }, + "diagrams": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Diagram" + } + }, + "artifact_links": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/ArtifactLink" + } + }, + "traces": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Trace" + } + } + }, + "required": [ + "schema_version", + "id", + "alias", + "name", + "description", + "elements", + "relations", + "diagrams", + "artifact_links", + "traces" + ], + "additionalProperties": false + }, + "StoredProject": { + "type": "object", + "properties": { + "resource_id": { + "type": "string", + "format": "uuid" + }, + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "model": { + "$ref": "#/components/schemas/Project" + }, + "migration": { + "anyOf": [ + { + "$ref": "#/components/schemas/MigrationReport" + }, + { + "type": "null" + } + ], + "description": "Present after legacy import/reopen; excluded from persisted envelopes. Resource identity and revision are unchanged by reopening." + }, + "source_project": { + "$ref": "#/components/schemas/SourceBundle" + } + }, + "required": [ + "resource_id", + "revision", + "model", + "source_project" + ], + "additionalProperties": false, + "description": "Accepted coupled model/source snapshot. Compiling source_project reproduces model; revision changes once if either representation changes. Older model-only or schema3 coupled envelopes migrate in memory without a write or revision change; both representations must independently migrate to the same graph." + }, + "ProjectSummary": { + "type": "object", + "properties": { + "resource_id": { + "type": "string", + "format": "uuid" + }, + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "model_id": { + "type": "string", + "format": "uuid" + }, + "schema_version": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "elements": { + "type": "integer", + "minimum": 0 + }, + "relations": { + "type": "integer", + "minimum": 0 + }, + "migration": { + "anyOf": [ + { + "$ref": "#/components/schemas/MigrationReport" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "resource_id", + "revision", + "model_id", + "schema_version", + "name", + "elements", + "relations" + ], + "additionalProperties": false + }, + "Issue": { + "type": "object", + "properties": { + "severity": { + "type": "string", + "enum": [ + "error", + "warning" + ] + }, + "message": { + "type": "string" + }, + "object_id": { + "type": "string", + "format": "uuid" + }, + "line": { + "type": "integer", + "minimum": 1 + }, + "column": { + "type": "integer", + "minimum": 1, + "description": "One-based Unicode scalar column." + }, + "code": { + "type": "string" + }, + "field": { + "type": "string" + }, + "path": { + "type": "string", + "description": "Logical source file path, when a source project supplied the diagnostic." + }, + "span": { + "$ref": "#/components/schemas/SourceSpan" + }, + "related": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SourceLocation" + } + } + }, + "required": [ + "severity", + "message", + "code" + ], + "additionalProperties": false + }, + "Problem": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "title": { + "type": "string" + }, + "status": { + "type": "integer" + }, + "code": { + "type": "string" + }, + "detail": { + "type": "string" + }, + "current_revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Issue" + } + } + }, + "required": [ + "type", + "title", + "status", + "code", + "detail" + ], + "additionalProperties": false + }, + "NameRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "Command": { + "oneOf": [ + { + "type": "object", + "properties": { + "Replace": { + "$ref": "#/components/schemas/Project" + } + }, + "required": [ + "Replace" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Batch": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Command" + } + } + }, + "required": [ + "Batch" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Add": { + "$ref": "#/components/schemas/Kind" + } + }, + "required": [ + "Add" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "AddElement": { + "type": "object", + "properties": { + "kind": { + "$ref": "#/components/schemas/Kind" + }, + "layer": { + "$ref": "#/components/schemas/Layer" + }, + "name": { + "type": "string" + }, + "parent": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "kind", + "layer", + "name", + "parent" + ], + "additionalProperties": false + } + }, + "required": [ + "AddElement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Connect": { + "type": "array", + "prefixItems": [ + { + "$ref": "#/components/schemas/RelationKind" + }, + { + "type": "string" + }, + { + "type": "string", + "format": "uuid" + }, + { + "type": "string", + "format": "uuid" + } + ], + "minItems": 4, + "maxItems": 4 + } + }, + "required": [ + "Connect" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditProject": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string", + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", + "description": "Unique persistent alias; core reserved words are forbidden." + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "id", + "alias", + "name", + "description" + ], + "additionalProperties": false + } + }, + "required": [ + "EditProject" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Reparent": { + "type": "object", + "properties": { + "element": { + "type": "string", + "format": "uuid" + }, + "parent": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "element", + "parent" + ], + "additionalProperties": false + } + }, + "required": [ + "Reparent" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Reidentify": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "string", + "format": "uuid" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "Reidentify" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Rename": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "Rename" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Describe": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "Describe" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SetAlias": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "string" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "SetAlias" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Delete": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "Delete" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "AddStep": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "string", + "format": "uuid" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "AddStep" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RemoveStep": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "integer", + "minimum": 0 + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "RemoveStep" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "MoveStep": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "integer", + "minimum": 0 + }, + { + "type": "integer", + "minimum": 0 + } + ], + "minItems": 3, + "maxItems": 3 + } + }, + "required": [ + "MoveStep" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SetSteps": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "SetSteps" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Layout": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "Layout" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CreateNode": { + "type": "object", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "node": { + "$ref": "#/components/schemas/NodePlacement" + } + }, + "required": [ + "diagram", + "node" + ], + "additionalProperties": false + } + }, + "required": [ + "CreateNode" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditNode": { + "type": "object", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "original": { + "type": "string", + "format": "uuid" + }, + "node": { + "$ref": "#/components/schemas/NodePlacement" + } + }, + "required": [ + "diagram", + "original", + "node" + ], + "additionalProperties": false + } + }, + "required": [ + "EditNode" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RelocateNode": { + "type": "object", + "description": "Move an existing placement to another diagram while preserving its UUID, alias, geometry, collapse state and dependent artifact references. The target diagram must accept the element and must not already contain its placement.", + "properties": { + "node": { + "type": "string", + "format": "uuid" + }, + "diagram": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "node", + "diagram" + ], + "additionalProperties": false + } + }, + "required": [ + "RelocateNode" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "MoveNode": { + "type": "object", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "node": { + "type": "string", + "format": "uuid" + }, + "position": { + "$ref": "#/components/schemas/Position" + }, + "with_descendants": { + "type": "boolean" + } + }, + "required": [ + "diagram", + "node", + "position", + "with_descendants" + ], + "additionalProperties": false + } + }, + "required": [ + "MoveNode" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SetEdgeRoute": { + "type": "object", + "description": "Upsert by edge identity; preserves unrelated route entries and order. Uses existing transaction validation and ETag checks.", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "route": { + "$ref": "#/components/schemas/EdgeRoute" + } + }, + "required": [ + "diagram", + "route" + ], + "additionalProperties": false + } + }, + "required": [ + "SetEdgeRoute" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RemoveEdgeRoute": { + "type": "object", + "description": "Reset to automatic routing. No-op if this existing diagram has no route for the existing edge.", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "edge": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "diagram", + "edge" + ], + "additionalProperties": false + } + }, + "required": [ + "RemoveEdgeRoute" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SetPortAnchor": { + "type": "object", + "description": "Upsert manual port position by port identity on an existing owner placement, preserving unrelated entries. Port must be a direct child of the placement's semantic element.", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "node": { + "type": "string", + "format": "uuid" + }, + "anchor": { + "$ref": "#/components/schemas/PortAnchor" + } + }, + "required": [ + "diagram", + "node", + "anchor" + ], + "additionalProperties": false + } + }, + "required": [ + "SetPortAnchor" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RemovePortAnchor": { + "type": "object", + "description": "Restore automatic positioning for an existing direct child Port. No-op when that valid owner placement has no manual anchor for the port; wrong or stale ownership is rejected.", + "properties": { + "diagram": { + "type": "string", + "format": "uuid" + }, + "node": { + "type": "string", + "format": "uuid" + }, + "port": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "diagram", + "node", + "port" + ], + "additionalProperties": false + } + }, + "required": [ + "RemovePortAnchor" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CreateElement": { + "$ref": "#/components/schemas/Element" + } + }, + "required": [ + "CreateElement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditElement": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/Element" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "EditElement" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CreateRelation": { + "$ref": "#/components/schemas/Relation" + } + }, + "required": [ + "CreateRelation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditRelation": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/Relation" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "EditRelation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CreateDiagram": { + "$ref": "#/components/schemas/Diagram" + } + }, + "required": [ + "CreateDiagram" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditDiagram": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/Diagram" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "EditDiagram" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CreateArtifact": { + "$ref": "#/components/schemas/ArtifactLink" + } + }, + "required": [ + "CreateArtifact" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditArtifact": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/ArtifactLink" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "EditArtifact" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CreateTrace": { + "$ref": "#/components/schemas/Trace" + } + }, + "required": [ + "CreateTrace" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "EditTrace": { + "type": "array", + "prefixItems": [ + { + "type": "string", + "format": "uuid" + }, + { + "$ref": "#/components/schemas/Trace" + } + ], + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "EditTrace" + ], + "additionalProperties": false + } + ] + }, + "TransactionRequest": { + "type": "object", + "properties": { + "commands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Command" + }, + "minItems": 1, + "maxItems": 200 + }, + "dry_run": { + "type": "boolean", + "default": false + } + }, + "required": [ + "commands" + ], + "additionalProperties": false + }, + "TransactionResult": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "dry_run": { + "type": "boolean" + }, + "changed": { + "type": "boolean" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Issue" + } + }, + "model": { + "$ref": "#/components/schemas/Project", + "description": "Proposed model, present only for a dry run." + }, + "source_project": { + "$ref": "#/components/schemas/SourceBundle", + "description": "Proposed accepted bundle, present only for a dry run. Source writeback is validated before returning a successful candidate." + } + }, + "required": [ + "revision", + "dry_run", + "changed", + "issues" + ], + "additionalProperties": false + }, + "MutationResult": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "changed": { + "type": "boolean" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Issue" + } + }, + "migration": { + "anyOf": [ + { + "$ref": "#/components/schemas/MigrationReport" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "changed" + ], + "additionalProperties": false + }, + "ValidationRequest": { + "oneOf": [ + { + "type": "object", + "properties": { + "format": { + "const": "json" + }, + "model": { + "$ref": "#/components/schemas/Project" + } + }, + "required": [ + "format", + "model" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "format": { + "const": "arcadia" + }, + "source": { + "type": "string" + } + }, + "required": [ + "format", + "source" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "format": { + "const": "source-project" + }, + "source_project": { + "$ref": "#/components/schemas/SourceBundle" + } + }, + "required": [ + "format", + "source_project" + ], + "additionalProperties": false + } + ] + }, + "ValidationResult": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "valid": { + "type": "boolean" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Issue" + } + }, + "migration": { + "anyOf": [ + { + "$ref": "#/components/schemas/MigrationReport" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "valid", + "issues" + ], + "additionalProperties": false + }, + "NeighborhoodRequest": { + "type": "object", + "properties": { + "roots": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "minItems": 1, + "maxItems": 100 + }, + "direction": { + "type": "string", + "enum": [ + "incoming", + "outgoing", + "both" + ], + "default": "both" + }, + "relation_kinds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RelationKind" + } + }, + "max_depth": { + "type": "integer", + "minimum": 0, + "maximum": 4, + "default": 1 + }, + "max_objects": { + "type": "integer", + "minimum": 1, + "maximum": 1000, + "default": 200 + }, + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + } + }, + "required": [ + "roots" + ], + "additionalProperties": false + }, + "NeighborhoodResult": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "elements": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Element" + } + }, + "relations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Relation" + } + }, + "truncated": { + "type": "boolean" + } + }, + "required": [ + "revision", + "elements", + "relations", + "truncated" + ], + "additionalProperties": false + }, + "ElementPage": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Element" + } + }, + "next_after": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "items", + "next_after" + ], + "additionalProperties": false + }, + "RelationPage": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Relation" + } + }, + "next_after": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "items", + "next_after" + ], + "additionalProperties": false + }, + "ArtifactPage": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ArtifactLink" + } + }, + "next_after": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "items", + "next_after" + ], + "additionalProperties": false + }, + "TracePage": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Trace" + } + }, + "next_after": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "items", + "next_after" + ], + "additionalProperties": false + }, + "ProjectPage": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProjectSummary" + } + }, + "next_after": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "items", + "next_after" + ], + "additionalProperties": false + }, + "TransitionDirection": { + "type": "string", + "enum": [ + "OaToSa", + "SaToOa" + ] + }, + "TransitionField": { + "type": "string", + "enum": [ + "Name", + "Description" + ] + }, + "TransitionMapping": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "target": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + }, + "target_kind": { + "anyOf": [ + { + "$ref": "#/components/schemas/Kind" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "source", + "target", + "target_kind" + ], + "additionalProperties": false + }, + "FieldDecision": { + "oneOf": [ + { + "type": "string", + "enum": [ + "TakeSource", + "KeepTarget" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "string" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "FieldResolution": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "field": { + "$ref": "#/components/schemas/TransitionField" + }, + "decision": { + "$ref": "#/components/schemas/FieldDecision" + } + }, + "required": [ + "source", + "field", + "decision" + ], + "additionalProperties": false + }, + "TransitionRequest": { + "type": "object", + "properties": { + "direction": { + "$ref": "#/components/schemas/TransitionDirection" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "maxItems": 100 + }, + "scope": { + "type": "string", + "enum": [ + "SelectedOnly", + "Required", + "Subtree" + ] + }, + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransitionMapping" + }, + "maxItems": 200 + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransitionField" + } + }, + "resolutions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldResolution" + }, + "maxItems": 400 + }, + "destination_diagram": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + }, + "communication_endpoints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunicationEndpointDecision" + }, + "maxItems": 200, + "default": [], + "description": "Explicit SA component-port pair per selected OA CommunicationMean. Reuse or Create only. Owners follow reviewed participant mappings; no participant-to-port substitution or automatic interface allocation." + }, + "operation_omissions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OperationOmission" + }, + "maxItems": 200, + "default": [], + "description": "Explicit SA-to-OA abstraction per selected invocation with operation intent. Nonempty rationale required by core; duplicates, irrelevant sources, and other directions are refused. Replies derive the Call abstraction. Source operation identities and values are preserved." + } + }, + "required": [ + "direction", + "sources", + "scope", + "mappings", + "fields", + "resolutions", + "destination_diagram" + ], + "additionalProperties": false + }, + "FieldChange": { + "type": "object", + "properties": { + "field": { + "$ref": "#/components/schemas/TransitionField" + }, + "before": { + "type": "string" + }, + "after": { + "type": "string" + } + }, + "required": [ + "field", + "before", + "after" + ], + "additionalProperties": false + }, + "TransitionChange": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "target": { + "$ref": "#/components/schemas/Id" + }, + "action": { + "type": "string", + "enum": [ + "Create", + "Update", + "Reuse" + ] + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldChange" + } + } + }, + "required": [ + "source", + "target", + "action", + "fields" + ], + "additionalProperties": false + }, + "TransitionConflict": { + "type": "object", + "properties": { + "source": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + }, + "target": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + }, + "field": { + "anyOf": [ + { + "$ref": "#/components/schemas/TransitionField" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + } + }, + "required": [ + "source", + "target", + "field", + "message" + ], + "additionalProperties": false + }, + "TransitionPlan": { + "type": "object", + "properties": { + "base_fingerprint": { + "type": "string" + }, + "request": { + "$ref": "#/components/schemas/TransitionRequest" + }, + "changes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransitionChange" + } + }, + "conflicts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TransitionConflict" + } + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + } + }, + "commands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Command" + } + } + }, + "required": [ + "base_fingerprint", + "request", + "changes", + "conflicts", + "warnings", + "commands" + ], + "additionalProperties": false + }, + "TransitionEnvelope": { + "type": "object", + "properties": { + "base_revision": { + "$ref": "#/components/schemas/Revision" + }, + "plan": { + "$ref": "#/components/schemas/TransitionPlan" + } + }, + "required": [ + "base_revision", + "plan" + ], + "additionalProperties": false + }, + "ControlKind": { + "type": "string", + "enum": [ + "Choice", + "Merge", + "Fork", + "Join", + "Loop" + ] + }, + "ScenarioViewpoint": { + "type": "string", + "enum": [ + "OperationalActivity", + "ParticipantInteraction", + "Functional", + "BoundaryInterface", + "MixedLegacy" + ] + }, + "MessageKind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Asynchronous", + "Call", + "Reply", + "Create", + "Delete" + ] + }, + { + "type": "object", + "properties": { + "Timer": { + "type": "object", + "properties": { + "expression": { + "type": "string" + } + }, + "required": [ + "expression" + ], + "additionalProperties": false + } + }, + "required": [ + "Timer" + ], + "additionalProperties": false + } + ] + }, + "MessageValue": { + "type": "object", + "properties": { + "path": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "default": [] + }, + "field": { + "type": "string", + "format": "uuid" + }, + "expression": { + "type": "string" + } + }, + "required": [ + "field", + "expression" + ], + "additionalProperties": false, + "description": "Identity is (path, field). Path lists enclosing DataField UUIDs, excluding the terminal field. Value storage traverses named Records; Reference storage stops traversal. Operation Call accepts In/InOut and Reply accepts Out/InOut/Return. Unspecified direction and retained ambiguous legacy empty paths warn. Expressions are descriptive, never executed." + }, + "LifelineBinding": { + "type": "object", + "properties": { + "referenced": { + "type": "string", + "format": "uuid" + }, + "local": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "referenced", + "local" + ], + "additionalProperties": false + }, + "StateKind": { + "type": "string", + "enum": [ + "State", + "Mode", + "Initial", + "Final", + "Choice", + "Junction", + "Fork", + "Join", + "ShallowHistory", + "DeepHistory", + "EntryPoint", + "ExitPoint", + "Terminate" + ] + }, + "TimeEventKind": { + "type": "string", + "enum": [ + "After", + "At" + ], + "description": "After is relative to source-state activation; At describes an absolute instant. Expressions are descriptive, not executed." + }, + "TransitionKind": { + "type": "string", + "enum": [ + "External", + "Local", + "Internal" + ] + }, + "EventBody": { + "oneOf": [ + { + "type": "object", + "properties": { + "Signal": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "uniqueItems": true, + "description": "Same-layer ExchangeItem identities carried by the signal." + } + }, + "required": [ + "items" + ], + "additionalProperties": false + } + }, + "required": [ + "Signal" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Time": { + "type": "object", + "properties": { + "kind": { + "$ref": "#/components/schemas/TimeEventKind" + }, + "expression": { + "type": "string" + } + }, + "required": [ + "kind", + "expression" + ], + "additionalProperties": false + } + }, + "required": [ + "Time" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Change": { + "type": "object", + "properties": { + "expression": { + "type": "string" + } + }, + "required": [ + "expression" + ], + "additionalProperties": false + } + }, + "required": [ + "Change" + ], + "additionalProperties": false + } + ] + }, + "PortContract": { + "oneOf": [ + { + "type": "object", + "properties": { + "FunctionInput": { + "type": "object", + "properties": { + "incoming_items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "incoming_items" + ], + "additionalProperties": false + } + }, + "required": [ + "FunctionInput" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "FunctionOutput": { + "type": "object", + "properties": { + "outgoing_items": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + }, + "required": [ + "outgoing_items" + ], + "additionalProperties": false + } + }, + "required": [ + "FunctionOutput" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Component": { + "type": "object", + "properties": { + "kind": { + "type": "string", + "enum": [ + "Standard", + "Flow" + ] + }, + "orientation": { + "type": "string", + "enum": [ + "Unset", + "In", + "Out", + "InOut" + ] + } + }, + "required": [ + "kind", + "orientation" + ], + "additionalProperties": false + } + }, + "required": [ + "Component" + ], + "additionalProperties": false + }, + { + "type": "string", + "enum": [ + "Legacy" + ] + } + ], + "description": "FunctionInput/Output are SA Function-owned item contracts. Component is SA System/SystemActor-owned; Standard requires Unset. Legacy requires a preserved legacy record and emits compatibility warnings. Mixed Standard/Flow component connections are invalid." + }, + "LegacyPortContract": { + "type": "object", + "properties": { + "direction": { + "type": "string", + "enum": [ + "In", + "Out", + "InOut" + ] + }, + "interface": { + "anyOf": [ + { + "type": "string", + "format": "uuid" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "direction", + "interface" + ], + "additionalProperties": false + }, + "MigrationReport": { + "type": "object", + "properties": { + "from_schema": { + "type": "integer", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6 + ] + }, + "to_schema": { + "type": "integer", + "const": 7 + }, + "preserved_ports": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string" + }, + "required_resolution": { + "type": "string" + } + }, + "required": [ + "id", + "alias", + "required_resolution" + ], + "additionalProperties": false + } + }, + "generated_endpoints": { + "type": "array", + "items": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "format": "uuid" + }, + "side": { + "type": "string", + "enum": [ + "source", + "target" + ] + }, + "port": { + "type": "string", + "format": "uuid" + }, + "owner": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string" + } + }, + "required": [ + "exchange", + "side", + "port", + "owner", + "alias" + ], + "additionalProperties": false + } + }, + "orientation_defaults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "exchange": { + "type": "string", + "format": "uuid" + }, + "oriented": { + "type": "boolean", + "const": true + } + }, + "required": [ + "exchange", + "oriented" + ], + "additionalProperties": false + } + }, + "required_resolutions": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "semantic_defaults": { + "type": "array", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "format": "uuid" + }, + "field": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "required": [ + "object", + "field", + "description" + ], + "additionalProperties": false + } + }, + "generated_interface_allocations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "source": { + "type": "string", + "format": "uuid" + }, + "target": { + "type": "string", + "format": "uuid" + }, + "alias": { + "type": "string" + }, + "order": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + } + }, + "required": [ + "id", + "source", + "target", + "alias", + "order" + ], + "additionalProperties": false + } + }, + "unresolved_message_values": { + "type": "array", + "items": { + "type": "object", + "properties": { + "occurrence": { + "type": "string", + "format": "uuid" + }, + "field": { + "type": "string", + "format": "uuid" + }, + "reason": { + "type": "string" + } + }, + "required": [ + "occurrence", + "field", + "reason" + ], + "additionalProperties": false + } + } + }, + "required": [ + "from_schema", + "to_schema", + "preserved_ports", + "generated_endpoints", + "orientation_defaults", + "required_resolutions" + ], + "additionalProperties": false, + "description": "Transient observations from explicit V1/V2/V3/V4/V5/V6 to V7 migration. New report lists default to empty when reading older responses. Reading an old envelope neither saves nor changes its revision. Allocation UUIDv5 uses project namespace and v2-interface-item::." + }, + "SourceBundle": { + "type": "object", + "description": "Complete source7 workspace (source3/4/5/6 migrate explicitly). The entry is a root filename. Files use canonical portable slash-separated relative .arcadia paths and all must be reachable. Includes resolve only against this map, never the service filesystem. Up to 256 files, 32 include edges along a path and 1,024 include edges overall. Serialized bundle JSON is at most 8 MiB, checked again after missing UUIDs are inserted. GET returns exact accepted stable text.", + "properties": { + "entry": { + "type": "string" + }, + "files": { + "type": "object", + "maxProperties": 256, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "entry", + "files" + ], + "additionalProperties": false + }, + "SourceSpan": { + "type": "object", + "description": "Half-open UTF-8 byte offsets [start,end) in the named source file.", + "properties": { + "start": { + "type": "integer", + "minimum": 0 + }, + "end": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "start", + "end" + ], + "additionalProperties": false + }, + "SourceLocation": { + "type": "object", + "properties": { + "path": { + "type": "string" + }, + "span": { + "$ref": "#/components/schemas/SourceSpan" + } + }, + "required": [ + "path", + "span" + ], + "additionalProperties": false + }, + "SourceProjectMutationResult": { + "type": "object", + "properties": { + "revision": { + "type": "integer", + "minimum": 1, + "description": "Current revision counter; use ETag as the opaque write validator." + }, + "changed": { + "type": "boolean" + }, + "issues": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Issue" + } + }, + "source_project": { + "$ref": "#/components/schemas/SourceBundle" + }, + "migration": { + "anyOf": [ + { + "$ref": "#/components/schemas/MigrationReport" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "revision", + "changed", + "issues", + "source_project", + "migration" + ], + "additionalProperties": false + }, + "ExchangeItemKind": { + "type": "string", + "enum": [ + "Information", + "Material", + "Energy" + ] + }, + "ExchangeMechanism": { + "type": "string", + "enum": [ + "Unspecified", + "Flow", + "Event", + "Operation", + "SharedData" + ] + }, + "ParameterDirection": { + "type": "string", + "enum": [ + "Unspecified", + "In", + "Out", + "InOut", + "Return" + ] + }, + "FieldStorage": { + "type": "string", + "enum": [ + "Value", + "Reference" + ] + }, + "TransmissionProtocol": { + "type": "string", + "enum": [ + "Unspecified", + "Synchronous", + "Asynchronous", + "Unicast", + "Multicast", + "Broadcast" + ] + }, + "AcquisitionProtocol": { + "type": "string", + "enum": [ + "Unspecified", + "Read", + "Accept" + ] + }, + "DataValue": { + "oneOf": [ + { + "type": "object", + "properties": { + "Boolean": { + "type": "boolean" + } + }, + "required": [ + "Boolean" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Integer": { + "type": "integer", + "format": "int64", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + } + }, + "required": [ + "Integer" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Real": { + "type": "number", + "format": "double", + "description": "Finite IEEE-754 binary64; no coercion from typed Integer values." + } + }, + "required": [ + "Real" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "String": { + "type": "string" + } + }, + "required": [ + "String" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Enumeration": { + "type": "string" + } + }, + "required": [ + "Enumeration" + ], + "additionalProperties": false + } + ] + }, + "DataConstructor": { + "type": "string", + "enum": [ + "Boolean", + "Integer", + "Real", + "String", + "Enumeration", + "Record" + ] + }, + "PortConstructor": { + "type": "string", + "enum": [ + "FunctionInput", + "FunctionOutput", + "Component", + "Legacy" + ] + }, + "OccurrenceConstructor": { + "type": "string", + "enum": [ + "Exchange", + "Action", + "Control", + "SequenceReference", + "ScenarioUse", + "State", + "Fragment", + "Branch" + ] + }, + "EventConstructor": { + "type": "string", + "enum": [ + "Signal", + "Time", + "Change" + ] + }, + "MessageConstructor": { + "type": "string", + "enum": [ + "Asynchronous", + "Call", + "Reply", + "Create", + "Delete", + "Timer" + ] + }, + "ReferenceCollection": { + "type": "string", + "enum": [ + "Steps", + "FragmentBranches", + "FunctionInputItems", + "FunctionOutputItems", + "SignalItems", + "ExchangeItems", + "CategoryExchanges", + "TransitionTriggers", + "TransitionEffects", + "Constrained" + ] + }, + "OrderedCollection": { + "type": "string", + "enum": [ + "Steps", + "FragmentBranches" + ] + }, + "IncidentEnd": { + "type": "string", + "enum": [ + "Source", + "Target" + ] + }, + "ArtifactFacet": { + "type": "string", + "enum": [ + "Presence", + "Name", + "Description", + "Owner", + "Relation", + "Uri", + "Revision", + "Fragment" + ] + }, + "ComponentPortKind": { + "type": "string", + "enum": [ + "Standard", + "Flow" + ] + }, + "ComponentPortOrientation": { + "type": "string", + "enum": [ + "Unset", + "In", + "Out", + "InOut" + ] + }, + "PortDirection": { + "type": "string", + "enum": [ + "In", + "Out", + "InOut" + ] + }, + "FragmentOperator": { + "type": "string", + "enum": [ + "Alternative", + "Parallel", + "Loop", + "Optional" + ] + }, + "StateActionKind": { + "type": "string", + "enum": [ + "Entry", + "Do", + "Exit" + ] + }, + "ArtifactRelation": { + "type": "string", + "enum": [ + "References", + "Satisfies", + "Verifies", + "Implements", + "DerivedFrom" + ] + }, + "HeaderFacet": { + "type": "string", + "enum": [ + "Name", + "Description", + "Parent" + ] + }, + "ReviewedString": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "string" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "string" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionId": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "HeaderReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Name": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Description": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Description" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Parent": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Parent" + ], + "additionalProperties": false + } + ] + }, + "ExchangeItemFacet": { + "type": "string", + "enum": [ + "Nature", + "Mechanism", + "Supertype" + ] + }, + "ReviewedExchangeItemKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ExchangeItemKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ExchangeItemKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedExchangeMechanism": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ExchangeMechanism" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ExchangeMechanism" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ExchangeItemReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Nature": { + "$ref": "#/components/schemas/ReviewedExchangeItemKind" + } + }, + "required": [ + "Nature" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Mechanism": { + "$ref": "#/components/schemas/ReviewedExchangeMechanism" + } + }, + "required": [ + "Mechanism" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Supertype": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Supertype" + ], + "additionalProperties": false + } + ] + }, + "InterfaceFacet": { + "type": "string", + "enum": [ + "Supertype" + ] + }, + "InterfaceReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Supertype": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Supertype" + ], + "additionalProperties": false + } + ] + }, + "DataFacet": { + "type": "string", + "enum": [ + "Constructor", + "IntegerMinimum", + "IntegerMaximum", + "RealMinimum", + "RealMaximum", + "StringMinimumLength", + "StringMaximumLength", + "RecordSupertype", + "Default", + "Unit" + ] + }, + "ReviewedDataConstructor": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/DataConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/DataConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptioni64": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "integer", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "integer", + "minimum": -9223372036854775808, + "maximum": 9223372036854775807 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionf64": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "Reviewedu32": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionu32": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionDataValue": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/DataValue" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/DataValue" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "DataReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Constructor": { + "$ref": "#/components/schemas/ReviewedDataConstructor" + } + }, + "required": [ + "Constructor" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "IntegerMinimum": { + "$ref": "#/components/schemas/ReviewedOptioni64" + } + }, + "required": [ + "IntegerMinimum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "IntegerMaximum": { + "$ref": "#/components/schemas/ReviewedOptioni64" + } + }, + "required": [ + "IntegerMaximum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RealMinimum": { + "$ref": "#/components/schemas/ReviewedOptionf64" + } + }, + "required": [ + "RealMinimum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RealMaximum": { + "$ref": "#/components/schemas/ReviewedOptionf64" + } + }, + "required": [ + "RealMaximum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "StringMinimumLength": { + "$ref": "#/components/schemas/Reviewedu32" + } + }, + "required": [ + "StringMinimumLength" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "StringMaximumLength": { + "$ref": "#/components/schemas/ReviewedOptionu32" + } + }, + "required": [ + "StringMaximumLength" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "RecordSupertype": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "RecordSupertype" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Default": { + "$ref": "#/components/schemas/ReviewedOptionDataValue" + } + }, + "required": [ + "Default" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Unit": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Unit" + ], + "additionalProperties": false + } + ] + }, + "FieldFacet": { + "type": "string", + "enum": [ + "Type", + "Minimum", + "Maximum", + "Unit", + "Direction", + "Storage", + "Default" + ] + }, + "ReviewedTypeRef": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TypeRef" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TypeRef" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedParameterDirection": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ParameterDirection" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ParameterDirection" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedFieldStorage": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/FieldStorage" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/FieldStorage" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionVecDataValue": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataValue" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/DataValue" + } + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "FieldReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Type": { + "$ref": "#/components/schemas/ReviewedTypeRef" + } + }, + "required": [ + "Type" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Minimum": { + "$ref": "#/components/schemas/Reviewedu32" + } + }, + "required": [ + "Minimum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Maximum": { + "$ref": "#/components/schemas/ReviewedOptionu32" + } + }, + "required": [ + "Maximum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Unit": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Unit" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Direction": { + "$ref": "#/components/schemas/ReviewedParameterDirection" + } + }, + "required": [ + "Direction" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Storage": { + "$ref": "#/components/schemas/ReviewedFieldStorage" + } + }, + "required": [ + "Storage" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Default": { + "$ref": "#/components/schemas/ReviewedOptionVecDataValue" + } + }, + "required": [ + "Default" + ], + "additionalProperties": false + } + ] + }, + "PortFacet": { + "type": "string", + "enum": [ + "Constructor", + "ComponentKind", + "Orientation", + "LegacyDirection", + "LegacyInterface" + ] + }, + "ReviewedPortConstructor": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/PortConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/PortConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedComponentPortKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ComponentPortKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ComponentPortKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedComponentPortOrientation": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ComponentPortOrientation" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ComponentPortOrientation" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedPortDirection": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/PortDirection" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/PortDirection" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "PortReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Constructor": { + "$ref": "#/components/schemas/ReviewedPortConstructor" + } + }, + "required": [ + "Constructor" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ComponentKind": { + "$ref": "#/components/schemas/ReviewedComponentPortKind" + } + }, + "required": [ + "ComponentKind" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Orientation": { + "$ref": "#/components/schemas/ReviewedComponentPortOrientation" + } + }, + "required": [ + "Orientation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "LegacyDirection": { + "$ref": "#/components/schemas/ReviewedPortDirection" + } + }, + "required": [ + "LegacyDirection" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "LegacyInterface": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "LegacyInterface" + ], + "additionalProperties": false + } + ] + }, + "ScenarioFacet": { + "type": "string", + "enum": [ + "Viewpoint", + "Context", + "Precondition", + "Postcondition" + ] + }, + "ReviewedScenarioViewpoint": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ScenarioViewpoint" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ScenarioViewpoint" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ScenarioReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Viewpoint": { + "$ref": "#/components/schemas/ReviewedScenarioViewpoint" + } + }, + "required": [ + "Viewpoint" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Context": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Context" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Precondition": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Precondition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Postcondition": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Postcondition" + ], + "additionalProperties": false + } + ] + }, + "LifelineFacet": { + "type": "string", + "enum": [ + "Represented" + ] + }, + "LifelineReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Represented": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Represented" + ], + "additionalProperties": false + } + ] + }, + "OccurrenceFacet": { + "type": "string", + "enum": [ + "Constructor", + "Precondition", + "Postcondition", + "Exchange", + "Sender", + "Receiver", + "MessageKind", + "TimerExpression", + "ReplyTo", + "Operation", + "Action", + "ActionLifeline", + "ControlKind", + "Sequence", + "Scenario", + "State", + "StateLifeline", + "FragmentOperator", + "BranchGuard" + ] + }, + "ReviewedOccurrenceConstructor": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/OccurrenceConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/OccurrenceConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedMessageConstructor": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/MessageConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/MessageConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedControlKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ControlKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ControlKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedFragmentOperator": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/FragmentOperator" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/FragmentOperator" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "OccurrenceReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Constructor": { + "$ref": "#/components/schemas/ReviewedOccurrenceConstructor" + } + }, + "required": [ + "Constructor" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Precondition": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Precondition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Postcondition": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Postcondition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Exchange": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Exchange" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Sender": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Sender" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Receiver": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Receiver" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "MessageKind": { + "$ref": "#/components/schemas/ReviewedMessageConstructor" + } + }, + "required": [ + "MessageKind" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TimerExpression": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "TimerExpression" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ReplyTo": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "ReplyTo" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Operation": { + "$ref": "#/components/schemas/ReviewedOptionOperationUse" + } + }, + "required": [ + "Operation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Action": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Action" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ActionLifeline": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "ActionLifeline" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ControlKind": { + "$ref": "#/components/schemas/ReviewedControlKind" + } + }, + "required": [ + "ControlKind" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Sequence": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Sequence" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Scenario": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "Scenario" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "State" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "StateLifeline": { + "$ref": "#/components/schemas/ReviewedOptionId" + } + }, + "required": [ + "StateLifeline" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "FragmentOperator": { + "$ref": "#/components/schemas/ReviewedFragmentOperator" + } + }, + "required": [ + "FragmentOperator" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "BranchGuard": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "BranchGuard" + ], + "additionalProperties": false + } + ] + }, + "EventFacet": { + "type": "string", + "enum": [ + "Constructor", + "TimeKind", + "TimeExpression", + "ChangeExpression" + ] + }, + "ReviewedEventConstructor": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/EventConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/EventConstructor" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedTimeEventKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TimeEventKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TimeEventKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "EventReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Constructor": { + "$ref": "#/components/schemas/ReviewedEventConstructor" + } + }, + "required": [ + "Constructor" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TimeKind": { + "$ref": "#/components/schemas/ReviewedTimeEventKind" + } + }, + "required": [ + "TimeKind" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TimeExpression": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "TimeExpression" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ChangeExpression": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "ChangeExpression" + ], + "additionalProperties": false + } + ] + }, + "StateFacet": { + "type": "string", + "enum": [ + "Kind", + "Entry", + "Exit", + "DoActivity" + ] + }, + "ReviewedStateKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/StateKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/StateKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "StateReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Kind": { + "$ref": "#/components/schemas/ReviewedStateKind" + } + }, + "required": [ + "Kind" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Entry": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Entry" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Exit": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Exit" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "DoActivity": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "DoActivity" + ], + "additionalProperties": false + } + ] + }, + "ConstraintFacet": { + "type": "string", + "enum": [ + "Expression" + ] + }, + "ConstraintReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Expression": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Expression" + ], + "additionalProperties": false + } + ] + }, + "RelationFacet": { + "type": "string", + "enum": [ + "Source", + "Target", + "AllocationOrder", + "Transmission", + "Acquisition", + "SourceRole", + "TargetRole", + "SourceMinimum", + "SourceMaximum", + "TargetMinimum", + "TargetMaximum", + "SourceNavigable", + "TargetNavigable", + "SourcePort", + "TargetPort", + "Oriented", + "ExtendCondition", + "SequenceGuard", + "TransitionKind", + "Trigger", + "Guard", + "Effect", + "StateActionPhase", + "ContextOwner", + "ContextSource", + "ContextTarget", + "ContextPurpose" + ] + }, + "ReviewedId": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedTransmissionProtocol": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TransmissionProtocol" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TransmissionProtocol" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedAcquisitionProtocol": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/AcquisitionProtocol" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/AcquisitionProtocol" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "Reviewedbool": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "boolean" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "boolean" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedTransitionKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TransitionKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/TransitionKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedStateActionKind": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/StateActionKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/StateActionKind" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "RelationReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Source": { + "$ref": "#/components/schemas/ReviewedId" + } + }, + "required": [ + "Source" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Target": { + "$ref": "#/components/schemas/ReviewedId" + } + }, + "required": [ + "Target" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "AllocationOrder": { + "$ref": "#/components/schemas/Reviewedu32" + } + }, + "required": [ + "AllocationOrder" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Transmission": { + "$ref": "#/components/schemas/ReviewedTransmissionProtocol" + } + }, + "required": [ + "Transmission" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Acquisition": { + "$ref": "#/components/schemas/ReviewedAcquisitionProtocol" + } + }, + "required": [ + "Acquisition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SourceRole": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "SourceRole" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TargetRole": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "TargetRole" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SourceMinimum": { + "$ref": "#/components/schemas/Reviewedu32" + } + }, + "required": [ + "SourceMinimum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SourceMaximum": { + "$ref": "#/components/schemas/ReviewedOptionu32" + } + }, + "required": [ + "SourceMaximum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TargetMinimum": { + "$ref": "#/components/schemas/Reviewedu32" + } + }, + "required": [ + "TargetMinimum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TargetMaximum": { + "$ref": "#/components/schemas/ReviewedOptionu32" + } + }, + "required": [ + "TargetMaximum" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SourceNavigable": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "SourceNavigable" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TargetNavigable": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "TargetNavigable" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SourcePort": { + "$ref": "#/components/schemas/ReviewedId" + } + }, + "required": [ + "SourcePort" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TargetPort": { + "$ref": "#/components/schemas/ReviewedId" + } + }, + "required": [ + "TargetPort" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Oriented": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "Oriented" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ExtendCondition": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "ExtendCondition" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "SequenceGuard": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "SequenceGuard" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "TransitionKind": { + "$ref": "#/components/schemas/ReviewedTransitionKind" + } + }, + "required": [ + "TransitionKind" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Trigger": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Trigger" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Guard": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Guard" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Effect": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Effect" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "StateActionPhase": { + "$ref": "#/components/schemas/ReviewedStateActionKind" + } + }, + "required": [ + "StateActionPhase" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ContextOwner": { + "$ref": "#/components/schemas/ReviewedId" + } + }, + "required": [ + "ContextOwner" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ContextSource": { + "$ref": "#/components/schemas/ReviewedOccurrenceEndpoint" + } + }, + "required": [ + "ContextSource" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ContextTarget": { + "$ref": "#/components/schemas/ReviewedOccurrenceEndpoint" + } + }, + "required": [ + "ContextTarget" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ContextPurpose": { + "$ref": "#/components/schemas/ReviewedContextualLinkPurpose" + } + }, + "required": [ + "ContextPurpose" + ], + "additionalProperties": false + } + ] + }, + "AnnotationKey": { + "type": "object", + "properties": { + "path": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + }, + "field": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "path", + "field" + ], + "additionalProperties": false + }, + "KeyPairId": { + "type": "object", + "properties": { + "oa": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + }, + "sa": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + } + }, + "required": [], + "additionalProperties": false + }, + "KeyPairString": { + "type": "object", + "properties": { + "oa": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sa": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [], + "additionalProperties": false + }, + "KeyPairAnnotationKey": { + "type": "object", + "properties": { + "oa": { + "anyOf": [ + { + "$ref": "#/components/schemas/AnnotationKey" + }, + { + "type": "null" + } + ] + }, + "sa": { + "anyOf": [ + { + "$ref": "#/components/schemas/AnnotationKey" + }, + { + "type": "null" + } + ] + } + }, + "required": [], + "additionalProperties": false + }, + "ReviewedArtifactRelation": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ArtifactRelation" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ArtifactRelation" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionString": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ArtifactReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Presence": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "Presence" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Name": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Description": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Description" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Owner": { + "$ref": "#/components/schemas/ReviewedId" + } + }, + "required": [ + "Owner" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Relation": { + "$ref": "#/components/schemas/ReviewedArtifactRelation" + } + }, + "required": [ + "Relation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Uri": { + "$ref": "#/components/schemas/ReviewedString" + } + }, + "required": [ + "Uri" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Revision": { + "$ref": "#/components/schemas/ReviewedOptionString" + } + }, + "required": [ + "Revision" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Fragment": { + "$ref": "#/components/schemas/ReviewedOptionString" + } + }, + "required": [ + "Fragment" + ], + "additionalProperties": false + } + ] + }, + "ReviewedVecId": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionMessageValue": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/MessageValue" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/MessageValue" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOptionLifelineBinding": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/LifelineBinding" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/LifelineBinding" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "FacetSelector": { + "oneOf": [ + { + "type": "object", + "properties": { + "Header": { + "$ref": "#/components/schemas/HeaderFacet" + } + }, + "required": [ + "Header" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ExchangeItem": { + "$ref": "#/components/schemas/ExchangeItemFacet" + } + }, + "required": [ + "ExchangeItem" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Category": { + "$ref": "#/components/schemas/CategoryFacet" + } + }, + "required": [ + "Category" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Interface": { + "$ref": "#/components/schemas/InterfaceFacet" + } + }, + "required": [ + "Interface" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Data": { + "$ref": "#/components/schemas/DataFacet" + } + }, + "required": [ + "Data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Field": { + "$ref": "#/components/schemas/FieldFacet" + } + }, + "required": [ + "Field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Port": { + "$ref": "#/components/schemas/PortFacet" + } + }, + "required": [ + "Port" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Scenario": { + "$ref": "#/components/schemas/ScenarioFacet" + } + }, + "required": [ + "Scenario" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Lifeline": { + "$ref": "#/components/schemas/LifelineFacet" + } + }, + "required": [ + "Lifeline" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Occurrence": { + "$ref": "#/components/schemas/OccurrenceFacet" + } + }, + "required": [ + "Occurrence" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Event": { + "$ref": "#/components/schemas/EventFacet" + } + }, + "required": [ + "Event" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/StateFacet" + } + }, + "required": [ + "State" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Constraint": { + "$ref": "#/components/schemas/ConstraintFacet" + } + }, + "required": [ + "Constraint" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Relation": { + "$ref": "#/components/schemas/RelationFacet" + } + }, + "required": [ + "Relation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Member": { + "type": "object", + "properties": { + "collection": { + "$ref": "#/components/schemas/ReferenceCollection" + }, + "keys": { + "$ref": "#/components/schemas/KeyPairId" + } + }, + "required": [ + "collection", + "keys" + ], + "additionalProperties": false + } + }, + "required": [ + "Member" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Order": { + "$ref": "#/components/schemas/OrderedCollection" + } + }, + "required": [ + "Order" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Literal": { + "$ref": "#/components/schemas/KeyPairString" + } + }, + "required": [ + "Literal" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Annotation": { + "$ref": "#/components/schemas/KeyPairAnnotationKey" + } + }, + "required": [ + "Annotation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Binding": { + "$ref": "#/components/schemas/KeyPairId" + } + }, + "required": [ + "Binding" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Child": { + "$ref": "#/components/schemas/KeyPairId" + } + }, + "required": [ + "Child" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Incident": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "end": { + "$ref": "#/components/schemas/IncidentEnd" + } + }, + "required": [ + "keys", + "end" + ], + "additionalProperties": false + } + }, + "required": [ + "Incident" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Artifact": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "facet": { + "$ref": "#/components/schemas/ArtifactFacet" + } + }, + "required": [ + "keys", + "facet" + ], + "additionalProperties": false + } + }, + "required": [ + "Artifact" + ], + "additionalProperties": false + } + ] + }, + "FacetReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Header": { + "$ref": "#/components/schemas/HeaderReview" + } + }, + "required": [ + "Header" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "ExchangeItem": { + "$ref": "#/components/schemas/ExchangeItemReview" + } + }, + "required": [ + "ExchangeItem" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Category": { + "$ref": "#/components/schemas/CategoryReview" + } + }, + "required": [ + "Category" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Interface": { + "$ref": "#/components/schemas/InterfaceReview" + } + }, + "required": [ + "Interface" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Data": { + "$ref": "#/components/schemas/DataReview" + } + }, + "required": [ + "Data" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Field": { + "$ref": "#/components/schemas/FieldReview" + } + }, + "required": [ + "Field" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Port": { + "$ref": "#/components/schemas/PortReview" + } + }, + "required": [ + "Port" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Scenario": { + "$ref": "#/components/schemas/ScenarioReview" + } + }, + "required": [ + "Scenario" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Lifeline": { + "$ref": "#/components/schemas/LifelineReview" + } + }, + "required": [ + "Lifeline" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Occurrence": { + "$ref": "#/components/schemas/OccurrenceReview" + } + }, + "required": [ + "Occurrence" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Event": { + "$ref": "#/components/schemas/EventReview" + } + }, + "required": [ + "Event" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "State": { + "$ref": "#/components/schemas/StateReview" + } + }, + "required": [ + "State" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Constraint": { + "$ref": "#/components/schemas/ConstraintReview" + } + }, + "required": [ + "Constraint" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Relation": { + "$ref": "#/components/schemas/RelationReview" + } + }, + "required": [ + "Relation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Member": { + "type": "object", + "properties": { + "collection": { + "$ref": "#/components/schemas/ReferenceCollection" + }, + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "review": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "collection", + "keys", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Member" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Order": { + "type": "object", + "properties": { + "collection": { + "$ref": "#/components/schemas/OrderedCollection" + }, + "review": { + "$ref": "#/components/schemas/ReviewedVecId" + } + }, + "required": [ + "collection", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Order" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Literal": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairString" + }, + "review": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "keys", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Literal" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Annotation": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairAnnotationKey" + }, + "review": { + "$ref": "#/components/schemas/ReviewedOptionMessageValue" + } + }, + "required": [ + "keys", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Annotation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Binding": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "review": { + "$ref": "#/components/schemas/ReviewedOptionLifelineBinding" + } + }, + "required": [ + "keys", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Binding" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Child": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "review": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "keys", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Child" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Incident": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "end": { + "$ref": "#/components/schemas/IncidentEnd" + }, + "review": { + "$ref": "#/components/schemas/Reviewedbool" + } + }, + "required": [ + "keys", + "end", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Incident" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Artifact": { + "type": "object", + "properties": { + "keys": { + "$ref": "#/components/schemas/KeyPairId" + }, + "review": { + "$ref": "#/components/schemas/ArtifactReview" + } + }, + "required": [ + "keys", + "review" + ], + "additionalProperties": false + } + }, + "required": [ + "Artifact" + ], + "additionalProperties": false + } + ] + }, + "SemanticBaseline": { + "type": "object", + "properties": { + "facets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetReview" + } + } + }, + "required": [ + "facets" + ], + "additionalProperties": false + }, + "Drift": { + "type": "string", + "enum": [ + "Unreviewed", + "Unchanged", + "OaChanged", + "SaChanged", + "BothChanged" + ] + }, + "FacetDrift": { + "type": "object", + "properties": { + "selector": { + "$ref": "#/components/schemas/FacetSelector" + }, + "current": { + "$ref": "#/components/schemas/FacetReview" + }, + "drift": { + "$ref": "#/components/schemas/Drift" + } + }, + "required": [ + "selector", + "current", + "drift" + ], + "additionalProperties": false + }, + "SemanticDrift": { + "type": "object", + "properties": { + "own": { + "$ref": "#/components/schemas/Drift" + }, + "linked": { + "$ref": "#/components/schemas/Drift" + }, + "own_unreviewed": { + "type": "boolean" + }, + "linked_unreviewed": { + "type": "boolean" + } + }, + "required": [ + "own", + "linked", + "own_unreviewed", + "linked_unreviewed" + ], + "additionalProperties": false + }, + "LinkedSemanticImpact": { + "type": "object", + "properties": { + "objects": { + "$ref": "#/components/schemas/KeyPairId" + }, + "traces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + }, + "drift": { + "$ref": "#/components/schemas/Drift" + }, + "unreviewed": { + "type": "boolean" + } + }, + "required": [ + "objects", + "traces", + "drift", + "unreviewed" + ], + "additionalProperties": false + }, + "SemanticRecord": { + "oneOf": [ + { + "type": "object", + "properties": { + "Element": { + "$ref": "#/components/schemas/Element" + } + }, + "required": [ + "Element" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Relation": { + "$ref": "#/components/schemas/Relation" + } + }, + "required": [ + "Relation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Artifact": { + "$ref": "#/components/schemas/ArtifactLink" + } + }, + "required": [ + "Artifact" + ], + "additionalProperties": false + } + ] + }, + "ImpactRecord": { + "oneOf": [ + { + "type": "object", + "properties": { + "Element": { + "$ref": "#/components/schemas/Element" + } + }, + "required": [ + "Element" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Relation": { + "$ref": "#/components/schemas/Relation" + } + }, + "required": [ + "Relation" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Artifact": { + "$ref": "#/components/schemas/ArtifactLink" + } + }, + "required": [ + "Artifact" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Diagram": { + "$ref": "#/components/schemas/Diagram" + } + }, + "required": [ + "Diagram" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Trace": { + "$ref": "#/components/schemas/Trace" + } + }, + "required": [ + "Trace" + ], + "additionalProperties": false + } + ] + }, + "SemanticImpact": { + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/Id" + }, + "before": { + "anyOf": [ + { + "$ref": "#/components/schemas/ImpactRecord" + }, + { + "type": "null" + } + ] + }, + "after": { + "anyOf": [ + { + "$ref": "#/components/schemas/ImpactRecord" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "object" + ], + "additionalProperties": false + }, + "SemanticDecision": { + "type": "string", + "enum": [ + "KeepTarget", + "TakeSource", + "Candidate" + ] + }, + "FacetResolution": { + "type": "object", + "properties": { + "facet": { + "$ref": "#/components/schemas/FacetSelector" + }, + "decision": { + "$ref": "#/components/schemas/SemanticDecision" + } + }, + "required": [ + "facet", + "decision" + ], + "additionalProperties": false + }, + "SemanticReviewRequest": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "resolutions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetResolution" + }, + "maxItems": 5000 + }, + "reset": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetSelector" + }, + "maxItems": 5000, + "default": [] + } + }, + "required": [ + "source", + "resolutions" + ], + "additionalProperties": false + }, + "SemanticTransitionRequest": { + "type": "object", + "properties": { + "transition": { + "$ref": "#/components/schemas/TransitionRequest" + }, + "traces": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Id" + }, + "maxProperties": 100, + "default": {} + }, + "references": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Id" + }, + "maxProperties": 5000, + "default": {} + }, + "reviews": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SemanticReviewRequest" + }, + "maxItems": 100, + "default": [] + }, + "candidates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SemanticRecord" + }, + "maxItems": 200, + "default": [] + }, + "accepted_impacts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SemanticImpact" + }, + "maxItems": 200, + "default": [] + } + }, + "required": [ + "transition" + ], + "additionalProperties": false, + "description": "Canonical OA-to-SA references include historical UUIDs. Traces map selected source IDs to trace IDs. Combined resolutions/reset limit: 5,000. Candidates must equal exactly the result of their selected facets; accepted_impacts explicitly acknowledge exact induced changes." + }, + "SemanticReviewPreview": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "target": { + "$ref": "#/components/schemas/Id" + }, + "facets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetDrift" + } + }, + "acknowledged": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetSelector" + } + }, + "retired": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetSelector" + } + }, + "linked_impacts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LinkedSemanticImpact" + } + } + }, + "required": [ + "source", + "target", + "facets", + "acknowledged", + "retired", + "linked_impacts" + ], + "additionalProperties": false + }, + "SemanticTransitionPlan": { + "type": "object", + "properties": { + "base_fingerprint": { + "type": "string" + }, + "request": { + "$ref": "#/components/schemas/SemanticTransitionRequest" + }, + "transition": { + "$ref": "#/components/schemas/TransitionPlan" + }, + "reviews": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SemanticReviewPreview" + } + }, + "impacts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SemanticImpact" + } + }, + "conflicts": { + "type": "array", + "items": { + "type": "string" + } + }, + "commands": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Command" + }, + "maxItems": 200 + }, + "prepared_fingerprint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "base_fingerprint", + "request", + "transition", + "reviews", + "impacts", + "conflicts", + "commands" + ], + "additionalProperties": false + }, + "SemanticTransitionEnvelope": { + "type": "object", + "properties": { + "base_revision": { + "$ref": "#/components/schemas/Revision" + }, + "plan": { + "$ref": "#/components/schemas/SemanticTransitionPlan" + } + }, + "required": [ + "base_revision", + "plan" + ], + "additionalProperties": false + }, + "SemanticQueryRequest": { + "type": "object", + "properties": { + "traces": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "maxItems": 100, + "minItems": 1, + "uniqueItems": true + }, + "references": { + "type": "object", + "propertyNames": { + "format": "uuid" + }, + "additionalProperties": { + "$ref": "#/components/schemas/Id" + }, + "maxProperties": 5000, + "default": {} + }, + "revision": { + "anyOf": [ + { + "$ref": "#/components/schemas/Revision" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "traces" + ], + "additionalProperties": false + }, + "SemanticQueryItem": { + "type": "object", + "properties": { + "trace": { + "$ref": "#/components/schemas/Id" + }, + "oa": { + "$ref": "#/components/schemas/Id" + }, + "sa": { + "$ref": "#/components/schemas/Id" + }, + "facets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacetDrift" + } + }, + "drift": { + "$ref": "#/components/schemas/SemanticDrift" + }, + "linked_impacts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LinkedSemanticImpact" + } + } + }, + "required": [ + "trace", + "oa", + "sa", + "facets", + "drift", + "linked_impacts" + ], + "additionalProperties": false + }, + "SemanticQueryResult": { + "type": "object", + "properties": { + "revision": { + "$ref": "#/components/schemas/Revision" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SemanticQueryItem" + }, + "maxItems": 100 + } + }, + "required": [ + "revision", + "items" + ], + "additionalProperties": false + }, + "ExchangeFamily": { + "type": "string", + "enum": [ + "Work", + "Participant" + ] + }, + "Coverage": { + "type": "string", + "enum": [ + "All", + "InBehavior", + "OutsideBehavior" + ] + }, + "ExchangeLabels": { + "type": "string", + "enum": [ + "Name", + "Items", + "NameAndItems" + ] + }, + "CategoryFacet": { + "type": "string", + "enum": [ + "Family" + ] + }, + "ReviewedExchangeFamily": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ExchangeFamily" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ExchangeFamily" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "CategoryReview": { + "oneOf": [ + { + "type": "object", + "properties": { + "Family": { + "$ref": "#/components/schemas/ReviewedExchangeFamily" + } + }, + "required": [ + "Family" + ], + "additionalProperties": false + } + ] + }, + "EdgeKind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Trace" + ] + }, + { + "type": "object", + "properties": { + "Relation": { + "$ref": "#/components/schemas/RelationKind" + } + }, + "required": [ + "Relation" + ], + "additionalProperties": false + } + ] + }, + "RelationKinds": { + "oneOf": [ + { + "type": "string", + "enum": [ + "All" + ] + }, + { + "type": "object", + "properties": { + "Only": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EdgeKind" + } + } + }, + "required": [ + "Only" + ], + "additionalProperties": false + } + ] + }, + "CategorySelection": { + "oneOf": [ + { + "type": "string", + "enum": [ + "All" + ] + }, + { + "type": "object", + "properties": { + "Any": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + } + }, + "required": [ + "Any" + ], + "additionalProperties": false + } + ] + }, + "ContextSelection": { + "oneOf": [ + { + "type": "string", + "enum": [ + "All" + ] + }, + { + "type": "object", + "properties": { + "Any": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + } + } + }, + "required": [ + "Any" + ], + "additionalProperties": false + } + ] + }, + "ViewOptions": { + "type": "object", + "properties": { + "hidden_edges": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "default": [] + }, + "relation_kinds": { + "$ref": "#/components/schemas/RelationKinds", + "default": "All" + }, + "work_categories": { + "$ref": "#/components/schemas/CategorySelection", + "default": "All" + }, + "participant_categories": { + "$ref": "#/components/schemas/CategorySelection", + "default": "All" + }, + "coverage": { + "$ref": "#/components/schemas/Coverage", + "default": "All" + }, + "work_contexts": { + "$ref": "#/components/schemas/ContextSelection", + "default": "All" + }, + "exchange_labels": { + "$ref": "#/components/schemas/ExchangeLabels", + "default": "Name" + } + }, + "required": [], + "additionalProperties": false, + "description": "Presentation only. Independent predicates intersect; category members union within a family. Only([]) hides all relations and traces. Any([]) remains an explicit empty selection. Traceability permits both-layer hidden/category/context references; ordinary projections require the diagram layer. Filtering preserves unfiltered automatic port positions." + }, + "CommunicationPortChoice": { + "oneOf": [ + { + "type": "object", + "properties": { + "Reuse": { + "type": "object", + "properties": { + "port": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "port" + ], + "additionalProperties": false + } + }, + "required": [ + "Reuse" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Create": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/Id" + }, + "alias": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "kind": { + "$ref": "#/components/schemas/ComponentPortKind" + }, + "orientation": { + "$ref": "#/components/schemas/ComponentPortOrientation" + } + }, + "required": [ + "id", + "alias", + "name", + "description", + "kind", + "orientation" + ], + "additionalProperties": false + } + }, + "required": [ + "Create" + ], + "additionalProperties": false + } + ] + }, + "CommunicationEndpointDecision": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "source_port": { + "$ref": "#/components/schemas/CommunicationPortChoice" + }, + "target_port": { + "$ref": "#/components/schemas/CommunicationPortChoice" + } + }, + "required": [ + "source", + "source_port", + "target_port" + ], + "additionalProperties": false + }, + "ReviewedOptionOperationUse": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/OperationUse" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "anyOf": [ + { + "$ref": "#/components/schemas/OperationUse" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedOccurrenceEndpoint": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/OccurrenceEndpoint" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/OccurrenceEndpoint" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "ReviewedContextualLinkPurpose": { + "type": "object", + "properties": { + "oa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ContextualLinkPurpose" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + }, + "sa": { + "oneOf": [ + { + "type": "string", + "enum": [ + "NotApplicable" + ] + }, + { + "type": "object", + "properties": { + "Value": { + "$ref": "#/components/schemas/ContextualLinkPurpose" + } + }, + "required": [ + "Value" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "oa", + "sa" + ], + "additionalProperties": false + }, + "OccurrenceEndpoint": { + "type": "object", + "properties": { + "references": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Id" + }, + "maxItems": 64 + }, + "occurrence": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "references", + "occurrence" + ], + "additionalProperties": false, + "description": "Ordered reference-occurrence IDs in an explicit caller owner, followed by the leaf contribution ID. Empty references means a direct contribution; sequence definition IDs are not path components." + }, + "ContextualLinkPurpose": { + "oneOf": [ + { + "type": "object", + "properties": { + "Precedence": { + "type": "object", + "properties": { + "guard": { + "type": "string" + } + }, + "required": [ + "guard" + ], + "additionalProperties": false + } + }, + "required": [ + "Precedence" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "Exchange": { + "type": "object", + "properties": { + "exchange": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "exchange" + ], + "additionalProperties": false + } + }, + "required": [ + "Exchange" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "CommonWork": { + "type": "object", + "properties": { + "work": { + "$ref": "#/components/schemas/Id" + } + }, + "required": [ + "work" + ], + "additionalProperties": false + } + }, + "required": [ + "CommonWork" + ], + "additionalProperties": false + } + ] + }, + "OperationUse": { + "type": "object", + "properties": { + "allocation": { + "anyOf": [ + { + "$ref": "#/components/schemas/Id" + }, + { + "type": "null" + } + ] + } + }, + "required": [], + "additionalProperties": false, + "description": "Present with absent/null allocation retains unresolved operation intent. A selected UUID identifies exactly an InterfaceItemAllocation, never an item, port, or name. Reply derives operation from its exact correlated Call." + }, + "OperationOmission": { + "type": "object", + "properties": { + "source": { + "$ref": "#/components/schemas/Id" + }, + "rationale": { + "type": "string" + } + }, + "required": [ + "source", + "rationale" + ], + "additionalProperties": false + } + } + } +}