feat: Add cwd and os to TerminalHistory for precise agent binding
This commit is contained in:
1 parent
98a1716ac8
commit
b3c64c1ad8
3 files changed
+18
-13
No files matched your search
@@ -64,12 +64,17 @@ Currently implemented persistent stores include:
|
||||
* **Environment State:** Pinned Files, Env Fingerprints, Milestones, and Environments.
|
||||
* **Safety Gates:** Authorized execution gates (Push Safety).
|
||||
|
||||
## 7. Full-Text Search Engine (Tantivy)
|
||||
To support blazing-fast, intelligent semantic retrieval across the sprawling knowledge graph, the daemon embeds **Tantivy**, a full-text search engine (inspired by Apache Lucene).
|
||||
* **The `MemoryIndex`:** Whenever the graph or auxiliary stores mutate, a background thread dynamically rebuilds the Tantivy index (`tantivy_index/` dir).
|
||||
* **Global Omni-Search:** This architecture powers the `omni_search` tool, allowing subagents to instantly fuzzy-search and rank documents across Entities, Tasks, Snippets, Error Fixes, and ADRs simultaneously in milliseconds, without loading massive JSON arrays into RAM.
|
||||
## 7. Full-Text & Semantic Search Engine (Tantivy + FastEmbed)
|
||||
To support blazing-fast, intelligent semantic retrieval across the sprawling knowledge graph, the daemon embeds **Tantivy** (a full-text search engine inspired by Apache Lucene) alongside **FastEmbed** (a local ONNX runtime for vector embeddings).
|
||||
* **The `MemoryIndex`:** Whenever the graph or auxiliary stores mutate, a background thread dynamically rebuilds the Tantivy index (`tantivy_index/` dir) and computes semantic vectors.
|
||||
* **Global Omni-Search:** This architecture powers the `omni_search` tool, allowing subagents to instantly fuzzy-search and semantically rank documents across Entities, Tasks, Snippets, Error Fixes, and ADRs simultaneously in milliseconds, without loading massive JSON arrays into RAM.
|
||||
|
||||
## 8. The Gate System (Push Safety Verification)
|
||||
## 8. Webhook Telemetry & Passive Ingestion
|
||||
The server features a suite of webhook listeners that passively ingest development activity to build context without requiring human copy-pasting:
|
||||
* **Terminal Ingestion (`/terminal/telemetry`):** Shell hooks (PowerShell/Nushell) silently POST command execution history and exit codes, allowing agents to read recent stack traces via the `memory://terminal/recent` resource.
|
||||
* **IDE Telemetry (`/nvim/telemetry`):** A connectionless UDP datagram listener receives focus events from Neovim, broadcasting the user's active file to the UI and Agent instantly.
|
||||
|
||||
## 9. The Gate System (Push Safety Verification)
|
||||
The binary supports a flexible safety gate authorization system, accessible both via the HTTP API and CLI subcommands.
|
||||
* **API / CLI set**: Records an authorization status (`authorized`, `blocked`, or `pending`) for a specific target and namespace. Can be invoked via `POST /gate/set` (JSON) or `mcp-memory-stub gate set`.
|
||||
* **API / CLI verify**: Evaluates a pending action against the gate store. It returns standard HTTP status codes (`200 OK`, `403 Forbidden`, `404 Not Found`) via `GET /gate/verify?action=...` or POSIX exit codes (0, 1, 2) via `mcp-memory-stub gate verify`. Both support a `consume` parameter/flag to immediately revoke the authorization after a successful check.
|
||||
@@ -165,12 +170,10 @@ Instead of forcing the LLM client to manually run `git rev-parse HEAD` and pass
|
||||
When engineering endpoints (`log_code_change`, `log_error_fix`, `log_tech_debt`) are invoked, the server asynchronously discovers the surrounding Git repository, peels the HEAD reference, and automatically injects the current commit hash, commit message, and branch name directly into the stored entities and audit logs. This guarantees airtight VCS traceability without wasting LLM tokens or relying on the agent's memory.
|
||||
|
||||
## 18. Upcoming Enhancements
|
||||
### A. Vector Embeddings for Semantic Search
|
||||
The `omni_search` will be upgraded from purely lexical `tantivy` indexing to include a local ONNX embedding model (via `fastembed`). This allows semantic retrieval of `ErrorFix` and `TechDebt` entries even when exact vocabulary does not match.
|
||||
|
||||
### B. Passive Terminal Ingestion
|
||||
A shell hook system (PowerShell/Nushell) will silently POST terminal execution history and exit codes to `/terminal/history`. LLMs can passively read this via the `memory://terminal/recent` resource, eliminating the need for the user to manually copy/paste stack traces.
|
||||
|
||||
### C. Graph Summarization & Decay
|
||||
### A. Graph Summarization & Decay
|
||||
To prevent context window bloat, the Redb engine will enforce TTLs on ephemeral nodes (`StickyNotes`, minor `Tasks`). Furthermore, an `archive_routine` prompt will allow subagents to automatically compress older `SessionSummaries` into dense milestone retrospectives.
|
||||
|
||||
### B. Proactive Subagent Triggers
|
||||
The daemon will eventually gain the ability to autonomously spawn background subagents (like the `BugDiagnostician`) when specific events are detected in the webhook telemetry, rather than relying strictly on the human user to initiate the agent.
|
||||
|
||||
Reference in new issue
Block a user