# Intel agent dropped citations mid long-form briefing, render failed

## TL;DR
Dropped citations mid briefing mean the agent generated claims faster than it recorded sources, and by the render step the links are gone. The fix is inline citation capture: every claim gets its source attached at generation time, stored alongside the text. The renderer then assembles citations from the stored data instead of hoping the model remembers.

## The error
```text
(render failed)
intel agent dropped citations mid long-form briefing; claims without sources, render failed
```

## When this helps
- briefings lose citations mid generation
- renders fail on missing sources
- building citation pipelines
- auditing briefing provenance

## When it doesn't
- the briefing is informal; citation overhead may not pay
- sources are unknown; capture what exists
- the renderer is the bug; fix the renderer

## Works with
python 3.8+ with json. No external dependencies.

## Steps
### 1. Capture citations inline at generation time
```python
import json
claims = [{"text": "Revenue grew.", "cite": "10-K/A [acc]", "url": "https://www.sec.gov/[path]"}]
open("claims.json", "w").write(json.dumps(claims, indent=2))
print("claim and citation stored together, atomically")
```
Expected: Paired storage. The citation cannot be separated from its claim later.

### 2. Validate every claim has a citation before rendering
```python
import json
claims = json.load(open("claims.json"))
bare = [c for c in claims if not c.get("cite")]
print("uncited claims:", len(bare))
print("render blocked" if bare else "render allowed")
```
Expected: A pre-render gate. Uncited claims block the render instead of shipping bare.

### 3. Render citations from the stored data
```python
import json
claims = json.load(open("claims.json"))
for c in claims:
    print("-", c["text"], "[" + c["cite"] + "]")
print("renderer assembles; the model does not recall")
```
Expected: Rendered output. Assembly is mechanical, not generative.

### 4. Backfill missing citations by re-extracting
```python
import json
print("for legacy drafts: re-run extraction with citation capture")
print("no citation, no claim; backfill or drop")
```
Expected: A backfill policy. Old drafts get citations or get cut.

## Other ways people phrase this
### agent dropped citations briefing
Capture inline at generation. Validate before render.

### citations missing long-form briefing
The renderer assembles from stored pairs. Nothing is recalled.

### render failed missing sources
Gate the render on citation completeness.

## Why it happens
Models generate text fluently and citations fragilely; in long briefings the citation bookkeeping decays while the prose continues. Capturing the citation with the claim at generation time makes provenance structural. The renderer then cannot drop what it never had to remember.

## Edge cases
- Citation capture adds latency; batch it with generation.
- URLs rot; store the accession or DOI alongside.
- A claim with a wrong citation is worse than none; validate the link.
- Legacy drafts need a backfill pass before they meet the gate.
- Citation URLs should be checked with a HEAD request before rendering; dead links fail the gate.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_KrZR_TTou7wfZ6WfV6qH-Q
