v0.7.2: gate-trace-lines + HITL inline — TDD

Gate trace visualization: gate-trace-lines converts gate-trace plists
to colored display lines (green passed, red blocked, yellow approval).
Data format: (:gate name :result :passed/:blocked/:approval :reason ...).
3 tests, 28/28 view suite.

HITL inline command handling: /approve HITL-xxxx and /deny HITL-xxxx
parsed as structured events (:action :hitl-respond), not raw text.
2 tests, 70/70 main suite.

Core: 65/65  Neuro: 13/13  All: 176/176
This commit is contained in:
2026-05-08 14:55:23 -04:00
parent 22878be710
commit b40e1e2844
6 changed files with 239 additions and 2 deletions

1
docs/.#ROADMAP.org Symbolic link
View File

@@ -0,0 +1 @@
user@amr.38893:1778162380

View File

@@ -1417,6 +1417,33 @@ Every Passepartout memory object has content-addressed identity via Merkle hashi
- Provenance data is already in the Merkle tree's parent-child hash chain. This is a rendering exposure, not new data.
~30 lines on existing Merkle infrastructure.
*** TODO Self-help — agent can answer questions about itself
:PROPERTIES:
:ID: id-v062-self-help
:CREATED: [2026-05-08 Fri]
:END:
Passepartout's documentation, source code, and state all live in the same Org files the agent already reads. No competitor can do self-help with zero hallucination because none have agent documentation in the same format as agent memory.
- Inject docs path into system prompt IDENTITY: ~"Your documentation: ~/memex/projects/passepartout/docs/USER_MANUAL.org. Read it to answer questions about yourself. You are Passepartout v0.7.2."~
- ~/help <topic>~ — agent reads ~USER_MANUAL.org~ by headline, returns relevant section. "How do I configure a new provider?" → reads the Provider Configuration section, explains with correct API key format. Zero hallucination — the docs are the source of truth.
- ~/why~ — shows the most recent gate trace in human-readable form: "Gate 7 (shell-safety) blocked your `rm -rf` because it matched pattern :destructive-rm. You can approve with /approve HITL-1234. Last 3 decisions: 1 blocked, 2 passed."
~30 lines for system prompt injection + ~20 lines for /help routing.
*** TODO Agent identity injection — system prompt knows its own config
:PROPERTIES:
:ID: id-v062-agent-identity
:CREATED: [2026-05-08 Fri]
:END:
Currently the system prompt has IDENTITY (assistant name) but the agent doesn't know its own version, providers, gate count, or config. When asked "what version are you?" or "what models do you have?", it hallucinates. Injecting live config into the system prompt makes the agent self-aware without file I/O.
- New CONFIG section in system prompt (between IDENTITY and TOOLS): ~"You are Passepartout v0.7.2. Active providers: Anthropic claude-sonnet-4 (default), DeepSeek deepseek-chat. Context window: 8K tokens. 21 security gates active. 47 rules learned. Context budget: 55% used."~
- Built from live state: ~*provider-cascade*~, ~tokenizer-context-limit~, ~(hash-table-count *skill-registry*)~, ~(hash-table-count *hitl-pending*)~, gate count
- The agent can answer any config question — "what providers?" "how many rules?" "what version?" — with zero hallucination
- Config section updates at each ~think()~ call (the data is small, ~100 tokens)
~40 lines in ~core-reason.lisp~ system prompt assembly.
** v0.8.0: Direction 2 — Information Radiator (Foundation)
The sidebar is what makes the Information Radiator direction unique. No competitor can render gate traces, focus maps, or rule counters because none has deterministic gates, foveal-peripheral context, or rule synthesis. The sidebar makes this data permanently visible. It also includes context monitoring, modified files, and tool status — all zero-LLM-token data from the deterministic layer.
@@ -1925,6 +1952,42 @@ No update mechanism exists. Users must manually ~git pull~ and re-run ~passepart
- Binary update path (when v0.14.0 ships): download binary from GitHub Releases, verify SHA-256, replace, restart
~80 lines bash + ~50 lines Lisp.
*** TODO Self-configuration — agent proposes and applies config changes
:PROPERTIES:
:ID: id-v090-self-config
:CREATED: [2026-05-08 Fri]
:END:
Passepartout's config is text files (`.env`, `.lisp`) — the same format the agent already edits. No competitor can self-configure because their config requires runtime restart or schema validation after file write. Passepartout can edit `.env` → daemon detects change → reloads → takes effect without restart.
- ~passepartout config set <key> <value>~ CLI command: writes to `.env`, triggers daemon reload. ~20 lines bash.
- Runtime config reload: daemon watches `.env` with ~inotify~ (reuses file-watch from v0.8.2). On change: re-reads env vars, reloads provider cascade, updates gate thresholds. No restart needed.
- Config validation before write: agent verifies provider names exist (against ~neuro-explorer~ registry), ports are valid numbers, thresholds are integers, file paths are within memex. On invalid value, proposes correction.
- Config change audit: every change writes to Merkle tree: "Agent changed DISPATCHER_RULE_THRESHOLD from 3 to 5. HITL approved." Gate trace records the decision.
~40 lines daemon + ~30 lines config validation.
Three tiers of self-configuration:
1. **Config Query** (v0.7.2) — "What providers do I have?" → answered from system prompt CONFIG section. Already implemented.
2. **Config Suggest** (v0.9.0) — "Should I use a cheaper model?" → agent analyzes telemetry, proposes specific config change with estimated savings. User decides.
3. **Config Apply** (v0.9.0) — "Add @credentials to privacy tags" → agent proposes change → HITL review → writes `.env` → daemon reloads → change takes effect within one think() cycle.
4. **Config Optimize** (v0.9.0) — "Make yourself cheaper" → agent analyzes cost patterns across all sessions, proposes multi-key optimization. User approves full batch.
*** TODO Self-diagnosis coach — ~/coach~ command
:PROPERTIES:
:ID: id-v090-coach
:CREATED: [2026-05-08 Fri]
:END:
Telemetry data (v0.9.0) plus the agent's self-knowledge enables coaching: the agent detects workflow anti-patterns and suggests improvements.
- ~/coach~ — analyzes telemetry from the last N sessions, produces a coaching report with 3-5 actionable tips:
- ~"💡 Tip: You type full file paths 89% of the time. Try @mention autocomplete (type @ then start typing a filename) — it's 3x faster and learns your most-used files."~
- ~"💡 Tip: You've approved 47 git status commands. This pattern can be auto-certified to skip future HITL. /certifications to review."~
- ~"💡 Tip: Your average context usage is 78%. Consider increasing CONTEXT_MAX_TOKENS for more awareness, or using /focus to reduce irrelevant context."~
- ~"💡 Tip: You use /theme 0 times. Passepartout has 8 themes. Try /theme gruvbox for a warmer terminal feel."~
- Coaching data sources: command frequency, HITL approval patterns, context usage history, feature adoption rate, telemetry aggregates
- Coaching is opt-in (privacy-respecting — no data leaves the machine). ~50 lines in telemetry skill + ~30 lines TUI rendering.
** v0.10.0: Tool Ecosystem (MCP-Native) + Voice Gateway
*(Renumbered from old v0.8.0.)*