Commit Graph
4 Commits
Author SHA1 Message Date
sam 8fea8e8686 feat(controlplane): field-level sys_audit table, audit view on settings pages, whole-task time limit 2026-09-25 09:54:30 +10:00
sam ae552db7e0 refactor(store)!: remove the SQLite task store, the PocketBase event store and the SQLite session store
The State Store, event capture and Gateway conversations already serve from
PostgreSQL. This deletes internal/store and internal/infrastructure/edastore,
the SQLite gateway session store and openProductionTaskStore, and the -db
recovery path on a legacy task file; backup, restore, validate and rollback
work on the database database_url names.

- The binding-secret cipher moves to internal/infrastructure/bindingcipher and
  ToolCall to internal/infrastructure/postgres.
- NewSessionStoreMemory is now a pure in-memory store that passes the shared
  SessionStore conformance suite.
- Tests run against PostgreSQL through internal/infrastructure/postgres/pgstore;
  legacyimport/legacyfixture writes the legacy files the import and the boot
  gate read.
- The cron dialect is owned in internal/domain/scheduling, so
  github.com/pocketbase/pocketbase and pocketbase/dbx leave go.mod.
  modernc.org/sqlite stays for the one-time import (legacyread).
- The UI and Messaging architecture gates ban the Postgres and legacy readers
  in place of internal/store.
2026-09-24 14:43:50 +10:00
sam 0c25a1fc6e feat(controlplane): derive resource schemas from the documents they describe
Twelve definitions each advertised a bare {"type":"object"} or {"type":"array"},
so no resource descriptor carried a single field: the Web UI had nothing to
label, describe or format a field with, and the one component that parsed a
schema was dead code. The constants could not be kept honest either -- a schema
written beside a struct drifts the moment a field is added, and nothing compares
the two.

Definition now names its document type and Descriptor derives the schema from it.
json tags give the keys, falling back to the Go field name because that is what
encoding/json stores; the Go type gives type and format; and a field's own
title, format and doc tags override. A duration is a string with format
"duration", which is how every duration field in the catalogue -- poll_interval,
max_uptime, rate_limit.window -- gets a client-side affordance from one rule
instead of twelve hand-written ones.

Deliberately structural: it emits no prose of its own. Field descriptions already
have one home (internal/webui/config_schema.go, keyed by dotted config path), and
a second would be two places to keep the same fact true. It also never emits
"required", because an empty string is legitimate for nearly every field here --
a blank workspace, a disabled rate limit -- so requiring most of them would
invite a client to enforce something the document does not mean.

Guarded by TestEveryResourceDescriptorDerivesProperties, which walks the catalogue
the production constructor builds and fails if any kind describes no fields --
the assertion that would have caught all twelve. It accepts a keyed collection's
additionalProperties as described, because a map document has no fixed keys.

Verified: controlplane, workflow, webui, archieui and staterpc suites, go vet,
go build ./..., golangci-lint run ./... (0 issues), docs:check.
2026-09-22 03:50:53 +10:00
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