ARCH: Rename system manifest and decouple all behavioral skills

This commit is contained in:
2026-04-13 16:38:59 -04:00
parent 19fb888434
commit f26b6ccec7
7 changed files with 44 additions and 64 deletions

View File

@@ -1,30 +0,0 @@
(in-package :org-agent)
(defun verify-git-clean-p (dir)
"Returns T if the git repository at DIR has no uncommitted changes."
(let ((status (uiop:run-program (list "git" "-C" (namestring dir) "status" "--porcelain")
:output :string
:ignore-error-status t)))
(string= "" (string-trim '(#\Space #\Newline #\Tab) status))))
(defun engineering-standards-gate (action context)
"Physically enforces the 'Commit Before Modify' rule."
(let* ((payload (getf action :payload))
(act (or (getf payload :action) (getf action :action)))
(target-file (getf payload :file)))
;; If the action involves modifying files, check git status
(when (member act '(:modify-file :write-file :replace :rename-file :delete-file))
(let ((proj-root (asdf:system-source-directory :org-agent)))
(unless (verify-git-clean-p proj-root)
(harness-log "DETERMINISTIC [Standards]: BLOCKING ACTION. Working tree is dirty. Commit changes before modification.")
(return-from engineering-standards-gate
(list :type :LOG :payload (list :text "Engineering Standard Violation: Working tree dirty. You MUST commit before modifying files."))))))
action))
(org-agent:defskill :skill-engineering-standards
:priority 900 ; High priority, runs before most skills
:trigger (lambda (ctx) t) ; Always active
:probabilistic nil
:deterministic #'engineering-standards-gate)

24
src/policy.lisp Normal file
View File

@@ -0,0 +1,24 @@
(in-package :org-agent)
(defun policy-check-sovereignty (action context)
"Ensures the action does not violate the Sovereignty invariant."
(declare (ignore context))
;; Implementation placeholder
action)
(defun policy-deterministic-gate (action context)
"The main policy gate. Sub-calls engineering standards if available."
(let ((current-action (policy-check-sovereignty action context)))
(when current-action
(let ((eng-pkg (find-package :org-agent.skills.org-skill-engineering-standards)))
(when eng-pkg
(let ((eng-gate (find-symbol "ENGINEERING-STANDARDS-GATE" eng-pkg)))
(when (and eng-gate (fboundp eng-gate))
(setf current-action (funcall (symbol-function eng-gate) current-action context)))))))
current-action))
(defskill :skill-policy
:priority 100
:trigger (lambda (ctx) t)
:probabilistic nil
:deterministic #'policy-deterministic-gate)

View File

@@ -1,13 +0,0 @@
(in-package :org-agent)
(defun policy-check-sovereignty (action context)
"Ensures the action does not violate the Sovereignty invariant."
(declare (ignore context))
;; Implementation placeholder
action)
(defskill :skill-policy
:priority 100
:trigger (lambda (ctx) t)
:probabilistic nil
:deterministic #'policy-check-sovereignty)