# Lynn V0.79.4 Overnight Progress

Date: 2026-05-26 09:13 CST
Branch: `codex/v0794-central-refactor`

This document records the overnight central-refactor checkpoints after the
V0.79.3 notarized package candidate was preserved.

## Current Guardrail

- Do not push, release, or mirror-upload from this branch yet.
- Do not download local model artifacts, BF16, GGUF, datasets, or training
  bundles to the local Mac.
- Keep `server/routes/chat.js`, `core/engine.js`, and
  `core/session-coordinator.js` as high-risk centers; only small, tested edge
  moves have landed so far.
- Ignore unrelated untracked engine/model experiment files in this worktree.

## Clean Checkpoints

### Checkpoint 1

Included changes:

- Provider state machine foundation:
  `shared/provider-state.ts`, `core/provider-state-machine.ts`.
- Local model IPC contract:
  `shared/local-model-ipc.ts`.
- Local model main-process IPC boundary skeleton:
  `desktop/local-model-manager-main.cjs`.
- Chat route context and title helper extraction:
  `server/chat/chat-route-context.ts`, `server/chat/title-generator.ts`.
- Chat stream emitter extraction:
  `server/chat/stream-emitters.ts`.
- Provider summary state snapshots:
  `core/provider-state-summary.ts`, `/api/providers/summary`.

Verified:

- `npm run typecheck:runtime`
- `npm run typecheck`
- `npm test`: 188 files / 1478 passed / 1 skipped

### Checkpoint 2

Included changes:

- Shared i18n runtime:
  `shared/i18n-runtime.ts`, with `server/i18n.ts` as compatibility re-export.
- Provider state consumed in settings UI.
- `core/expert-manager` migrated to TypeScript.
- `server/chat/local-office-answer` migrated to TypeScript.

Verified:

- `npm run typecheck:runtime`
- `npm run typecheck`
- Focused tests: 12 files / 154 passed
- `npm test`: 192 files / 1493 passed / 1 skipped
- `npm run build:server`, including runtime import smoke

### Checkpoint 3

Included changes:

- `server/routes/providers` migrated to TypeScript.
- `core/plugin-manager` migrated to TypeScript.
- `core/migrate-providers` migrated to TypeScript, with migration tests.
- `core/execution-router` migrated to TypeScript.
- `lib/llm/provider-client` migrated to TypeScript.
- `lib/compat/checks/*` migrated to TypeScript.
- Small REST routes migrated to TypeScript:
  `server/routes/experts`, `server/routes/upload`, `server/routes/mcp`.
- `lib/tools/notify-tool` migrated to TypeScript.

Verified:

- `npm run typecheck:runtime`
- `npm run typecheck`
- Focused tests: 13 files / 124 passed
- `npm test`: 193 files / 1497 passed / 1 skipped
- `npm run build:server`, including runtime import smoke

### Checkpoint 4

Included changes:

- Core manager migrations:
  `core/model-manager`, `core/channel-manager`,
  `core/config-coordinator`, `core/skill-manager`.
- Route migrations:
  `server/routes/fs`, `server/routes/memory`, `server/routes/bridge`,
  `server/routes/channels`.
- Tool and memory leaf migrations:
  `lib/tools/todo`, `lib/tools/cron-tool`, `lib/tools/active-task`,
  `lib/memory/session-stats`, `lib/memory/active-task`,
  `lib/memory/config-loader`, `lib/memory/memory-exclusions`.

Verified:

- `npm run typecheck:runtime`
- `npm run typecheck`
- Focused tests across migrated modules: 129+ passing tests
- `npm test`: 193 files / 1497 passed / 1 skipped
- `npm run build:server`, including runtime import smoke

### Checkpoint 5

Included changes:

- Tool migrations:
  `lib/tools/web-fetch`, `lib/tools/delegate-tool`,
  `lib/tools/report-tool`, `lib/tools/update-settings-tool`,
  `lib/tools/poster-tool`, `lib/tools/pptx-tool`, `lib/tools/docx-tool`.

Verified:

- `npm run typecheck:runtime`
- Focused tests for migrated tools:
  `delegate-tool`, `realtime-market-weather`, `stock-market-tool`,
  `generated-tools`, `report-tool-editorial`, `update-settings-tool`,
  `tool-tiering`
- `npm run typecheck`
- `npm run build:server`, including runtime import smoke
- `npm test`: 193 files / 1497 passed / 1 skipped

## TS Coverage Snapshot

At this checkpoint, for runtime folders (`core/`, `server/`, `lib/`, `shared/`):

- `*.ts`: 160
- `*.js`: 133

For runtime + React UI (`core/`, `server/`, `lib/`, `shared/`,
`desktop/src/react`):

- `*.ts`: 278
- `*.tsx`: 140
- `*.js`: 133

For the actively targeted runtime slices (`core/`, `server/routes`,
`lib/tools`, `lib/memory`):

- `*.ts`: 67
- `*.js`: 38

## Landed Commit Range

Latest V0.79.4 commits include:

- `0d70851 chore(v0.79.4): migrate snapshot restore tool to TypeScript`
- `53d208c chore(v0.79.4): migrate docx tool to TypeScript`
- `66cccdd chore(v0.79.4): migrate pptx tool to TypeScript`
- `f7452da chore(v0.79.4): migrate poster tool to TypeScript`
- `ef2d00e chore(v0.79.4): migrate settings tool to TypeScript`
- `454cbb9 chore(v0.79.4): migrate report tool to TypeScript`
- `ae9fc5a chore(v0.79.4): migrate fetch and delegate tools to TypeScript`
- `6237d9e chore(v0.79.4): migrate memory config helpers to TypeScript`
- `b507ec5 chore(v0.79.4): migrate agent tools to TypeScript`
- `0e95d86 chore(v0.79.4): migrate active task helpers to TypeScript`
- `e43c708 chore(v0.79.4): migrate session stats to TypeScript`
- `d76d911 chore(v0.79.4): migrate cron tool to TypeScript`
- `4e3e7c3 chore(v0.79.4): migrate todo tool to TypeScript`
- `5b9a13b chore(v0.79.4): migrate channels route to TypeScript`
- `e03fbfb chore(v0.79.4): migrate config coordinator to TypeScript`
- `9a5d35e chore(v0.79.4): migrate skill manager to TypeScript`
- `d64398c chore(v0.79.4): migrate bridge route to TypeScript`
- `1dc43d6 chore(v0.79.4): migrate channel manager to TypeScript`
- `8f4c39b chore(v0.79.4): migrate fs route to TypeScript`
- `7370765 chore(v0.79.4): migrate memory route to TypeScript`
- `79bb9fe chore(v0.79.4): migrate model manager to TypeScript`
- `796f281 chore(v0.79.4): migrate notify tool helper to TypeScript`
- `aeda3de chore: migrate execution router to TypeScript`
- `3901d09 Migrate compat checks to TypeScript`
- `41d0f47 Migrate small REST routes to TypeScript`
- `1f501c8 refactor: migrate provider migration helper to ts`
- `a8691d2 chore(v0.79.4): migrate plugin manager to TypeScript`
- `0f0bb29 Migrate providers route to TypeScript`
- `7043d61 chore(v0.79.4): migrate provider client helper to TypeScript`
- `2a2c3bf chore(v0.79.4): migrate local office answer helper to TypeScript`
- `b9d55c6 Migrate ExpertManager to TypeScript`
- `c41198a Use provider state snapshot in settings UI`
- `2cc422b refactor i18n runtime into shared`
- `14b6c1a feat(v0.79.4): expose canonical provider state snapshots`
- `2261f40 refactor(v0.79.4): extract chat stream emitters`
- `9162c69 feat(v0.79.4): add local model IPC main-process boundary`
- `71da64b refactor(v0.79.4): extract chat route context and title helper`
- `aef36a5 feat(v0.79.4): add local model IPC contract`
- `fadedf4 feat(v0.79.4): add provider state machine foundation`

## Next Safe Work

Recommended next moves before touching the true centers:

- Continue reducing `lib/tools/**` and `lib/memory/**` leaf JS where focused
  tests exist (`browser-tool`, `experience`, `channel-tool`,
  `restore-snapshot-tool`, and `install-skill` are plausible next slices).
- Consider medium route migrations only when they have focused tests
  (`agents`, `config`, `sessions`, `skills`, `review`, `desk`), and keep them
  one-at-a-time.
- Keep build smoke in the loop after any route/core migration because package
  runtime resolution is the real compatibility gate.

Hold for a separate V0.79.4 late phase:

- `server/routes/chat.js` finalizer/local bridge split.
- `core/engine.js` service extraction.
- `core/session-coordinator.js` decomposition.
