feat(contract): add contract 1.0 model - #197
Conversation
Signed-off-by: Niall Roche <niall.roche@gmail.com>
| * Profiles which populate artifacts should define the manifest canonicalization | ||
| * and require the list to agree with artifactManifestHash. | ||
| */ | ||
| concept TemplateReference { |
There was a problem hiding this comment.
This is intentionally a concept rather than an identifiable asset. It needs to be a self-contained value that can be embedded in contracts, signatures, states and obligations without requiring a separately registered template asset.
I agree that identifier is ambiguous, so I propose renaming it to templateId. The referenced archive is ultimately distinguished by its template id, version and archive hash, rather than by the identifier alone.
There is also a duplicate TemplateReference in #195. I plan to hold that PR and either import this shared type or remove the redundant transaction-level field when #195 moves to the 1.0 contract model.
| * available. clauseId and clauseHash identify a specific originating clause | ||
| * when a downstream record needs finer-grained provenance. | ||
| */ | ||
| concept AgreementReference { |
There was a problem hiding this comment.
Also intentional. agreementId identifies the agreement being referenced; it does not identify the AgreementReference value itself.
Making the reference an asset identified by agreementId would introduce identity and registry semantics for what is intended to be a portable provenance snapshot. It would also be problematic for distinct references to different clauses within the same agreement, since they would share the same asset identity.
I will clarify this distinction in the model documentation.
| */ | ||
| 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
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