docs: add literate prose to naming-drift aliases and HITL gateway changes
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 3s

Adds prose sections before every code block to satisfy the
prose-before-code discipline. Each backward-compatibility alias
(process-signal, perceive-gate, reason-gate, act-gate, inject-stimulus)
now has its own subsection explaining why it exists and what new code
should use instead.

Also:
- Fixes double #+end_src in core-loop-perceive.org
- Renames inject-stimulus → stimulus-inject in heartbeat-start and
  client-handle-connection (both already had aliases)
- Adds HITL interception prose to gateway-manager.org telegram/signal
  sections
- Splits Pre-Reason Handler Registry into two code blocks (defvar + defun)
  for one-per-block compliance
This commit is contained in:
2026-05-03 13:58:08 -04:00
parent bbc5e4d8bf
commit 3f51a772d4
11 changed files with 109 additions and 47 deletions

View File

@@ -70,21 +70,34 @@ before the signal reaches the LLM. The handler receives the full signal
and returns T if the signal was consumed (don't continue to reason)
or nil if processing should proceed normally.
*** Pre-Reason Handler Hash Table
;; REPL-VERIFIED: 2026-05-03T13:00:00
#+begin_src lisp
(defvar *pre-reason-handlers* (make-hash-table :test 'eq)
"Pre-reason handler registry: sensor keyword → handler function.")
#+end_src
*** register-pre-reason-handler
;; REPL-VERIFIED: 2026-05-03T13:00:00
#+begin_src lisp
(defun register-pre-reason-handler (sensor fn)
"Registers FN to handle signals with SENSOR in the perceive gate.
FN receives (signal) and returns T if consumed, nil to continue."
(setf (gethash sensor *pre-reason-handlers*) fn))
;; Alias for backward compatibility
(defun inject-stimulus (raw-message &key stream (depth 0))
"Alias for stimulus-inject."
(stimulus-inject raw-message :stream stream :depth depth))
#+end_src
** inject-stimulus backward-compatibility alias
Skills and external code that still call ~inject-stimulus~ (the previous
name for the pipeline injection function) can use this alias. New code
should call ~stimulus-inject~ directly.
;; REPL-VERIFIED: 2026-05-03T13:00:00
#+begin_src lisp
(defun inject-stimulus (raw-message &key stream (depth 0))
(stimulus-inject raw-message :stream stream :depth depth))
#+end_src
** Stimulus Injection (stimulus-inject)
@@ -139,12 +152,12 @@ The perceive gate is the first stage of the metabolic pipeline. It receives a no
All signals get tagged with their processing stage (`:status :perceived`) and the current foveal focus before being passed to the Reason stage.
*** loop-gate-perceive
The main perceive pipeline stage.
;; REPL-VERIFIED: 2026-05-03T13:00:00
#+begin_src lisp
;; Alias: perceive-gate → loop-gate-perceive
(defun perceive-gate (signal)
(loop-gate-perceive signal))
(defun loop-gate-perceive (signal)
"Stage 1 of the metabolic pipeline: Normalize sensory input."
(let* ((payload (getf signal :payload))
@@ -199,6 +212,18 @@ All signals get tagged with their processing stage (`:status :perceived`) and th
signal))
#+end_src
*** perceive-gate (backward-compatibility alias)
The pipeline gate was originally named ~perceive-gate~. Code that still
uses the old name can call this alias. New code should call
~loop-gate-perceive~.
;; REPL-VERIFIED: 2026-05-03T13:00:00
#+begin_src lisp
(defun perceive-gate (signal)
(loop-gate-perceive signal))
#+end_src
* Test Suite
Verifies that the perceive gate correctly ingests AST nodes into memory and that the depth limiter prevents runaway recursive signals.
#+begin_src lisp :tangle ../lisp/core-loop-perceive.lisp