ARCH: Rename system manifest and decouple all behavioral skills
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#+TITLE: System Definition (org-agent.asd)
|
||||
#+TITLE: Manifest (org-agent.asd)
|
||||
#+AUTHOR: Amr
|
||||
#+FILETAGS: :harness:system:
|
||||
#+STARTUP: content
|
||||
|
||||
* System Definition (org-agent.asd)
|
||||
* Manifest (org-agent.asd)
|
||||
** Architectural Intent: The ASDF Skeleton
|
||||
|
||||
The ~org-agent.asd~ file is the physical blueprint of the Lisp Machine. It uses **Another System Definition Facility (ASDF)** to orchestrate the compilation and loading of all harness modules.
|
||||
@@ -40,8 +40,7 @@ This system defines the core "Thin Harness." It includes the protocol, the objec
|
||||
:serial t
|
||||
:components ((:file "src/package")
|
||||
(:file "src/skills")
|
||||
(:file "src/system-invariants")
|
||||
(:file "src/engineering-standards")
|
||||
(:file "src/policy")
|
||||
(:file "src/communication-validator")
|
||||
(:file "src/communication")
|
||||
(:file "src/memory")
|
||||
@@ -8,8 +8,7 @@
|
||||
:serial t
|
||||
:components ((:file "src/package")
|
||||
(:file "src/skills")
|
||||
(:file "src/system-invariants")
|
||||
(:file "src/engineering-standards")
|
||||
(:file "src/policy")
|
||||
(:file "src/communication-validator")
|
||||
(:file "src/communication")
|
||||
(:file "src/memory")
|
||||
|
||||
@@ -50,8 +50,7 @@ The Engineering Standards skill provides the deterministic enforcement of the wo
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Git Status Enforcement
|
||||
#+begin_src lisp :tangle ../src/engineering-standards.lisp
|
||||
(in-package :org-agent)
|
||||
#+begin_src lisp
|
||||
|
||||
(defun verify-git-clean-p (dir)
|
||||
"Returns T if the git repository at DIR has no uncommitted changes."
|
||||
@@ -77,15 +76,6 @@ The Engineering Standards skill provides the deterministic enforcement of the wo
|
||||
action))
|
||||
#+end_src
|
||||
|
||||
** Skill Definition
|
||||
#+begin_src lisp :tangle ../src/engineering-standards.lisp
|
||||
(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)
|
||||
#+end_src
|
||||
|
||||
* See Also
|
||||
- [[file:org-skill-system-invariants.org][System Policy]]
|
||||
- [[file:../README.org][org-agent README]]
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* Overview
|
||||
The *Org-Agent* is a probabilistic-deterministic harness for a personal operating system. It uses Org-mode as its native memory and Common Lisp as its deterministic reasoning engine.
|
||||
|
||||
#+begin_src lisp :tangle ../src/system-invariants.lisp
|
||||
#+begin_src lisp :tangle ../src/policy.lisp
|
||||
(in-package :org-agent)
|
||||
#+end_src
|
||||
|
||||
@@ -23,12 +23,23 @@ The Deterministic Engine uses these headlines as a "Moral Compass" during the de
|
||||
** 1. Sovereignty Above All
|
||||
Every action must increase the user's independence from centralized, proprietary platforms. If a tool or library introduces a dependency on a non-sovereign entity, it must be flagged for replacement.
|
||||
|
||||
#+begin_src lisp :tangle ../src/system-invariants.lisp
|
||||
#+begin_src lisp :tangle ../src/policy.lisp
|
||||
(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))
|
||||
#+end_src
|
||||
|
||||
** 2. Technical Mastery & Mentorship
|
||||
@@ -46,10 +57,10 @@ Prioritize local, energy-efficient, and offline-first architectures. The "Memex"
|
||||
* Operational Mandates
|
||||
Every action performed by an agent in this environment must also adhere to the [[file:../../org-agent-contrib/org-skill-engineering-standards.org][Engineering Standards]].
|
||||
|
||||
#+begin_src lisp :tangle ../src/system-invariants.lisp
|
||||
#+begin_src lisp :tangle ../src/policy.lisp
|
||||
(defskill :skill-policy
|
||||
:priority 100
|
||||
:trigger (lambda (ctx) t)
|
||||
:probabilistic nil
|
||||
:deterministic #'policy-check-sovereignty)
|
||||
:deterministic #'policy-deterministic-gate)
|
||||
#+end_src
|
||||
|
||||
@@ -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
24
src/policy.lisp
Normal 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)
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user