feat(contract): add contract 1.0 model - #197
Conversation
Signed-off-by: Niall Roche <niall.roche@gmail.com>
| */ | ||
| abstract asset Clause identified by clauseId { | ||
| o String clauseId | ||
| o ContentHash clauseHash optional |
There was a problem hiding this comment.
Yes—good catch @mttrbrts , although I want to distinguish a clause’s source template from an enclosing contract template.
As in our current model a clause may be authored independently, maintained in a clause bank, and reused by multiple contract templates. A clause should therefore optionally identify its own source template rather than inherit provenance from whichever contract happens to use it.
Here is what I propose:
abstract asset Clause identified by clauseId {
o String clauseId
o ContentHash clauseHash optional
o TemplateReference sourceTemplate optional
}
I have added sourceTemplate that identifies an independently versioned clause template or archive when one exists. It does not identify the contract templates that subsequently incorporate the clause.
The field is optional because a standalone or directly authored clause may not have been produced from a template at all. In serialised data, the property would be omitted rather than represented as null.
A contract template that consumes a banked clause should record that composition in its own manifest or composition metadata. I don't think it makes sense for a reusable clause should not maintain a changing list of every template that uses it. We could maybe build some tooling to aggregate this if needed
Builds on the contract, runtime and obligation 1.0 models from #197, #198 and #196, which are included here unchanged as the commits beneath this one. This commit is the delta: it keeps their type inventory and reworks the structure underneath it. This is a design target, not a migration-ready change. It settles the structural questions that a stable 1.0 release needs answered, so that the answers can be reviewed together rather than one PR at a time. - Rename contract@1.0.0 to agreement@1.0.0, and model an agreement as a set of documents rather than a single instrument, so that a master agreement with schedules and confirmations is expressible. - Add party@1.0.0 defining Party and its portable PartyRef projection, so the 1.0 family has one party representation instead of three. - Address clause instances by TemplateMark instance path in a map, rather than by a static tree, since clause instances are data-driven: a list block yields one instance per element and a conditional may yield none. - Carry template data by composition in TemplateData rather than by subclassing the agreement envelope, so the envelope's type and its relationship URIs stay stable across template versions. - Hold runtime state as one revisioned document per agreement, with per-clause state keyed by the same instance paths. - Point obligation@1.0.0 at the shared PartyRef and AgreementReference in place of its local equivalents. contract@1.0.0 is deleted rather than kept alongside agreement@1.0.0. Model URLs are permanent, so it must never be published if this direction is taken: a dead namespace is worse than the rename. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Matt Roberts <code@rbrts.uk>
Closes N/A
Introduces a substantive
org.accordproject.contract@1.0.0model for agreement provenance and template identity. This is the first prerequisite for moving signature, runtime and obligation models onto a coherent 1.0 dependency family.Changes
ContractandClauseassets in the versioned 1.0 namespace.AgreementReferencefor downstream obligation, evidence and protocol models.TemplateReferencewith archive and optional artifact-manifest hashes.TemplateArtifactentries for logic, model, grammar, prose, documentation, tests and resources.logic.tsto record their path, language, runtime and entry-point role.contract@0.2.0models unchanged for compatibility.Flags
org.accordproject.contractis proposed as the canonical family for new models; the legacyorg.accordproject.cicero.contractfamily remains unchanged pending explicit migration guidance.archiveHashis mandatory in 1.0 so template provenance is verifiable rather than descriptive.artifactManifestHashaccompanyartifacts.AgreementReference.agreementIdmaps toContract.contractIdwhen the complete asset is available.TemplateReferencefrom this namespace once published.Screenshots or Video
Not applicable. This PR contains a Concerto model change only.
Related Issues
Author Checklist
--signoffoption of git commit.mainfromniallroche:codex/contract-1.0-model