The clients API lists discovered devices, counts them, lets an operator acknowledge them and prunes stale ones #146

Open
opened 2026-10-31 12:42:15 -04:00 by claude · 0 comments
Owner
  • Draft: PN-4
  • Priority: high (the operator cannot see discovered devices without it)
  • Agent: coder
  • Depends on: #145
  • Decisions: Q-PN-3, Q-PN-4

Why

ClientsController.List (src/dotnet/src/Ninlil.Web/Controllers/ClientsController.cs:91-149) filters only by favorite, presence and creation time. There is no origin filter and no acknowledge action.

What changes

  • ClientsController.List and summary (ClientsController.cs:163): add origin and acknowledged query parameters and a discovered (unacknowledged) count in the summary model.
  • New POST api/clients/{id}/acknowledge (clients:write), shaped like pause at ClientsController.cs:502.
  • Retention: a sweep in Ninlil.Dns.Server.ClientIdentity deletes unacknowledged discovered clients whose newest LastSeenUtc is older than ClientPresenceOptions.DiscoveredDeviceRetention (default 30 days; zero keeps them forever). Acknowledged rows and rows of any other origin are never swept. Update ENVIRONMENT.md.
  • Swashbuckle examples under src/dotnet/src/Ninlil.Web/Examples/.

Acceptance

  • This test fails first: in src/dotnet/tests/Ninlil.Web.Tests, List_WithOriginDiscovered_ReturnsOnlyDiscoveredClients (shared host; finds its own rows, never assumes counts).
  • Tests for acknowledge, the summary count, and the retention sweep (deletes an unacknowledged row unseen for 31 days; keeps an acknowledged one; zero keeps everything).
  • ENVIRONMENT.md updated. REST API changed: the snapshot is regenerated in #147, not here.
  • Gate: dotnet test src/dotnet/tests/Ninlil.Web.Tests, dotnet test src/dotnet/tests/Ninlil.Dns.Server.ClientIdentity.Tests.

Source

audit-feature-parity.md §2A #10.
Owner decision 2026-10-31: "delete after 30 days unseen, configurable" (Q-PN-4).

- **Draft:** PN-4 - **Priority:** high (the operator cannot see discovered devices without it) - **Agent:** coder - **Depends on:** #145 - **Decisions:** Q-PN-3, Q-PN-4 ### Why `ClientsController.List` (`src/dotnet/src/Ninlil.Web/Controllers/ClientsController.cs:91-149`) filters only by favorite, presence and creation time. There is no origin filter and no acknowledge action. ### What changes - `ClientsController.List` and `summary` (`ClientsController.cs:163`): add `origin` and `acknowledged` query parameters and a `discovered` (unacknowledged) count in the summary model. - New `POST api/clients/{id}/acknowledge` (`clients:write`), shaped like `pause` at `ClientsController.cs:502`. - Retention: a sweep in `Ninlil.Dns.Server.ClientIdentity` deletes unacknowledged discovered clients whose newest `LastSeenUtc` is older than `ClientPresenceOptions.DiscoveredDeviceRetention` (default 30 days; zero keeps them forever). Acknowledged rows and rows of any other origin are never swept. Update ENVIRONMENT.md. - Swashbuckle examples under `src/dotnet/src/Ninlil.Web/Examples/`. ### Acceptance - [ ] This test fails first: in `src/dotnet/tests/Ninlil.Web.Tests`, `List_WithOriginDiscovered_ReturnsOnlyDiscoveredClients` (shared host; finds its own rows, never assumes counts). - [ ] Tests for acknowledge, the summary count, and the retention sweep (deletes an unacknowledged row unseen for 31 days; keeps an acknowledged one; zero keeps everything). - [ ] ENVIRONMENT.md updated. REST API changed: the snapshot is regenerated in #147, not here. - [ ] Gate: `dotnet test src/dotnet/tests/Ninlil.Web.Tests`, `dotnet test src/dotnet/tests/Ninlil.Dns.Server.ClientIdentity.Tests`. ### Source `audit-feature-parity.md` §2A #10. Owner decision 2026-10-31: "delete after 30 days unseen, configurable" (Q-PN-4).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#146
No description provided.