fix(models): promote contract, runtime and party to 1.0 without breaking templates - #199
Draft
mttrbrts wants to merge 3 commits into
Draft
fix(models): promote contract, runtime and party to 1.0 without breaking templates#199mttrbrts wants to merge 3 commits into
mttrbrts wants to merge 3 commits into
Conversation
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>
5 tasks
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 #N/A
Promotes
contract,runtimeandpartyto 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 #197 —
TemplateReference,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
Contract.agreementHashandContract.templateoptional. No existing contract instance carries either, so requiring them invalidates all of them.runtime@1.0.0.Stateto its unidentified0.2.0shape. An identifier cannot be optional, so adding one invalidates every existing state instance and forces the 12 templates that subclassStateto 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.party@1.0.0as a straight promotion ofparty@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
agreementHashandtemplatewhen it is ready to produce them, and lets the canonicalization rules that makeagreementHashreproducible 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:
contractoragreementVerification
Verified against the
payment-upon-deliverytemplate fromaccordproject/cicero-template-library, migrated by rewriting its import lines only, with no structural change:TemplateModel extends Contract)extends Clause)extends State)extends Request)Contractstill declarescontractId,agreementHash?,template?.The same check against #197 and #198 as they stand fails on
agreementHashfor contract instances and on the missing identifier for state instances.Flags
runtime@1.0.0still removes the deprecatedruntime@0.2.0.Obligationevent, 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.0in Codex/obligation 1.0 models #196 is the intended destination.party@1.0.0andcontract@1.0.0beforeruntime@1.0.0, since the build resolves imports over HTTP.Screenshots or Video
Not applicable. Concerto model changes only.
Related Issues
Author Checklist
--signoffoption of git commit.🤖 Generated with Claude Code