feat(controlplane): runtime administration over the State Store's gRPC server
The Web UI and messaging channels now read and write Archie's runtime settings through one versioned, audited control-plane API hosted on the State Store's existing gRPC server: catalog, query, command, watch. Each feature owns its resource, validation and commands; storage only writes versions and audit records. Workflows move with it. Definitions become portable YAML compiled through a closed, typed step registry and stored as a control-plane resource, so the yaegi interpretation paths (internal/gate, wfeval, wfextract, gateeval, gateextract, skillbuild) are deleted rather than carried. The UI process reads definitions as data: the JSON projection lives in internal/domain/workflow/task so a dashboard decodes the stored collection without linking the workflow engine, which cmd/archie-ui's deletion gate forbids. Shipped definitions ride the catalog descriptor rather than a bespoke REST route, keeping the API to its four operations. archie-messaging gains -state-store-target/-state-store-token and reads channel settings from the database, failing closed when the State Store is unreachable: the database is authoritative for those settings.
This commit is contained in:
131 files changed
+8510
-3371
No files matched your search
@@ -0,0 +1,61 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controlplane.v1;
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service ControlPlaneService {
|
||||
rpc Catalog(CatalogRequest) returns (CatalogResponse);
|
||||
rpc Query(QueryRequest) returns (QueryResponse);
|
||||
rpc Command(CommandRequest) returns (CommandResponse);
|
||||
rpc Watch(WatchRequest) returns (stream WatchResponse);
|
||||
}
|
||||
|
||||
message ResourceDescriptor {
|
||||
string kind = 1;
|
||||
string title = 2;
|
||||
string schema_json = 3;
|
||||
repeated string commands = 4;
|
||||
// ApplyMode is "live", "restart-required", or "domain-managed".
|
||||
string apply_mode = 5;
|
||||
// QueryService and command_service identify an existing domain API when
|
||||
// the resource is not stored as a generic JSON document.
|
||||
string query_service = 6;
|
||||
string command_service = 7;
|
||||
// DefaultsJson is the factory value a client can restore this resource to.
|
||||
// Empty when the resource has no shipped default.
|
||||
string defaults_json = 8;
|
||||
}
|
||||
message CatalogRequest {}
|
||||
message CatalogResponse { repeated ResourceDescriptor resources = 1; }
|
||||
|
||||
message Resource {
|
||||
string kind = 1;
|
||||
int64 version = 2;
|
||||
bytes value_json = 3;
|
||||
google.protobuf.Timestamp updated_at = 4;
|
||||
}
|
||||
message QueryRequest { string kind = 1; }
|
||||
message QueryResponse { Resource resource = 1; }
|
||||
|
||||
message CommandRequest {
|
||||
string kind = 1;
|
||||
string command = 2;
|
||||
bytes value_json = 3;
|
||||
int64 expected_version = 4;
|
||||
string request_id = 5;
|
||||
// Actor and source are supplied by a trusted service adapter, never copied
|
||||
// from browser/request JSON.
|
||||
string actor = 6;
|
||||
string source = 7;
|
||||
}
|
||||
message CommandResponse { Resource resource = 1; }
|
||||
|
||||
message WatchRequest {
|
||||
string kind = 1;
|
||||
int64 after_version = 2;
|
||||
}
|
||||
message WatchResponse {
|
||||
Resource resource = 1;
|
||||
string error = 2;
|
||||
}
|
||||
@@ -15,6 +15,14 @@ service StateStoreService {
|
||||
// Administrative task credential lifecycle. Worker credentials cannot call these.
|
||||
rpc RegisterTaskGrant(RegisterTaskGrantRequest) returns (RegisterTaskGrantResponse);
|
||||
rpc RevokeTaskGrant(RevokeTaskGrantRequest) returns (RevokeTaskGrantResponse);
|
||||
// Identity domain. Task-scoped grants cannot call these administrative RPCs.
|
||||
rpc ListIdentities(ListIdentitiesRequest) returns (ListIdentitiesResponse);
|
||||
rpc GetIdentity(GetIdentityRequest) returns (GetIdentityResponse);
|
||||
rpc CreateIdentity(CreateIdentityRequest) returns (CreateIdentityResponse);
|
||||
rpc RenameIdentity(RenameIdentityRequest) returns (RenameIdentityResponse);
|
||||
rpc SuspendIdentity(SuspendIdentityRequest) returns (SuspendIdentityResponse);
|
||||
rpc ReactivateIdentity(ReactivateIdentityRequest) returns (ReactivateIdentityResponse);
|
||||
rpc RetireIdentity(RetireIdentityRequest) returns (RetireIdentityResponse);
|
||||
// Lifecycle
|
||||
rpc EnqueueIssue(EnqueueIssueRequest) returns (EnqueueIssueResponse);
|
||||
rpc EnqueueChatTask(EnqueueChatTaskRequest) returns (EnqueueChatTaskResponse);
|
||||
@@ -121,6 +129,45 @@ message RevokeTaskGrantRequest {
|
||||
}
|
||||
message RevokeTaskGrantResponse {}
|
||||
|
||||
message Identity {
|
||||
string id = 1;
|
||||
string kind = 2;
|
||||
string display_name = 3;
|
||||
string lifecycle = 4;
|
||||
int64 version = 5;
|
||||
google.protobuf.Timestamp created_at = 6;
|
||||
google.protobuf.Timestamp updated_at = 7;
|
||||
}
|
||||
message IdentityAudit {
|
||||
string actor_id = 1;
|
||||
string source = 2;
|
||||
string request_id = 3;
|
||||
}
|
||||
message ListIdentitiesRequest {}
|
||||
message ListIdentitiesResponse { repeated Identity identities = 1; }
|
||||
message GetIdentityRequest { string id = 1; }
|
||||
message GetIdentityResponse { Identity identity = 1; }
|
||||
message CreateIdentityRequest {
|
||||
string id = 1;
|
||||
string kind = 2;
|
||||
string display_name = 3;
|
||||
IdentityAudit audit = 4;
|
||||
}
|
||||
message RenameIdentityRequest {
|
||||
string id = 1;
|
||||
int64 expected_version = 2;
|
||||
string display_name = 3;
|
||||
IdentityAudit audit = 4;
|
||||
}
|
||||
message SuspendIdentityRequest { string id = 1; int64 expected_version = 2; IdentityAudit audit = 3; }
|
||||
message ReactivateIdentityRequest { string id = 1; int64 expected_version = 2; IdentityAudit audit = 3; }
|
||||
message RetireIdentityRequest { string id = 1; int64 expected_version = 2; IdentityAudit audit = 3; }
|
||||
message CreateIdentityResponse { Identity identity = 1; }
|
||||
message RenameIdentityResponse { Identity identity = 1; }
|
||||
message SuspendIdentityResponse { Identity identity = 1; }
|
||||
message ReactivateIdentityResponse { Identity identity = 1; }
|
||||
message RetireIdentityResponse { Identity identity = 1; }
|
||||
|
||||
// Task mirrors internal/domain/workflow.Task.
|
||||
message Task {
|
||||
int64 id = 1;
|
||||
|
||||
Reference in new issue
Block a user