Files
govoplan-core/docs/TEMPLATE_CAPABILITY_CONTRACT.md

1.3 KiB

Template And Generated Artifact Capability Contracts

Core defines provider-neutral contracts for optional template libraries and generated artifact storage. Core does not render templates or store generated files itself.

Templates

  • templates.catalog lists typed, versioned template references and checks a consumer's available fields, usage, and output format.
  • templates.renderer accepts a TemplateRenderRequest containing pinned input data and returns immutable render evidence plus an artifact reference.

The DTOs contain identifiers, hashes, plain mappings, and scalar metadata. They do not expose Template ORM models or require Campaign, Distribution Lists, Addresses, Reporting, Forms, or Mail.

Generated Artifacts

files.artifact_store accepts a ManagedArtifactWriteRequest and returns a ManagedArtifactRef. Producers supply bytes, a safe filename/content type, idempotency key, and non-secret provenance. Files owns path normalization, authorization, versions, storage, and download behavior.

Consumers must discover both contracts through the module registry and degrade only the unavailable path. A template renderer may return a bounded download when Files is absent. A caller must not infer successful external delivery from successful rendering or artifact persistence.