Checkpoint source 7 workflows and in-progress diagram authoring redesign
Rust checks / check (ubuntu-latest) (push) Canceled after 0s
Rust checks / check (windows-latest) (push) Canceled after 0s

Preserve current core, source, REST, desktop, recovery, documentation and validation work, including AGENTS.md and the development summary. This is a work-in-progress checkpoint: the new compact palette has outstanding compilation errors and native acceptance; earlier passing gates retain their documented scope.
This commit is contained in:
Codex
2026-09-10 10:06:55 -07:00
parent 4b6b5fc197
commit e2ecfea69b
162 changed files with 17595 additions and 926 deletions
+69 -3
View File
@@ -6,7 +6,7 @@ use std::{
use uuid::Uuid;
pub type Id = Uuid;
pub const SCHEMA_VERSION: u32 = 6;
pub const SCHEMA_VERSION: u32 = 7;
pub const MAX_COORDINATE: f32 = 1_000_000.;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
@@ -523,6 +523,28 @@ pub struct MessageValue {
pub field: Id,
pub expression: String,
}
/// Explicit operation intent. A missing allocation remains an unfinished operation,
/// whereas an absent OperationUse retains ordinary channel-message semantics.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct OperationUse {
pub allocation: Option<Id>,
}
/// A contribution in a caller instance. Paths contain reference occurrence IDs,
/// never sequence definitions; repeated references therefore remain distinct.
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct OccurrenceEndpoint {
pub references: Vec<Id>,
pub occurrence: Id,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub enum ContextualLinkPurpose {
Precedence { guard: String },
Exchange { exchange: Id },
CommonWork { work: Id },
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
pub enum OccurrenceBody {
@@ -536,6 +558,8 @@ pub enum OccurrenceBody {
reply_to: Option<Id>,
#[serde(default)]
values: Vec<MessageValue>,
#[serde(default, skip_serializing_if = "Option::is_none")]
operation: Option<OperationUse>,
},
Action {
action: Option<Id>,
@@ -797,6 +821,7 @@ impl ElementBody {
message_kind: MessageKind::Asynchronous,
reply_to: None,
values: vec![],
operation: None,
},
precondition: String::new(),
postcondition: String::new(),
@@ -863,6 +888,7 @@ pub enum RelationKind {
CapabilityGeneralization,
MissionInvolvement,
SequenceLink,
ContextualLink,
StateTransition,
Availability,
ExchangeAllocation,
@@ -871,7 +897,7 @@ pub enum RelationKind {
StateAction,
}
impl RelationKind {
pub const ALL: [Self; 24] = [
pub const ALL: [Self; 25] = [
Self::InterfaceItemAllocation,
Self::DataAssociation,
Self::Allocation,
@@ -890,6 +916,7 @@ impl RelationKind {
Self::CapabilityGeneralization,
Self::MissionInvolvement,
Self::SequenceLink,
Self::ContextualLink,
Self::StateTransition,
Self::Availability,
Self::ExchangeAllocation,
@@ -937,7 +964,9 @@ impl RelationKind {
(Kind::Entity | Kind::Actor, Kind::OperationalMission)
| (Kind::System | Kind::SystemActor, Kind::Mission)
),
Self::SequenceLink => from == Kind::Occurrence && to == Kind::Occurrence,
Self::SequenceLink | Self::ContextualLink => {
from == Kind::Occurrence && to == Kind::Occurrence
}
Self::StateTransition => from.is_state() && to.is_state(),
Self::ExchangeAllocation => false,
Self::InterfaceProvision | Self::InterfaceRequirement => {
@@ -980,6 +1009,9 @@ impl RelationKind {
Self::CapabilityGeneralization => "Specific capability → general capability",
Self::MissionInvolvement => "Participant → mission in the same perspective",
Self::SequenceLink => "Preceding → following contribution in the same process or chain",
Self::ContextualLink => {
"Contributions addressed in an explicit process or chain caller"
}
Self::StateTransition => "State → state in one machine",
Self::ExchangeAllocation => {
"Communication means / boundary exchange → operational interaction / functional exchange"
@@ -1012,6 +1044,7 @@ impl fmt::Display for RelationKind {
Self::CapabilityGeneralization => "Capability generalization",
Self::MissionInvolvement => "Mission involvement",
Self::SequenceLink => "Sequence link",
Self::ContextualLink => "Contextual link",
Self::StateTransition => "State transition",
Self::ExchangeAllocation => "Exchange allocation",
Self::InterfaceProvision => "Interface provision",
@@ -1126,6 +1159,12 @@ pub enum RelationBody {
target: Id,
guard: String,
},
ContextualLink {
owner: Id,
source: OccurrenceEndpoint,
target: OccurrenceEndpoint,
purpose: ContextualLinkPurpose,
},
StateTransition {
source: Id,
target: Id,
@@ -1162,6 +1201,13 @@ pub enum RelationBody {
},
}
impl Relation {
/// Caller ownership cannot be inferred from a contextual link's leaf IDs.
pub fn contextual_owner(&self) -> Option<Id> {
match self.body {
RelationBody::ContextualLink { owner, .. } => Some(owner),
_ => None,
}
}
pub fn kind(&self) -> RelationKind {
self.body.kind()
}
@@ -1193,6 +1239,7 @@ impl RelationBody {
Self::CapabilityGeneralization { .. } => RelationKind::CapabilityGeneralization,
Self::MissionInvolvement { .. } => RelationKind::MissionInvolvement,
Self::SequenceLink { .. } => RelationKind::SequenceLink,
Self::ContextualLink { .. } => RelationKind::ContextualLink,
Self::StateTransition { .. } => RelationKind::StateTransition,
Self::ExchangeAllocation { .. } => RelationKind::ExchangeAllocation,
Self::InterfaceProvision { .. } => RelationKind::InterfaceProvision,
@@ -1203,6 +1250,7 @@ impl RelationBody {
}
pub fn endpoints(&self) -> (Id, Id) {
match self {
Self::ContextualLink { source, target, .. } => (source.occurrence, target.occurrence),
Self::InterfaceItemAllocation { source, target, .. }
| Self::DataAssociation { source, target, .. }
| Self::Allocation { source, target }
@@ -1231,6 +1279,10 @@ impl RelationBody {
}
pub fn set_endpoints(&mut self, a: Id, b: Id) {
match self {
Self::ContextualLink { source, target, .. } => {
source.occurrence = a;
target.occurrence = b;
}
Self::InterfaceItemAllocation { source, target, .. }
| Self::DataAssociation { source, target, .. }
| Self::Allocation { source, target }
@@ -1337,6 +1389,20 @@ impl RelationBody {
target,
guard: String::new(),
},
RelationKind::ContextualLink => Self::ContextualLink {
owner: Id::nil(),
source: OccurrenceEndpoint {
references: vec![],
occurrence: source,
},
target: OccurrenceEndpoint {
references: vec![],
occurrence: target,
},
purpose: ContextualLinkPurpose::Precedence {
guard: String::new(),
},
},
RelationKind::StateTransition => Self::StateTransition {
source,
target,