Skip to content

feat(device): add device list and device get - #69

Merged
joaodrp merged 1 commit into
mainfrom
feat/device-reads
Aug 19, 2026
Merged

feat(device): add device list and device get#69
joaodrp merged 1 commit into
mainfrom
feat/device-reads

Conversation

@joaodrp

@joaodrp joaodrp commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Read-only device surface (device list, device get <id|name>), pulled ahead of rule import as v0.2 (D17 amended, roadmap renumbered v0.2-v0.5).

Contract

{
  "id": "dev...", "name": "...",
  "profile": {"id": "pk...", "name": "..."},
  "status": "pending | active | soft-disabled | hard-disabled",
  "analytics": "none | some | full" | null,
  "clients": 1 | null, "learn_ip": false, "icon": "desktop-linux" | null,
  "ctrld": {"version": "v1.5.3" | null, "last_fetch": "RFC-3339" | null} | null,
  "resolvers": {"doh": "...", "dot": "...", "v4": [], "v6": []}
}
  • id is the API's device_id (what /devices/{device_id} and resolvers.uid key on); PK != device_id is a loud shape error, never a silent pick.
  • analytics: null = not reported, distinct from "none" (reported as off).
  • resolvers.v4/v6 are [] when omitted, never absent.
  • device get filters client-side; GET /devices/{id} exists live but is undocumented (D16).
  • Name resolution as for profiles: id wins, unique case-insensitive name, ambiguity exit 2, no match exit 3 (device.not_found).

Also

  • release-plz.toml: features_always_increment_minor = true so a feat: slice tags a minor (0.1.2 shipped feat(cargo) as a patch).
  • Docs: commands.md device section, roadmap v0.2 gate, stale (vX) tags and one dead anchor fixed, discharged first-release watch items removed.

Verification

  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (unit, wiremock + insta snapshots, help/reference snapshots, README matrix check).
  • Live: device list passed against the real API (read-only check added to tests/live.rs).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CcF4yZHc4V6yQVvsx96KiX

Read-only device surface, pulled ahead of `rule import` as v0.2 (D17 amended).

- `id` is the API's `device_id`; `PK != device_id` is a shape error (exit 8)
- four-state `status`, `analytics` `null` != `none`, `resolvers.v4/v6` always arrays
- `clients`, `ctrld.*`, `icon` nullable: an absent optional never fails the listing
- `device get` is a client-side filter over `GET /devices`
- release sequence renumbered v0.2-v0.5; `feat:` now bumps minor in release-plz

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CcF4yZHc4V6yQVvsx96KiX
@joaodrp
joaodrp merged commit 333b3aa into main Aug 19, 2026
10 checks passed
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