Skip to content

feat!: upgrade to Concerto v4.0.3 (breaking change)#137

Merged
mttrbrts merged 6 commits into
accordproject:mainfrom
rockaxorb13:fix/v4-api-updates
May 7, 2026
Merged

feat!: upgrade to Concerto v4.0.3 (breaking change)#137
mttrbrts merged 6 commits into
accordproject:mainfrom
rockaxorb13:fix/v4-api-updates

Conversation

@rockaxorb13
Copy link
Copy Markdown
Contributor

fixes #136

This PR fixes the first and second problems listed in #136, as directed by @mttrbrts, these changes did not break the v3 build and as per my understanding, the strict : true parameter for modelManager was mostly redundant.

For the serializer API changes I updated Serializer.fromJSON() calls, adding an option:
({ validate: true, acceptResourcesForRelationships: false });
This satisfies v3's strict TypeScript requirements for the SerializerOptions interface while preparing the calls for v4's updated signature where these options are made optional.

Updated snapshots to adjust these changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates template-engine to better align with Concerto v4 API changes by removing deprecated ModelManager strict-mode usage and adding explicit serializer option objects to relevant deserialization calls.

Changes:

  • Remove { strict: true } from ModelManager instantiations (tests + interpreter internal validation helpers).
  • Update Serializer.fromJSON(...) call sites to pass an explicit SerializerOptions object.
  • Update Jest snapshots to match the new diagnostics output.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/TemplateMarkInterpreter.ts Removes ModelManager strict mode and adds serializer options for validation/deserialization.
test/TemplateMarkInterpreter.test.ts Removes strict mode from ModelManager in interpreter integration tests.
test/HelloWorld.test.ts Removes strict mode from ModelManager in hello-world test setup.
test/GenerateOptions.test.ts Removes strict mode from ModelManager in generation options tests.
test/CustomTemplateModel.test.ts Removes strict mode from ModelManager in custom model test setup.
test/__snapshots__/TemplateMarkInterpreter.test.ts.snap Snapshot updates reflecting changed error locations/output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/TemplateMarkInterpreter.ts Outdated
Comment thread src/TemplateMarkInterpreter.ts Outdated
@mttrbrts
Copy link
Copy Markdown
Member

Thanks for working on this! However, adding explicit options like { validate: true, acceptResourcesForRelationships: false } everywhere shouldn't be necessary — these should be the defaults.

The root cause is that the TypeScript type definitions in Concerto v4 appear to incorrectly require these options. I've opened an upstream issue to fix this: accordproject/concerto#1192

Once that's fixed, this PR can be simplified to just remove the strict: true from ModelManager (which is the correct fix), without needing to add redundant options to every Serializer call.

Let's fix the type definitions upstream first, then revisit this PR.

This comment was generated by AI on behalf of @mttrbrts.

@rockaxorb13
Copy link
Copy Markdown
Contributor Author

Understood! Sorry for the delay, I will get to this asap.

@rockaxorb13
Copy link
Copy Markdown
Contributor Author

@mttrbrts done, ready for review

- Bump concerto-core, concerto-util to 4.0.2 and concerto-codegen to 4.0.0
- Add concerto-vocabulary 4.0.2 (required peer dep of concerto-codegen v4)
- Fix all Serializer constructor calls to pass empty options object ({})
- Fix all serializer.fromJSON() calls to pass empty options object ({})
- Add explicit types to InMemoryWriter.getFilesInMemory() forEach callback
  (InMemoryWriter is typed as `any` in concerto-util v4 exports)
- Update snapshots to reflect v4 codegen output (concerto namespace types
  no longer emitted; line offsets updated accordingly)
- Bump package version to 3.0.0 (breaking: drops Concerto v3 support)

BREAKING CHANGE: requires Concerto v4; not compatible with Concerto v3

Co-Authored-By: Matt Roberts <[email protected]>
- @accordproject/cicero-core: 0.25.2 → 0.26.0
- @accordproject/concerto-codegen: 4.0.0 → 4.0.1
- @accordproject/concerto-core: 4.0.2 → 4.0.3
- @accordproject/concerto-util: 4.0.2 → 4.0.3
- @accordproject/concerto-vocabulary: 4.0.2 → 4.0.3
- @accordproject/markdown-common: 0.17.2 → 0.18.0
- @accordproject/markdown-template: 0.17.2 → 0.18.0
- @accordproject/markdown-html: 0.17.2 → 0.18.0

Co-Authored-By: Claude Opus 4.5 (1M context) <[email protected]>
Signed-off-by: mttrbrts <[email protected]>
@mttrbrts mttrbrts changed the title feat!: upgrade to Concerto v4.0.2 (breaking change) feat!: upgrade to Concerto v4.0.3 (breaking change) May 7, 2026
mttrbrts and others added 2 commits May 7, 2026 09:57
Co-Authored-By: Claude Opus 4.5 (1M context) <[email protected]>
Signed-off-by: mttrbrts <[email protected]>
Co-Authored-By: Claude Opus 4.5 (1M context) <[email protected]>
Signed-off-by: mttrbrts <[email protected]>
Co-Authored-By: Claude Opus 4.5 (1M context) <[email protected]>
Signed-off-by: mttrbrts <[email protected]>
@mttrbrts mttrbrts enabled auto-merge (squash) May 7, 2026 09:08
@mttrbrts mttrbrts merged commit 2dcc977 into accordproject:main May 7, 2026
9 of 10 checks passed
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25486640833

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 63.844%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 1 uncovered change across 1 file (4 of 5 lines covered, 80.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
src/TemplateMarkInterpreter.ts 3 2 66.67%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1128
Covered Lines: 719
Line Coverage: 63.74%
Relevant Branches: 537
Covered Branches: 344
Branch Coverage: 64.06%
Branches in Coverage %: Yes
Coverage Strength: 5700.41 hits per line

💛 - Coveralls

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.

Breaking changes for Concerto V4 compatibility and hardening

4 participants