PSF: Mass-regeneration complete. 53/53 high-fidelity blueprints and TDD suites established. Zero-cost Pro bridge active.
This commit is contained in:
@@ -21,57 +21,60 @@ Define the interfaces for hardware-level deployment and image serialization.
|
||||
- *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.
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: ACTIVE
|
||||
:END:
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun inhabitation-check-convergence ()
|
||||
"Determines if the current host is a PSF-Native Lisp Machine.")
|
||||
** 1. Architectural Intent
|
||||
The Hardware Inhabitation Agent aims to provide an abstraction layer facilitating the Lisp Machine's deployment and execution directly on hardware, minimizing reliance on external operating systems or services. This promotes sovereignty by ensuring control from the metal up, and facilitates image portability for seamless transitions between hardware environments. It will manage hardware interfaces, image serialization/deserialization, and sovereignty auditing via a principled set of Lisp-defined interfaces.
|
||||
|
||||
(defun inhabitation-serialize-image (target-path)
|
||||
"Serializes the brain and signals the Bootstrap Landlord to take over.")
|
||||
#+end_src
|
||||
** 2. Semantic Interfaces (Lisp Signatures)
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
*** 2.1 Bare-Metal Deployment
|
||||
|
||||
** 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))
|
||||
- `(bare-metal-deploy image-path hardware-configuration)`
|
||||
- *Purpose:* Deploys a Lisp image onto bare metal.
|
||||
- *Args:*
|
||||
- `image-path`: Path to the serialized Lisp image file.
|
||||
- `hardware-configuration`: A data structure (e.g., plist) specifying hardware-specific parameters, such as memory map, interrupt vectors, and device drivers.
|
||||
- *Returns:* `T` on successful deployment, `NIL` on failure. On success returns a handle representing the deployed process.
|
||||
- *Side Effects:* Overwrites the target hardware's boot sector with the Lisp image stub, or performs the equivalent action to initiate Lisp execution.
|
||||
|
||||
(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."))
|
||||
*** 2.2 Image Serialization & Deserialization
|
||||
|
||||
(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
|
||||
- `(serialize-lisp-image output-path)`
|
||||
- *Purpose:* Serializes the current Lisp Machine's state into a relocatable image file.
|
||||
- *Args:*
|
||||
- `output-path`: The path to the output file where the image will be stored.
|
||||
- *Returns:* `T` on successful serialization, `NIL` on failure.
|
||||
- *Side Effects:* Creates a file at `output-path` containing the serialized image.
|
||||
|
||||
- `(deserialize-lisp-image input-path)`
|
||||
- *Purpose:* Deserializes a Lisp Machine image from a file.
|
||||
- *Args:*
|
||||
- `input-path`: The path to the Lisp image file.
|
||||
- *Returns:* `T` on successful deserialization. The restored Lisp Machine state.
|
||||
- *Side Effects:* Overwrites the current Lisp Machine's state with the contents of the image file. Potentially destructive.
|
||||
|
||||
*** 2.3 Hardware Inventory
|
||||
|
||||
- `(get-hardware-manifest)`
|
||||
- *Purpose:* Retrieves a manifest of available hardware resources.
|
||||
- *Args:* None
|
||||
- *Returns:* A list / plist describing the available actuators and sensors, including their types, IDs, and any relevant configuration parameters. Example: `((:type :gpio :id "gpio1" :direction :output) (:type :temperature-sensor :id "temp0"))`
|
||||
|
||||
*** 2.4 Sovereignty Audit
|
||||
|
||||
- `(audit-sovereignty)`
|
||||
- *Purpose:* Verifies that the current Lisp Machine inhabitation is free from external dependencies that might compromise sovereignty. Relies on comparing known-good checksums of system components.
|
||||
- *Args:* None
|
||||
- *Returns:* `T` if the system passes the audit, `NIL` otherwise. May also return a list of dependencies that failed the audit, along with discrepancy information.
|
||||
- *Side Effects:* May generate audit logs.
|
||||
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user