Skip to content

OSS-368 P0 contract: versioned node-control protocol and ownership model - #516

Merged
athNdev merged 1 commit into
mainfrom
codex/managed-node-runtime-track
Nov 18, 2026
Merged

athNdev merged 1 commit into
mainfrom
codex/managed-node-runtime-track

Conversation

@athNdev

@athNdev athNdev commented Nov 18, 2026

Copy link
Copy Markdown
Owner

OSS-368 / Track C — P0 Contract & model (plan §19)

Focused PR: versioned typed node-control contract and node ownership model only. No agent, daemon lifecycle or enrollment server is implemented (P1+). P0-GATE (PR509 server redaction + PR510 UI no-round-trip) is merged, so the hard gate is satisfied.

Scope

  • New separate proto proto/carbonpanel/v1/node_control.proto: NodeControlService with 9 RPCs; authenticated NodeIdentity (fingerprints/generations only), TTL-bounded one-time enrollment metadata, per-node NodeAuthorizationClaims, capability/version negotiation with explicit skew, redacted health/preflight reports, OperationEnvelope dedupe with deadline/attempt/capability snapshot, and fail-closed DispatchOperation with no legacy/host-socket fallback. NodeTransport deliberately has no legacy value.
  • No secrets in responses: token exists only in ClaimEnrollmentRequest; all responses carry fingerprints/metadata. A descriptor test enforces this.
  • Generated Go+TS via pinned bun scripts/proto-generate.mjs (local pinned buf 1.50.0). Only this new proto's outputs were created; no other owner's proto or generated file changed.
  • DB model/migration: metadata-only Node columns (transport, enrollment_state/expiry/id, protocol_version, capabilities_json, capability_owner, credential_generation, key/token fingerprints). Idempotent gormigrate migration with native column-only rollback; existing/new nodes stay legacy, nothing auto-enrolled. CreateNode whitelist updated.
  • Tests: owned on-disk SQLite fixture applies, re-applies and rolls back the real migration with legacy backfill and node-row preservation; fresh-install defaults. Five auth scenarios × all 9 RPCs prove denial by default (no CodeUnimplemented), including broad nodes:* grant and no-auth admin. No secret fields in any response descriptor.
  • ADR 0019 + new knowledge/architecture/node-control-protocol.md; generated architecture index line. knowledge/decisions/adrs.md was not edited (orchestrator owns it).

Acceptance coverage (plan §19 P0)

make proto-lint/buf lint + buf format -d clean; bun scripts/proto-generate.mjs --check identical; new RPCs denied by default with negative fixtures; migration apply/rollback fixture; no secrets in responses; W16 resolver, W17 streaming and W15 admission untouched.

Verification

  • buf lint, buf format -d — clean; proto-generate.mjs --check — outputs match.
  • go test ./internal/db ./internal/rpc ./pkg/proto/... -count=1 and go vet — pass.
  • go test ./... -count=1, go vet ./... — pass.
  • bun run check (0 errors/warnings), bun run test (315 pass), bun run lint (prettier + eslint) — pass.
  • knowledge-lint -fix then plain — pass, 62 concepts, 38/38 queries.

For the orchestrator — ADR index row text (not written here)

| [0019](../../docs/adr/0019-node-control-contract.md) | Versioned typed node-control contract with redacted responses and fail-closed routing | [Node control protocol](../architecture/node-control-protocol.md), [RPC contract](../architecture/rpc-contract.md) |

Limitations / blockers

  • Contract only: no handler implementations, agent, enrollment server, daemon lifecycle or wire-exposed credential clear RPC. S4 node-principal middleware remains shared with Track A; the new RPCs stay denied until permissions are mapped.
  • No live host, deployment, release or real credential used.
  • Do not merge here: independent review and green CI required.

Adds a separate node_control.proto with authenticated node identity, bounded one-time enrollment metadata, per-node claims, capability and version negotiation, health/preflight, operation dedupe, bounded contexts and fail-closed dispatch with no legacy fallback. Generated Go/TS come only from this file via the pinned generator. Adds metadata-only Node columns, an idempotent migration with column-only rollback, legacy-safe defaults, an owned-DB apply/rollback fixture, negative RBAC fixtures proving all nine RPCs denied by default, a descriptor check for secret fields in responses, ADR 0019 and a governing knowledge concept. No agent, daemon lifecycle or enrollment server is implemented.
@athNdev
athNdev merged commit 5ae094b into main Nov 18, 2026
22 checks passed
@athNdev
athNdev deleted the codex/managed-node-runtime-track branch November 18, 2026 05: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