Files
archie/internal/domain/workflow/task/definition_source.go
T
sam 02720c8e81 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.
2026-09-21 08:17:42 +10:00

29 lines
985 B
Go

package task
// WorkflowDefinitionEntry is one workflow's portable YAML as the control plane
// stores and serves it. YAML stays canonical and can be copied between Archie
// installations.
//
// It lives with the task vocabulary rather than with the engine for the same
// reason Definition does: a dashboard reads the stored collection without
// linking the workflow engine, which the UI process must never pull in.
type WorkflowDefinitionEntry struct {
ID string `json:"id"`
YAML string `json:"yaml"`
}
// WorkflowDefinitionCollection is the workflow-definitions resource value.
type WorkflowDefinitionCollection struct {
Definitions []WorkflowDefinitionEntry `json:"definitions"`
}
// DefinitionByID resolves one workflow from a collection.
func (c WorkflowDefinitionCollection) DefinitionByID(id string) (WorkflowDefinitionEntry, bool) {
for _, entry := range c.Definitions {
if entry.ID == id {
return entry, true
}
}
return WorkflowDefinitionEntry{}, false
}