# CLI 0.0.4-microsoft-preview.16

Microsoft migration engine preview. Stable `latest` remains 0.0.3.

## Context capacity checked before model work

- Precheck now measures the required prompts for grouping, discovery, planning, task planning and conversion tasks before starting model work. Direct Microsoft stage sessions enforce the same check.
- Runtime and precheck share the actual prompt builder and phase-specific tool definitions. Required Microsoft agent instructions and prerequisite skills remain complete and unmodified.
- Insufficient capacity produces structured `CONTEXT_BUDGET` requirements identifying every affected phase, its byte allowance, reserves, minimum configured context and suggested YAML. This is not reported as a missing binding or dependency.
- Planning no longer duplicates the full orchestration coverage dataset in its mandatory prompt. Exact requirements remain available through `migration_getMigrationContext` and paginated archive reads. All coverage rules and finalization checks remain enforced.
- Context measurements use the existing conservative UTF-8 byte bound, not estimated token counts. Tool-loop limits and evidence retention are unchanged.

## YAML setting for the full Microsoft pipeline

Merge these settings into the existing `agent` section, preserving provider, model and endpoint:

```yaml
agent:
  contextWindowTokens: 262144
  maxOutputTokens: 8192
```

Use this only when the model, Ollama server and available memory support it. With the current pinned instructions and conservative guard, 131072 fits discovery but not planning. Planning's minimum configured context is approximately 185,387 with an 8192 output reserve; 262144 gives additional evidence headroom. Passing preflight is not a guarantee of inference memory availability or successful migration.

## Install or update (PowerShell)

```powershell
Invoke-WebRequest 'https://tools.lambogenius.com/lambogenius-integration-migration/0.0.4-microsoft-preview.16/install-cli.ps1' -OutFile install-cli-preview16.ps1
# Review the downloaded script before running it.
& .\install-cli-preview16.ps1 -SkipDependencies
li.cmd --version
```

Expected version: `0.0.4-microsoft-preview.16`. Omit `-SkipDependencies` if prerequisites need installation. Use `li.cmd` to avoid PowerShell's built-in alias.

The engine fingerprint changes. Preserve old output and select a fresh generated workspace; do not force resume by editing checkpoint fingerprints. Installation does not reset entitlements or extend the license term.

## Verification and limitations

78 Microsoft-core tests, 219 CLI tests and 24 installer/release tests passed, along with compilation and lint. Seven new regressions cover the reported 54,748-byte prefix, zero-call early failure, all-stage 64K/128K/256K capacity, structured precheck guidance, complete upstream skill content, non-duplicated coverage data, Unicode and output reserves.

These tests verify context handling and retained validation requirements. They do not constitute a new end-to-end FINACCONT-BT conversion or demonstrate runtime behavioral equivalence. No customer source/output, global installation, license counters or Azure resources were changed.
