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,31 @@
#+TITLE: PRD: Skill - Architect Agent
#+STATUS: FROZEN
#+AUTHOR: Agent
#+CREATED: [2026-03-31 Tue 12:15]
* 1. Purpose
Define the automated architectural behaviors for the PSF Consensus Loop. The Architect skill transforms a FROZEN PRD (Demand) into a rigorous PROTOCOL (Blueprint).
* 2. User Needs
** 2.1 PRD Perception
As the system orchestrator, I need the Architect to identify when a project is ready for blueprinting.
- The Architect MUST monitor `$PROJECTS_DIR` for `PRD.org` files with `#+STATUS: FROZEN`.
** 2.2 Semantic Translation
I need ambiguous requirements translated into executable interfaces.
- The Architect MUST generate `PROTOCOL.org` with Lisp-style function signatures for all core requirements.
- It MUST define the "Architectural Intent" to maintain long-term system integrity.
** 2.3 Institutional Memory Integration
I need architectural decisions to be grounded in experience.
- The Architect MUST reference `notes/institutional-memory.org` when making significant design choices.
** 2.4 Physical Actuation
I need the blueprint to be physically written to the project directory.
- The skill must have a symbolic (Lisp) actuator that writes the generated Org content to the disk.
* 3. Success Criteria
- [ ] **Trigger Accuracy:** Architect correctly identifies a `FROZEN` PRD and ignores `DRAFT` PRDs.
- [ ] **Protocol Generation:** Architect generates a `PROTOCOL.org` that contains at least one valid Lisp interface signature.
- [ ] **File Integrity:** The generated `PROTOCOL.org` is syntactically valid Org-mode and contains the correct front matter (`#+TITLE`, `#+STATUS: DRAFT`).

View File

@@ -0,0 +1,40 @@
#+TITLE: PROTOCOL: Skill - Architect Agent
#+STATUS: DRAFT
#+AUTHOR: Architect-Agent
#+CREATED: [2026-03-31 Tue 12:20]
* 1. Architectural Intent
This protocol defines the shared Lisp interfaces for the Architect skill. It ensures a rigorous "Consensus Loop" by defining how the Architect perceives requirements and actuates blueprints.
Following the **Literate Mandate**, the Architect skill's own implementation must be generated from its Org-mode source.
* 2. Semantic Interfaces
** 2.1 Requirements Perception
#+begin_src lisp
(defun architect-perceive-frozen-prd (project-name)
"Checks if a project has a FROZEN PRD.
Returns a plist: (:status :frozen :path \"path/to/PRD.org\") or NIL."
)
#+end_src
** 2.2 Blueprint Actuation
#+begin_src lisp
(defun architect-actuate-protocol (project-name blueprint-content)
"Physically writes the PROTOCOL.org file.
Input: project name and generated Org content.
Returns a success message or error signal."
)
#+end_src
** 2.3 Memory Retrieval
#+begin_src lisp
(defun architect-query-institutional-memory (context-tags)
"Retrieves relevant architectural patterns from notes/institutional-memory.org.
Input: tags like :emacs:gtd:psf.
Returns a list of relevant patterns/learnings."
)
#+end_src
* 3. Integration with PSF Lifecycle
The Architect is triggered when a project transitions from `:DEMAND` to `:BLUEPRINT`. Its output (a SIGNED Protocol) is the "Safety Gate" for the **Analyst** phase.