feat(automation): conversation-authored automation registry (SSOT)#55
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.py—automations+automation_runstables (append-only versions,kindsingle|composed).controlplane/app.py— ~16 endpoints + an Automations dashboard panel (view + token-gated controls).mcp/— agent-facing toolsnil_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 anactiveautomation; 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
croniterwhen the durable Temporal runtime lands.Before demo
Run
scripts/smoke_automation.pyagainst the live stack — the one production path the suite mocks.