Skip to content

Prototype: migrate copyright-license's nested payment clause onto agreement@1.0.0, run by template-engine - #528

Closed
mttrbrts wants to merge 19 commits into
mainfrom
claude/template-nested-payment-migration-00l9at
Closed

mttrbrts wants to merge 19 commits into
mainfrom
claude/template-nested-payment-migration-00l9at

Conversation

@mttrbrts

@mttrbrts mttrbrts commented Aug 23, 2026 •

Copy link
Copy Markdown
Member

Summary

This migrates copyright-license onto the org.accordproject 1.0.0 namespaces:

The logic is written with template-engine's new logic API (defineLogic, handlers taking (request, self), run in transactions).

The sample now loads, drafts, initialises and triggers end to end through cicero-core and template-engine. It no longer has a local runtime or any test workarounds. The changes it needs upstream are in draft PRs, installed here from their prebuilt dist branches:

Repo PR What
models #205 (on #200) Clause gets its own data and clauses. AgreementReference.documentId. AgreementState.states (one index by instance id). ObligationIssued.
template-archive (cicero-core) #946, #950 Finds the template model by its TemplateData parent type, or by accordproject.templateModel in package.json. Finds state by StateData. Legacy runtime@0.2.0 templates keep working.
template-engine #187 The logic API, an agreement runtime (nested transactions, JSON in and out), a codegen CLI for type factories, testing helpers, and AgreementProcessor. Drafting uses the named template model.

Changes

  • feat: migrate template library to Concerto v5 #529 merged in. The prototype needs template-engine 5 and cicero-core 2.2+, which feat: migrate template library to Concerto v5 #529 moves the library to. Its changes show in this diff until feat: migrate template library to Concerto v5 #529 merges.

  • Root dependencies. @accordproject/template-engine and @accordproject/cicero-core now come from the dist branches of template-engine#187 and template-archive#950. An override makes the engine share the same cicero-core.

  • Three sibling templates replace the nested composed/ and documents/ folders, because cicero-core loads model/ and logic/ recursively:

    • copyright-license-agreement-poc: the licence. A stateful document with an inline payment clause.
    • late-payment-poc: a stateful clause template, composed into the licence.
    • licensed-work-schedule-poc: a stateless document.

    The licence keeps copies of the other two templates' models, because its logic uses their types. It names its template model in package.json.

  • Models.

    • The 1.0.0 namespaces are refreshed from models#205.
    • The proposal namespace (composition.cto) is removed, because models#205 folds it into agreement, runtime and obligation.
    • Each template keeps only the cached namespaces it imports.
  • Logic.

    • Imports defineLogic and related types from @accordproject/template-engine/logic.
    • Factories come from logic/generated/types.ts, which npm run compile (template-engine-codegen --offline) generates alongside Concerto's interfaces.
    • runtime/ and scripts/generate-types.js are gone.
  • Tests.

    • Unit tests use @accordproject/template-engine/testing.
    • The agreement tests run on the engine's AgreementProcessor, which compiles and loads each template's logic as it would from its archive. They cover:
      • a cousin read;
      • a composed clause chase;
      • committing the licence and its clause together;
      • rejection that commits nothing;
      • determinism;
      • the serverless store's retry and redelivery.
    • The tests no longer import concerto-core directly, so the vitest alias for its ESM version bug is gone.
    • tsc type-checks both logic files and the compile-time checks against the engine's declarations.
    • The runtime's own semantics tests moved to template-engine.
  • Render suite. The expectedLoadFailures entry is gone. All three templates compile, draft, init and trigger through TemplateArchiveProcessor.

Flags

  • Git dependencies. The root package.json points at unreleased dist branches. Before merging, swap them for releases of template-engine and cicero-core.
  • Remove .mcp.json before ready. Commit 0ac00b1 adds a session tooling file (.mcp.json) that should be dropped before this is marked ready.
  • concerto-core 5.0.0's ESM build still reports 5.0.0-beta.2, so it rejects the 1.0.0 namespaces' concerto version "^5.0.0" (concerto-core 5.0.0 ESM build reports its version as 5.0.0-beta.2, rejecting concerto version "^5.0.0" models concerto#1462, fix in #1463). These tests now reach concerto-core only through the CommonJS builds of cicero-core and template-engine, so they don't hit it.
  • Not yet possible:
    • placing a composed clause in its parent's text, because TemplateMark's ClauseDefinition can't name a template;
    • resolving a TemplateReference to an archive. The tests name templates by package name, and hash each template's files as a stand-in for archiveHash.
  • The licence's copies of the other two models must stay identical to them. AgreementProcessor refuses an agreement whose templates define a shared namespace differently.

Validation

  • npm test (every workspace's unit tests, then the render suite): every workspace passes, including 40 tests in the licence and 3 in late-payment. Render: 123 passed, plus 3 failures that were already expected (the 10 new tests are this PR's three templates).
  • template-engine#187: 140 jest tests pass (109 existing, 31 new), and webpack builds.

Related Issues

Author Checklist

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

🤖 Generated with Claude Code

https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS

models#200 extensibility conclusion

The attempted composed-template evidence was removed because current Cicero does not yet resolve or compose a referenced child template archive. Loading two archives independently and projecting their identities into an AgreementDocument would only simulate the target shape, not prove composition.

The model-level conclusion remains useful and does not require that tooling feature to exist first:

  • AgreementDocument.clauses records provenance at clause instance paths without prescribing how a referenced template is resolved.
  • Clause.template uses the resolver-neutral TemplateReference (templateId, version, immutable archiveHash).
  • A future hosted, HTTP, local/nested-archive, IPFS, or other resolver can interpret templateId under a profile and verify the returned bytes against archiveHash without changing AgreementDocument or Clause.
  • If a resolver needs additional locator metadata, a profile may extend TemplateReference; the core agreement model remains typed to the base concept and does not need to be rewritten.
  • Inline-only clause blocks still have no clauses entry because no separate template archive was resolved.

Cicero/TemplateMark URI resolution and parent-child composition are therefore separate future tooling work, potentially spanning cicero-core, markdown/TemplateMark handling, and template-engine. This PR does not claim to implement or validate that feature.

claude added 2 commits August 23, 2026 22:52
Prototypes migrating copyright-license's nested PaymentClause onto the
model design proposed in accordproject/models#200 ("Agreement 1.0 Model
Redesign"): composition over inheritance (TemplateData/ClauseData composed
into an AgreementDocument instead of subclassing Contract/Clause), a
unified Party type replacing the duplicated licensee*/licensor* string
fields, and clause instances addressed by path through a Concerto 4 Map.

The vendored party@0.1.0/agreement@0.1.0 models, sample.json round-trip,
and trigger() logic all work end to end. Natural-language rendering is
marked as an expected failure: markdown-template's grammar resolution
only looks at properties declared directly on the @template class and
never walks the supertype chain, so a composed/inherited envelope isn't
renderable with today's tooling -- consistent with that PR being flagged
"a design target, not migration-ready". Details are in the model file
comments and the template's README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
npm ci failed in CI because the new workspace package wasn't reflected in
the lock file. Added only the two entries npm install generates for the
new workspace, leaving pre-existing unrelated version drift in the lock
file untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
@mttrbrts
mttrbrts force-pushed the claude/template-nested-payment-migration-00l9at branch from df08e5d to 439fa91 Compare August 23, 2026 22:52
claude and others added 4 commits September 4, 2026 12:28
The model design proposed in accordproject/models#200 has moved on
substantially since this prototype was written. Bring it back in line:

- No `@template` decorator, no envelope class. A template's model now
  declares exactly one concrete subtype of
  `templatedata@1.0.0.TemplateData`, and that subtype IS the template
  model (`CopyrightLicenseData`), carrying its variables directly. This
  also fixes the specific rendering gap the previous revision hit:
  TemplateMark's TypeVisitor resolves properties via
  `ClassDeclaration#getOwnProperty`, which doesn't walk supertypes, so
  an empty `TemplateModel extends AgreementDocument {}` could never
  resolve its inherited `data`. Rooting the grammar at the data itself
  removes the `{{#with data}}` wrapper and the problem it hit.
- No `clauses` map. `copyright-license` has no sub-template archive --
  `{{#clause paymentTerms}}` is an inline grammar block in this
  template's own grammar -- so `PaymentTerms` is simply a nested
  ordinary concept, addressed as a subtree of the data. This removes
  the data-duplication `logic.ts` previously had to paper over with
  `clauses['paymentTerms']?.data ?? licenseData.paymentTerms`.
- `licensee`/`licensor` are `PartyRef` values (a portable embedded
  reference), not `--> Party` relationships. A relationship reaches
  `trigger()` as an unresolvable `"resource:...#me"` string with no
  registry to resolve it against; `resolveParty()` is gone along with
  the relationship. `--> Party` belongs on the envelope's
  `AgreementParty`, where a registry exists (see model/agreement.cto,
  which documents that wider envelope even though this template's own
  model has none to be composed onto).
- Renamed the vendored `data@1.0.0` stand-in to `templatedata@1.0.0`,
  split into its own model/templatedata.cto per the current namespace
  split, and updated model/party.cto (adds `PartyRef`) and
  model/agreement.cto (drops `Clause.path`, adds `AgreementParty`,
  documents why `Clause`/`Clauses` are out of scope for this
  prototype) to match.

Empirically, removing `@template` fixes rendering but trades it for a
worse problem: the installed `@accordproject/cicero-core` (2.1.1, and
the copy vendored inside `@accordproject/template-engine`) finds a
template's root exclusively via the `@template` decorator, and
`Template#validate()` -- called unconditionally by
`Template.fromDirectory()` -- calls `getTemplateModel()`
unconditionally too. So without the decorator this template cannot be
*loaded* at all with today's toolchain, let alone drafted or triggered
-- confirmed empirically (see README). The fix is
accordproject/template-archive#946, which is not released.

`@template` has deliberately not been added back -- that would paper
over the exact gap this prototype exists to demonstrate. Instead,
test/render.test.mjs gains an `expectedLoadFailures` set (a strict
superset of `expectedFailures`, since a template here can't even load)
covering this template in both the render and trigger describes, each
`it.fails` naming template-archive#946, and the module-level
template-loading probe now tolerates a known load failure without
taking down the whole render-test file for every other template.

npm run test --workspaces --if-present: 49/49 workspace test files
pass (212 tests). npm run test:render: 114 passed, 5 expected fail (of
119), 0 unexpected failures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPtNYorvvn7MQwTovLXp2r
Signed-off-by: Claude <noreply@anthropic.com>
Align the Accord dependency graph with Concerto v5 and update templates for strict v5 validation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
Include the optional zod peer selected by current npm 11 so CI clean installs remain reproducible.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
Add explicit AgreementDocument provenance fixtures and a Vitest evidence harness that distinguishes composed sub-template provenance (clauses map present) from inline-only clause usage (clauses map absent), and document repro steps in the prototype README.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
@mttrbrts

Copy link
Copy Markdown
Member Author

Added composed-template provenance evidence for models#200 closure in this PR.

What was added

  • src/copyright-license-agreement-poc/evidence/composed-agreement-document.json
  • src/copyright-license-agreement-poc/evidence/inline-only-agreement-document.json
  • test/composed-template-provenance.evidence.test.mjs
  • README update: src/copyright-license-agreement-poc/README.md (new section: “Composed-template provenance evidence (models#200 closure)”).

Repro command

npx vitest run test/composed-template-provenance.evidence.test.mjs

Observed/asserted results

  • Composed case: AgreementDocument.clauses.paymentTerms is present and contains a Clause.template TemplateReference to a separate clause-template archive.
  • Path semantics: clause provenance map key is paymentTerms (rooted at AgreementDocument.data), not data.paymentTerms.
  • Inline-only case: AgreementDocument.clauses is intentionally absent; payment data still exists in data.paymentTerms.
  • Inline baseline anchor: existing src/copyright-license/sample.json has inline paymentClause data and no provenance map.

Note: this environment does not have node/npm binaries available, so I could not execute the Vitest command locally in-session; the test is committed as a reproducible harness for CI/local verification.

@mttrbrts

Copy link
Copy Markdown
Member Author

Reviewer note: the earlier fixture JSON in this PR captures intended AgreementDocument/clauses shape, but by itself is not execution-proof of composed parent+child archive loading.

A follow-up update is now being prepared to provide execution-backed evidence for two separate archives (with explicit reproduction details), plus clear documentation of current API/tooling limits and template-archive#946 gating.

Replaces fixture-only envelope assertions with execution-backed provenance binding.

The evidence test now loads parent and child templates independently,
round-trips each through CTA archives, instantiates a child Clause from the
child archive, and binds the child template reference/hash at the parent
clause path. This proves archive-level provenance boundaries with concrete
runtime-derived identifiers and hashes.

README now explicitly states what is and is not proven: this demonstrates
executable provenance binding semantics, while native contract+child archive
composition remains unavailable as a first-class cicero-core API, and
models#200 parent loading remains gated on template-archive#946.

Local validation execution remains blocked in this environment because
node/npm binaries are unavailable.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
@mttrbrts

Copy link
Copy Markdown
Member Author

Superseding update for reviewers: commit e21cdbc1 replaces the earlier fixture-only evidence with an executable two-archive provenance harness.

What changed:

  • Removed fixture-only agreement document pair (composed-agreement-document.json, inline-only-agreement-document.json).
  • Added src/copyright-license-agreement-poc/evidence/composition-binding.json.
  • Updated test/composed-template-provenance.evidence.test.mjs to load parent/child templates independently, round-trip each through distinct CTA archives, instantiate a child Clause, and assert child provenance binding at clauses.paymentClause vs absent clauses for inline-only.
  • README evidence section now explicitly scopes this as executable provenance-boundary proof (not native composition API proof).

Repro:

npx vitest run test/composed-template-provenance.evidence.test.mjs

Note: local command execution remains blocked in this CLI environment if node/npm are unavailable; the harness is committed for CI/local verification.

composition-binding.json's parentTemplate/clauses.paymentClause.template
paths were off by one directory level ("../copyright-license" /
"../payment-upon-signature"), so Template.fromDirectory() couldn't find
either template's package.json from evidence/. Both templates actually
live two levels up from evidence/ (evidence -> copyright-license-agreement-poc
-> src -> <template>), confirmed by running the new evidence test locally
and by CI's "Unit Tests (22.x, ubuntu-latest)" failing with the same error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
@mttrbrts
mttrbrts force-pushed the claude/template-nested-payment-migration-00l9at branch from d065a7c to 46e45a3 Compare September 17, 2026 17:09
The fixtures project provenance from independently loaded templates but do not exercise URI resolution or parent-child composition. Remove them rather than imply Cicero currently supports that behavior; model extensibility can be assessed independently.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <code@rbrts.uk>
@mttrbrts

Copy link
Copy Markdown
Member Author

Correction to the earlier composition-evidence comments: the fixture-only and two-independently-loaded-archive harnesses have been removed in commit 4aada7b3. Neither exercised URI resolution or actual parent-child template composition, so they were not useful closure evidence.

What #528 now claims is limited to models#200 extensibility: AgreementDocument.clauses[path].template is a resolver-neutral TemplateReference. Future hosted registry, HTTP, local/nested-archive, IPFS, or other resolution can be supplied by tooling/profile semantics and verified against archiveHash without rewriting AgreementDocument or Clause. If additional locator fields are needed, a profile can extend TemplateReference.

Actual reference resolution/composition remains a major Cicero/TemplateMark/template-engine feature and is explicitly out of scope for this prototype.

@github-actions github-actions Bot added the maintainer-engaged A maintainer has commented or reviewed this item label Sep 18, 2026
…e state

Show how state works under models#200: the template declares one
StateData subtype (CopyrightLicenseState) holding agreement-scoped
status, with the inline payment clause's state as a nested subtree at
the same instance path as its data. init() seeds it, PaymentRequest
and a new PaymentReceived request transition it, and paying in full
moves the clause to PAID and the licence to IN_FORCE in one returned
state. A vendored runtime@1.0.0 stand-in models the AgreementState
envelope the runtime owns around that state.

The README documents that today's toolchain only recognises state as
a subclass of org.accordproject.runtime@0.2.0.State, so this state
would not be detected even once template-archive#946 lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
…ycle

Rework the state illustration around design decisions for models#200:

- The payment lifecycle is an obligation@1.0.0 PaymentObligation, not a
  status enum in template state. Clause state keeps only facts
  (amountPaid, dueAt); logic derives the obligation's status and revision
  from them and emits ObligationTransition events. The licence being in
  force is derived (obligation FULFILLED), not stored.
- init() issues the obligation via a proposed ObligationIssued event;
  obligation id and AgreementReference use the clause path, with the
  runtime expected to back-fill agreementId.
- Amounts are PreciseAmount (digit-string unscaledValue, BigInt maths),
  rendered with a grammar formula; overpayment is rejected.
- The runtime stand-in sketches per-document state (documentStates).
- Logic is deterministic: timestamps come from data or requests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
…ts PreciseAmount

template-engine 5.1.0 already drafts org.accordproject.money@1.PreciseAmount
natively; the grammar formula is only needed because this repo pins 4.0.0
and the vendored money stand-in doesn't match the drafter's namespace key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
…1 DX

Add @accordproject/template-engine 5.1.0 as a devDependency of this
workspace only (the rest of the repo stays on 4.0.0), with tests showing:

- the template renders end to end when the root concept is named
  explicitly, with no @template decorator;
- money@1.0.0 PreciseAmount is drafted natively, so the grammar uses a
  plain {{amount}} instead of a formula;
- logic.ts type-checks against 5.1's injected runtime declarations.

Vendor models#200's money@1.0.0 verbatim under its real namespace: its
BigInteger is a String scalar it declares itself, so it compiles with the
repo's Concerto 4 toolchain (correcting an earlier claim that it could
not). Type response events with the model's event types and take
timestamp types from generated interfaces, since 5.1's codegen maps
DateTime to string where Concerto 4's maps it to Date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
…emplate instances

Prototype a proposed alternative to models#200's agreement/runtime shapes
that supports embedded executable clauses with a single structure for the
template hierarchy:

- agreement: an AgreementDocument has a root TemplateInstance
  { instanceId, template, data, children }. Inline clauses stay subtrees
  of a template's data; composed clauses are child instances with their
  own template and data.
- runtime: AgreementState.states indexes each stateful instance's own
  StateData by stable instanceId, so state never mirrors the tree.
- logic: a document's logic gets handles to its composed clauses, sends
  them requests, and returns its own state plus theirs; the runtime
  commits them as one revision or nothing.

Example: an agreement of two documents, the licence (inline payment
terms plus a composed late payment clause with its own model, grammar
and logic) and a stateless licensed-work schedule, driven end to end by
a runtime stand-in (agreement/host.ts) and validated against the models.

Compile this workspace with concerto-cli 4.2.0 (Concerto 5): the repo's
4.0.1 codegen drops the import for a type used only as a map value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
…logic API on models#200 1.0.0

Move the prototype onto models#200's real 1.0.0 namespaces, vendored
verbatim, with design B's changes in one proposal namespace
(poc.accordproject.composition@0.1.0) as subtypes of the types they
would change: ComposedClause, IndexedAgreementState, DocumentReference
and ObligationIssued. Drop the runtime@0.2.0 and contract@0.2.0 copies
and the poc stand-ins.

Prototype the proposed logic API in runtime/:
- defineLogic().init().on(RequestType, (request, self) => ...): one
  handler per request type, dispatched on $class (or the nearest
  supertype), with no switch; the handlers' signatures are the API a
  composing template triggers (ApiOf / Clause).
- self is the instance's node in the agreement tree, with read-only
  views of its parent, clauses, document and cousins.
- Handlers write only through self (setState, emit, triggering their own
  composed clauses), buffered in a transaction that commits as one
  revision; each clause runs in a nested transaction discarded if it
  throws.
- execute()/initialise() are JSON-to-JSON, so the agreement can run as
  a stateless function with conditional writes.
- testInstance/stubClause run unit tests on the same transaction code.

Port both logic files, and add tests for the engine's semantics, a
retried conditional write, and compile-time checks of the typing, run
with tsc.

concerto-core 5.0.0's ESM build reports its version as 5.0.0-beta.2 and
rejects models#200's `concerto version "^5.0.0"`, so this workspace's
tests load its CommonJS build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
claude added 2 commits October 1, 2026 09:18
…ted type factory

Generate a factory per concrete model type (scripts/generate-types.js,
run by `npm run compile` after Concerto's codegen, into
logic/generated/types.ts): `create()` fills in `$class`, and
`$identifier` for identified types; `is()` narrows a value to the type;
`ref()` makes a relationship. They replace the hand-written request type
constants, and are the keys handlers register under.

Both logic files, the prototype runtime and every test now make values
with factories, so none writes a `$class` or relationship string by hand.
Compile-time checks cover that a factory rejects a hand-written `$class`
and requires every field, and a test checks the generated factories
against the models.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
Session tooling only, for generating illustrations: not part of the
template prototype. Reads GEMINI_API_KEY from the environment. Drop this
commit before the PR is marked ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
Signed-off-by: Claude <noreply@anthropic.com>
…nt@1.0.0 prototype

The prototype needs template-engine 5 and cicero-core 2.2+, which #529
moves the library to. package-lock.json is taken from #529: this branch's
only lockfile change was a workspace-local template-engine 5.1, which the
prototype no longer needs.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
… API, as three templates

The prototype's local runtime is replaced by the released shape of the
design:

- Models: the 1.0.0 namespaces are refreshed from accordproject/models#205,
  which folds the prototype's proposal namespace (composition.cto) into
  agreement@1.0.0 (Clause with data and clauses, AgreementReference with a
  documentId), runtime@1.0.0 (AgreementState.states) and obligation@1.0.0
  (ObligationIssued). composition.cto is removed.
- Templates: the composed late payment clause and the licensed work
  schedule become sibling templates, late-payment-poc and
  licensed-work-schedule-poc, since cicero-core loads model/ and logic/
  recursively. The licence keeps copies of their models, which its logic
  uses, and names its template model in package.json
  (accordproject.templateModel).
- Logic imports defineLogic from @accordproject/template-engine/logic and
  its factories from logic/generated/types.ts, which template-engine-codegen
  writes with Concerto's interfaces (npm run compile). runtime/ and
  scripts/generate-types.js are removed.
- Tests use @accordproject/template-engine/testing, and the agreement tests
  run on template-engine's AgreementProcessor, which compiles and loads each
  template's logic. Without a direct concerto-core import, the vitest alias
  around concerto-core's ESM version is no longer needed.
- The library depends on template-engine and cicero-core from the dist
  branches of accordproject/template-engine#187 and
  accordproject/template-archive#950, so the render suite loads, drafts,
  initialises and triggers all three templates; the expectedLoadFailures
  entry is removed.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011LWZaJoaq9HFMVceNxCXMS
@mttrbrts mttrbrts changed the title Prototype: migrate copyright-license's nested payment clause onto models#200 Prototype: migrate copyright-license's nested payment clause onto agreement@1.0.0, run by template-engine Oct 1, 2026
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open with no activity. Remove the stale label or comment to keep it active. Only items with maintainer engagement are auto-closed.

@github-actions github-actions Bot added the Stale label Oct 17, 2026
@github-actions github-actions Bot closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-engaged A maintainer has commented or reviewed this item Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants