passepartout: v0.5.0 File Reorganization
Some checks failed
Deploy (Gitea) / deploy (push) Failing after 2s

Extract non-core fragments using self-repair criterion:
- core-context -> symbolic-awareness (224 lines, fboundp guards in think())
- heartbeat generation -> symbolic-events (renamed events-start-heartbeat)

Rename 23 files for clarity and new naming scheme:
- 6 core: core-package, core-transport, core-pipeline,
          core-perceive, core-reason, core-act
- 13 system: symbolic-*, neuro-*, embedding-*, channel-shell
- 4 gateway: channel-cli, channel-tui-*, channel-tui-state

Utility relocations:
- markdown-strip -> programming-markdown
- plist-keywords-normalize -> programming-lisp
- cognitive-tool-prompt -> programming-tools
- VAULT-MEMORY -> security-vault
- Merge *backend-registry* into *probabilistic-backends*

Split gateway-messaging into channel-telegram/channel-signal/
channel-discord/channel-slack (4 independent skills)

Delete dead system-model.lisp (16-line wrapper)

Document self-repair criterion in DESIGN_DECISIONS

Version bump: 0.4.3 -> 0.5.0
This commit is contained in:
2026-05-07 18:20:48 -04:00
parent eeb1234086
commit da160b71e3
42 changed files with 4374 additions and 2253 deletions

View File

@@ -741,7 +741,7 @@ Rationale: The current file naming scheme mixes three concerns: architectural ro
The criterion: a file belongs in core if, when corrupted, the agent cannot fix it without human help. Corrupted core = dead brain, dead hands, or unreachable. Corrupted skill = degraded but self-repairable.
*** TODO Extract core-context → symbolic-awareness
*** DONE Extract core-context → symbolic-awareness
:PROPERTIES:
:ID: id-v050-reorg-awareness
:CREATED: [2026-05-07 Thu]
@@ -755,7 +755,7 @@ Rationale: ~core-context.lisp~ (224 lines) handles ~context-assemble-global-awar
- Remove ~core-context~ from ~passepartout.asd~ ~:components~.
- FiveAM: verify ~think()~ produces valid output when awareness skill is not loaded.
*** TODO Extract heartbeat generation → symbolic-events
*** DONE Extract heartbeat generation → symbolic-events
:PROPERTIES:
:ID: id-v050-reorg-heartbeat
:CREATED: [2026-05-07 Thu]
@@ -768,7 +768,7 @@ Rationale: The heartbeat thread (~heartbeat-start~, ~*heartbeat-thread*~, auto-s
- In ~core-pipeline.lisp~'s ~main()~: change ~(heartbeat-start)~ to ~(when (fboundp 'events-start-heartbeat) (events-start-heartbeat))~.
- ~symbolic-events~ already processes ~:heartbeat~ signals for cron dispatch (existing code). Now it also generates them.
*** TODO Relocate 6 utility fragments to correct files
*** DONE Relocate 6 utility fragments to correct files
:PROPERTIES:
:ID: id-v050-reorg-utilities
:CREATED: [2026-05-07 Thu]
@@ -783,7 +783,7 @@ Rationale: Several functions live in core files not because they need core prote
- ~VAULT-MASK-STRING~ + ~*VAULT-MEMORY*~ (core-skills.lisp) → ~security-vault.lisp~.
- ~*backend-registry*~ dedup: merge with ~*probabilistic-backends*~ (core-reason.lisp:10-12), remove ~backend-register~ (core-reason.lisp:18-19), update ~backend-cascade-call~ to check only one hash table.
*** TODO Rename 6 core files — shorter, clearer names
*** DONE Rename 6 core files — shorter, clearer names
:PROPERTIES:
:ID: id-v050-reorg-core-names
:CREATED: [2026-05-07 Thu]
@@ -799,7 +799,7 @@ Rename mapping:
Update: ASDF ~:components~, all ~:tangle~ headers in ~.org~ files, cross-file references, ~README.org~, ~ARCHITECTURE.org~, ~AGENTS.md~, ~*dispatcher-protected-paths*~ (wildcard ~core-*~ still matches — no change needed).
*** TODO Rename 13 system-* → symbolic-/neuro-/embedding-*
*** DONE Rename 13 system-* → symbolic-/neuro-/embedding-*
:PROPERTIES:
:ID: id-v050-reorg-system-names
:CREATED: [2026-05-07 Thu]
@@ -820,11 +820,11 @@ Rename mapping:
- ~system-model-embedding-native~~embedding-native~
- ~system-actuator-shell~~channel-shell~
*** TODO Delete ~system-model.lisp~ (16-line wrapper)
*** DONE Delete ~system-model.lisp~ (16-line wrapper)
The file delegates to ~*probabilistic-backends*~ — dead code. No skill references it directly.
*** TODO Rename 4 gateway-* → channel-*
*** DONE Rename 4 gateway-* → channel-*
:PROPERTIES:
:ID: id-v050-reorg-channel-names
:CREATED: [2026-05-07 Thu]
@@ -838,7 +838,7 @@ Rename mapping:
Update TUI package name: ~passepartout.gateway-tui~~passepartout.channel-tui~.
*** TODO Split ~gateway-messaging~ → 4 ~channel-*~ files
*** DONE Split ~gateway-messaging~ → 4 ~channel-*~ files
:PROPERTIES:
:ID: id-v050-reorg-messaging-split
:CREATED: [2026-05-07 Thu]
@@ -852,7 +852,7 @@ Rationale: ~gateway-messaging.lisp~ (411 lines) bundles 4 independent platforms.
- ~channel-slack~: Events API + ~chat.postMessage~. Replace hardcoded channel IDs. ~register-actuator :slack~.
- Delete ~gateway-messaging.lisp~. Update ~DEFSKILL-FROM-ORG~ references in ~system-config~ setup wizard.
*** TODO Document core/non-core self-repair criterion
*** DONE Document core/non-core self-repair criterion
:PROPERTIES:
:ID: id-v050-reorg-docs
:CREATED: [2026-05-07 Thu]
@@ -884,6 +884,55 @@ 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.