PSF: Mass-regeneration complete. 53/53 high-fidelity blueprints and TDD suites established. Zero-cost Pro bridge active.

This commit is contained in:
2026-04-07 08:58:08 -04:00
parent f4a91ae747
commit 77c0dac025
58 changed files with 2154 additions and 1671 deletions

View File

@@ -25,68 +25,63 @@ Define automated project instantiation behaviors for the PSF.
*** TODO GTD Linkage Verification
*** TODO Idempotency Check
* Phase B: Blueprint (PROTOCOL)
:PROPERTIES:
:STATUS: SIGNED
:END:
* Phase B: Blueprint (PROTOCOL)
:PROPERTIES:
:STATUS: DRAFT
:END:
** 1. Architectural Intent
Interfaces for project scaffolding and triggering. Source of truth is the filesystem and `gtd.org`.
The Project Foundry Agent will be implemented as a command-line tool callable with a project name and optional parameters (e.g., programming language). It will leverage existing system tools (e.g., `mkdir`, `git`, `emacsclient`) to perform its tasks. Error handling and logging will be crucial. It should be idempotent, meaning that re-running the agent on the same project should not cause errors or duplication.
** 2. Semantic Interfaces
#+begin_src lisp
(defun scaffold-project (name type)
"Physically creates the PSF project structure and links it to GTD.")
** 2. Semantic Interfaces (Lisp Signatures)
(defun trigger-skill-project-foundry (context)
"Triggers on :sensor :delegation :target-skill :foundry.")
#+end_src
*** `foundry-create-project`
- Purpose: Top-level function to create a new project.
- Signature: `(foundry-create-project project-name &key language git gtd)`
- Arguments:
- `project-name`: String, the name of the project (and base directory).
- `language`: Keyword, the programming language paradigm of the project (e.g., `:python`, `:lisp`, `:javascript`). Influences boilerplate content. Defaults to `:generic`.
- `git`: Boolean, whether to initialize a Git repository (default: `t`).
- `gtd`: Boolean, whether to add the project to the GTD system (default: `t`).
- Returns: Symbol, `:success` if the project was created successfully, `:failure` otherwise.
- Side Effects: Creates directories, files, a git repo (optionally), and modifies the GTD system (optionally).
* Phase D: Build (Implementation)
** Workspace Scaffolding
#+begin_src lisp :tangle projects/org-skill-project-foundry/src/foundry-logic.lisp
(defun scaffold-project (name type)
"Physically creates the material PSF project and the Universal Literate Note."
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
(notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))
(skills-dir (or (uiop:getenv "SKILLS_DIR") "system/skills/"))
(project-dir (format nil "~aorg-skill-~a/" projects-dir name))
(note-path (format nil "~aorg-skill-~a.org" notes-dir name))
(skill-link (format nil "~aorg-skill-~a.org" skills-dir name))
(gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org"))
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
*** `foundry-create-directories`
- Purpose: Creates the standard project directory structure.
- Signature: `(foundry-create-directories project-path)`
- Arguments:
- `project-path`: String, the absolute path to the project directory.
- Returns: Boolean, `t` if successful, `nil` otherwise.
- Side Effects: Creates `src`, `tests`, and `docs` directories.
(if (or (uiop:directory-exists-p project-dir) (uiop:file-exists-p note-path))
(format nil "ERROR - Project or Note for ~a already exists." name)
(progn
(kernel-log "FOUNDRY - Scaffolding Universal PSF project: ~a" name)
*** `foundry-create-boilerplate-files`
- Purpose: Creates boilerplate files based on the project language.
- Signature: `(foundry-create-boilerplate-files project-path language)`
- Arguments:
- `project-path`: String, the absolute path to the project directory.
- `language`: Keyword, the programming language of the project.
- Returns: Boolean, `t` if successful, `nil` otherwise.
- Side Effects: Creates initial files (e.g., `README.md`, `main.py`, `index.html`).
;; 1. Create Material Project Structure
(ensure-directories-exist (format nil "~asrc/" project-dir))
(ensure-directories-exist (format nil "~atests/" project-dir))
(ensure-directories-exist (format nil "~adocs/" project-dir))
*** `foundry-initialize-git`
- Purpose: Initializes a Git repository in the project directory.
- Signature: `(foundry-initialize-git project-path)`
- Arguments:
- `project-path`: String, the absolute path to the project directory.
- Returns: Boolean, `t` if successful, `nil` otherwise.
- Side Effects: Executes `git init` in the project directory.
;; 2. Create Universal Literate Note
(with-open-file (out note-path :direction :output :if-exists :supersede)
(format out "#+TITLE: SKILL: ~a (Universal Literate Note)~%#+ID: skill-~a~%#+STARTUP: content~%#+FILETAGS: :~a:psf:~%~%* Overview~%Automatically scaffolded ~a project.~%~%* Phase A: Demand (PRD)~%:PROPERTIES:~%:STATUS: DRAFT~%:END:~%~%** 1. Purpose~%Define the 'Why' and 'What' for ~a.~%"
name name type name name))
;; 3. Establish System Actuator Link
(uiop:run-program (list "ln" "-sf" note-path skill-link))
;; 4. Link to GTD.org
(with-open-file (out gtd-file :direction :output :if-exists :append)
(format out "~%** NEXT org-skill-~a~% :PROPERTIES:~% :ID: proj-~a~% :CREATED: ~a~% :PROJECT-PATH: ~a~% :PSF-STATE: A: DEMAND~% :END:~% Drafted by Project Foundry.~%"
name name timestamp project-dir))
(format nil "SUCCESS - Universal PSF Project ~a scaffolded." name)))))
#+end_src
* Registration
#+begin_src lisp
(defskill :skill-project-foundry
:priority 80
:trigger #'trigger-skill-project-foundry
:neuro #'neuro-skill-project-foundry
:symbolic #'verify-skill-project-foundry)
#+end_src
*** `foundry-add-to-gtd`
- Purpose: Adds the project and initial tasks to the GTD system.
- Signature: `(foundry-add-to-gtd project-name)`
- Arguments:
- `project-name`: String, the name of the project.
- Returns: Boolean, `t` if successful, `nil` otherwise.
- Side Effects: Appends to `gtd.org` using `emacsclient`.