Repository navigation
fix: list each manifest type as an element type - #73
Merged
Merged
Conversation
get_supported_element_types() now returns 244 names: the 187 object and document types, the 44 enums, and the 13 unions. validate_element accepts each name; an enum validates from its string value and a union through a cached TypeAdapter. The element parameter is typed Any. BREAKING: `root-model` is no longer an element type. It was never an OSCAL type. The conformance runner runs the element-types operation, so the element-types/all case passes and its expected failure is removed. The pre-fix snapshot of the list is deleted. Closes #59
get_supported_element_types() now returns 244 names: the 187 object and document types, the 44 enums, and the 13 unions. validate_element accepts each name; an enum validates from its string value and a union through a cached TypeAdapter. The element parameter is typed Any. BREAKING: `root-model` is no longer an element type. It was never an OSCAL type. The conformance runner runs the element-types operation, so the element-types/all case passes and its expected failure is removed. The archived OpenSpec change is included. Closes #59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #59
Summary
get_supported_element_types()returns 244 names: 187 object and document types, 44 enums, and 13 unions. It matches theelement-types/allcorpus case (ELV-002).validate_elementaccepts each listed name. An enum validates from its string value (ELV-001). A union validates through aTypeAdapterinleft_to_rightmode, made on first use and cached. The type ofelementchanges fromdict[str, Any] | NonetoAny.element-typesoperation. Theelement-types/allexpected failure is removed, and the pre-fix snapshot of the list is deleted.openspec/changes/archive/2026-11-16-list-each-manifest-element-type).Breaking change
root-modelis no longer an element type.validate_element(x, "root-model")raises the unknown-element-typeOscalParseError. The name came from theRootModelimport inmodels.pyand was never an OSCAL type.Out of scope
Which branch a failure of a union element reports: #69.
models.pyand the post-processor are unchanged.Benchmarks
Python 3.14.8, pydantic 2.14.2. Median of 7 runs, SP 800-53 rev5 catalog. "After" is two runs, because the run-to-run spread is as large as any difference.
parse_oscal(bytes)serialize_oscal(doc, indent=None)serialize_oscal(doc)doc.model_dump_json()pydantic_core.to_json(doc)No median moves by more than the spread between the two "after" runs (up to about 5 ms). Peak memory is unchanged: 36.5 / 84.4 / 144.4 / 146.4 MB before, 36.5 / 84.3 / 144.4 / 146.4 MB after. The change touches no parse or serialize path, and adds nothing at import. PERFORMANCE.md is unchanged.
Verification
hatch run releasepasses.models.pyhas no drift.The branch has two commits (the first holds only the snapshot deletion), so squash on merge.