Automations phase 2: chaining, refinements, dry run
Chaining: spec gains calls:[ids] + calledOnly. On fire, a task calls its
same-owner callees in order; each callee evaluates its OWN condition and
may call onward. Safety: write-time cycle rejection (owner-graph DFS) plus
a runtime visited-set + depth cap (5); calledOnly tasks skip the schedule;
existing per-task fire caps and the owner daily email cap still apply
across the chain. The LLM never chooses calls — the user wires the graph.
Refinements: AgentTask.refinements jsonb (migration 026) stores added
constraints; the UI composes prompt+refinements into the compile text and
shows removable chips. Dry run: condition-check is split from fire() so
POST /api/agent/dry-run evaluates a spec without acting or recording —
the 'Extend → Try it' preview ('result would be false right now').
UI: detail view gains the 'If true, call' card (picker disables
loop-creating options), refinement chips + Extend/Try it/Add flow, called-by
breadcrumb, and a 'when called' frequency label.
Verified: full DB integration suite under -race (chaining fires callees,
cycle rejected at write + runtime guard terminates a DB-injected cycle,
calledOnly skips schedule, dry run records nothing, refinements capped),
db-converge + atomicity, web lint/SSR/build, browser regression extended
for chaining + refinement + dry run.
This commit is contained in:
@@ -139,6 +139,7 @@ func NewServer(cfg *config.Config, database *db.DB) *http.Server {
|
||||
// 4.7c Agent automations ("hey superbrain"): compile NL into a validated
|
||||
// proposal (never writes), then owner-confirmed task CRUD + runs.
|
||||
mux.HandleFunc("POST /api/agent/compile", authed(handlers.CompileLimiter(handlers.HandleAgentCompile)))
|
||||
mux.HandleFunc("POST /api/agent/dry-run", authed(handlers.DryRunLimiter(handlers.HandleAgentDryRun)))
|
||||
mux.HandleFunc("GET /api/agent/tasks", authed(handlers.HandleAgentTasksList))
|
||||
mux.HandleFunc("POST /api/agent/tasks", authed(handlers.HandleAgentTasksCreate))
|
||||
mux.HandleFunc("PATCH /api/agent/tasks/{id}", authed(handlers.HandleAgentTasksUpdate))
|
||||
|
||||
Reference in New Issue
Block a user