feat(registry): versioned structured host registry (registry v2)#85
Merged
Conversation
Replace the colon-delimited `~/.config/remo/known_hosts` store with a versioned JSON `registry.json` (format v2, named per-type fields, no positional overloading) behind a single accessor `core/registry.py` that owns parse/serialize/validate/advisory-lock/migrate for the CLI, providers, and web service. - Lazy, lossless, idempotent CLI migration (known_hosts -> registry.json, original renamed to known_hosts.v1.bak); tolerant per-entry migration skips+reports a v2-invalid legacy entry instead of aborting. - `core/known_hosts.py` slimmed to thin delegates (public API unchanged). - `remo add` accepts IPv6 literals (bracketed and bare multi-colon); the colon-safety field rejections are gone (JSON has no positional overloading). - Web read paths (discovery/state/check) collapse onto the shared read-only accessor; advisory `fcntl` locking wraps every read-modify-write with graceful degradation. - Setup API adoption mirror moves to payload v2 with a `payload_versions` capability handshake (still accepts v1); push delta-cache bumped to cache_version: 2. `replace_registry` uses true wholesale-replace semantics so the service removes (not renames) any stale legacy mirror and a malformed stale mirror can't 500 an otherwise-valid apply. - Docs (README, web-session-interface, CLAUDE.md) updated to registry.json. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HAPB5GA4NVUgKFsVFVJDxN
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the colon-delimited
~/.config/remo/known_hostsstore with a versioned JSONregistry.json(format v2 — named per-type fields, no positional overloading), behind a single accessorcore/registry.pythat owns parse / serialize / validate / advisory-lock / migrate for the CLI, providers, and web service.What changed
src/remo_cli/core/registry.py— the one surface every consumer reads/writes through; atomic writes (os.replace), tolerant reads (per-entry warnings, never exceptions), andfcntladvisory locking with graceful degradation.known_hosts→registry.json, original renamed toknown_hosts.v1.bak; a v2-invalid legacy entry is skipped + reported, never fatal.remo addaccepts bracketed and bare IPv6 literals.discovery/state/checkcollapse onto the shared read-only accessor (no side effects, read-only-mount safe).payload_versions; the CLI aborts before any mutation if the service is behind; push delta-cache bumped tocache_version: 2.core/known_hosts.pypublic API unchanged, so ~30 existing call sites need no changes.docs/web-session-interface.md,CLAUDE.md) updated.Review fixes folded in (xhigh self-review)
replace_registrynow uses true wholesale-replace semantics — the service removes (not renames) a stale legacy mirror, and a malformed stale mirror can no longer 500 an otherwise-valid apply.put_registryapply catchesRegistryError(not justOSError) → clean 500 instead of an uncaught traceback.Testing
ruff check src/remo_cliclean;mypyclean (60 files).quickstart.mdscenarios manually verified end-to-end.🤖 Generated with Claude Code
https://claude.ai/code/session_01HAPB5GA4NVUgKFsVFVJDxN