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
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:
@@ -6,6 +6,20 @@ use super::*;
|
||||
mod diagnostic_tests;
|
||||
|
||||
type Slot = (Id, FacetSelector);
|
||||
fn context_leaf_path(project: &Project, slot: &Slot) -> Option<&'static str> {
|
||||
if project.relations.get(&slot.0)?.kind() != RelationKind::ContextualLink {
|
||||
return None;
|
||||
}
|
||||
match slot.1 {
|
||||
FacetSelector::Relation(RelationFacet::Source) => {
|
||||
Some("/body/ContextualLink/source/occurrence")
|
||||
}
|
||||
FacetSelector::Relation(RelationFacet::Target) => {
|
||||
Some("/body/ContextualLink/target/occurrence")
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
struct Intent {
|
||||
value: Value,
|
||||
row: RowAddress,
|
||||
@@ -47,6 +61,13 @@ fn canonical(facet: &FacetSelector, layer: Layer) -> Option<FacetSelector> {
|
||||
})
|
||||
}
|
||||
fn observe(project: &Project, slot: &Slot) -> Result<Value, String> {
|
||||
if let Some(path) = context_leaf_path(project, slot) {
|
||||
let value = record_value(project, slot.0)?
|
||||
.pointer(path)
|
||||
.cloned()
|
||||
.ok_or("Qualified endpoint leaf is absent.")?;
|
||||
return Ok(serde_json::json!({"Value":value}));
|
||||
}
|
||||
if let Some((_, facet)) = artifacts::parts(&slot.1) {
|
||||
return Ok(artifacts::observation(
|
||||
project.artifact_links.get(&slot.0),
|
||||
@@ -297,10 +318,9 @@ fn write_slot(project: &mut Project, slot: &Slot, observation: &Value) -> Result
|
||||
serde_json::to_value(order).expect("Order");
|
||||
} else {
|
||||
let path = scalar::binding(project, slot.0, &slot.1)
|
||||
.or_else(|| context_leaf_path(project, slot).map(str::to_owned))
|
||||
.ok_or("A selected property was retired by another row's constructor proposal.")?;
|
||||
*value
|
||||
.pointer_mut(&path)
|
||||
.ok_or("Selected property is no longer available.")? = supplied;
|
||||
crate::forms::set_shape_value(&mut value, &path, supplied)?;
|
||||
}
|
||||
install(project, slot.0, value)
|
||||
}
|
||||
@@ -325,6 +345,22 @@ pub(super) fn request(state: &State) -> Result<SemanticTransitionRequest, String
|
||||
})
|
||||
.collect();
|
||||
let mut request = SemanticTransitionRequest::new(transition);
|
||||
let mut omissions = BTreeMap::new();
|
||||
for address in &addresses {
|
||||
if let Some(raw) = state
|
||||
.row(*address)
|
||||
.and_then(|row| row.operation_omission.as_ref())
|
||||
&& omissions
|
||||
.insert(address.source, raw.clone())
|
||||
.is_some_and(|prior| prior != *raw)
|
||||
{
|
||||
return Err("Rows reviewing the same operation disagree on the explicit omission rationale. Retain one consistent decision before Apply.".into());
|
||||
}
|
||||
}
|
||||
request.transition.operation_omissions = omissions
|
||||
.into_iter()
|
||||
.map(|(source, rationale)| OperationOmission { source, rationale })
|
||||
.collect();
|
||||
request.references = references.clone();
|
||||
request.accepted_impacts = state.accepted_impacts.clone();
|
||||
let mut slots = BTreeMap::new();
|
||||
@@ -435,6 +471,32 @@ pub(super) fn request(state: &State) -> Result<SemanticTransitionRequest, String
|
||||
observe(&proposed, &slot)?
|
||||
};
|
||||
agree(state, &mut slots, slot.clone(), observed, address, facet)?;
|
||||
if matches!(
|
||||
facet,
|
||||
FacetSelector::Relation(
|
||||
RelationFacet::ContextSource | RelationFacet::ContextTarget
|
||||
)
|
||||
) {
|
||||
let leaf = (
|
||||
address.target,
|
||||
FacetSelector::Relation(
|
||||
if matches!(facet, FacetSelector::Relation(RelationFacet::ContextSource)) {
|
||||
RelationFacet::Source
|
||||
} else {
|
||||
RelationFacet::Target
|
||||
},
|
||||
),
|
||||
);
|
||||
let observed = observe(
|
||||
if *decision == SemanticDecision::KeepTarget {
|
||||
base
|
||||
} else {
|
||||
&proposed
|
||||
},
|
||||
&leaf,
|
||||
)?;
|
||||
agree(state, &mut slots, leaf, observed, address, facet)?;
|
||||
}
|
||||
let first_equal = row.can_acknowledge_constructor(base, facet)
|
||||
&& (*decision != SemanticDecision::Candidate
|
||||
|| observe(base, &slot)? == observe(&proposed, &slot)?);
|
||||
|
||||
Reference in New Issue
Block a user