feat: Context Manager skill + org-object→memory-object fix
Some checks failed
Deploy (Gitea) / deploy (push) Has been cancelled

- system-context-manager (new skill): stack-based project focusing with
  push-context/pop-context, path resolution relative to base path, and
  scope-aware memory queries via context-scoped-query.
- core-memory: add :scope slot to memory-object struct (default :memex).
- core-memory: ingest-ast accepts &key (scope :memex), propagates to children.
- core-context: context-query accepts :scope parameter for filtering.
- DEFECT FIX: renamed org-object-* accessors to memory-object-*
  across core-context, security-dispatcher, tests, and defpackage exports.
  The struct was renamed but accessor references were never updated —
  the code referenced nonexistent functions.
This commit is contained in:
2026-05-03 12:08:04 -04:00
parent 22697baa2d
commit 529f8d0782
11 changed files with 417 additions and 119 deletions

View File

@@ -182,14 +182,12 @@ The "Brain" meets the "Machine." Standardization and professionalization of the
Unified control plane and Human-in-the-Loop state management.
** Tasks
*** Remediation: Backfill v0.1.0/v0.2.0 Gaps
**** Remediation: Backfill v0.1.0/v0.2.0 Gaps
These features were marked DONE in prior versions but are stubs, no-ops, or
missing. They must be completed before v0.3.0 feature work proceeds.
**** DONE P0: Add vault-get-secret / vault-set-secret wrappers :backfill:
***** DONE P0: Add vault-get-secret / vault-set-secret wrappers :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-vault-secret-wrappers
@@ -203,7 +201,7 @@ and called from =gateway-manager.org= (lines 36, 86, 180) but never defined.
=gateway-link= crashes at runtime. Add one-line wrappers in =security-vault.org=
that delegate to the existing =vault-get=/=vault-set= with ~:type :secret~.
**** DONE P0: system-archivist — Scribe + Gardener :backfill:
***** DONE P0: system-archivist — Scribe + Gardener :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-archivist-distillation
@@ -217,7 +215,7 @@ Gardener: scan for broken =[[file:]]= links and orphaned =memory-object= entries
Wire both as cron jobs via =system-event-orchestrator=.
Depends on: orchestrator bootstrap (P1 item below).
**** DONE P0: system-self-improve — surgical edit + error fix :backfill:
***** DONE P0: system-self-improve — surgical edit + error fix :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-self-improve-real
@@ -233,7 +231,7 @@ CLOSED: [2026-05-03 Sun 10:42]
Remove the dead first =defskill= registration (trigger nil, overwritten by second).
Depends on: =programming-org=, =programming-literate= (P0 items below).
**** DONE P0: programming-org — fix org-modify + org-ast-render :backfill:
***** DONE P0: programming-org — fix org-modify + org-ast-render :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-org-modify-render
@@ -247,7 +245,7 @@ node by ID in file and apply changes to its content.
=org-ast-render(ast)= returns a hardcoded placeholder. Should convert plist AST
back to Org text.
**** DONE P0: programming-literate — fix both stubs :backfill:
***** DONE P0: programming-literate — fix both stubs :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-literate-real
@@ -260,7 +258,7 @@ CLOSED: [2026-05-03 Sun 10:42]
have balanced parentheses. Returns T if all balanced, error message otherwise.
=literate-tangle-sync-check=: verify =.lisp= file matches tangled output of =.org= file.
**** DONE P1: system-event-orchestrator — bootstrap implementation :backfill:
***** DONE P1: system-event-orchestrator — bootstrap implementation :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-orchestrator-bootstrap
@@ -273,7 +271,7 @@ CLOSED: [2026-05-03 Sun 10:42]
and =#+CRON:= properties and register them via the existing registries.
Prerequisite for archivist cron jobs.
**** DONE P1: system-memory — memory introspection :backfill:
***** DONE P1: system-memory — memory introspection :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-memory-inspect
@@ -286,7 +284,7 @@ CLOSED: [2026-05-03 Sun 10:42]
by type, TODO state distribution, orphan count, snapshot list. Trigger on
=:INTROSPECTION= sensor type.
**** DONE P1: Path relic — skills/ → lisp/ in skill-initialize-all :backfill:
***** DONE P1: Path relic — skills/ → lisp/ in skill-initialize-all :backfill:
CLOSED: [2026-05-03 Sun 10:42]
:PROPERTIES:
:ID: id-path-relic
@@ -299,7 +297,7 @@ CLOSED: [2026-05-03 Sun 10:42]
under =$PASSEPARTOUT_DATA_DIR=. Core and skills were merged into =lisp/=.
Update both functions to point at =lisp/=.
**** DONE P2: core-context — semantic retrieval (embeddings) :backfill:
***** DONE P2: core-context — semantic retrieval (embeddings) :backfill:
CLOSED: [2026-05-03 Sun 11:42]
:PROPERTIES:
:ID: id-embeddings
@@ -312,7 +310,7 @@ CLOSED: [2026-05-03 Sun 11:42]
embeddings via Ollama =nomic-embed-text= at ingest time. Store in
=memory-object.vector=. Fallback: TF-IDF bag-of-words.
**** DONE P2: core-context — subtree-based skill source loading :backfill:
***** DONE P2: core-context — subtree-based skill source loading :backfill:
CLOSED: [2026-05-03 Sun 11:42]
:PROPERTIES:
:ID: id-skill-subtree
@@ -324,7 +322,7 @@ CLOSED: [2026-05-03 Sun 11:42]
=context-skill-source= reads entire Org files. Add =context-skill-subtree=
for targeted retrieval of specific function docs or test blocks by heading name.
**** DONE P3: Variable name drift normalization (out of scope for now) :backfill:
***** DONE P3: Variable name drift normalization (out of scope for now) :backfill:
CLOSED: [2026-05-03 Sun 11:50]
:PROPERTIES:
:ID: id-name-normalization
@@ -338,7 +336,7 @@ underscore (reason/context) vs =*skill-registry*= with hyphen (defpackage).
Normalization pass across all modules. Touches every file — do after P0-P2
are stable. Do not mix with functional changes.
*** DONE Project Renaming (Bouncer → Dispatcher)
**** DONE Project Renaming (Bouncer → Dispatcher)
:PROPERTIES:
:ID: id-9e779580-287b-b3d1-37b9-bcefd750bf9e
:CREATED: [2026-05-01 Fri 15:40]
@@ -348,7 +346,7 @@ are stable. Do not mix with functional changes.
:END:
The Dispatcher's role has evolved beyond security guard. It is the seed of the deterministic engine — it learns to execute procedures without invoking the neural net.
*** DONE Event Orchestrator (unified hooks+cron+routing)
**** DONE Event Orchestrator (unified hooks+cron+routing)
:PROPERTIES:
:ID: id-d35aea3d-2e5f-4a12-a9b0-1c2d3e4f5a6b
:CREATED: [2026-05-02 Sat 14:00]
@@ -363,7 +361,7 @@ Unified control plane for hooks, cron, and complexity-based routing.
- Hooked into heartbeat for cron processing
- Rule-based tier classifier (overrideable via ~*tier-classifier*~)
*** TODO Context Manager (project scoping)
**** TODO Context Manager (project scoping)
:PROPERTIES:
:ID: id-a10ed34e-9f37-4a15-b499-46672c00d951
:CREATED: [2026-05-02 Sat 23:00]
@@ -373,22 +371,22 @@ Path resolution relative to current context.
Memory scope: ~:scope~ property on memory-objects (memex/session/project).
Implement lazy-loading proxies for large-scale memory traversal.
*** TODO Model-Tier Routing (cost optimization)
**** TODO Model-Tier Routing (cost optimization)
Extend ~*model-selector-fn*~ for complexity-based routing.
- Heartbeats → smallest model
- User input → medium model
- Complex reasoning → large model
*** TODO Memory Scope Segmentation
**** TODO Memory Scope Segmentation
Extend memory-object with ~:scope~ property.
- ~:memex~ (permanent knowledge), ~:session~ (ephemeral), ~:project~ (current work)
- Scope-aware retrieval in memory layer
*** TODO Asynchronous Embedding Gateway
**** TODO Asynchronous Embedding Gateway
Provider-agnostic vector generation (Ollama, llama.cpp, OpenAI).
Edits mark nodes as ~:vector :pending~; background worker batches and updates Merkle tree.
*** TODO TUI Experience (Daily Driver Quality)
**** TODO TUI Experience (Daily Driver Quality)
The TUI is a standalone Croatoan app in ~org/gateway-tui.org~.
None of these changes require daemon modifications — the protocol between TUI and
daemon (port 9105, framed plists) is stable.
@@ -403,7 +401,7 @@ daemon (port 9105, framed plists) is stable.
- P4: Tab completion for / commands — ~3h
- P4: Configurable theme — ~4h
*** TODO Human-in-the-Loop (HITL)
**** TODO Human-in-the-Loop (HITL)
Continuation-based interaction. The agent can suspend its cognitive loop to ask for
permission or clarification and resume precisely where it left off. Builds on the
dispatcher's existing Flight Plan mechanism.
@@ -412,25 +410,24 @@ dispatcher's existing Flight Plan mechanism.
Structured tracking, failure handling, and course correction for multi-step engineering work.
** Tasks
*** TODO Long-Horizon Planning (task tree DAG)
**** TODO Long-Horizon Planning (task tree DAG)
Decompose complex tasks into Org-mode headline trees.
Terminal states: ~:todo~~:next-action~~:in-progress~~:done~ / ~:blocked~ / ~:stuck~.
Parent summarises child results.
Branch pruning when paths fail.
*** TODO Git Steward (version control integration)
**** TODO Git Steward (version control integration)
Status, diff, commit, push, branch operations.
Policy enforces commit-before-modify gate.
Log commits to memory.
*** TODO TDD Runner Integration
**** TODO TDD Runner Integration
Run FiveAM tests on file save.
Inject ~:test-failure~ event on red.
Hook into self-fix for auto-repair proposals.
*** TODO Deep Emacs Integration
**** TODO Deep Emacs Integration
Full org-agenda awareness: navigate, clock time, refile, archive.
Uses org-element + org-id.
@@ -438,13 +435,12 @@ Uses org-element + org-id.
Interactive terminal sessions and autonomous dependency management.
** Tasks
*** TODO Interactive PTY Actuator
**** TODO Interactive PTY Actuator
Stream long-running process output to the context window (e.g., ~npm run dev~, REPLs).
Async interrupt control (Ctrl+C emulation).
*** TODO The Environment Steward
**** TODO The Environment Steward
Autonomously detect missing dependencies ("Command not found").
Propose installation command and retry the failed action.
@@ -452,29 +448,28 @@ Propose installation command and retry the failed action.
The agent bootstraps itself and manages parallel workstreams.
** Tasks
*** TODO Skill Creator (autonomous skill generation)
**** TODO Skill Creator (autonomous skill generation)
LLM drafts complete skill org-file from natural language.
Mandatory: syntax validation → jail-load → test → register.
*** TODO Architect Agent (PRD → PROTOCOL)
**** TODO Architect Agent (PRD → PROTOCOL)
Scan ~:STATUS: FROZEN~ PRDs. Generate Phase B PROTOCOL from Phase A.
*** TODO GTD Integration (project tracking)
**** TODO GTD Integration (project tracking)
Full GTD cycle: capture, clarify, organize, reflect, engage.
org-gtd v4.0 DAG (~:TRIGGER:~, ~:BLOCKER:~).
*** TODO Consensus Loop (multi-model agreement)
**** TODO Consensus Loop (multi-model agreement)
Run multiple providers for critical decisions.
Compare results, detect disagreements.
Confidence scoring.
*** TODO Web Research (Playwright browsing)
**** TODO Web Research (Playwright browsing)
Headless Chromium via Python bridge.
Text extraction, screenshots, Gemini Web UI automation.
*** TODO Memex Management (PARA lifecycle)
**** TODO Memex Management (PARA lifecycle)
Archive DONE tasks, suggest refiling.
Detect orphaned nodes.
PARA/Zettelkasten maintenance.
@@ -483,13 +478,12 @@ PARA/Zettelkasten maintenance.
Multimodal visual interaction and ecosystem-wide tool compatibility.
** Tasks
*** TODO Computer Use / Vision
**** TODO Computer Use / Vision
Allow the agent to request host OS or browser screenshots.
Analyze UI and issue precise X/Y coordinate click/type commands via X11/Wayland bridge.
*** TODO MCP Gateway Bridge
**** TODO MCP Gateway Bridge
Lisp-native client for the Model Context Protocol.
Connect Passepartout to external tools and data sources.
@@ -497,9 +491,8 @@ Connect Passepartout to external tools and data sources.
Automated benchmarking to mathematically prove the agent's reasoning capabilities.
** Tasks
*** TODO SWE-Bench Harness
**** TODO SWE-Bench Harness
Automated pipeline that clones repositories and feeds GitHub issues.
Track multi-step resolution trajectory, run tests, and score success.
@@ -507,18 +500,18 @@ Track multi-step resolution trajectory, run tests, and score success.
Feature-complete agent competitive with commercial agents. All features from v0.2.0 through v0.8.0 combined, verified, and tested end-to-end.
| Area | Parity Target |
|------|--------------|
| Self-improvement | Claude Code self-debug |
| Planning | ULTRAPLAN equivalent |
| Tool ecosystem | 10+ cognitive tools |
| Context window | Semantic search + scope segmentation |
| Safety | 6 Policy invariants + formal verification |
| Multi-step tasks | Task trees with terminal states |
| Code editing | Full file read/write via org manipulation |
| Memory | Vector recall in memory-object |
| Area | Parity Target |
|-------------------+---------------------------------------------|
| Self-improvement | Claude Code self-debug |
| Planning | ULTRAPLAN equivalent |
| Tool ecosystem | 10+ cognitive tools |
| Context window | Semantic search + scope segmentation |
| Safety | 6 Policy invariants + formal verification |
| Multi-step tasks | Task trees with terminal states |
| Code editing | Full file read/write via org manipulation |
| Memory | Vector recall in memory-object |
| Emacs integration | Full org-mode control (exceeds Claude Code) |
| Autonomy | 100% local capable (exceeds Claude Code) |
| Autonomy | 100% local capable (exceeds Claude Code) |
*** v2.0.0: Lisp Machine Emergence