Skip to content

fix(update): journal to_version, stdio-mcp restore, repair verb#446

Merged
githubrobbi merged 1 commit into
mainfrom
fix/update-flow-polish
Jun 17, 2026
Merged

fix(update): journal to_version, stdio-mcp restore, repair verb#446
githubrobbi merged 1 commit into
mainfrom
fix/update-flow-polish

Conversation

@githubrobbi

@githubrobbi githubrobbi commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Three rough edges surfaced while exercising upgrade → downgrade → realign on a
live Windows install (the mechanism itself is sound; these are polish).

1. Applied + committed → unknown (real)

The CLI never wrote to_version into the snapshot, so journal.to_version
always fell back to "unknown" — on both the bare auto-apply and explicit
--version paths. The journal's record of what an apply committed to was wrong,
which matters for recover/rollback and audit. write_snapshot now takes the
target tag (explicit --version, else resolved latest) and emits it (the schema
already modelled the field).

2. Spurious components failed to restart: [mcp] (real, minor)

The stdio MCP server (uffsmcp) is spawned and owned by its LLM host (Claude
Desktop / Cursor / Windsurf) over stdio. Quiesce rightly stops it to free the file
lock; restore then tried to relaunch it detached — no client to serve, so it
warned. Now a deliberate no-op success; the host respawns it on next use. (The HTTP
gateway is a separate binary, uffs-mcp-http, never captured here — detection
scans only for uffsmcp.)

3. --repair UX (minor)

The doctor hint said "re-run with --repair", but uffs --update repair errored
and bare uffs --update --repair silently no-op'd; the only working form was the
non-obvious doctor --repair. Added repair as a first-class verb (= doctor --repair), routed a bare --repair flag to it, and fixed the hints to name
uffs --update repair.

Best-practice note: verbs stay bare (doctor, repair), options stay dashed
(--repair, --version) — git/cargo convention. repair becomes a verb so users
never have to guess whether it's a verb or a flag.

Validation

Host clippy (strict workspace lints) clean; uffs-cli + uffs-update tests pass,
incl. new coverage: snapshot to_version probe + mcp_restore_is_noop_success.

…d repair verb

Three rough edges surfaced while exercising upgrade/downgrade/realign on a
live Windows install:

1. `Applied + committed → unknown` — the CLI never wrote `to_version` into
   the snapshot, so `journal.to_version` always fell back to "unknown" (on
   both the bare auto-apply and explicit `--version` paths). The journal's
   record of what an apply committed to was therefore wrong, which matters
   for `recover`/rollback and audit. `write_snapshot` now takes the target
   tag (explicit `--version`, else resolved latest) and emits it; the
   schema already modelled the field.

2. "components failed to restart: [mcp]" — the stdio MCP server (`uffsmcp`)
   is spawned and OWNED by its LLM host (Claude Desktop / Cursor / Windsurf)
   over stdio. Quiesce rightly stops it to free the file lock for the swap,
   but `restore` then tried to relaunch it detached — which has no client to
   serve and spuriously warned. It's now a deliberate no-op success; the
   host respawns it on the next tool call. (The HTTP gateway is a separate
   binary, `uffs-mcp-http`, never captured here.)

3. `--repair` UX — the doctor hint said "re-run with `--repair`", but
   `uffs --update repair` errored and bare `uffs --update --repair` silently
   no-op'd; the working form was the non-obvious `doctor --repair`. Add
   `repair` as a first-class verb (= `doctor --repair`), route a bare
   `--repair` flag to it too, and fix the hints to name `uffs --update repair`.

Host clippy (strict workspace lints) clean; uffs-cli + uffs-update tests
pass (incl. new snapshot to_version + mcp-restore-noop coverage).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 17, 2026 14:14
@githubrobbi githubrobbi merged commit 463a5ea into main Jun 17, 2026
21 checks passed
@githubrobbi githubrobbi deleted the fix/update-flow-polish branch June 17, 2026 14:28
githubrobbi added a commit that referenced this pull request Jun 17, 2026
… doc

Dev-facing docs to match the user manual:
- cli-grammar.md: add `repair` + `bins` to the `--update` action surface;
  note repair = doctor --repair alias, the doctor→update redirect, and that
  bare update reconciles the whole core set (adds a missing core binary).
- UFFS-Self-Update-Feasibility-and-Design.md: add a §4.1 as-built addendum
  (action-based grammar) covering completeness (#447/#448), the repair verb +
  doctor redirect (#446/#449), and the journal to_version fix (#446).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
githubrobbi added a commit that referenced this pull request Jun 17, 2026
… issues (#449)

* feat(update): doctor redirects to the update flow to fix update-class issues

`uffs --update doctor` already diagnoses; now, when it finds an issue the
update flow fixes — out of date, version-skewed, or **missing a core binary**
— it redirects there instead of teaching the health-check helper the core set:

- piped / non-TTY: prints a `→ run \`uffs --update\`` hint;
- interactive TTY: asks "Run `uffs --update` now to fix this? [y/N]";
- `--repair` / `repair`: runs the update flow automatically (after the helper's
  local self-heal — resume/rollback, sweep backups, restart services).

Keeps the architecture clean: the helper stays a dumb snapshot processor; the
CLI (which owns the core set) decides what "incomplete" means and how to fix it.
`--offline` skips the redirect (assess needs the release feed). The prompt
never blocks a non-TTY caller — it returns "no" and falls back to the hint.

Host clippy (strict) clean; uffs-cli tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: note repair/bins actions + completeness in cli-grammar & design doc

Dev-facing docs to match the user manual:
- cli-grammar.md: add `repair` + `bins` to the `--update` action surface;
  note repair = doctor --repair alias, the doctor→update redirect, and that
  bare update reconciles the whole core set (adds a missing core binary).
- UFFS-Self-Update-Feasibility-and-Design.md: add a §4.1 as-built addendum
  (action-based grammar) covering completeness (#447/#448), the repair verb +
  doctor redirect (#446/#449), and the journal to_version fix (#446).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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