Repository navigation
feat(ir): read and write IR 3.1.0 with a v3 Specs distribution - #34
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
IR 3.1.0 is now a supported release. A later 3.x minor such as 3.2.0 is still refused with unsupported_format_version_minor, and the message lists each minor family the table covers.
A v3 distribution is now Library or Specs. The codec reads a Specs from formatVersion 3.1.0 on and refuses one declared below it with specs_before_3_1, before the body is decoded. A Specs distribution's own modules accept only types, values and doc, so a module definition is refused with unknown_member. Writers emit the lowest version that fits: 3 for a Library, "3.1.0" for a Specs. v3_to_v4 and v4_to_v3 migrate Specs both ways with the dependency mappings and diagnostics a Library uses, and keep one typed overload per kind. An Application still has no format-3 form. Fixtures come from finos/morphir efa36060 (kit case distributions-0011) and finos/morphir-rust cd9f7fb.
ir inspect reports kind Specs for a v3 file, and ir convert moves a Specs between format 3.1.0 and draft v4. A v3 Library is still written as format 3. The package READMEs, AGENTS.md and the BDD scenarios describe IR 3.1.0, specs_before_3_1 and the lowest-version writer, and state that document trees stay out of scope (bead morphir-ukvn.8.17).
…rops A v3 Specs upgrades with no annotations and encodes as v4, also with the input-attribute drop requested; a v4 Specs whose value specification carries an annotation is refused with unsupported_v4_downgrade.
DamianReeves
force-pushed
the
DamianReeves/ir-3-1-0
branch
from
October 27, 2026 07:19
ca40757 to
726ae69
Compare
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
5 tasks done
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 #28. Bead
morphir-ukvn.8.13.Summary
IR format 3.1.0 is a minor revision of format 3 (finos/morphir decision record 0018). It adds the v3
Specsdistribution. This PR reads and writes 3.1.0 and follows finos/morphirefa36060and the morphir-rust reference commitcd9f7fb.[3.0.0,3.2.0),[4.0.0,4.1.0), the finos reference table."3.1.x"is supported."3.2.0"still fails withunsupported_format_version_minor, and the message lists3.0.x, 3.1.x and draft 4.0.x.morphir.ir.v3.Specs;v3.Distributionis nowLibrary | Specs. ASpecsis spelled["Specs", package, dependencies, { modules }].Specsthat declares3,"3"or"3.0.x"fails with the new codespecs_before_3_1atformatVersion. The check runs before the body is decoded.Specsdistribution's own modules accept onlytypes,valuesanddoc. A module definition (access/value) fails withunknown_member. Dependency modules keep the morphir-elm reading.3for aLibrary, even one read as"3.1.0", and"3.1.0"for aSpecs.Specsmigrates to a v4SpecsDistribution, and back. Each direction uses the dependency-specification mappings and diagnostics aLibraryalready uses.v3_to_v4andv4_to_v3have one typed overload per kind, soLibrarycallers keep precise types. AnApplicationstill has no v3 form. TheLibrarypath and the v4 model and codec files did not change.ir inspectreportskind: Specsfor v3, andir convertconvertsSpecsin both directions.add-ir-3-1-0was proposed, implemented and archived in this branch (openspec/changes/archive/2026-10-27-add-ir-3-1-0/). The main specsir/format-version,ir/v3,ir/migrateandtools/ir-interchangeare synced.tests/fixtures/ir/v3/mck-distributions-0011-specs.json(kit case distributions-0011, finos/morphirefa36060) andrust-classic-specs-transport.json(morphir-rustcd9f7fb). Provenance is recorded inPROVENANCE.md.Breaking:
v3.codec.decode_versioned_distributionnow returnsLibrary | Specs, and a"3.1.0"document is no longer refused.Out of scope: the v3 JSON and YAML document trees of decision 0018 (design SCOPE-1). morphir-python has no document tree for v4 either. Follow-up bead
morphir-ukvn.8.17.Differs from Rust: a
Specsmodule that omitstypesorvaluesfails withmissing_member, as every v3 module specification does in this package. Rust defaults the missing member to empty. No known writer omits them.Test plan
mise run check: ruff lint and format, mypy and pyright strict, 1845 tests, coverage 98.2%mise run test-bdd: 27 scenarios, including inspecting a 3.1.0Specs, aSpecsround trip to v4 and back,specs_before_3_1, and refusing3.2.0openspec validate --specs --strict: all specs validformatVersion: 3