Skip to content

feat: give each engine a stable instance id and a unique name - #43

Merged
ant1fr merged 1 commit into
developfrom
feat/instance-identity
Nov 19, 2026
Merged

ant1fr merged 1 commit into
developfrom
feat/instance-identity

Conversation

@ant1fr

@ant1fr ant1fr commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

Two engines on one LAN advertised the same mDNS name (Smart Frame Engine), and clients had no stable identity to key on.

  • instance_id: random UUID generated once, stored in /data/instance.json, never derived from hardware.
  • instance_name: INSTANCE_NAME, else Smart Frame Engine <first 6 chars of the id>.
  • GET /api/health (still public) returns both; Zeroconf TXT carries instance_id, the service name is the instance name, and registration uses allow_name_change=True so a clash renames instead of silently disabling advertising.
  • Contract 1.1 (additive, api_version stays 1): docs/API_CONTRACT.md changelog and docs/openapi.json updated. Package version bumped to 1.0.0rc2.

Test plan

  • ruff, ruff format, mypy app
  • full pytest (1108 passed, 1 skipped)
  • new tests: id persistence and corruption, unique default names, name override, health fields, two advertisers with distinct names

🤖 Generated with Claude Code

https://claude.ai/code/session_01VzFCH4ztqBYejkvLvFgnaq

- instance_id: random UUID generated once, kept in /data/instance.json
- instance_name: INSTANCE_NAME or 'Smart Frame Engine <id prefix>'
- exposed on GET /api/health and in the Zeroconf TXT record; the mDNS service name is the
  instance name and registration may rename on conflict, so two engines on one LAN coexist
- contract 1.1 (additive), openapi.json regenerated, package version 1.0.0rc2

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VzFCH4ztqBYejkvLvFgnaq
@github-actions github-actions Bot added the feat New feature label Nov 19, 2026
@ant1fr
ant1fr merged commit 85b23f5 into develop Nov 19, 2026
5 checks passed
@ant1fr
ant1fr deleted the feat/instance-identity branch November 19, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant