# Live Runner Successor Handoff - 2026-05-27

## Branch / Worktree

- Worktree: `/var/www/vps2.happyuser.info/top/top_1_veronika_live_runner_sep`
- Branch: `codex/veronika-live-runner-sep-20260527`
- Governance read:
  - `/var/www/vps2.happyuser.info/top/.codex_CLI_laptop_local_philosofy/PHILOSOPHY.md`
  - `/var/www/vps2.happyuser.info/top/.codex_CLI_laptop_local_philosofy/AGENT_GOVERNANCE.md`
  - `/var/www/vps2.happyuser.info/top/.codex_CLI_laptop_local_philosofy/ENVIRONMENT_POLICY.md`
- Requested governance file not found:
  - `/var/www/vps2.happyuser.info/top/.codex_CLI_laptop_local_philosofy/AGENT_GIT_WORKTREE_POLICY.md`

## Dirty Files

Current `git status --short`:

```text
 M continuity/lines/live-runner.md
 M obw_platform/runners/live_runner_dual.py
 M obw_platform/strategies/cryptomine_pack_dual_full.py
 M obw_platform/strategies/cryptomine_pack_dual_full_lifo_strict.py
?? obw_platform/runners/legacy_strategy_adapter.py
?? obw_platform/runners/live_runner_dual_responsibility_map.md
?? obw_platform/runners/strategy_intents.py
?? obw_platform/tests/test_live_runner_strategy_intents.py
```

This handoff file is new and will also appear as untracked after creation.

## Refactor Summary

- Added explicit execution intent contract in `obw_platform/runners/strategy_intents.py`.
- Refactored `live_runner_dual.py` so strategy intent/policy controls:
  - entry sizing or explicit sizing delegation;
  - DCA order style;
  - limit-to-market fallback permission;
  - retry/backoff checks;
  - close/reduce permission separated from risk-increasing entry/DCA backoff.
- Added hybrid DB+JSON pending entry lifecycle:
  - DB table `pending_entry_orders`;
  - create/update/fill/cancel/remove/restart-load helpers;
  - DB-first startup load with JSON mirror as transition fallback.
- Changed stale pending-limit sync so final order/fill state is fetched and applied before cancel/removal.
- Added no-fill restart recovery guard: if a restart-loaded stale pending entry lacks strategy snapshot metadata, runner blocks recovery of that pending entry instead of restoring `None` or deleting state.
- Extended restart guard to inspect exchange-wide open orders when supported, fall back to symbol-scoped fetch when required, ignore reduce-only/close orders, and preserve order side / positionSide metadata in block payloads.
- Added `obw_platform/runners/legacy_strategy_adapter.py` for explicit legacy compatibility only:
  - `size -> qty`;
  - old no-qty signals only when `legacy_runner_notional_sizing=true`;
  - old `manage_position(is_live, sym, row, pos, ctx)` support;
  - legacy DCA default order type as explicit policy.
- Added execution policy/backoff hooks and JSON-safe rollback snapshots to live-candidate strategy classes touched by this branch.

## Tests / Checks Run

```bash
PYTHONPATH=. python obw_platform/tests/test_live_runner_strategy_intents.py
```

Result:

```text
Ran 46 tests in 2.457s
OK
```

```bash
python -m py_compile obw_platform/runners/strategy_intents.py obw_platform/runners/legacy_strategy_adapter.py obw_platform/runners/live_runner_dual.py obw_platform/strategies/cryptomine_pack_dual_full.py obw_platform/strategies/cryptomine_pack_dual_full_lifo_strict.py obw_platform/tests/test_live_runner_strategy_intents.py
```

Result: passed with no output.

No live or paper-live process was started. No secrets or `.env` values were read. No live runtime DB/log/state was intentionally written.

## Current Verdict

Verdict: `paper/replay ready`.

It is not a `live restart candidate` because:

- DB-backed pending lifecycle is new and needs adversarial review.
- Strategy snapshot persistence and restart recovery are newly changed and need focused review.
- Exchange-wide `fetch_open_orders()` behavior is covered by fake contract tests only, not by a replay/virtual exchange preflight.
- Legacy compatibility adapter is new and should be reviewed against real old strategies before enabling.
- The worktree is dirty and uncommitted.

## Known Risks

- DB-backed pending lifecycle is new and needs adversarial review, especially crash points between order submit, DB upsert, JSON mirror write, fill sync, cancel, and remove.
- Strategy snapshot persistence/recovery must be reviewed, especially JSON-safe snapshot shape for active strategies and no-fill rollback semantics.
- Exchange-wide `fetch_open_orders()` must be verified against replay/fake exchange before live restart.
- Legacy strategy adapter compatibility must be reviewed; strict mode should remain default.
- Worktree is dirty/uncommitted.

## Safety Boundaries

- Do not place live orders.
- Do not read secrets or `.env` values.
- Do not restart live or paper-live processes.
- Do not remove `STOP_NEW_ORDERS`, `KILL`, or live control guard files.
- Do not write live runtime DB/log/state unless the human explicitly instructs it.
- Work with the dirty tree; do not revert unknown changes.

## Suggested Next Successor Tasks

1. Review the current diff before editing.
2. Find and use a virtual exchange or replay exchange for preflight if available.
3. Run preflight with fake/replay exchange only.
4. Review DB pending lifecycle, strategy snapshot recovery, exchange-wide open-order adapter behavior, and legacy adapter compatibility.
5. Only after replay evidence decide whether the branch remains `foundation only`, is `paper/replay ready`, or can become a `live restart candidate`.
