# Feature Metrics — Capture Convention

Two numbers per Feature, to measure **Agentic-SDLC (TAS) effectiveness vs traditional, no-AI work**. Stored in the Feature file **frontmatter** under a `metrics:` map, mirrored to `project-status.yaml` `features.{ID}.metrics`.

## Fields

| Field | Who fills | Unit | When |
|---|---|---|---|
| `human_time` | 👤 human, **once** | hours (decimal) | `/tas-plan`, before any code |
| `ai_time` | 🤖 auto, **cumulative** | hours (decimal, 0.1) | `/tas-dev`, accumulated to Done |

```yaml
metrics:
  human_time:   # est. traditional no-AI effort in hours — set once, LOCKED
  ai_time:      # cumulative AI-assisted implementation time in hours (0.1) — auto
```

**Speed-up = `human_time / ai_time`** (e.g. `human_time: 16`, `ai_time: 2.5` → 6.4× faster).

## `human_time` — the only manual number

- The single human input: at `/tas-plan`, estimate how many hours this Feature would take built the **traditional way (no AI)** — full hand-coding + manual tests + review + debug + docs.
- Estimate **before any code** and **LOCK** it — never edit after the Feature is Done (post-hoc editing = hindsight bias and destroys the comparison).
- For accuracy use reference-class (similar past features) or 3-point PERT `(O + 4M + P) / 6`.
- **Calibrate** periodically: build a few features the traditional way to sanity-check these estimates.

## `ai_time` — fully automatic, cumulative

- `/tas-dev` records a start timestamp (system clock, e.g. `Get-Date`) when implementation begins (Step 3), and **adds** the elapsed hours to `metrics.ai_time` when the invocation ends — at Done, or whenever it stops and hands control back to the human.
- A Feature usually takes several `/tas-dev` invocations; each one accumulates, so `ai_time` is the **sum across all runs** from first implement to Done.
- Round to `0.1` h.

### Honest limits

- This is session **wall-clock** (it includes human review/typing pauses) — a *proxy* for AI-assisted effort, not pure model-compute time (the kit can't read that).
- A crashed/abandoned invocation that never flushes loses its slice. **Cross-check** against calendar lead time (first dev commit → done, from git) to catch drift.

## Autonomous mode

- `human_time: N/A` — no human to estimate (so no speed-up ratio for that Feature).
- `ai_time` is still measured normally (the agent times its own run).

## Rules

- Lives in the Feature frontmatter `metrics:`; mirror the same fields into `project-status.yaml` `features.{ID}.metrics`.
- **Never block the workflow on metrics.** Human skips `human_time` → `N/A`, continue.
- `human_time` once set is authoritative — never overwrite. `ai_time` is **append-only** (accumulate, never reset).
