feat: memory scope segmentation — wire context scope into perceive gate
Some checks failed
Deploy (Gitea) / deploy (push) Has been cancelled
Some checks failed
Deploy (Gitea) / deploy (push) Has been cancelled
Adds *scope-resolver* hook in core-loop-perceive that the context-manager skill sets at load time. The perceive gate now passes the active scope to ingest-ast, tagging all ingested objects with the current context scope. Implementation: - core-loop-perceive: *scope-resolver* defvar (default nil → :memex), two ingest-ast calls now pass (if *scope-resolver* (funcall it) :memex) - core-defpackage: export *scope-resolver* and context-query - system-context-manager: auto-init sets *scope-resolver* to #'current-scope This completes the Memory Scope Segmentation feature: all three scopes (:memex, :session, :project) are supported, scope-aware retrieval (context-query :scope / context-scoped-query) was already implemented, and ingested objects now correctly carry the active scope.
This commit is contained in:
@@ -51,11 +51,12 @@
|
||||
#:context-get-recent-completed-tasks
|
||||
#:context-list-all-skills
|
||||
#:context-get-skill-source
|
||||
#:context-get-system-logs
|
||||
#:context-resolve-path
|
||||
#:context-get-skill-telemetry
|
||||
#:telemetry-track
|
||||
#:context-assemble-global-awareness
|
||||
#:context-get-system-logs
|
||||
#:context-resolve-path
|
||||
#:context-get-skill-telemetry
|
||||
#:telemetry-track
|
||||
#:context-assemble-global-awareness
|
||||
#:context-query
|
||||
#:process-signal
|
||||
#:loop-process
|
||||
#:perceive-gate
|
||||
@@ -75,12 +76,13 @@
|
||||
#:dispatch-action
|
||||
#:register-actuator
|
||||
#:load-skill-from-org
|
||||
#:skill-initialize-all
|
||||
#:load-skill-with-timeout
|
||||
#:topological-sort-skills
|
||||
#:validate-lisp-syntax
|
||||
#:defskill
|
||||
#:*skill-registry*
|
||||
#:skill-initialize-all
|
||||
#:load-skill-with-timeout
|
||||
#:topological-sort-skills
|
||||
#:validate-lisp-syntax
|
||||
#:defskill
|
||||
#:*skill-registry*
|
||||
#:*scope-resolver*
|
||||
#:skill
|
||||
#:skill-name
|
||||
#:skill-priority
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
(defvar *loop-interrupt* nil)
|
||||
|
||||
(defvar *scope-resolver* nil
|
||||
"If set, function returning current scope keyword. Used by perceive gate.")
|
||||
|
||||
(defvar *loop-async-sensors* '(:chat-message :delegation :user-command)
|
||||
"Sensors that are processed in dedicated threads.")
|
||||
|
||||
@@ -79,13 +82,13 @@ FN receives (signal) and returns T if consumed, nil to continue."
|
||||
(let ((ast (getf payload :ast)))
|
||||
(when ast
|
||||
(snapshot-memory)
|
||||
(ingest-ast ast))))
|
||||
(ingest-ast ast :scope (if *scope-resolver* (funcall *scope-resolver*) :memex)))))
|
||||
(:point-update
|
||||
(let ((element (getf payload :element)))
|
||||
(when element
|
||||
(snapshot-memory)
|
||||
(setf *loop-focus-id* (getf element :id))
|
||||
(ingest-ast element))))
|
||||
(ingest-ast element :scope (if *scope-resolver* (funcall *scope-resolver*) :memex)))))
|
||||
(:interrupt
|
||||
(setf *loop-interrupt* t))
|
||||
;; HITL: re-injected approved action from dispatcher-approvals-process
|
||||
|
||||
@@ -116,3 +116,6 @@ until stack is empty or :memex context is reached."
|
||||
(when (> (context-stack-depth) 0)
|
||||
nil))
|
||||
nil))
|
||||
|
||||
(when (boundp '*scope-resolver*)
|
||||
(setf *scope-resolver* #'current-scope))
|
||||
|
||||
Reference in New Issue
Block a user