#+TITLE: SKILL: Hardware Inhabitation Agent (Universal Literate Note) #+ID: skill-hardware-inhabitation #+STARTUP: content #+FILETAGS: :sovereignty:deployment:bare-metal:lisp:psf: #+DEPENDS_ON: skill-shell-actuator skill-environment-config * Overview The *Hardware Inhabitation Agent* is the system's "Physical Interface." It manages the deployment of the Lisp Machine across different hardware compartments, ensuring absolute sovereignty via bare-metal inhabitation and environment portability. * Phase A: Demand (PRD) :PROPERTIES: :STATUS: FROZEN :END: ** 1. Purpose Define the interfaces for hardware-level deployment and image serialization. ** 2. User Needs - *Bare-Metal Deployment:* Support for running Lisp directly on minimal hardware (e.g., RISC-V/ARM). - *Image Portability:* Serialize and move the live Lisp Image across environments. - *Hardware Inventory:* Maintain a manifest of available physical actuators and sensors. - *Sovereignty Audit:* Verify that the current inhabitation is free from non-sovereign dependencies. * Phase B: Blueprint (PROTOCOL) :PROPERTIES: :STATUS: SIGNED :END: ** 1. Architectural Intent Define the "Convergence Bridge" between the cognitive agent and the hardware bootstrap. ** 2. Semantic Interfaces #+begin_src lisp (defun inhabitation-check-convergence () "Determines if the current host is a PSF-Native Lisp Machine.") (defun inhabitation-serialize-image (target-path) "Serializes the brain and signals the Bootstrap Landlord to take over.") #+end_src * Phase D: Build (Implementation) ** Inhabitation & Migration Logic #+begin_src lisp :tangle projects/org-skill-hardware-inhabitation/src/inhabitation-logic.lisp (defun inhabitation-check-convergence () "Checks for the presence of PSF-Native ISA features (e.g., tagged memory)." #+psf-native t #-psf-native (progn (kernel-log "SOVEREIGNTY - Currently running on non-native hardware (Simulator Mode).") nil)) (defun inhabitation-serialize-image (target-path) "Serializes the live SBCL image for migration. If convergence is reached, this image becomes the Native Boot Image." (kernel-log "MIGRATION - Freezing brain state to ~a..." target-path) #+sbcl (sb-ext:save-lisp-and-die target-path :executable t :toplevel #'org-agent:main) #-sbcl (kernel-log "ERROR - Serialization requires SBCL.")) (defun inhabitation-audit-sovereignty () "System 2 check for proprietary 'leaks' in the landlord layer." (let ((env (uiop:getenv "NODE_ENV"))) (if (equal env "docker") (kernel-log "SOVEREIGNTY WARNING - Living in a Docker container (Low Sovereignty).") (kernel-log "SOVEREIGNTY - Host environment verified.")))) #+end_src * Registration #+begin_src lisp (defskill :skill-hardware-inhabitation :priority 100 :trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :migration-request)) :neuro (lambda (context) "Analyze the migration target and verify sovereignty.") :symbolic (lambda (action context) (let ((path (getf (getf action :payload) :target-path))) (inhabitation-serialize-image path) action))) #+end_src