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

+7 -9
View File
@@ -452,8 +452,8 @@ def _print_repairs(scheduler: Scheduler) -> None:
def _answer_approvals(scheduler: Scheduler) -> None:
"""Ask any pending creation approvals at the REPL.
Only prompts when `creation_approval` is on (the scheduler posts nothing
otherwise). An empty answer denies.
Only prompts when a category (or the global default) uses the `ask` mode
(the scheduler posts nothing otherwise). An empty answer denies.
"""
while True:
pending = scheduler.pending_approvals()
@@ -539,7 +539,7 @@ def repl(scheduler: Scheduler, config: dict) -> int:
"housekeeping (slash-prefixed so plain requests still route by SemIf): "
"/delete <category> <skill> | /clear-config <category> <skill> | "
"/regen <category> <skill> | /cancel-build <category> <skill> | "
"/lock <category> on|off"
"/mode <category> allow|deny|ask"
)
while True:
_answer_questions(scheduler)
@@ -630,14 +630,12 @@ def repl(scheduler: Scheduler, config: dict) -> int:
status, detail = scheduler.cancel_skill_build(parts[1], parts[2])
print(f"[{status}] {detail}")
continue
if lower.startswith("/lock "):
if lower.startswith("/mode "):
parts = line.lstrip("/").split()
if len(parts) != 3 or parts[2].lower() not in ("on", "off"):
print("usage: /lock <category> on|off")
if len(parts) != 3 or parts[2].lower() not in ("allow", "deny", "ask"):
print("usage: /mode <category> allow|deny|ask")
continue
status, detail = scheduler.set_category_lock(
parts[1], parts[2].lower() == "on"
)
status, detail = scheduler.set_category_mode(parts[1], parts[2].lower())
print(f"[{status}] {detail}")
continue
if lower == "idle":