fix(interaction): preserve failed settle counters

Merged
TH
11d ago
+177-46

Summary

Keep completed settle-loop captures, elapsed time, and quiet window when a later capture or session publication fails. For example, agent-device press "label=Continue" --settle still succeeds when observation breaks. The unavailable observation remains unsettled and publishes no settled diff or refs.

Four files: move failure reporting and its existing test into matching small modules, then cover both failure branches and the zero-before-outcome case. The legacy test aggregate shrinks.

Validation

Tested head: 012ce8d0fbd7d52c439d697a911de90b00718858 (base fc224bc1e1).

  • pnpm check:affected --base fc224bc1e1 --head 012ce8d0fb --run: passed.
  • Fresh-context review: no actionable findings; focused settle suites passed 30/30.
  • Same command: pnpm exec vitest run --project unit-core src/commands/interaction/runtime/settle-unavailable.test.ts. New tests retained while restoring base settle.ts, then restoring head:
base fc224bc1e1 implementationhead 012ce8d0fb
2 failed, 3 passed5 passed

Both failures are completed-counter assertions; fake clocks avoid production waits.

CI coverage/provider jobs are pending. Native behavior is unchanged; no live-device run was performed.