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,33 @@
#+TITLE: PRD: Skill - Technical Analyst Agent
#+STATUS: FROZEN
#+AUTHOR: Agent
#+CREATED: [2026-03-31 Tue 12:25]
* 1. Purpose
Define the automated testing and analysis behaviors for the PSF Consensus Loop. The Technical Analyst skill transforms a SIGNED PROTOCOL (Blueprint) into a comprehensive, failing TDD suite (Success Criteria).
* 2. User Needs
** 2.1 Protocol Perception
As the system orchestrator, I need the Analyst to identify when an architecture is ready for testing.
- The Analyst MUST monitor `$PROJECTS_DIR` for `PROTOCOL.org` files with `#+STATUS: SIGNED`.
** 2.2 TDD Inception (Success Criteria)
I need rigorous test cases generated from semantic interfaces.
- The Analyst MUST generate a test suite in the project's `tests/` directory.
- It MUST cover both the "Happy Path" and "Edge Case" scenarios.
- It MUST ensure that all tests match the function signatures defined in the project's `PROTOCOL.org`.
** 2.3 Automated Test Execution (Initial)
I need the Analyst to verify that the tests *fail* initially (Red-Green-Refactor).
- The skill must have a symbolic (Lisp) actuator that writes the generated test code and confirms its existence.
** 2.4 Structural Enforcement
I need the Analyst to ensure the project's `tests/` directory is correctly initialized.
- The Analyst MUST be able to scaffold the `tests/` directory if it is missing.
* 3. Success Criteria
- [ ] **Trigger Accuracy:** Analyst correctly identifies a `SIGNED` PROTOCOL and ignores `DRAFT` Protocols.
- [ ] **TDD Suite Generation:** Analyst generates a test suite that references at least one interface from the PROTOCOL.
- [ ] **Physical Inception:** The generated test code is physically written to `tests/test-suite.lisp` (or equivalent).
- [ ] **Edge Case Coverage:** The generated suite includes at least one negative test case (error handling).

View File

@@ -0,0 +1,40 @@
#+TITLE: PROTOCOL: Skill - Technical Analyst Agent
#+STATUS: DRAFT
#+AUTHOR: Tech-Analyst-Agent
#+CREATED: [2026-03-31 Tue 12:30]
* 1. Architectural Intent
This protocol defines the shared Lisp interfaces for the Technical Analyst skill. It ensures that the PSF Consensus Loop follows a strict TDD mandate by defining how the Analyst perceives signed architectures and actuates failing test suites.
Following the **Literate Mandate**, the Analyst skill's own implementation must be generated from its Org-mode source.
* 2. Semantic Interfaces
** 2.1 Blueprint Perception
#+begin_src lisp
(defun tech-analyst-perceive-signed-protocol (project-name)
"Checks if a project has a SIGNED PROTOCOL.
Returns a plist: (:status :signed :path \"path/to/PROTOCOL.org\") or NIL."
)
#+end_src
** 2.2 TDD Suite Actuation
#+begin_src lisp
(defun tech-analyst-actuate-tdd-suite (project-name test-content)
"Physically writes the TDD suite (test code) to the project.
Input: project name and generated Lisp/Python test code.
1. Ensures the 'tests/' directory exists.
2. Writes the content to 'tests/test-suite.*'.
Returns a success message or error signal."
)
#+end_src
** 2.3 Success Criteria Generation
#+begin_src lisp
(defun tech-analyst-generate-success-criteria (project-name)
"Extracts success criteria from the PROTOCOL and PRD to generate the 'RED' test suite."
)
#+end_src
* 3. Integration with PSF Lifecycle
The Analyst is triggered when a project transitions from `:BLUEPRINT` to `:SUCCESS`. Its output (a failing TDD suite in `tests/`) is the "Safety Gate" that permits the **Coder** (Phase D: Build) to begin implementation.