# openspec/changes/wf-investor-update/proposal.md

## Why

Investor updates are assembled by hand from five tools, and the numbers drift from one month to the next. Investors trust a number they can click. Each month's update builds on the last instead of starting over.

## What Changes

- Add the `investor-update` workflow to the PromptReports workflow library, run by the workflow runner as an agent acting for a person.
- Sales as Code: Forecast grades for the month (today: Planned).
- CommitOps: Promises kept and broken (today: Planned).
- RepoOps: Reliability and shipped work (today: Planned).
- AI Source of Truth: Check each figure against its record (today: Built).
- PromptCompute: A person approves the update (today: Built).
- PromptReports: Send it (today: Planned).
- Gate `investor.update.send` through PromptCompute approvals; each gated step runs only after `verifyResume` passes, with `final_args`.
- Write a signed record at the end of each run and count one workflow request.

## Impact

- Products: Sales as Code, CommitOps, RepoOps, PromptCompute, AI Source of Truth.
- Outside the family: Your email.
- State: Partly built. The AI Source of Truth figure check is live. Four parts to go.
- Plan row: LDG-2278.

# openspec/changes/wf-investor-update/tasks.md

## 1. Connect and authorize

- [ ] 1.1 Confirm the org has a connection for each of: Sales as Code, CommitOps, RepoOps, PromptCompute, AI Source of Truth. Stop and tell the user which is missing.
- [ ] 1.2 Get a PromptReports ID agent token for each product the run calls (RFC 8693 exchange). Where a product does not accept ID tokens yet, use its connect key.
- [ ] 1.3 Register policy for `investor.update.send` with `require_approval` as the default.

## 2. Build the steps

- [ ] 2.1 Sales as Code: Forecast grades for the month. Blocked: this part is Planned; until it ships, record the step's evidence as `missing` and continue.
- [ ] 2.2 CommitOps: Promises kept and broken. Blocked: this part is Planned; until it ships, record the step's evidence as `missing` and continue.
- [ ] 2.3 RepoOps: Reliability and shipped work. Blocked: this part is Planned; until it ships, record the step's evidence as `missing` and continue.
- [ ] 2.4 AI Source of Truth: Check each figure against its record.
- [ ] 2.5 PromptCompute: A person approves the update.
- [ ] 2.6 PromptReports: Send it. Blocked: this part is Planned; until it ships, record the step's evidence as `missing` and continue.

## 3. Verify and record

- [ ] 3.1 Run a dry run with the user's inputs: Month = 2026-10; Recipients = Investor list.
- [ ] 3.2 Run it once for real; approve each gate as the user.
- [ ] 3.3 Measure the outcomes: Numbers with a record link: target 100%; Hours to assemble the update; Corrections issued after sending: target 0.
- [ ] 3.4 Confirm the run left a signed record with a task id and one workflow request counted.

# openspec/changes/wf-investor-update/specs/workflow-investor-update/spec.md

## ADDED Requirements

### Requirement: Every figure links to a record

Each number in the update SHALL link to the record it came from, with its date.

#### Scenario: Every figure links to a record

- **WHEN** a figure fails the AI Source of Truth check
- **THEN** the approval card shows the failed figure and the send step waits

### Requirement: Evidence stays honest

Each step SHALL report what it saw as measured, inferred or missing, and SHALL never report missing as measured.

#### Scenario: A product part is not built

- **WHEN** a step depends on a part that is Planned or Proposed
- **THEN** the step records `missing`, names the part, and the approval card shows the gap

### Requirement: One run is one workflow request

The runner SHALL count one workflow request when the first step starts, and SHALL NOT count retries, resumes or dry runs.

#### Scenario: A gated step resumes after two days

- **WHEN** a person approves a step and the run resumes
- **THEN** the org's usage does not change
