Repository navigation
[M1.6b2] Record what agents observe for their replicas - #175
Merged
Merged
Conversation
added 2 commits
November 7, 2026 12:48
What the agent last saw for an allocation, apart from the scheduler's reservation in allocations, with forced tenant RLS. Signed-off-by: review <[email protected]>
The node stream hands state reports with the current epoch to the deployments context through a small fleet registry. Invalid reports are ignored whole; valid ones update only the reporting node's placed replicas, auditing changes as allocation.observed by the node. The agent daemon now sends its reports. Signed-off-by: review <[email protected]>
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 7, 2026
## What changed M1.6b3: what agents report (#175) is now visible. - **`GET …/applications/{a}/replicas`** (`environment.read`) lists placed replicas with node name, container and the last observed state (null until seen). - **Application page:** a Replicas table, with "not reported yet" for a container the agent has not seen. It reloads with deployments. - **`allocation.observed`** events now carry `environmentId`, so the live stream of #179 includes them and the page updates when a container stops. ## How it was tested - Web test for the table. Full local gate: 302 API and 69 web tests, Go race tests, lint, drift, Semgrep, Prettier. - **Not run:** the integration assertion added to `allocation-observations.integration.spec.ts`, because Docker is not reachable here. ## Security considerations Same read permission as the other application routes. It reveals node names and container names to `environment.read` holders, and no environment values. --------- Signed-off-by: review <[email protected]> Co-authored-by: review <[email protected]>
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.
What changed
M1.6b2: agents now send their state reports, and the control plane records what they observe. The owner approved the separate observed-state model on 2026-11-07.
allocation_observationstable: one row per allocation with container id, observed state and time, under forced tenant RLS. It is separate fromallocations.state, so an observation never frees or takes scheduler capacity.assertTenantDatabaseRolenow covers 17 tables.observationChanges(domain):missing;AllocationObservationshandles a report in one tenant transaction, using the node identity from its certificate. A report with any invalid container (name, id, state, duplicate, over 256 containers) is ignored whole, keeping the last good state. Changes are audited asallocation.observed, with the node as actor.NodeStreamrefuses a report with a stale epoch. It hands valid ones toStateReports, a small fleet registry, because deployments depends on fleet and fleet cannot import it back.How it was tested
allocation-observations.integration.spec.ts(another node's report touches nothing, audit sequence, reservation unchanged), because Docker is not reachable from this environment. It needs a run on a machine with Docker.Security considerations
sk.managed, no environment and no commands.