> ## Documentation Index
> Fetch the complete documentation index at: https://meganharrisonconsulting.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Activation Runbook

> Controlled steps for activating the latest Project Intelligence packet writer.

## Goal

Activate `project_intelligence_synthesis_v1` as the current packet writer for
active client projects, then verify that the frontend reads fresh packets.

## Preconditions

* Source ingestion is current.
* Source embedding coverage is healthy.
* AI Gateway is configured and required for backend model calls.
* PM app final projections are explicitly allowed for the controlled run.
* Daily model budget guardrails are configured before broad background synthesis.

## Activation Steps

1. Confirm live packet drift.

```sql theme={null}
select
  compiler_version,
  packet_version,
  freshness_status,
  count(*) as rows,
  count(*) filter (where packet_type = 'current') as current_rows,
  count(*) filter (
    where packet_type = 'current'
      and generated_at > now() - interval '36 hours'
  ) as current_fresh_36h,
  max(generated_at) as newest_generated_at
from intelligence_packets
group by compiler_version, packet_version, freshness_status
order by newest_generated_at desc nulls last;
```

2. Run a dry run for one representative active project.

Use the admin refresh path or backend function to call:

```text theme={null}
refresh_project_intelligence(project_id, dry_run=true)
```

The dry run must show source documents in the delta window, valid source IDs,
structured project facts, and no silent model failure.

3. Run a controlled write for one project.

```text theme={null}
refresh_project_intelligence(project_id, dry_run=false)
```

The write must update the single `packet_type='current'` row for that target
with:

```text theme={null}
compiler_version = project_intelligence_synthesis_v1
packet_version = project_intelligence_synthesis_v1:current
```

4. Verify the project page reads the new packet.

Open the project intelligence page and confirm the packet generated time,
summary, and cited source evidence match the write.

5. Activate the portfolio backstop.

Run or enable the synthesis sweep only after the single-project proof passes.
The sweep should cover active projects and skip unchanged projects through the
empty-delta guard.

6. Rerun health checks.

```bash theme={null}
npm run rag:verify:source-lifecycle
npm run rag:verify:project-intelligence-live-paths
npm run docs:verify:project-intelligence
```

## Stop Conditions

Stop activation and mark it blocked if any of these happen:

* The dry run reports a model/provider failure.
* The write creates a second current packet instead of updating the one current
  row.
* The compiler version remains legacy after the write.
* Source citations are fabricated or missing.
* The frontend renders stale or unrelated packet content.

## Completion Criteria

Activation is complete only when live data shows current
`project_intelligence_synthesis_v1` packets for active project targets and the
verification commands pass.
