Skip to content

core-spec: move semantic_model out of the Enumerations section in spec.yaml - #367

Closed
eisber wants to merge 1 commit into
apache:mainfrom
eisber:eisber/spec-yaml-doc-root-section
Closed

core-spec: move semantic_model out of the Enumerations section in spec.yaml#367
eisber wants to merge 1 commit into
apache:mainfrom
eisber:eisber/spec-yaml-doc-root-section

Conversation

@eisber

@eisber eisber commented Sep 7, 2026

Copy link
Copy Markdown

Summary

core-spec/spec.yaml is a multi-document YAML file whose --- separators group the
specification into sections. semantic_model is a document-root key, but it sits after the
# Enumerations separator, so it parses as a member of that section alongside the enum
definitions.

On main today:

>>> [list(d) for d in yaml.safe_load_all(open("core-spec/spec.yaml"))]
[['version'],
 ['dialects', 'datatypes', 'vendor_name', 'semantic_model'],   # <-- root key in # Enumerations
 ['datasets'],
 ['relationships'],
 ['fields'],
 ['metrics']]

This PR gives the document-root keys their own section, matching how every other section in
the file is delimited:

[['version'],
 ['dialects', 'datatypes', 'vendor_name'],
 ['semantic_model'],
 ['datasets'],
 ['relationships'],
 ['fields'],
 ['metrics']]

Scope

Five added lines, all of them a --- separator and comments. No key, value or enum member
is added, removed, renamed or reordered
, so the parsed content of the file is unchanged
apart from which section semantic_model belongs to.

Nothing in the repository parses core-spec/spec.yaml — it is documentation. (The two
spec.yaml references under converters/ontology/tests/ are unrelated tmp_path fixtures.)
So this carries no runtime risk; it makes the file say what it already meant.

Noticed while preparing #323, and split out of it so that PR stays about one thing.

Related Issues

None.

Checklist

Specification

  • Spec changes are included in core-spec/ and follow the existing structure
  • Spec changes have been discussed on the mailing list or in a linked issue — not applicable, this is a comment-only sectioning fix with no semantic change
  • Breaking changes to the spec are clearly called out in the summary — there are none

Ontology

  • Ontology changes in ontology/ are consistent with spec changes — ontology/ is untouched
  • New or modified terms are defined and documented — no terms added or modified

Converters

  • Converter logic in converters/ is updated to reflect spec or ontology changes — not applicable, nothing parses this file
  • New converters include tests under the converter's test directory — not applicable

Validation

  • Validation rules in validation/ are updated if the spec changed — no change needed; validate.py reads ossie-schema.json, not spec.yaml
  • New validation cases are covered by tests — not applicable; existing suites re-run green (test_validate.py 34 passed, validation/tests/ 10 passed)

Documentation

  • docs/ is updated to reflect any user-facing changes — no user-facing change
  • New features or behaviors are documented with examples where appropriate — no new behavior
  • CONTRIBUTING.md is updated if the contribution process changed — not applicable

Examples

  • examples/ are added or updated for any new spec constructs — no new constructs

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests — no new functionality

Compliance

  • ASF license headers are present on all new source files — no new files added
  • No third-party dependencies are added without PMC/IPMC approval — none added

…c.yaml

spec.yaml is a multi-document YAML file whose --- separators group the
specification into sections. semantic_model is a document-root key, but it
sits after the # Enumerations separator, so it parses as a member of that
section alongside the enum definitions:

    0 -> ['version']
    1 -> ['dialects', 'datatypes', 'vendor_name', 'semantic_model']
    2 -> ['datasets']

Give the root keys their own section, matching how every other section in the
file is delimited:

    0 -> ['version']
    1 -> ['dialects', 'datatypes', 'vendor_name']
    2 -> ['semantic_model']
    3 -> ['datasets']

Comment-only restructuring: no key, value or enum member is added, removed or
changed, and nothing in the repository parses this file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 7, 2026 16:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity core-spec/​spec.yaml — The new “Document root” comment is potentially misleading in a multi-document YAML file:…
What changed in this PR

This PR adjusts the sectioning in core-spec/spec.yaml so semantic_model is separated into its own YAML document, preventing it from being grouped under the “Enumerations” section when parsed as a multi-document YAML file.

Changes:

  • Inserted a --- document separator before semantic_model
  • Added a short “Document root” comment block to clarify intent
File Description
core-spec/​spec.yaml Adds a new YAML document boundary + comments so semantic_model is no longer parsed within the Enumerations document

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread core-spec/spec.yaml
Comment on lines +63 to +65
# Document root
# Keys allowed on the root object of an Ossie document, alongside the `version`
# declared at the top of this file.
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.

2 participants