scheduler: new-skill creation is a tri-state allow/deny/ask mode

Replace the boolean creation_approval and the per-category boolean
locks.new_skill with a single tri-state new_skill_creation mode: a global
default (allow | deny | ask) with a per-category override in the category
config. allow authors immediately, deny blocks creation, ask gates on human
approval (the old approval path). housekeeping/response stay denied in code.

Surfaces updated: config.example.json, REPL /mode, dashboard
/api/new-skill-modes + /api/new-skill-mode, static UI. The retired booleans
creation_approval (true->ask) and locks.new_skill (true->deny) are still read
as fallbacks so an existing deployment keeps its behaviour.

Docs (AGENTS.md, docs/flow.md) and tests updated.
This commit is contained in:
gabby committed 2026-10-10 01:38:16 +00:00
1 parent 88700898be
commit c5ee87875f
11 files changed
+350 -160

No files matched your search

+6 -6
View File
@@ -151,7 +151,7 @@ def build_tree_payload(scheduler: Scheduler) -> dict:
]
for category, skills in sorted(snapshot.items())
},
"locks": scheduler.category_locks(),
"new_skill_modes": scheduler.category_modes(),
}
@@ -235,8 +235,8 @@ class DashboardHandler(BaseHTTPRequestHandler):
if path == "/api/approvals":
self._send(200, {"approvals": self.scheduler.pending_approvals()})
return
if path == "/api/locks":
self._send(200, {"locks": self.scheduler.category_locks()})
if path == "/api/new-skill-modes":
self._send(200, {"modes": self.scheduler.category_modes()})
return
if path == "/api/timers":
self._send(
@@ -345,12 +345,12 @@ class DashboardHandler(BaseHTTPRequestHandler):
if path == "/api/cancel-build":
self._housekeeping("cancel_skill_build")
return
if path == "/api/lock":
if path == "/api/new-skill-mode":
with self.lock:
try:
body = self._read_json()
status, detail = self.scheduler.set_category_lock(
str(body.get("category", "")), bool(body.get("locked"))
status, detail = self.scheduler.set_category_mode(
str(body.get("category", "")), str(body.get("mode", ""))
)
except Exception as exc:
self._send_error(500, str(exc))