fix(kernel): Allow approved logs and events to pass act-gate without being flagged as blocked
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s
This commit is contained in:
@@ -103,8 +103,11 @@ The final stage of the metabolic loop. It performs a "last-mile" safety check be
|
||||
|
||||
;; 1. Last-Mile Safety Check (The Bouncer & Deterministic Gates)
|
||||
(when approved
|
||||
(let ((verified (deterministic-verify approved signal)))
|
||||
(if (and (listp verified) (member (getf verified :type) '(:LOG :EVENT :log :event)))
|
||||
(let* ((original-type (getf approved :type))
|
||||
(verified (deterministic-verify approved signal)))
|
||||
(if (and (listp verified)
|
||||
(member (getf verified :type) '(:LOG :EVENT :log :event))
|
||||
(not (member original-type '(:LOG :EVENT :log :event))))
|
||||
(progn
|
||||
(harness-log "ACT BLOCKED: Action failed last-mile deterministic check.")
|
||||
(setf (getf signal :approved-action) nil)
|
||||
|
||||
@@ -97,14 +97,15 @@ Once a proposal is generated, it MUST pass through the deterministic gates. Ever
|
||||
(gate (skill-deterministic-fn skill)))
|
||||
(when (or (null trigger) (ignore-errors (funcall trigger context)))
|
||||
(let ((next-action (funcall gate current-action context)))
|
||||
;; Interception occurs if the gate returns a signal (LOG/EVENT) AND either:
|
||||
;; 1. The original action was NOT a signal (e.g. it was a REQUEST).
|
||||
;; 2. The gate returned a DIFFERENT signal than it was given.
|
||||
(when (and (listp next-action)
|
||||
(member (getf next-action :type) '(:LOG :EVENT :log :event))
|
||||
(not (eq next-action current-action)))
|
||||
(harness-log "DETERMINISTIC: Intercepted by skill '~a'" (skill-name skill))
|
||||
(return-from deterministic-verify next-action))
|
||||
;; Interception occurs if the gate returns a signal (LOG/EVENT) AND the original was a REQUEST.
|
||||
;; If the original was already a LOG/EVENT, we only intercept if the gate returns a NEW signal object.
|
||||
(let ((original-type (getf current-action :type)))
|
||||
(when (and (listp next-action)
|
||||
(member (getf next-action :type) '(:LOG :EVENT :log :event))
|
||||
(or (not (member original-type '(:LOG :EVENT :log :event)))
|
||||
(not (eq next-action current-action))))
|
||||
(harness-log "DETERMINISTIC: Intercepted by skill '~a'" (skill-name skill))
|
||||
(return-from deterministic-verify next-action)))
|
||||
(setf current-action next-action)))))
|
||||
current-action))
|
||||
#+end_src
|
||||
|
||||
@@ -70,8 +70,11 @@
|
||||
|
||||
;; 1. Last-Mile Safety Check (The Bouncer & Deterministic Gates)
|
||||
(when approved
|
||||
(let ((verified (deterministic-verify approved signal)))
|
||||
(if (and (listp verified) (member (getf verified :type) '(:LOG :EVENT :log :event)))
|
||||
(let* ((original-type (getf approved :type))
|
||||
(verified (deterministic-verify approved signal)))
|
||||
(if (and (listp verified)
|
||||
(member (getf verified :type) '(:LOG :EVENT :log :event))
|
||||
(not (member original-type '(:LOG :EVENT :log :event))))
|
||||
(progn
|
||||
(harness-log "ACT BLOCKED: Action failed last-mile deterministic check.")
|
||||
(setf (getf signal :approved-action) nil)
|
||||
|
||||
@@ -67,14 +67,15 @@
|
||||
(gate (skill-deterministic-fn skill)))
|
||||
(when (or (null trigger) (ignore-errors (funcall trigger context)))
|
||||
(let ((next-action (funcall gate current-action context)))
|
||||
;; Interception occurs if the gate returns a signal (LOG/EVENT) AND either:
|
||||
;; 1. The original action was NOT a signal (e.g. it was a REQUEST).
|
||||
;; 2. The gate returned a DIFFERENT signal than it was given.
|
||||
(when (and (listp next-action)
|
||||
(member (getf next-action :type) '(:LOG :EVENT :log :event))
|
||||
(not (eq next-action current-action)))
|
||||
(harness-log "DETERMINISTIC: Intercepted by skill '~a'" (skill-name skill))
|
||||
(return-from deterministic-verify next-action))
|
||||
;; Interception occurs if the gate returns a signal (LOG/EVENT) AND the original was a REQUEST.
|
||||
;; If the original was already a LOG/EVENT, we only intercept if the gate returns a NEW signal object.
|
||||
(let ((original-type (getf current-action :type)))
|
||||
(when (and (listp next-action)
|
||||
(member (getf next-action :type) '(:LOG :EVENT :log :event))
|
||||
(or (not (member original-type '(:LOG :EVENT :log :event)))
|
||||
(not (eq next-action current-action))))
|
||||
(harness-log "DETERMINISTIC: Intercepted by skill '~a'" (skill-name skill))
|
||||
(return-from deterministic-verify next-action)))
|
||||
(setf current-action next-action)))))
|
||||
current-action))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user