---
skill: lfcs-feedback-aggregator
version: 1
status: live (cron-driven, daily 04:00 AEST)
model: claude-haiku-4-5-20251001
inputs:
  - (none — pulls all Bid Line Item Overrides from Airtable)
outputs:
  - Rate Template proposals (notes appended to template; confidence=Needs review)
  - Common Misses Pattern proposals (drafted as Common Misses rows; confidence=Needs review)
  - _Brain/Open-Threads.md notification appended for each proposal
  - _Internal_Audit_Trail event row (event_type=feedback_aggregator_run)
implementation: HQ-Vault/11_OpsMan_LFCS/Codebase/lfcs-pricing-agent/lib/feedback_aggregator.py
---

# lfcs-feedback-aggregator

Cron-driven daily aggregator that turns captured overrides into Rate Template +
Common Misses Pattern proposals. Per Stage 4 § 3.3 + Stage 5 milestone 1 § 4.

## Diversity criteria (the rule)

A proposal fires only if ALL of:

| Criterion | Rate Template | Common Misses Pattern |
|---|---|---|
| Min override count | 3 | 2 |
| Min distinct jobs | 2 | 2 |
| Min days span (max - min created_at) | 30 | 30 |
| Min distinct reason-code domains | 2 | 2 |
| Min total dollar impact | — | $5,000 |
| Min median delta_pct | — | 10% |

Per Stage 4 correction #2: stricter than count-only. Library sharpens on signal,
not noise. If 3 overrides come from the same job + same context + same conditions,
they don't fire — that's effectively one signal counted three times.

## Auto-update behaviour

**NEVER auto-applied.** Proposals are written with `confidence=Needs review` and
notify Rocky via `_Brain/Open-Threads.md` + Telegram (existing Hermes plumbing).
Old `base_rate_aud` is preserved until Rocky confirms accept/reject/modify.

## Stage 5 kill criterion

If aggregator surfaces > 50% noise (Rocky rejects majority of proposals after
2026-08), tighten diversity criteria further (e.g., raise to ≥3 jobs, ≥60 days,
≥3 reason-code domains). Re-tune until Rocky's accept-rate exceeds 50%.

## Cron schedule

`/etc/cron.d/lfcs-feedback-aggregator`:
```
0 18 * * *  ccuser  cd /home/ccuser/rateright-growth && python -m lib.feedback_aggregator >> logs/feedback-aggregator.log 2>&1
```

(18:00 UTC = 04:00 AEST.)

## Run modes

```python
from lib.feedback_aggregator import (
    evaluate_rate_template_proposals,
    evaluate_common_misses_proposals,
)

rt_props = evaluate_rate_template_proposals()
cmp_props = evaluate_common_misses_proposals()

for p in rt_props:
    print(p.to_md())
```

## Related

- `lfcs-override-capture` (writes the data this skill reads)
- `_methodology_Rate_Templates` table (target for proposals)
- `_methodology_Common_Misses_Patterns` table (target for pattern auto-derive)
