# Passes 4, 5, 6 — done_when / time_horizon / plain-language enrichment

Date: 2026-05-16
Output: encoded directly in `patch.json` per the audit spec.

## Pass 4 — done_when criteria

Added concrete completion criteria to **22 pending tasks**, covering:

- **All 14 EXECUTION_READY** tasks (mandatory per Pass 3 rules)
- **The 2 LOW_REVERSIBILITY EXECUTION_READY** tasks have the **additional mandatory verification + rollback checks** baked into `done_when`:
  - `catalog-refactor-shared-json`: visual parity per surface + 5-trading-day observation + per-surface revert plan
  - `add-user-role-approval`: column-existence + downstream join + 5-trading-day observation + DROP-COLUMN rollback documented
- **4 upstream foundation tasks** that gate compounding work (p0-daily-summary-view, etc.) — even though STILL_PENDING_REAL, their done_when is needed so when the upstream blocker clears, the task is execute-ready.
- **2 high-leverage MEDIUM tasks** (data-freshness-audit, mtf-vp-tradingview-handler)

VAGUE_CANDIDATE tasks (`remove-na-labels`, `strategy-backside-backtest`) intentionally got **no done_when** in the patch — Pass 1 already proposed a reframe before they qualify.

The rest of the pending tasks (~88) get no done_when in this audit. Most are either user/jimbo/alex/roberto-owned (out of scope per audit rules), or P2/none-priority (long_term / research, time-horizon doesn't justify the enrichment effort yet).

## Pass 5 — time_horizon

Every pending task got one of `immediate | near_term | long_term | research`:

| Horizon | Count | Mapping |
|---|---|---|
| immediate | 16 | All P0 tasks |
| near_term | 45 | All P1 tasks |
| long_term | 49 | All P2 + none priority |
| research | 0 | None this round |

Per audit rules: weekend pick filter is `time_horizon in [immediate, near_term]`. **61 pending tasks** clear this filter. Combined with the EXECUTION_READY (16) + supervised eligible (2 — catalog-refactor and add-user-role-approval) filters, the autonomous queue draws from a **14-task pool**.

Compounding infrastructure tasks default to `near_term` (per spec) — except when P0, in which case the priority wins and they're `immediate`. **5 of 7 compounding tasks are P0+immediate** (p0-freshness-dashboard, p0-orchestrator, p0-daily-summary-view, p0-identity-fn, p0-param-surface-registry); **2 are P1+near_term** (catalog-refactor-shared-json, shared-user-dropdown).

> *Updated 2026-05-16 consistency pass: original analyzer set compounding-P0 tasks to near_term (compounding default winning over priority). Corrected per spec — priority wins.*

## Pass 6 — plain-language enrichment

`plain_title` set on **all 110 pending tasks**. Heuristics applied:

- Strip "1/6", "2/6" foundation numbering ("1/6 Data-freshness dashboard..." → "Data-freshness dashboard...")
- Strip "BUG:", "USER:", "TODAY:" prefixes
- Cap at 120 chars

Examples:
| original | plain_title |
|---|---|
| 1/6 Data-freshness dashboard: /system/freshness.json + banner on hub | Data-freshness dashboard: /system/freshness.json + banner on hub |
| USER: 3 steps to finish journal persistence | 3 steps to finish journal persistence |
| BUG: Risk Bump Progress bar does not respect the selected date range... | Risk Bump Progress bar does not respect the selected date range... |
| 4/6 Identity function: resolve_user(account_id) -> (user_id, trader_name) | Identity function: resolve_user(account_id) -> (user_id, trader_name) |

`why_it_matters` set on **59 P0/P1 tasks**. Hand-written overrides on 14 high-leverage tasks (foundation P0s, data-freshness-audit, catalog-refactor, etc.); auto-generated from note text for the remaining P0/P1 tasks. P2 and none-priority tasks got no `why_it_matters` — keeping the patch focused.

## Notes

- `plain_title` may collide for a small number of tasks once foundation numbering is stripped — verified manually that none of the 14 EXECUTION_READY plain titles collide.
- `why_it_matters` for auto-generated entries is the first ~200 chars of the note. Hand-tune as needed during James's review.
- Schema v3 in todos.json doesn't currently have `plain_title` / `why_it_matters` columns. The apply_audit_patch.py runner needs to handle additive field-set per task (no schema migration needed; the page renderers can ignore unknown fields).
