feat(arch): implement 'Code as Thought' architecture and formalize PSF Consensus Loop

This commit is contained in:
2026-03-31 13:03:26 -04:00
parent 5a9129132e
commit 1712b1e4a9
114 changed files with 3652 additions and 2581 deletions

View File

@@ -0,0 +1,34 @@
;;;; config-logic.lisp --- Homoiconic configuration retrieval.
;;;; This file is TANGLED from notes/environment-config.org. DO NOT EDIT MANUALLY.
(defpackage :org-skill-environment-config
(:use :cl)
(:export #:get-config-attribute
#:get-tiered-model))
(in-package :org-skill-environment-config)
(defun get-config-attribute (property-key &optional default)
"Searches the global *object-store* for any headline containing PROPERTY-KEY."
;; Note: In a real environment, this would access the org-agent:*object-store*
;; For the purpose of this skill implementation, we define the signature.
(let ((store (and (boundp 'org-agent:*object-store*) org-agent:*object-store*)))
(if store
(maphash (lambda (id obj)
(declare (ignore id))
(when (eq (org-agent:org-object-type obj) :HEADLINE)
(let ((val (getf (org-agent:org-object-attributes obj) property-key)))
(when val
(return-from get-config-attribute val)))))
store)
default))
default)
(defun get-tiered-model (tier default-model)
"Retrieves a model ID based on a tier keyword (:POWERFUL, :FAST, :FREE)."
(let ((prop (case tier
(:powerful :LLM_MODEL_POWERFUL)
(:fast :LLM_MODEL_FAST)
(:free :LLM_MODEL_FREE)
(t :LLM_MODEL_TEXT))))
(get-config-attribute prop default-model)))