passepartout: v0.5.0 hotfix 2 — daemon stable
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s

- Restore (in-package :passepartout) to core-reason
- Move *VAULT-MEMORY* back to core-skills
- Fix ASDF and defstruct/defpackage ordering
- Increase daemon timeout to 120s
- Handshake: 0.5.0

Verified: daemon processes messages, TUI clean, gate trace works
This commit is contained in:
2026-05-07 20:14:51 -04:00
parent da160b71e3
commit 924bf8f479
71 changed files with 2976 additions and 3888 deletions

View File

@@ -884,55 +884,6 @@ After all renames complete, update every remaining reference:
*** Verify: ASDF compiles, FiveAM suite passes, integration tests pass.
*** Time Awareness — Temporal Context for the Agent
Rationale: Passepartout already has the infrastructure for time awareness — timestamped memory (v0.1.0), heartbeat+cron (v0.3.0), and foveal-peripheral context pruning (v0.2.0). Adding time awareness costs ~175 lines of Lisp and unlocks three layers that no competitor provides. The temporal dimension is the missing axis in the foveal-peripheral model: prune in time as well as in semantic space.
*** TODO Time Awareness — Level 2: temporal memory filtering
:PROPERTIES:
:ID: id-v050-time-memory
:CREATED: [2026-05-07 Thu]
:END:
Rationale: ~memory-object-version~ has been set to ~get-universal-time~ on every ingest since v0.1.0. Every memory node carries a timestamp. But ~context-query~ has no time filter — "what did I work on today?" serializes all nodes to the LLM instead of filtering 500→12 in sub-millisecond Lisp.
- ~memory-objects-since(timestamp)~ in ~core-memory.lisp~: hash-table walk returning objects with ~version >= timestamp~. ~20 lines.
- ~memory-objects-in-range(since until)~ in ~core-memory.lisp~: version between two timestamps. ~15 lines.
- Extend ~context-query~ in ~symbolic-awareness.lisp~ with ~:since~ and ~:until~ keyword parameters. ~10 lines.
- Pure Lisp, sub-millisecond, 0 LLM tokens. ~90% token reduction on time-scoped memory queries.
- FiveAM test: ingest 3 nodes at T0, sleep, ingest 2 nodes at T1, verify ~memory-objects-since(T1)~ returns exactly 2.
*** TODO Time Awareness — Level 3: ~sensor-time~ skill
:PROPERTIES:
:ID: id-v050-sensor-time
:CREATED: [2026-05-07 Thu]
:END:
Rationale: The heartbeat fires every 60 seconds for maintenance tasks. It can also carry temporal awareness — scanning for approaching deadlines, tracking session duration, and injecting temporal context so the LLM knows "3 deadlines today: Submit report (45min)" without triggering a call. This turns "what should I do today?" from a 1,5004,000 token LLM call into a 0-token pre-loaded context answer.
- New skill: ~sensor-time.org~~sensor-time.lisp~. ~120 lines.
- Session tracking: record session start time at load. Expose ~(session-duration)~.
- Cron-registered heartbeat tick: ~orchestrator-register-cron "time-tick"~ with ~:action sensor-time-tick~, ~:tier :reflex~ (no LLM), ~:repeat "+1m"~.
- Deadline scanning on tick: query memory for headlines with ~:DEADLINE~ or ~:SCHEDULED~ properties. If within ~DEADLINE_WARNING_MINUTES~ (env var, default 60), inject deadline note into awareness context.
- Deadline context note format: ~"3 deadlines approaching: Submit report (45min), Review PR (2h), Call mom (3h)."~
- ~TUI status bar~: add session duration and deadline count to the status bar (reuse existing gate-trace / focus-map rendering from v0.4.0).
- FiveAM test: set deadline 30 minutes from now, fire tick, verify deadline appears in awareness context.
*** TODO Time Awareness — Level 1: timestamp in system prompt
:PROPERTIES:
:ID: id-v050-time-prompt
:CREATED: [2026-05-07 Thu]
:END:
Rationale: The system prompt currently has IDENTITY, TOOLS, CONTEXT, LOGS. No TIME. The LLM cannot answer "what time is it?" or contextualize deadlines correctly. Adding a timestamp costs ~8 incremental tokens and eliminates guessing, time-check tool calls, and preamble hedging. Combined with session duration from Level 3, the LLM knows "2026-05-07 Thu 14:32:17 UTC. Session: 3h 12m."
- ~format-time-for-llm~ function: returns human-readable date + time + optional session duration. Uses ~multiple-value-bind~ with ~decode-universal-time~. ~15 lines.
- Inject into ~think()~'s system prompt format string in ~core-reason.lisp~: add ~TIME:~ section between IDENTITY and TOOLS. ~5 lines.
- ~TIME_AWARENESS~ env var (default ~true~) in ~.env.example~. When ~false~, timestamp omitted.
- ~TIME_FORMAT~ env var (default ~iso~): ~iso~ = ~2026-05-07T14:32:17Z~, ~natural~ = ~2:32 PM UTC, Thursday May 7, 2026~.
- Session duration from ~session-duration~ function in ~sensor-time~ skill (Level 3). If skill not loaded, omit duration, show time only.
- FiveAM test: ~format-time-for-llm~ returns string containing current year and UTC; with ~TIME_AWARENESS=false~ returns empty string.
*** Token Economics (foundation complete — now build features)
**Design insight: why token economics is the structural differentiator.** Passepartout's sparse-tree rendering and deterministic safety gates should produce 23x fewer tokens than competitors for equivalent coding tasks, and 1324x fewer for knowledge management. But without caching and budget enforcement, the fixed overhead per call eats these savings. A coding session that touches 30 files with competent context management costs ~72K tokens (Passepartout) versus ~185K (Claude Code). Without caching, the Passepartout number climbs toward ~150K because every call retransmits the static prefix. The architectural advantage exists in theory but requires operational plumbing to materialize.
@@ -1187,6 +1138,55 @@ The cost tracking and budget enforcement are defensive advantages: no competitor
The minimum viable local model advantage is structural: at 2,0004,000 effective tokens (foveal-peripheral + caching), a 78B parameter model on consumer hardware is a daily driver. Competitors at 32K+ effective tokens require 70B+ parameter models and 1632 GB VRAM. Passepartout runs on a laptop GPU where competitors need a data center card or cloud API.
** v0.5.1: Time Awareness
Rationale: Passepartout already has the infrastructure for time awareness — timestamped memory (v0.1.0), heartbeat+cron (v0.3.0), and foveal-peripheral context pruning (v0.2.0). Adding time awareness costs ~175 lines of Lisp and unlocks three layers that no competitor provides. The temporal dimension is the missing axis in the foveal-peripheral model: prune in time as well as in semantic space.
*** TODO Time Awareness — Level 2: temporal memory filtering
:PROPERTIES:
:ID: id-v051-time-memory
:CREATED: [2026-05-07 Thu]
:END:
Rationale: ~memory-object-version~ has been set to ~get-universal-time~ on every ingest since v0.1.0. Every memory node carries a timestamp. But ~context-query~ has no time filter — "what did I work on today?" serializes all nodes to the LLM instead of filtering 500→12 in sub-millisecond Lisp.
- ~memory-objects-since(timestamp)~ in ~core-memory.lisp~: hash-table walk returning objects with ~version >= timestamp~. ~20 lines.
- ~memory-objects-in-range(since until)~ in ~core-memory.lisp~: version between two timestamps. ~15 lines.
- Extend ~context-query~ in ~symbolic-awareness.lisp~ with ~:since~ and ~:until~ keyword parameters. ~10 lines.
- Pure Lisp, sub-millisecond, 0 LLM tokens. ~90% token reduction on time-scoped memory queries.
- FiveAM test: ingest 3 nodes at T0, sleep, ingest 2 nodes at T1, verify ~memory-objects-since(T1)~ returns exactly 2.
*** TODO Time Awareness — Level 3: ~sensor-time~ skill
:PROPERTIES:
:ID: id-v051-sensor-time
:CREATED: [2026-05-07 Thu]
:END:
Rationale: The heartbeat fires every 60 seconds for maintenance tasks. It can also carry temporal awareness — scanning for approaching deadlines, tracking session duration, and injecting temporal context so the LLM knows "3 deadlines today: Submit report (45min)" without triggering a call. This turns "what should I do today?" from a 1,5004,000 token LLM call into a 0-token pre-loaded context answer.
- New skill: ~sensor-time.org~~sensor-time.lisp~. ~120 lines.
- Session tracking: record session start time at load. Expose ~(session-duration)~.
- Cron-registered heartbeat tick: ~orchestrator-register-cron "time-tick"~ with ~:action sensor-time-tick~, ~:tier :reflex~ (no LLM), ~:repeat "+1m"~.
- Deadline scanning on tick: query memory for headlines with ~:DEADLINE~ or ~:SCHEDULED~ properties. If within ~DEADLINE_WARNING_MINUTES~ (env var, default 60), inject deadline note into awareness context.
- Deadline context note format: ~"3 deadlines approaching: Submit report (45min), Review PR (2h), Call mom (3h)."~
- ~TUI status bar~: add session duration and deadline count to the status bar (reuse existing gate-trace / focus-map rendering from v0.4.0).
- FiveAM test: set deadline 30 minutes from now, fire tick, verify deadline appears in awareness context.
*** TODO Time Awareness — Level 1: timestamp in system prompt
:PROPERTIES:
:ID: id-v051-time-prompt
:CREATED: [2026-05-07 Thu]
:END:
Rationale: The system prompt currently has IDENTITY, TOOLS, CONTEXT, LOGS. No TIME. The LLM cannot answer "what time is it?" or contextualize deadlines correctly. Adding a timestamp costs ~8 incremental tokens and eliminates guessing, time-check tool calls, and preamble hedging. Combined with session duration from Level 3, the LLM knows "2026-05-07 Thu 14:32:17 UTC. Session: 3h 12m."
- ~format-time-for-llm~ function: returns human-readable date + time + optional session duration. Uses ~multiple-value-bind~ with ~decode-universal-time~. ~15 lines.
- Inject into ~think()~'s system prompt format string in ~core-reason.lisp~: add ~TIME:~ section between IDENTITY and TOOLS. ~5 lines.
- ~TIME_AWARENESS~ env var (default ~true~) in ~.env.example~. When ~false~, timestamp omitted.
- ~TIME_FORMAT~ env var (default ~iso~): ~iso~ = ~2026-05-07T14:32:17Z~, ~natural~ = ~2:32 PM UTC, Thursday May 7, 2026~.
- Session duration from ~session-duration~ function in ~sensor-time~ skill (Level 3). If skill not loaded, omit duration, show time only.
- FiveAM test: ~format-time-for-llm~ returns string containing current year and UTC; with ~TIME_AWARENESS=false~ returns empty string.
** v0.6.0: Signal Pipeline, Concurrency & Streaming
The current pipeline is strictly sequential — one signal traverses Perceive → Reason → Act before the next signal begins. Background tasks (heartbeat, embedding cron, gardener scans) compete with foreground interactions. A heartbeat that fires during a long tool chain is queued. A Telegram message during a multi-step planning cycle is queued. The system feels sluggish under concurrent load even though the symbolic operations are near-instant (SBCL hash table lookups are microseconds) — the bottleneck is the single-pipeline architecture, not the hardware.