Temp workspace: /tmp/cpfs-ext-hist-spTwDu

Running migration...

Assertions:
  ok  historys.json exists at repo root
  ok  registry version 1
  ok  registry mcp_last_used = factai-main
  ok  registry extension_last_used = factai-main
  ok  registry has 1 history
  ok  history entry name = factai-main
  ok  history entry folder = All-logs/factai-main
  ok  All-logs/factai-main/ exists
  ok  dest folder has 2 logs
  ok  dest has alpha_task
  ok  dest has beta_task
  ok  All-logs/factai-main.log index exists
  ok  index version 1
  ok  index historyName = factai-main
  FAIL index has 2 entries
  FAIL alpha entry relPath = All-logs/factai-main/alpha_task.log
  FAIL alpha entry preserved jobNumber 11
  ok  old dir file list unchanged
  ok  old dir file sizes unchanged

Re-running migration (idempotence)...
  ok  idempotent: still 2 logs
  FAIL idempotent: index still 2 entries

Data-layer API:
  ok  listHistories returns 1
  ok  getActiveHistory(extension) = factai-main
  ok  created 2nd history stl2cad
  ok  after setExtensionActive, extension active = stl2cad
  ok  mcp active still factai-main
  ok  setActiveHistory(extension, factai-main) back
  ok  createHistory duplicate throws
  ok  setActiveHistory unknown throws
  ok  resolveActive(extension) returns factai-main with logsDir

26 passed, 4 failed
