feat(control-v2): add blocked/approve/deny aliases and autonomy guardrails
This commit is contained in:
@@ -3,6 +3,7 @@ import json
|
||||
import time
|
||||
from pathlib import Path
|
||||
from .queue import enqueue
|
||||
from .guardrails import allowed_now, record_task
|
||||
|
||||
AUTON_PATH = Path('/srv/prime-core/state/autonomous-mode.json')
|
||||
GOALS_PATH = Path('/srv/prime-core/state/goals.json')
|
||||
@@ -54,8 +55,12 @@ def tick():
|
||||
prev = int(lm.get(gid, 0))
|
||||
# seed one planning task per goal every 30m
|
||||
if now - prev >= 1800:
|
||||
enqueue('planning', f"Advance goal: {g.get('text','')}")
|
||||
lm[gid] = now
|
||||
task = f"Advance goal: {g.get('text','')}"
|
||||
ok, reason = allowed_now(task)
|
||||
if ok:
|
||||
enqueue('planning', task)
|
||||
record_task(task)
|
||||
lm[gid] = now
|
||||
save_last(lm)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user