# Training Coach Clean Continuation Handoff

Prepared: 2026-08-03

## Purpose

Resume the unfinished Telegram nutrition-onboarding implementation without
loading the oversized inherited conversation.

This is a state handoff, not an instruction to start work automatically. The
new session must first read this file, report the recovered state, and wait for
the user. Do not register or create a Goal during bootstrap.

## Session migration

- Deprecated source session:
  `019fbd87-103f-7d02-a3ae-5d365f8f85bb`
- Raw source:
  `/home/cube/.senpi/agent/sessions/--home-cube-projects-richard-traning coach--/2026-08-01T13-32-53-184Z_019fbd87-103f-7d02-a3ae-5d365f8f85bb.jsonl`
- Observed size before migration: `217915643` bytes (`208M`).
- The source session inherited a much older implementation transcript and
  repeatedly failed compaction with:
  `Context remains above the compaction threshold because compaction did not complete`.
- Do not resume or fork that session.
- Do not use `--continue`; it may select the deprecated transcript.
- No Goal file belongs to the clean session.
- The old Goal JSON for session `019fb268-4c7f-7260-8b58-49539ae618a7`
  currently describes an unrelated blocked email-send task. It is stale and
  must not be imported.
- The corresponding `objective-full.txt` and the latest persisted
  `senpi.todo-state` are the reliable recovery sources used below.

## User-approved implementation objective

Complete and verify four pre-launch UX improvements across:

- `/home/cube/projects/richard/hermes-agent`
- `/home/cube/.hermes/profiles/physique-coach/workspace/checkin_cli`
- the isolated `dualcoachtest` runtime where applicable

The required product flows are:

1. Exact-route customer onboarding with current-version consent
   Grant/Decline controls. Consent persistence must be idempotent, must not
   activate a customer, and must never fall through to generic LLM ingress.
2. Durable Pause/Resume controls and exact Korean aliases, distinct from
   withdrawal. Paused state must survive restart and block processing and
   transport fail-closed without changing consent or activation evidence.
3. Customer check-in progress `N/M`, Previous, Continue later, and
   optional-only Skip. Preserve the same session across defer/resume, reject
   stale callbacks, invalidate dependent answers after navigation changes, and
   keep Telegram callback data at or below 64 UTF-8 bytes.
4. Adaptive operator first-send Preview -> Confirm/Cancel. Preview and Cancel
   must have no customer-delivery side effects. Confirm must revalidate all
   existing authority, consent, activation, grounding, revision, origin,
   replay, reservation-first, unknown-delivery, and sent-audit gates and permit
   at most one winner.

Adjacent requirements:

- Preserve exact customer/trainer/operator route separation.
- Preserve withdrawal behavior and owner-only controls.
- Preserve stale or ungrounded card suppression.
- Preserve reservation-first and provider-unknown no-retry behavior.
- Preserve append-only audit and sent-audit reconciliation.
- Keep real-customer delivery disabled.
- Do not send a real customer or pilot any message.
- Do not perform a live Telegram/provider send without a new explicit approval.
- Preserve unrelated shared-worktree changes.
- Do not commit or push unless the user explicitly requests it.

## Latest persisted work cursor

The latest reliable `senpi.todo-state` was persisted at
`2026-07-31T15:26:42.952Z`.

Completed:

- Capture protected live authority and worktree baselines.
- Port readiness implementation to canonical profile source.
- Add failing schema and calculation contract tests.
- Add failing private store and recovery tests.
- Add failing admin readiness and activation tests.
- Add failing Telegram ingress and publication tests.
- Add failing adaptive proposal-only contract tests.
- Implement strict onboarding models and calculations.
- Implement private versioned onboarding persistence store.
- Implement onboarding service and operator CLI.
- Implement disabled registry projection and activation v2.
- Implement global restriction knowledge seed validation.
- Implement thin Telegram onboarding adapter and wiring.

In progress:

- Integrate readiness cutover and adaptive policy.

Pending:

- Run canonical profile and gateway verification suites.
- Deploy feature allowlist and verify source parity.
- Perform isolated customer and trainer surface QA.
- Fix observed UX and functional defects RED-GREEN.
- Clean QA resources and audit protected state.
- Review complete diff and reconcile success criteria.

## Last observed implementation activity

Immediately before the compaction failure, the source session:

- added
  `/home/cube/projects/richard/hermes-agent/gateway/platforms/telegram_nutrition_onboarding_authority.py`;
- moved consent-receipt and feature-epoch digest helpers out of
  `telegram_nutrition_onboarding_runtime.py`;
- was tracing adaptive policy loading in
  `gateway/platforms/nutrition_coaching.py`;
- had not captured a green verification result for that final extraction or
  the readiness/adaptive-policy integration.

Treat the last edits as unverified. Re-read them and obtain diagnostics and
focused test evidence before building on them.

## Shared-worktree warning

Both the gateway repository and canonical profile are already heavily dirty.
The status includes many files unrelated to this objective. Never reset,
clean, stash, revert, or broadly format either worktree.

Known objective-related untracked gateway surfaces include:

- `gateway/platforms/nutrition_onboarding_reconciler.py`
- `gateway/platforms/nutrition_onboarding_reconciliation.py`
- `gateway/platforms/nutrition_service_state.py`
- `gateway/platforms/telegram_nutrition_onboarding*.py`
- `gateway/platforms/telegram_room_bootstrap*.py`
- `scripts/nutrition-room-bootstrap`
- `scripts/nutrition-service-state`
- matching focused tests under `tests/gateway/`

Known objective-related canonical profile surfaces include:

- `workspace/checkin_cli/checkin_cli/nutrition_onboarding*.py`
- `workspace/checkin_cli/checkin_cli/nutrition_readiness*.py`
- `workspace/checkin_cli/checkin_cli/wizard*.py`
- `workspace/checkin_cli/checkin_cli/customer_admin.py`
- `workspace/checkin_cli/checkin_cli/customer_coaching.py`
- matching tests under `workspace/checkin_cli/tests/`

This list is a navigation aid, not proof that every listed dirty file belongs
to the deprecated session. Establish ownership from source and tests before
editing.

## Safe resume procedure

On the first clean-session turn:

1. Read this entire file.
2. Confirm the session has no inherited transcript and no active Goal.
3. Inspect the current worktrees without modifying them.
4. Re-read the in-progress readiness/adaptive-policy integration and the last
   extracted authority helper.
5. Reconstruct the smallest focused test command from the existing tests.
6. Report the recovered cursor and proposed next test to the user.
7. Wait for explicit approval before implementation, service restart, feature
   deployment, or any Telegram/provider action.

Do not claim prior tests are green from the old transcript. Do not create
synthetic history, modify registry/JSONL state directly, or infer live service
state from this document.
