Skip to content

feat(update): reconcile a missing core binary into a complete install#448

Merged
githubrobbi merged 1 commit into
mainfrom
feat/update-completeness
Jun 17, 2026
Merged

feat(update): reconcile a missing core binary into a complete install#448
githubrobbi merged 1 commit into
mainfrom
feat/update-completeness

Conversation

@githubrobbi

@githubrobbi githubrobbi commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #447 (centralized core-binary set). uffs --update was a version
reconciler, not a reinstaller — acquire only re-fetched binaries the install
already had, so a deleted core binary stayed gone. This closes the gap:
uffs --update now brings the install to a complete latest core set
regardless of starting state (outdated, skewed, or missing a core binary).

CLI (uffs-cli)

  • assess() flags an update when an unmanaged root is missing a core binary
    (canonical set = binaries::KNOWN_BINARIES, incl. uffs-mft; broker Windows-only).
  • The apply snapshot is completed to the full core set — a missing stem is
    appended with a null on-disk version so acquire downloads it and apply
    adds it. Doctor/non-apply snapshots report the install exactly as found.

Crash-safe core (uffs-update)

  • apply::backup_and_swap now handles an absent target (the add path): no
    .bak, just place → returns None; a replace still backs up → Some(bak).
  • New apply::remove_added + BinaryEntry::added: rollback_all deletes an
    added binary and restores a replaced one. Both idempotent on untouched
    targets — INV-2/INV-3 preserved.

Validation

Host clippy (strict) clean; uffs-cli + uffs-update tests pass, incl. new
add_then_rollback_deletes_the_added_binary + snapshot-completion probes.
Windows apply paths covered by CI + on-device verification.

…stall

`uffs --update` was a version reconciler, not a reinstaller: `acquire` only
re-fetched binaries the install already had, so a deleted core binary stayed
gone. Close that gap so `uffs --update` brings the install to a *complete*
latest core set regardless of starting state (outdated, skewed, or missing a
core binary).

CLI (uffs-cli):
- `assess()` now also flags an update when an unmanaged root is missing a core
  binary (the canonical set in `binaries::KNOWN_BINARIES`).
- The apply snapshot is completed to the full core set: a missing core stem is
  appended with a null on-disk version so `acquire` downloads it and `apply`
  adds it. Doctor/non-apply snapshots report the install exactly as found.

Crash-safe core (uffs-update):
- `apply::backup_and_swap` now handles an absent target — the "add" path: no
  `.bak`, just place the new image (returns `None`); a replace still backs up
  and returns `Some(bak)`.
- New `apply::remove_added` + `BinaryEntry::added`: `rollback_all` deletes an
  added binary (no `.bak` to restore) and restores a replaced one. Both
  primitives are idempotent on untouched targets, preserving INV-2/INV-3.

The core set is the single source of truth from the prior commit (incl.
uffs-mft; uffs-broker Windows-only), so every flow honours the same list.

Host clippy (strict) clean; uffs-cli + uffs-update tests pass, incl. new
add/rollback + snapshot-completion coverage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 17, 2026 15:20
@githubrobbi githubrobbi merged commit 8c18857 into main Jun 17, 2026
21 checks passed
@githubrobbi githubrobbi deleted the feat/update-completeness branch June 17, 2026 15:34
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