- Add deepseek and nvidia entries to gateway-provider config - Add DEEPSEEK_API_KEY and NVIDIA_API_KEY to .env.example - Add deepseek and nvidia to doctor's LLM provider check - Fix remaining harness-log → log-message reference
30 lines
1.3 KiB
Org Mode
30 lines
1.3 KiB
Org Mode
#+TITLE: SKILL: Protocol Validator (org-skill-protocol-validator.org)
|
|
#+AUTHOR: Agent
|
|
#+FILETAGS: :system:protocol:validation:
|
|
#+PROPERTY: header-args:lisp :tangle ../lisp/security-validator.lisp
|
|
|
|
* Overview
|
|
The Protocol Validator enforces schema compliance on every message entering or leaving the cognitive pipeline. It checks that messages are valid plists, that they have the required ~:type~ and ~:payload~ fields, and that the type is one of the known types (~:REQUEST~, ~:EVENT~, ~:RESPONSE~, ~:LOG~, ~:STATUS~). This prevents malformed messages from crashing the pipeline and ensures backward compatibility when the protocol evolves.
|
|
|
|
* Implementation
|
|
|
|
** Validation Logic
|
|
#+begin_src lisp
|
|
(defun validator-protocol-check (msg)
|
|
"Enforces structural schema compliance on protocol messages."
|
|
(validate-communication-protocol-schema msg))
|
|
#+end_src
|
|
|
|
** Skill Registration
|
|
#+begin_src lisp
|
|
(defskill :passepartout-security-validator
|
|
:priority 95
|
|
:trigger (lambda (ctx) (declare (ignore ctx)) t)
|
|
:deterministic (lambda (action ctx)
|
|
(declare (ignore ctx))
|
|
(handler-case
|
|
(progn (validator-protocol-check action) action)
|
|
(error (c)
|
|
(list :type :LOG :payload (list :level :error :text (format nil "Protocol Violation: ~a" c)))))))
|
|
#+end_src
|