Skip to content

feat(automation): conversation-authored automation registry (SSOT)#55

Merged
Basheirkh merged 3 commits into
mainfrom
feat/automation-registry
Jun 24, 2026
Merged

feat(automation): conversation-authored automation registry (SSOT)#55
Basheirkh merged 3 commits into
mainfrom
feat/automation-registry

Conversation

@Basheirkh

Copy link
Copy Markdown
Contributor

What

Dynamic automation by talking to the agent: the agent drafts a plan → the deterministic validator (V1–V6, against the live adapter skeleton) lowers-or-rejects it → it is content-hashed + versioned in an SSOT → a human approves it → it is armed → it fires on manual / event / cron|interval triggers → and can span multiple backends via author-declared cross-system composition.

Story end to end: talk → validate → register → approve → run → see & control in the dashboard.

How (additive — kernel untouched)

  • src/nilscript/automation/ — models, authoring (draft gate), skeleton→context, dispatch, scheduler (event + cron/interval), compose (cross-system).
  • controlplane/store.pyautomations + automation_runs tables (append-only versions, kind single|composed).
  • controlplane/app.py — ~16 endpoints + an Automations dashboard panel (view + token-gated controls).
  • mcp/ — agent-facing tools nil_automation_draft/register/approve/run/list.
  • scripts/smoke_automation.py — live smoke test for the production grant-minting path.

Guarantees preserved

Agent is the untrusted proposer; the code decides admission (a hallucinated verb has nothing to bind to — V4). Draft = preview-only; register = pending_approval (never auto-armed); run fires only an active automation; re-fire replays (idempotent); content-hash = version lock. Controls are token-gated (server posture unchanged; the browser supplies the operator token, never holds it by default).

Tests

~57 new tests (incl. real two-adapter cross-system handoff + MCP-tool→CP→SSOT). Full suite green (367).

Honestly out of scope

Single-stage dual-backend authority (atomic 2PC); inferred ontology mapping (handoffs are author-declared); full cron via croniter when the durable Temporal runtime lands.

Before demo

Run scripts/smoke_automation.py against the live stack — the one production path the suite mocks.

AI Bot added 3 commits June 24, 2026 16:27
Dynamic automation by talking to the agent: the agent drafts a plan, the
deterministic validator (V1–V6, against the live adapter skeleton) lowers-or-
rejects it, it is content-hashed and versioned in an SSOT, a human approves it,
it is armed, and it fires on manual / event / cron|interval triggers — and can
span multiple backends via author-declared cross-system composition.

Additive layer in src/nilscript/automation/ (models, authoring, skeleton,
dispatch, scheduler, compose) + automations/automation_runs tables and ~16
control-plane endpoints; the kernel/executor is untouched. Includes agent-facing
MCP tools (nil_automation_draft/register/approve/run/list), a read+control
Automations dashboard panel (control token-gated, browser-supplied operator
token), and a live smoke-test script. ~57 new tests; full suite green.

Honestly out of scope: single-stage dual-backend authority (atomic 2PC) and
inferred ontology mapping (handoffs are author-declared); full cron via croniter
when the durable Temporal runtime lands.
Enable several adapters in one workspace at once (e.g. PocketBase + Odoo) so a
cross-system automation can run between two backends linked via NIL/MCP:

- store.set_adapter_active: non-exclusive enable/disable (exclusive activate_adapter
  kept for single-backend default routing); active_adapter() returns the most-recent
  active as the default — composition addresses adapters by id, so multi-active never
  makes a plain propose/commit ambiguous.
- control plane: POST /adapters/{ws}/{id}/enable|disable (token-gated) + per-adapter
  Enable/Disable toggles in the MCP-routing panel (operator-token gated).
- MCP: nil_automation_compose_register so an agent can author a two-system automation
  by talking (stages validated against each adapter's own live skeleton).

+5 tests; full suite green (372).
A one-click builder in the control-plane dashboard: pick adapter A + verb,
adapter B + verb, declare the handoff, and register a two-system automation —
no agent round-trip needed. Verb dropdowns load live from each adapter's own
skeleton (new token-gated GET /api/adapter-skeleton). Submit is token-gated and
posts to /automations/compose/register, surfacing per-stage refusal codes.

+2 tests; full suite green (374).
@Basheirkh Basheirkh merged commit 7d6ba28 into main Jun 24, 2026
4 of 5 checks passed
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