Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions src/accordproject/contract@1.0.0.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

concerto version "^3.0.0"

namespace org.accordproject.contract@1.0.0

import org.accordproject.crypto@1.0.0.ContentHash from https://models.accordproject.org/crypto/crypto@1.0.0.cto

/**
* The role of a named artifact within a template archive.
*/
enum TemplateArtifactRole {
o LOGIC
o MODEL
o GRAMMAR
o PROSE
o DOCUMENTATION
o TEST
o RESOURCE
o CUSTOM
}

/**
* A named, hash-addressed artifact contained in a template archive.
*
* For executable logic, name and path can identify an entry point such as
* "logic.ts" while language and runtime describe how it is executed. The
* content hash ensures that an evaluation can identify the exact artifact,
* independently of the archive-level hash.
*/
concept TemplateArtifact {
o String name
o TemplateArtifactRole role
o String customRole optional
o String path
o String language optional
o String runtime optional
o Boolean entryPoint default=false
o ContentHash contentHash
}

/**
* A reference to the immutable template archive used to create an agreement.
*
* archiveHash commits to the complete archive. artifactManifestHash commits to
* the canonical manifest of named artifacts when the archive supplies one.
* Profiles which populate artifacts should define the manifest canonicalization
* and require the list to agree with artifactManifestHash.
*/
concept TemplateReference {
o String identifier
o String version
o ContentHash archiveHash
o ContentHash artifactManifestHash optional
o TemplateArtifact[] artifacts optional
}

/**
* Portable provenance for an instantiated agreement.
*
* agreementId maps to Contract.contractId when the complete Contract asset is
* available. clauseId and clauseHash identify a specific originating clause
* when a downstream record needs finer-grained provenance.
*/
concept AgreementReference {
o String agreementId
o ContentHash agreementHash
o TemplateReference template
o String clauseId optional
o ContentHash clauseHash optional
}

/**
* Contract data for an instantiated agreement.
*
* agreementHash commits to the canonical agreement representation, excluding
* the agreementHash property itself. template identifies the reusable archive
* from which the agreement was created.
*
* Both are optional so that a template can move from contract@0.2.0 to this
* namespace by changing its import lines alone, and adopt provenance when it
* is ready to produce it. Requiring them would invalidate every existing
* contract instance, since none carries a hash or a template reference today.
* A future release may require them once the canonicalization rules that make
* agreementHash reproducible have been agreed.
*/
abstract asset Contract identified by contractId {
o String contractId
o ContentHash agreementHash optional
o TemplateReference template optional
}

/**
* An identifiable clause in a contract.
*/
abstract asset Clause identified by clauseId {
o String clauseId
o ContentHash clauseHash optional
}
30 changes: 30 additions & 0 deletions src/accordproject/party@1.0.0.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

concerto version "^3.0.0"

namespace org.accordproject.party@1.0.0

/**
* A party to a contract.
*
* Promoted unchanged from party@0.2.0 so that the 1.0 family has a party
* namespace to depend on. A portable, registry-free party reference is
* deliberately not added here: obligation@1.0.0 and signature@1.0.0 each carry
* their own today, and reconciling them is a design decision for a later
* release rather than part of a version promotion.
*/
participant Party identified by partyId {
o String partyId
}
50 changes: 50 additions & 0 deletions src/accordproject/runtime@1.0.0.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

concerto version "^3.0.0"

namespace org.accordproject.runtime@1.0.0

import org.accordproject.contract@1.0.0.Contract from https://models.accordproject.org/accordproject/contract@1.0.0.cto
import org.accordproject.crypto@1.0.0.ContentHash from https://models.accordproject.org/crypto/crypto@1.0.0.cto

/**
* Base request for invoking contract logic with no custom request properties.
*/
transaction Request {
}

/**
* Base response for contract logic with no custom response properties.
*/
transaction Response {
}

/**
* The runtime state of a contract.
*
* This is carried over from runtime@0.2.0 unchanged, and in particular remains
* unidentified. Giving State an identifier is a breaking change that optional
* properties cannot soften: an identifier is required by definition, so every
* existing state instance would become invalid, and templates which subclass
* State would have to be reissued. Identity, revisioning and state hashing are
* left to a later release which can settle how state is scoped to an agreement
* and to its individual clauses.
*
* Obligations are intentionally not defined in this namespace. New
* implementations should use org.accordproject.obligation@1.0.0 so durable
* obligation state and lifecycle events are not coupled to the runtime API.
*/
asset State {
}