Repository navigation
Closed
Description
Parent: Deliver Galactic Worker with Local and Fabric delivery for tenant services
Deliverable
A branch-buildable Worker with its client library, capability registry and deterministic reconciliation, implementing the #1431 contract. It satisfies the "authorized clients use the same API" and "an independent client exercises the contract" parts of the "Implement common foundation" phase exit.
Follow repository conventions:
- Health gRPC in
cmd/galactic-{gateway,nat,router}/root.go. - Metrics through
go.miloapis.com/instrumentation, asdocs/development/conventions.md"Metrics and logging" requires, with ascrape_test.go(TestMetricsScrape) for any/metricsendpoint. - The independent-client pattern of
examples/looking-glass-clientandtask test:looking-glass-client.
Work items
- Authorize ownership and tenant scope. Implement versioned requests, observed generation and per-capability status. Dispatch programming to the delivery modules (T5, T6) through a module interface. Keep observed readiness separate from accepted intent.
- Serialize conflicting claims and split durable from reconstructible state. Recover from a crash after each side effect, with bounded retry and tolerance for duplicate watch events. Report a reason for each unavailable module. Allow release only by the current owner.
- Add an independent client as its own module under
examples/, with atasktarget that builds and tests it and fails if it imports Galactic packages beyond the published Worker API.
Dependencies
Blocked by #1431 (contract).
Acceptance
task test:unitcovers concurrent clients, duplicate and out-of-order requests, and restart with persisted or rediscovered state.- A foreign-VPC request is rejected, and a test snapshots the routes, rules, links and pinned maps before and after to show zero mutation.
- A release from a non-owner is rejected and leaves state unchanged.
- The independent client requests, observes, updates and releases through the documented interface with only its advertised privileges, and its new
tasktarget passes intask ci. - The delivering PR targets
integration/galactic-worker, carries this evidence and saysFixes datum-cloud/galactic#1433. GitHub does not auto-close from a non-default base, so close this issue explicitly when the PR merges and record the PR and merged SHA.
Activity
privateip commentedon Nov 18, 2026
Triage verdict: valid, unblocked. The #1431 contract is merged on
integration/galactic-worker(550da21d31d3ef7b99256722b25b7770d4428b0a) underdocs/worker/. That branch has no Worker yet: there is nocmd/galactic-worker, noapi/workerand no Worker client. The precedents this Task reuses are present:internal/edge/ownershipfence (Claim,Fence,Adopt,CommitSnapshot,Exclusive)internal/edge/masque/authoritycmd/galactic-nat/root.goexamples/looking-glass-clientmodule with its import guard intask test:looking-glass-clientThe approved implementation plan follows in the next comment.
privateip commentedon Nov 18, 2026
Approved plan
Layout
api/worker/v1alpha1/worker.protodefines thegalactic.worker.v1alpha1.Workerservice. Its bindings are generated bytask generate:proto.cmd/galactic-workerholds the binary. It serves the API on a unix socket, gRPC health on TCP and/metricswith aTestMetricsScrape.internal/worker/...holds auth, sessions, the durable claim store, reconciliation, the module interface and capability registry, and trusted-source lookups.pkg/workerclientis the client library.examples/worker-clientis an independent module. The newtask test:worker-clienttarget builds, vets and tests it, and fails if it imports Galactic packages other thanapi/worker/v1alpha1andpkg/workerclient.task test:unitruns that target, sotask cidoes too.Auth chain
galactic-worker) is checked with TokenReview and cached until it expires.SO_PEERCREDgives the peer PID, and that PID's cgroup must belong to the token's pod.State
Request,UpdateorReleasereturns.internal/edge/ownershipfence. On start, Worker runsClaim, orFencethenAdopt, thenCommitSnapshot. Until that snapshot commits, the scope answersUNAVAILABLE/Resyncing.Delivery modules (#1435, #1436) implement this interface:
CapabilitiesPlan, which has no side effectsApply, which runs inside the fence commitReadThis Task uses test doubles for them.
Contract additions, recorded in
docs/worker/within this PR:FAILED_PRECONDITION/NoSession, with the session ID carried in metadata.Resolved=False/DestinationKindUnsupported. Integrate NAT66 and NAT64 with Local and Fabric shard delivery #1437 adds the shard resolver and Integrate Gateway Maglev selection and direct server return #1438 the backend resolver, both inside Worker.hostPIDand read access to/procfor the peer check. Package branch deployments and expose actionable diagnostics #1441 packages that.ClaimLimitdefaults to 1024 claims per caller, set by a flag (D18).Tests
task test:unit:task test:unit-root: a cross-VPC request is refused, and snapshots of routes, rules, links and pinned maps taken before and after are identical. An unprivileged twin checks the store and the module only.Risk: the change is additive and no existing writer changes. The proto shape and module interface become binding for #1434 to #1440.
privateip commentedon Nov 18, 2026
Delivered by #1446, merged into integration/galactic-worker as 1441530. The acceptance evidence is in the PR comments.