Skip to content

fix(models): promote contract, runtime and party to 1.0 without breaking templates - #199

Draft
mttrbrts wants to merge 3 commits into
mainfrom
claude/models-1.0-minimal-promotion
Draft

fix(models): promote contract, runtime and party to 1.0 without breaking templates#199
mttrbrts wants to merge 3 commits into
mainfrom
claude/models-1.0-minimal-promotion

Conversation

@mttrbrts

@mttrbrts mttrbrts commented Aug 23, 2026

Copy link
Copy Markdown
Member

Closes #N/A

Promotes contract, runtime and party to 1.0 without settling the structural questions raised in review of #197 and #198, so that downstream models and templates get stable 1.0 namespaces to depend on now.

This PR extends #197 and #198 rather than replacing them. Their commits are included unchanged and a single commit on top adjusts what is required, not what is declared. All of the forward-looking types in #197TemplateReference, TemplateArtifact, TemplateArtifactRole, AgreementReference — are kept in full.

The companion "north star" PR, #200, shows where these namespaces should eventually go. This one is deliberately the smallest step that is safe to merge and publish today.

Changes

  • Make Contract.agreementHash and Contract.template optional. No existing contract instance carries either, so requiring them invalidates all of them.
  • Return runtime@1.0.0.State to its unidentified 0.2.0 shape. An identifier cannot be optional, so adding one invalidates every existing state instance and forces the 12 templates that subclass State to be reissued. State identity, revisioning and hashing are left to a later release which can settle how state is scoped to an agreement and its clauses.
  • Add party@1.0.0 as a straight promotion of party@0.2.0, so the 1.0 family is not missing a party namespace.

Why optional rather than removed

Requiring provenance and requiring nothing are not the only options. Declaring the types but not requiring them lets a template adopt agreementHash and template when it is ready to produce them, and lets the canonicalization rules that make agreementHash reproducible be agreed separately, without blocking the version promotion on either.

What this deliberately does not decide

Each of these was raised in review and is left open, because none of them has to be settled to publish a 1.0 namespace:

  • whether the namespace should be contract or agreement
  • whether an agreement is one instrument or a set of documents
  • how clauses are addressed, and whether clause structure belongs in the model at all
  • whether template data is carried by inheritance or composition
  • how runtime state is scoped to a contract and to its clauses
  • how the three party representations across the 1.0 family are reconciled
  • whether hashes commit across levels

Verification

Verified against the payment-upon-delivery template from accordproject/cicero-template-library, migrated by rewriting its import lines only, with no structural change:

existing instance result
contract (TemplateModel extends Contract) validates unchanged
clause (extends Clause) validates unchanged
state (extends State) validates unchanged
request (extends Request) validates unchanged

Contract still declares contractId, agreementHash?, template?.

The same check against #197 and #198 as they stand fails on agreementHash for contract instances and on the missing identifier for state instances.

Flags

  • runtime@1.0.0 still removes the deprecated runtime@0.2.0.Obligation event, as feat(runtime): add runtime 1.0 model #198 proposed. 21 templates subclass it. Because 1.0 is a new namespace nothing breaks until a template opts in, but those 21 need somewhere to go — obligation@1.0.0 in Codex/obligation 1.0 models #196 is the intended destination.
  • Stays on Concerto 3 syntax. No map types are introduced.
  • Publish order: party@1.0.0 and contract@1.0.0 before runtime@1.0.0, since the build resolves imports over HTTP.

Screenshots or Video

Not applicable. Concerto model changes only.

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Ensure that CI passes

🤖 Generated with Claude Code

niallroche and others added 3 commits August 23, 2026 22:00
Signed-off-by: Niall Roche <niall.roche@gmail.com>
Signed-off-by: Niall Roche <niall.roche@gmail.com>
Adjusts the proposed contract@1.0.0 and runtime@1.0.0 models so that the
57 templates in the template library can move to the 1.0 namespaces by
changing their import lines alone, and adds the party@1.0.0 namespace the
family is missing.

The forward-looking types in contract@1.0.0 are kept in full. Only the
requirement to populate them is deferred, so that provenance can be adopted
per template rather than all at once.

- Make Contract.agreementHash and Contract.template optional. No existing
  contract instance carries either, so requiring them invalidates all of
  them.
- Return runtime@1.0.0.State to its unidentified 0.2.0 shape. An identifier
  cannot be optional, so adding one invalidates every existing state
  instance and forces the 12 templates that subclass State to be reissued.
  State identity and revisioning are left to the agreement model.
- Add party@1.0.0 as a straight promotion of party@0.2.0.

Verified against the payment-upon-delivery template that existing contract,
clause, state and request instances still validate after an import-only
migration.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
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