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,57 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
commandBody,
|
||||
resourcesForPage,
|
||||
upsertWorkflowDefinition,
|
||||
removeWorkflowDefinition,
|
||||
} from "../src/stores/control-plane.ts";
|
||||
|
||||
test("control-plane commands keep the edited version and typed values", () => {
|
||||
assert.deepEqual(JSON.parse(commandBody({
|
||||
max_model_tool_steps: 12,
|
||||
max_runtime_seconds: 900,
|
||||
max_consecutive_gate_failures: 3,
|
||||
}, 7)), {
|
||||
value: {
|
||||
max_model_tool_steps: 12,
|
||||
max_runtime_seconds: 900,
|
||||
max_consecutive_gate_failures: 3,
|
||||
},
|
||||
expected_version: 7,
|
||||
});
|
||||
});
|
||||
|
||||
test("control-plane resources belong to one settings narrative", () => {
|
||||
const catalog = [
|
||||
"workflow-execution-settings", "provider-settings", "model-role-assignments",
|
||||
"repository-policies", "channel-settings", "scheduling-policy", "tool-settings",
|
||||
"plugin-settings", "container-runtime-policies", "workflow-definitions",
|
||||
].map((kind) => ({ kind, title: kind, schema_json: "{}", commands: ["replace"] }));
|
||||
|
||||
assert.deepEqual(resourcesForPage(catalog, "tasks").map(({ kind }) => kind), ["workflow-execution-settings"]);
|
||||
assert.deepEqual(resourcesForPage(catalog, "models").map(({ kind }) => kind), ["provider-settings", "model-role-assignments"]);
|
||||
assert.deepEqual(resourcesForPage(catalog, "repositories").map(({ kind }) => kind), ["repository-policies"]);
|
||||
assert.deepEqual(resourcesForPage(catalog, "channels").map(({ kind }) => kind), ["channel-settings"]);
|
||||
assert.deepEqual(resourcesForPage(catalog, "advanced").map(({ kind }) => kind), [
|
||||
"scheduling-policy", "tool-settings", "plugin-settings", "container-runtime-policies",
|
||||
]);
|
||||
assert.deepEqual(resourcesForPage(catalog, "workflows").map(({ kind }) => kind), ["workflow-definitions"]);
|
||||
});
|
||||
|
||||
test("workflow edits replace by id without dropping sibling definitions", () => {
|
||||
const original = { definitions: [
|
||||
{ id: "implement", yaml: "id: implement\nsteps: []\n" },
|
||||
{ id: "tdd", yaml: "id: tdd\nsteps: []\n" },
|
||||
] };
|
||||
assert.deepEqual(upsertWorkflowDefinition(original, { id: "implement", yaml: "id: implement\nsteps:\n - type: implement.code\n" }), {
|
||||
definitions: [
|
||||
{ id: "implement", yaml: "id: implement\nsteps:\n - type: implement.code\n" },
|
||||
{ id: "tdd", yaml: "id: tdd\nsteps: []\n" },
|
||||
],
|
||||
});
|
||||
assert.deepEqual(removeWorkflowDefinition(original, "implement"), {
|
||||
definitions: [{ id: "tdd", yaml: "id: tdd\nsteps: []\n" }],
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user