Skip to content

feat(node-registry): persist interview device identity (schema v4)#226

Merged
Assar63 merged 2 commits into
masterfrom
feat/node-registry-identity
Jun 27, 2026
Merged

feat(node-registry): persist interview device identity (schema v4)#226
Assar63 merged 2 commits into
masterfrom
feat/node-registry-identity

Conversation

@Assar63

@Assar63 Assar63 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Persists the post-inclusion interview's device-identity triple into node-registry so it survives daemon restarts and is queryable without re-interviewing the device.

What

  • NodeInfo gains manufacturerId / productTypeId / productId (u16, 0 until gathered).
  • NodeRegistry subscribes to the ManufacturerSpecificReport bus event and calls the new setDeviceIdentity(), which updates the in-memory entry and persists it. No-op for unknown nodes (mirrors setSecurityScheme).
  • Schema v4: three identity columns added. Migration is cumulative from v1/v2/v3 (add-scheme → rename → add-identity); v0 still drops + recreates.

Why

The post-inclusion order is SecurityBootstrap → Interview → Policy (#203). The interview learns the (mfr, type, product) identity that PolicyRegister's device-level defaults key on; persisting it means a restart doesn't lose it, and the console detail pane / #45 can show it without re-interviewing.

Tests

New node_registry_identity_test: set/query, unknown-node no-op, and ManufacturerSpecificReport → identity recording. Full suite green on both gnu + llvm presets (477 tests).

Part of #203.

🤖 Generated with Claude Code

Assar63 and others added 2 commits June 18, 2026 08:02
Record the post-inclusion interview's device-identity triple
(manufacturer / product type / product id) into each node's row so it
survives daemon restarts and is queryable without re-interviewing.

- NodeInfo gains manufacturerId / productTypeId / productId (u16).
- NodeRegistry subscribes to ManufacturerSpecificReport and calls the
  new setDeviceIdentity(), which updates the in-memory entry and persists
  it (no-op for unknown nodes, mirroring setSecurityScheme).
- Schema v4: three identity columns, cumulative migration from v1/v2/v3
  (v0 still drops + recreates).
- Tests: set/query, unknown-node no-op, and ManufacturerSpecificReport
  -> identity recording.

Part of #203.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Add trailing return type to the call_once init lambda.
- Use std::map::contains in seed() instead of find() != end().
- Make Stmt::step()/execDone() const (SQLite pointers aren't
  reassigned); step() gains [[nodiscard]] and the PRAGMA
  user_version Stmt is declared const.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Assar63 Assar63 merged commit 0feb0a2 into master Jun 27, 2026
4 checks passed
@Assar63 Assar63 deleted the feat/node-registry-identity branch June 27, 2026 18:09
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