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

This commit is contained in:
2026-04-19 15:23:08 -04:00
parent 8c6a192af1
commit 22726047a1
4 changed files with 28 additions and 20 deletions

View File

@@ -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)

View File

@@ -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))