# CLI 0.0.4-microsoft-preview.31

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

## Audited Ollama stream recovery

- Treat a successful Ollama HTTP response that ends without its required final
  `done: true` record as a structured `MODEL_STREAM_INCOMPLETE` failure. The
  accumulated response remains rejected and cannot reach tool validation or
  execution.
- Preserve the incomplete response and diagnostic as a distinct engine-audit
  round, count its estimated token usage, and permit one fresh model round for
  the same current-stage action. Two consecutive incomplete streams still fail
  closed, and the retry cannot exceed the existing stage round limit.
- Reset the consecutive recovery allowance only after a complete model
  response. This permits separate transient interruptions during a long stage
  without creating an unbounded retry loop.
- Accept only 2xx Ollama generation responses. Redirects and other non-2xx
  responses now report their HTTP status instead of being misclassified as a
  missing completion marker.
- Count an empty 2xx stream that lacks its completion marker as an estimated
  provider invocation, so retry and failure reports do not hide an attempted
  model call.

The preview.30 qualification run completed grouping and the full Microsoft
Discovery stage, including the architecture that preview.29 rejected. Planning
also stored its target architecture, then Ollama planning call 11 ended after
84.791 seconds with valid partial NDJSON but no terminal completion record. The
host executed no tool and rejected the partial response. Preview.31 adds the
bounded, audited recovery for exactly that pre-tool condition.

## Mermaid labelled-edge recovery retained

This preview includes preview.30's deterministic repair for quoted or
space-containing Mermaid endpoints on labelled solid, dotted, and thick links.
When a label has one declared node ID, its edges reconnect to that ID instead
of creating a duplicate logical orchestration. Undeclared and ambiguous labels
retain stable, fail-closed handling through the pinned Mermaid grammar.

## Verification and limits

- 149 Microsoft migration-core tests and 254 CLI tests pass, including bounded
  retry, audit separation, round-limit, repeated-interruption, redirect, empty
  stream accounting, and the exact Mermaid regression coverage.
- The failed preview.30 reports and stage audit are preserved under
  `failure-evidence/2026-09-21T16-43-41-preview30-ollama-stream` in the test
  workspace. They establish a provider-stream interruption, not a missing
  BizTalk dependency or an executed partial tool call.
- A complete fresh FINACCONT2024Backup-BT migration with preview.31 remains a
  post-publication qualification step. This release does not claim a deployed
  Logic Apps runtime test or business equivalence.

## PowerShell update

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

Expected version: `0.0.4-microsoft-preview.31`. This preview is not promoted to
the stable `latest` alias. Preserve existing reports and generated output before
upgrading. Use a fresh generated workspace because the Microsoft engine
fingerprint changed; do not edit fingerprint records to force checkpoint reuse.
Installation does not reset license counters.
