Acme Marketing Architecture

11. Report publication: versioned definitions, sign-off, contracted delivery, lineage and restatement

11. Report publication: versioned definitions, sign-off, contracted delivery, lineage and restatement

Date: 2026-10-26

Status

Accepted


Problem

"Downstream" for Acme is not only systems that subscribe to business events (ADR 7). It also includes published reports: figures that leave the platform as files or feeds for Finance and, assumed until Q2 is answered, clients and partners, on a cadence, and that people act on and later ask questions about. The architect's reference for this half of the problem is a statistical reporting platform at a public-sector agency, where the upstream (intake, validation, transcoding) was strong and the downstream was the weak half: reports generated by hand, delivered over an inherited channel, with no lineage from a published figure back to the source record, no recorded sign-off, and no answer to "what happens when a source corrects a file after the report went out". The same questions apply here:

⚠️ Requires stakeholder input: the report set, definitions and cadence; whether the delivery channel is contractual; what recipients do on a restatement; retention periods. Asked in open questions Q2 (reconcile or reload, which carries the restatement and sign-off policy); the report set and channels are open items there. The decision below is the mechanism; the policy values are theirs.


Decision

We will treat publication as a pipeline with the same discipline as ingestion.

  1. Report definitions as code. One definition per report (YAML plus a Python renderer): name, owner, approver, audience, grain, Gold tables and measures, filters, format (CSV, XLSX, PDF), cadence, recipients and channel. Versioned in Git and released through the deployment pipeline; a change is a new definition version, and the version is stamped on every publication.
  2. Generation from pinned Gold versions. The report generator (Fabric notebook, Python) reads Gold at explicit Delta versions and writes a publication manifest: definition version, period, the Gold table versions used, generator version, generated-at, and supersedes (if a revision). Files go to Files/publications/{report}/{period}/{version}/. Any publication can be reproduced by re-running its definition at its pinned versions.
  3. Sign-off before release. The orchestrator routes a generated publication to the named approver through a Power Automate approval in Teams; the decision (approver, time, comment) is written to control.publication_log. The delivery adapter refuses a publication without an approved row.
  4. Delivery over the contracted channel. A delivery adapter sends approved files over whatever the recipient's contract requires: SFTP with key authentication, an HTTPS API, email, or a Power BI app for recipients who accept it. Files and messages are flagged original or revision. Delivery evidence (file hash, channel response, time) is recorded; retries and dead-lettering as for webhooks. FTP in clear is not offered; where a recipient insists on FTP, it is recorded as a risk accepted by the business.
  5. Lineage. Publication manifest → Gold Delta versions (time travel) → _batch_id on every Gold and Silver row → Bronze rows → landing manifest → source window and extraction time. Tokens keep the chain free of identifiers. A published figure can be explained to an auditor as a query over pinned versions plus the batch ids it aggregates.
  6. Restatement policy. When Gold for an already-published period changes beyond tolerance, the Gold jobs emit metrics.restated; Activator triggers re-publication for the affected period. The generator produces a new revision with supersedes set and a change summary (per measure: before, after, cause: reload, replay, logic change); it goes through sign-off again and is delivered flagged revision. Previous publications are retained and retrievable; nothing is overwritten. A closed-period freeze (no automatic re-publication after period close, revisions on request only) is available as a per-report setting for Finance.
  7. Retention and audit. Publications, manifests and the publication log are retained for the longer of the recipient's contractual period and the company retention schedule (assumption: 7 years for financial reporting); the log is append-only; report.published and report.superseded are business events on the bus.
  8. Access. Row- and object-level security stays in the semantic model for interactive use; a report definition carries its audience, and a recipient receives only the rows its definition filters to (for example one client's campaigns).

Considered Options

Option Summary Pros Cons
✅ Python generation from pinned Gold versions, recorded sign-off, delivery adapter, version-and-supersede As above Reproducible figures; lineage to the source window; sign-off and delivery are evidence, not habits; restatement is explicit; any channel behind one adapter Definitions must be maintained as code; approvers become a step in the pipeline; a revision policy must be agreed with each recipient
Manual export and scripted upload Analyst exports, a script uploads No build Invisible, untestable, no lineage, no sign-off record; the pattern the reference design is replacing. Rejected.
Power BI paginated reports with subscriptions Reports rendered and emailed by the service No code for internal audiences; good formatting No pinned-version manifest, weak restatement evidence, external channels limited to email; kept for internal distribution where lineage is not required
Third-party reporting or distribution tool Vendor product Mature scheduling and delivery Another vendor in the data path; lineage and restatement semantics are the vendor's; cost. Not justified at this report count
Overwrite on restatement Replace the delivered file in place Simplest for recipients who only want "the latest" Destroys the record of what was published; fails audit. Rejected; recipients who want only the latest receive the revision flagged as such

Consequences

Positive:

Negative / Trade-offs:

Risks: | Risk ID | Description | Impact (E/H/M/L) | Mitigation | |---------|-------------|------------------|------------| | R1 | A recipient's contract forbids re-delivery or demands a fixed format on restatement | M | Per-report policy; hold-and-notify option; contract review before launch | | R2 | Approver unavailable; reports late | M | Delegation rules; reminder and escalation in the flow; SLA per report | | R3 | Definition drifts from the Gold schema | M | Definitions versioned with the schema; contract tests at G2 | | R4 | Channel credentials (SFTP keys, API tokens) leak | H | Key Vault, managed identity, rotation runbook | | R5 | Recipient insists on plain FTP | M | Risk recorded and accepted by the business owner; SFTP offered |