Skip to content

IDS 1.0 writer and producer constructors (0.1.4) - #12

Merged
GeneralPawz merged 1 commit into
mainfrom
feat/ids-writer
Sep 30, 2026
Merged

GeneralPawz merged 1 commit into
mainfrom
feat/ids-writer

Conversation

@GeneralPawz

Copy link
Copy Markdown
Contributor

Closes #10.

What

  • to_string / to_writer write the typed model as IDS 1.0: IDS/xs/xsi namespaces and the 1.0 xsi:schemaLocation, XSD element order, simpleValue vs xs:restriction as the Value holds them, @cardinality on every requirement facet, optional elements omitted when None.
  • Refusals with a typed WriteError + model path (e.g. specifications[0]/requirements/facets[2]/@dataType): non-1.0/conflicting version, no specifications, no IFC release, empty or out-of-order applicability, xs:restriction without facets or with unknown base, non-required entity requirement, optional partOf, @uri where not allowed, invalid dataType/author/date, characters XML 1.0 cannot carry. to_writer writes nothing for a refused model.
  • Producer constructors: Ids::new (declares 1.0, no fake Detected evidence), Info::new, Specification::new (optional applicability) + require, Applicability::set_occurrence, Requirement::new/with_occurrence, facet news, Restriction::enumeration/pattern, From into Value/Facet/Requirement.
  • Version 0.1.4 (additive API).

Evidence

$ ./scripts/gate.sh                     # exit 0
$ IDS_TEST_CASES=… cargo test --test corpus -- --ignored
test corpus_every_case_reads_as_declared_ids_1_0 ... ok
test corpus_every_case_round_trips_through_the_writer ... ok      # 334 cases, read(write(read(x))) == read(x), fixed point
test written_documents_validate_against_the_official_xsd ... ok  # 334 + kitchen sink via xmlschema; negative control rejected

The XSD is not vendored; scripts/validate-ids.py reads it from the local buildingSMART checkout. Mutations (unescaped \n/\r, dropped optional cardinality, dropped minOccurs) are each caught — see PLAN.md.

https://claude.ai/code/session_01DiS9fZk8w57TKopxGHYYaK

`to_string`/`to_writer` write the typed model as IDS 1.0 with the IDS, xs
and xsi namespaces and the 1.0 schemaLocation, in the element order ids.xsd
requires. Anything the schema rejects, plus an applicability or
xs:restriction without facets, is refused with a typed WriteError naming the
model path; nothing reaches the output of a refused model.

Constructors (`Ids::new` declaring 1.0, `Specification::new`, facet `new`s,
`From` conversions) build a document without faking Detected evidence.

All 334 buildingSMART test cases satisfy read(write(read(x))) == read(x),
writing is a fixed point, and the output validates against the official
ids.xsd (scripts/validate-ids.py, with a negative control).

Release 0.1.4.

Closes #10

Claude-Session: https://claude.ai/code/session_01DiS9fZk8w57TKopxGHYYaK
@GeneralPawz
GeneralPawz merged commit e01fd43 into main Sep 30, 2026
2 checks passed
@GeneralPawz
GeneralPawz deleted the feat/ids-writer branch September 30, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write IDS 1.0 documents (serializer and producer constructors)

1 participant