File size: 3,791 Bytes
57ed4c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Finish audit β€” Habit Journal P1

Date: 2026-07-22 (updated after gap close)  
Scope: architecture ↔ code ↔ deploy readiness. Non-goals (PERMA/Ξ΄/H, EventKit, push, multi-user) excluded.

## Inventory

| Area | Required | Status | Files |
|------|----------|--------|-------|
| Auth session + AGENT_TOKEN | Session cookie + bearer agent | **done** | `app/routers/auth.py`, `app/deps.py`, `app/config.py`, `app/routers/agent.py` |
| Entries CRUD + pending | Create/list/patch, pending resolve | **done** | `app/routers/entries.py`, `PendingResolve.tsx` |
| Daily 6-pt + movement/proof/fantasy | Formula unchanged + additive fields | **done** | `app/models.py`, `app/store_daily.py`, `Daily.tsx` |
| Entry loop fields | `fse_spike`, `avoidance_types`, `proof_brick`, `walk_type` | **done** | `models.py`, `store_entries.py`, `Log.tsx`, `api.ts` |
| `GET /api/loop/summary` | Week loop metrics | **done** | `app/routers/loop.py` |
| Resolve pending sheet | <3 taps | **done** | `ResolvePendingSheet.tsx` |
| Home: week / pending / plan / banners | Indoors + Move now + proof + plan | **done** | `Home.tsx`, `MoveNowSheet.tsx` |
| Log: tags, high-I proof, label-only warn | Tags + proof + warning | **done** | `Log.tsx` |
| Plan: timeline, feedback, reschedule, seed | P1 Seligman lock | **done** | `Plan.tsx`, `plan.py` |
| Agent: GET context, PUT plan | Priors + movement + label_only_fail_rate | **done** | `agent.py` |
| Coach: parse + template-echo β†’ Rules | Placeholders β†’ backup | **done** | `coach_service.py` (`is_template_echo`) |
| backup_replies high-I FSE | Proof + interrupt, not label-only | **done** | `backup_replies.py` |
| Plan soft all-grind warn | explore/restore when capacity allows | **done** | `schedule_math.validate_blocks`, `DayPlan.warnings` |
| Stats + remedies | SERVER_PICKS | **done** | `stats.py` |
| Debug paste / traces | Copy bundle | **done** | `debug.py`, `CoachResult.tsx` |
| SW network-only `/api/*` | Never cache API | **done** | `static/sw.js`, `vite.config.ts` |
| Dockerfile multi-stage β†’ static/ | Frontend build in image | **done** | `Dockerfile` |
| Proof kind label set (8) | Interrupt walk … Other | **done** | models + Daily/Log (legacy kinds still validate) |
| Tests | Listed cases | **done** | `tests/` β€” 30 passed in `.venv` |
| README env + HF deploy | AGENT_TOKEN, OPENROUTER_*, DATA_ROOT | **done** | `README.md` |

## Remaining (non-critical)

- Live Space verification checklist below (needs deploy + phone).
- Free-tier HF `/data` is ephemeral across rebuilds β€” export if you need history.

## Live acceptance (fill after deploy)

- [ ] `GET /api/health` 200  
- [ ] Login works  
- [ ] Nav shows **Plan**  
- [ ] Daily saves movement + proof fields, reload persists  
- [ ] Home indoors banner after 2 indoors dailies β†’ Move now sheet  
- [ ] Log I=9 + remedy Labeling β†’ warning + Rules not label-only  
- [ ] Coach fake template β†’ backup (`TEMPLATE_ECHO`)  
- [ ] Plan: block β†’ feedback β†’ priors change  
- [ ] `GET /api/agent/context` bearer returns priors + movement + `label_only_fail_rate`  
- [ ] Reschedule without OR key β†’ rules, P0 kept  
- [ ] Pending resolve < 3 taps  
- [ ] Production build at `/`  

## Deploy (HF Space)

```text
# From repo root, with HF remote configured (usually `hf` or `origin`):
git add -A
git status
git commit -m "Finish P1: loop summary, template-echo Rules, Move now, proof kinds"
git push hf master:main
# or: git push origin master
```

Space: https://Mbonea-Fastwhisper.hf.space  
Secrets in Space settings (not git): `APP_PASSWORD`, `APP_SECRET_KEY`, optional `AGENT_TOKEN`, `OPENROUTER_API_KEY`.  
`DATA_ROOT` default `/data/loop_logger` (Docker creates it).

Phone check: hard-refresh or clear SW cache once after deploy so Plan / Move now appear.