Skip to content

fix(hub): show the Wiki migration command in Health when migration is required - #272

Open
M4Y4NK-V3RM4 wants to merge 3 commits into
mex-memory:mainfrom
M4Y4NK-V3RM4:fix/268-hub-health-migration-command
Open

M4Y4NK-V3RM4 wants to merge 3 commits into
mex-memory:mainfrom
M4Y4NK-V3RM4:fix/268-hub-health-migration-command

Conversation

@M4Y4NK-V3RM4

Copy link
Copy Markdown

What

Hub Health now tells you what to do when the Wiki index is migration_required, instead of showing "No repair recommended" with no action. This is the first fix listed in #268. The other three (population prompt wording, launchHub routing to finalize, a migration job) are not included, and some of them overlap the setup work in #271.

  • WikiHealthDetails gets an optional, nullable, bounded recoveryCommand: { label, command } field (strict, max 200 chars each). Older payloads without it still parse.
  • projectWikiHealthStatus sets it only for migration_required, to "Preview the required Wiki migration" / mex wiki migrate --dry-run. Every other state gets null. allowedWikiOperations and recommendedWikiOperation are unchanged, so the Hub still never runs the migration itself (explicit-mutation rule).
  • The migration_required health summary now says to preview with mex wiki migrate --dry-run and then apply it with the CLI.
  • HealthPage → WikiHealthReadout: when a recovery command is present and no job is recommended, the pill reads "CLI action required" and the label and command are shown in a <code> block under the facts.
  • The label and command live in one small constant (src/wiki/migration/recovery.ts). mex capabilities and the Specs recovery in team/specs/cli/projections.ts now build their existing --json strings from it, so all three can't drift apart. Their output is byte-for-byte unchanged.

Why

Part of #268. A scaffold committed before finalization leaves every clone at migration_required, and Health was a dead end, even though the CLI already knows the next step (src/capabilities.ts, Specs recovery).

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • CI/Tooling

How to test

  1. Open the Hub on a repo whose Wiki index is migration_required (repro steps in A setup committed before finalization leaves every clone's Wiki at migration_required, with no Hub recovery #268, or delete .mex/wiki.db on a scaffold whose .mex/*.md files have no mex: key).
  2. Health → Wiki index shows "CLI action required" with "Preview the required Wiki migration" and mex wiki migrate --dry-run.
  3. Any other state (fresh, stale, missing…) looks exactly as before.

Run locally on top of main (54f7d7a):

  • npm run typecheck (contracts, root, hub-web): pass
  • npx vitest run src/hub/__tests__/services.test.ts packages/hub-contracts/src/index.test.ts src/team/specs/cli/__tests__/commands.test.ts test/capabilities.test.ts test/wiki-architecture.test.ts src/hub/http/__tests__/app.test.ts: 6 files, 141 tests pass
  • cd packages/hub-web && npx vitest run src/app/page-states.test.tsx: 55 tests pass

New tests: a services test (recovery command and summary for migration_required, null for fresh), a contracts test (optional, nullable, bounded, strict), and a Health page test (command shown, "No repair recommended" absent).

Not run: the full npm test suite and npm run build. I didn't add a CHANGELOG line, to avoid conflicting with the 0.8.4 release PR. Happy to add one if you'd like.

Checklist

  • Tests pass (npm test). Only the targeted files above were run.
  • No breaking changes (the new contract field is optional)
  • Tested locally with a real project. Not tested against a live Hub, only through unit and page tests.

Assisted-by: AI agent (Hark) with ZCode/GLM-5.3-Flash. I reviewed the change and the test results above.

… required

Part of mex-memory#268. Hub Health showed 'No repair recommended' for a
migration_required Wiki index. Carry a bounded recoveryCommand in
WikiHealthDetails and render it, sharing the wording with mex
capabilities and Specs recovery.

Assisted-by: AI agent (Hark) with ZCode/GLM-5.3-Flash
…Wiki health cases

Assisted-by: AI agent (Hark) with ZCode/GLM-5.3-Flash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant