ocs_doc_api: Phase 3-ii — typed AttributeDefinition create (Phase 3 complete)

- CreateAttributeDefinition(AttributeDefinitionSpec) op (append-only).
- backend add_attribute_definition (ATTDEF tag/prompt/default/insertion/height/rotation).
- facade create_attribute_definition; entity_kind_name AttributeDefinition/AttributeEntity.
- spec AttributeDefinition family; api_reference + binding_schema regenerated; mocks + baseline.
- Test phase3ii_create_attribute_definition -> 614 host lib + 3 consistency green.
This commit is contained in:
Sebastian committed 2026-09-06 12:43:34 +02:00
1 parent 8d8c120880
commit f8ae54a351
14 files changed
+128 -3

No files matched your search

@@ -200,6 +200,12 @@ impl DocApiBackend for MockBackend {
fn dimension_measurement(&self, id: ObjectId) -> ApiResult<f64> {
self.dimension_measurements.get(&id).copied().ok_or(ApiError::UnknownId(id))
}
fn add_attribute_definition(&mut self, spec: &ocs_doc_api::ops::AttributeDefinitionSpec) -> ApiResult<ObjectId> {
if spec.tag.is_empty() {
return Err(ApiError::validation("CreateAttributeDefinition", "empty tag"));
}
Ok(self.alloc("AttributeDefinition"))
}
fn set_attribute(&mut self, id: ObjectId, tag: &str, value: &str) -> ApiResult<()> {
if !self.entity_exists(id) {
return Err(ApiError::UnknownId(id));