refactor: rename alignment skills, scrub marketing lingo, and implement physical git safety gate
This commit is contained in:
30
src/engineering-standards.lisp
Normal file
30
src/engineering-standards.lisp
Normal file
@@ -0,0 +1,30 @@
|
||||
(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 "DELIBERATE [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
|
||||
:neuro nil
|
||||
:symbolic #'engineering-standards-gate)
|
||||
@@ -70,6 +70,7 @@
|
||||
#:skill
|
||||
#:skill-name
|
||||
#:skill-priority
|
||||
#:skill-dependencies
|
||||
#:skill-trigger-fn
|
||||
#:skill-neuro-prompt
|
||||
#:skill-symbolic-fn
|
||||
|
||||
50
src/system-invariants.lisp
Normal file
50
src/system-invariants.lisp
Normal file
@@ -0,0 +1,50 @@
|
||||
(in-package :org-agent)
|
||||
|
||||
(org-agent:def-cognitive-tool :harness-status "Returns the current operational status of the Org-Agent harness, including loaded skills and telemetry."
|
||||
nil
|
||||
:body (lambda (args)
|
||||
(declare (ignore args))
|
||||
(format nil "HARNESS STATUS:
|
||||
- Active Skills: ~a
|
||||
- Uptime: ~a seconds
|
||||
- Memory Usage: ~a
|
||||
- Providers: ~a"
|
||||
(hash-table-count org-agent:*skills-registry*)
|
||||
(get-universal-time) ; Placeholder for actual uptime
|
||||
"Not implemented"
|
||||
org-agent:*provider-cascade*)))
|
||||
|
||||
(org-agent:def-cognitive-tool :list-skills "Lists all currently loaded skills and their metadata."
|
||||
nil
|
||||
:body (lambda (args)
|
||||
(declare (ignore args))
|
||||
(let ((output "LOADED SKILLS:
|
||||
"))
|
||||
(maphash (lambda (name skill)
|
||||
(setf output (concatenate 'string output
|
||||
(format nil "- ~a (Priority: ~a, Deps: ~s)~%"
|
||||
name
|
||||
(org-agent:skill-priority skill)
|
||||
(org-agent:skill-dependencies skill)))))
|
||||
org-agent:*skills-registry*)
|
||||
output)))
|
||||
|
||||
(org-agent:defskill :skill-system-invariants
|
||||
:priority 1000 ; Absolute highest priority
|
||||
:trigger (lambda (context) t) ; Always active as a fallback
|
||||
:neuro (lambda (context)
|
||||
"You are the Org-Agent System Invariants Skill. Your goal is to empower the user through the Lisp Machine.
|
||||
Follow the Core Invariants:
|
||||
1. Sovereignty: Avoid proprietary traps.
|
||||
2. Technical Mastery: Explain your logic.
|
||||
3. Zero-Bloat: Keep it minimal.
|
||||
4. Transparency: Your thoughts are auditable.
|
||||
5. Sustainability: Think long-term.")
|
||||
:symbolic (lambda (action context)
|
||||
;; Basic invariant check: Block actions that appear to violate sovereignty
|
||||
(let ((payload (getf action :payload)))
|
||||
(if (and payload (search "proprietary" (format nil "~s" payload)))
|
||||
(progn
|
||||
(org-agent:harness-log "DELIBERATE [Invariants]: Sovereignty violation suspected. Blocking action.")
|
||||
nil)
|
||||
action))))
|
||||
Reference in New Issue
Block a user