feat(node-registry): persist interview device identity (schema v4)#226
Merged
Conversation
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>
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.
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
NodeInfogainsmanufacturerId/productTypeId/productId(u16, 0 until gathered).NodeRegistrysubscribes to theManufacturerSpecificReportbus event and calls the newsetDeviceIdentity(), which updates the in-memory entry and persists it. No-op for unknown nodes (mirrorssetSecurityScheme).Why
The post-inclusion order is SecurityBootstrap → Interview → Policy (#203). The interview learns the
(mfr, type, product)identity thatPolicyRegister'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, andManufacturerSpecificReport→ identity recording. Full suite green on both gnu + llvm presets (477 tests).Part of #203.
🤖 Generated with Claude Code