# Moonsail Optional Delivery Template

Use this structured handoff when the request benefits from a durable,
machine-checked delivery record. A concise chat response, a Space update, or
another user-requested shape is also valid when it communicates the final
outputs, runtime-backed provenance, actual-artifact review, and material gaps.

Choosing this template opts into its format contract. `scripts/verify.mjs`
parses `# Delivery:` documents and reports missing sections, missing fields,
and unmatched outputs. Fix those findings or label the remaining gaps
unverified before presenting a document in this format.

## Opt-In Format Rules

- When using this template, the document title MUST be a single line starting
  with `# Delivery:`.
  That marker is what switches verify.mjs into delivery mode.
- The four sections below are all REQUIRED, in this order, even when empty:
  `## Outputs`, `## Provenance`, `## Verification`, `## Unverified`.
- Entries are markdown list items. An entry starts with `- ` and its fields
  are `key: value` pairs, one per line, indented under the entry.
- Provider and model names belong ONLY in `## Provenance`. Anywhere else they
  count as provider names leaking into copy.
- A claim without a source gets the literal label `[unverified]` on the same
  line, or it moves to `## Unverified`.

## Template

```markdown
# Delivery: <short production title>

## Outputs

- role: <asset role, e.g. hero-video, main-image, cutdown-9x16>
  platform: <target platform, e.g. tiktok, amazon, youtube>
  aspect_ratio: <e.g. 9:16>
  duration: <for video/audio, e.g. 30s>
  url: <final reachable URL>

## Provenance

- output: <role from Outputs this entry backs>
  provider: <e.g. fal>
  model: <exact model ID>
  job_id: <generation Job ID>
  object_id: <exact delivered Object ID>
  review_job_id: <review Job ID>
  reviewed_object_id: <exact Object ID from the final review receipt>
  reviewed_sha256: <SHA-256 from the final review receipt>
  prompt: <prompt or pointer to the prompt artifact>
  references: <asset IDs and source URLs used>
  cost: <cost if available, or "not available">

## Verification

- request_fit: <pass|fail> - <output type, platform, ratio, duration, count vs brief>
- source_integrity: <pass|fail> - <claims, quotes, compliance facts vs sources>
- reachability: <pass|fail> - <every url checked>
- media_review: <pass|fail> - <receipt status, coverage, and observable findings>
  review_job_id: <review Job ID>
  reviewed_object_id: <exact Object ID from the final review receipt>
  reviewed_sha256: <SHA-256 from the final review receipt>
- cost_evidence: <pass|fail> - <cost records captured or noted unavailable>

## Unverified

- <each unverified claim, assumption, or gap; write "- none" if empty>
```

## Field Requirements (enforced by verify.mjs)

- Outputs entry: `role:` and `url:` are required; `platform:` and
  `aspect_ratio:` are expected (info finding when missing).
- Provenance entry: `output:`, `provider:`, `model:`, `job_id:`, `object_id:`,
  `review_job_id:`, `reviewed_object_id:`, and `reviewed_sha256:` are required.
  `prompt:` and `cost:` are expected (info finding when missing).
- Every Outputs `role:` needs a Provenance entry whose `output:` matches it.
- A media output can pass `media_review` only when `object_id:` exactly matches
  `reviewed_object_id:` from the final review receipt. It also records
  `reviewed_sha256:` from that receipt. A repaired artifact needs a new Object
  and receipt; an earlier Object or hash cannot bind to it.
- Every Provenance entry needs a `media_review: pass` gate in `## Verification`
  that repeats the same `review_job_id:`, `reviewed_object_id:`, and
  `reviewed_sha256:` on the lines under it. A pass without those bindings, or
  with different values, fails `delivery-review-evidence`.
- `## Verification` needs at least one checked gate line.
- `## Unverified` must exist; keeping it honest is the point. Never delete a
  finding to make verification pass; move it here instead.

## Optional Process

1. Choose this format when a formal handoff will be useful.
2. Add each output and its provenance entry as soon as a Job goes
   terminal.
3. Run `node <skill dir>/scripts/verify.mjs --strict <delivery file>`; it exits
   non-zero while warning findings remain.
4. Fix findings or move them to `## Unverified` with a reason, then re-run
   until the strict gate exits clean.
5. Present the document with URLs first, then provenance, verification, and
   unverified gaps.
