Skip to content

feat(status): protocol + styling foundation for a unified --status#527

Merged
githubrobbi merged 1 commit into
mainfrom
feat/status-json
Jul 5, 2026
Merged

feat(status): protocol + styling foundation for a unified --status#527
githubrobbi merged 1 commit into
mainfrom
feat/status-json

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

What

Checkpoint (A) of the --status / stats refactor: land the data + shared styling foundation now, so the renderer rewrite and --json wiring (Phase 2/3) build on a stable base. No user-visible change yet.

uffs-statusfmt (new, zero-dep leaf crate)

One visual language for every status surface — daemon, broker, combined-system, MCP:

  • Palette — TTY/NO_COLOR/TERM=dumb-aware color detection (detect()), plus plain() for --json/tests.
  • Glyph — health markers ( up / down / warn / · off), colored per palette.
  • header / section / field (aligned key: value) / status_row (short one-line summary).
  • Unit-tested in plain mode (no escapes, alignment, shapes).

Status protocol gains operator-relevant signals it never exposed

On StatusResponse (all #[serde(default)], back-compatible):

  • git_sha — the running build's short SHA (semver alone can't distinguish two builds).
  • elevated + reading_via_broker — is the daemon elevated-direct, or reading the live MFT via the zero-UAC Access Broker path? Backed by a new cross-platform uffs_mft::registered_broker_handle_count (real count on Windows, 0 elsewhere).
  • live_update: Option<LiveUpdateInfo> — how many per-shard USN journal loops are running (is live update actually active?).
  • paths: Option<DaemonPaths> — data/cache dir, socket/pipe, log dir, so an operator can find the index, connect, and read logs.

Hot-path discipline

live_update liveness is recorded once when the loops spawn (a single relaxed AtomicUsize store) and read on demand at status time — deliberately not a per-patch "last applied" timestamp, which would add a store to every USN apply on the live-indexing hot path.

Follow-ups (next PRs)

  • Phase 2/3: rewrite all 5 renderers on uffs-statusfmt (short / -v long / color), consolidate --daemon stats into --daemon status -v, thread --json.
  • Broker completeness: version / uptime / binary path / handles-vended (protocol additions on uffs-broker + uffs-broker-protocol).

Verification

All local gates green before push (host + Windows xwin clippy -D warnings, rustdoc -Dwarnings --document-private-items, doc-tests, tests, deny, manifest audit) — full 14-gate pre-push passed (109s).

@githubrobbi githubrobbi enabled auto-merge July 4, 2026 19:54
…tatus

Groundwork for the status/stats consolidation (renderers + --json land next).
No user-visible change yet — this adds the data + the shared styling.

- New `uffs-statusfmt` leaf crate (zero deps): one visual language for every
  --status surface — TTY/NO_COLOR-aware `Palette`, health `Glyph`s, aligned
  `field`s, `section`/`header`, `status_row`. Unit-tested (plain mode).

- Status protocol (StatusResponse) gains operator-relevant signals not exposed
  before: `git_sha` (running build), `elevated` + `reading_via_broker`
  (zero-UAC broker path vs elevated-direct; new cross-platform
  `uffs_mft::registered_broker_handle_count`), `live_update`
  (LiveUpdateInfo{active_loops}), and `paths` (DaemonPaths).

- `live_update` is recorded ONCE at loop spawn (a single relaxed store) and
  read on demand — no per-patch bookkeeping on the live-indexing hot path.

- Daemon `live_update` module holds the loop-count signal + on-demand path
  gather; the status build site populates every new field.

Verified: clippy on the four crates --all-targets -D warnings green;
manifest-inheritance audit clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi githubrobbi added this pull request to the merge queue Jul 5, 2026
Merged via the queue into main with commit 41ec9d3 Jul 5, 2026
28 checks passed
@githubrobbi githubrobbi deleted the feat/status-json branch July 5, 2026 00:21
github-merge-queue Bot pushed a commit that referenced this pull request Jul 5, 2026
…v / --json) (#529)

Bring the combined system view to the same unified styling as `--daemon
status`, with short / long / JSON levels and richer operator detail — no
change to the broker's security-sensitive pipe protocol.

- `uffs --status` (short): per-section health glyph + key fields for Daemon,
  Access Broker, MCP HTTP Gateway, MCP Stdio Sessions.
- `uffs --status -v`: expands each section. Daemon adds commit / elevation /
  broker mode, live-update loops, memory, data dir (the #527 fields). Broker
  adds binary path + uptime + a stale-binary check (Windows).
- `uffs --status --json`: machine-readable superset of all four sections.

Broker "completeness" (binary path, uptime, stale check) is derived from the
service PID via process introspection — a new `process_creation_time` FFI in
`uffs-mft::platform::process` alongside the existing `process_image_path`, so
NO new broker wire-protocol surface. Handle-adoption is already visible via
the daemon's `reading_via_broker` (#527).

TTY/NO_COLOR-aware colour via `uffs-statusfmt::Palette`; piped output stays
plain. `health()` is shared with `--daemon status` so both agree on the
daemon glyph + phase wording. `-v` / `--json` threaded through dispatch;
`--status --help` documents them.

Verified: host + xwin (Windows) clippy `--all-targets -D warnings`, rustdoc
`-Dwarnings --document-private-items`, fmt — all green. Smoke-tested the
daemon-down render for `--status`, `--status --json`, `--daemon status -v`.

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