Skip to content

feat: injection sanitizer, assembler budget fix, expanded tagger, /memory command#3

Merged
rdevaul merged 3 commits intordevaul:mainfrom
garrettekinsman:main
Mar 21, 2026
Merged

feat: injection sanitizer, assembler budget fix, expanded tagger, /memory command#3
rdevaul merged 3 commits intordevaul:mainfrom
garrettekinsman:main

Conversation

@garrettekinsman
Copy link

Rich's updates (2026-03-19):

  • HIGH-01 fix: prompt injection sanitization at /ingest API layer
  • assembler: always include first recency/topic message (budget edge case)
  • tagger: 6 new rules (memory, trading, compute, agents, monitoring)
  • plugin: /memory status command + graph/ghost mode toggles
  • README: shadow mode documentation

Security hardening by Agent: Vera:

  • HIGH-02 fix: bind API to 127.0.0.1 (was 0.0.0.0)
  • MEDIUM-01 fix: zero-width Unicode char stripping in sanitizer
  • MEDIUM-02 fix: additional injection patterns (from now on, [SYSTEM]:, HTML comments)

Audited by Agent: Vera (grade: B+)
All 139 tests passing.

Garrett Kinsman and others added 3 commits March 19, 2026 20:24
- Add scripts/memory_harvester.py: indexes memory files into ContextGraph
- Add scripts/context_injector.py: dynamic memory injection bridge
- Add scripts/update_memory_dynamic.py: memory update hook
- Add INTEGRATION.md: memory integration architecture
- Add memory-injection-bridge-v1-2026-03-19.md: injection bridge spec
- Zero changes to harvester.py, api/server.py, assembler.py, plugin/*

Rich will implement the memory injection hook on his side.
## Changes
1. scripts/harvester.py — added Discord and Vera session patterns
   - agent:main:discord:* (Discord channels)
   - agent:main:direct:* (Discord direct messages)
   - agent:vera:* (Vera subagent sessions)
   - Updated _channel_from_key() to detect discord/vera channels

2. scripts/verify_logging.py — NEW diagnostic tool
   - Checks interaction logs (data/interactions/YYYY-MM-DD.jsonl)
   - Checks comparison logs (~/.tag-context/comparison-log.jsonl)
   - Polls live API (http://127.0.0.1:8300/health, /comparison-stats)
   - Reports harvester state and coverage gaps
   - Identifies missing sessions and Discord coverage

3. memory_harvester.py — path verified correct
   - Already uses ~/.openclaw/workspace/memory/daily/ (post-migration path)

## Verification Output (2026-03-19)
=== Logging Health: 2026-03-19 ===

Interaction log: 171 records today, 2 yesterday
Comparison log:  60 turns logged, avg 283 tokens saved (20.3%)
API health:      OK — 1000 messages, 157 tags
Harvester state: last_run=never, sessions_tracked=8

=== Coverage Gaps ===
Harvestable sessions: 8
Missing from log:     4
Discord sessions:     7 total, 3 captured
Discord coverage:     YES

Missing sessions (4):
  - agent:main:discord:channel:1471025308139258055
  - agent:main:discord:channel:1471021607261700241
  - agent:main:discord:channel:1472826107177730214
  - agent:main:direct:510637988242522133

Discord sessions (7):
  ✓ agent:main:discord:channel:784460676068409394
  ✗ agent:main:discord:channel:1471025308139258055
  ✗ agent:main:discord:channel:1471021607261700241
  ✓ agent:main:direct:784460676068409394
  ✓ agent:main:discord:channel:1472826107177730217
  ✗ agent:main:discord:channel:1472826107177730214
  ✗ agent:main:direct:510637988242522133

## Status
✅ Discord sessions now in INCLUDE_PATTERNS — will be harvested on next run
✅ Verification tool ready for daily health checks
✅ 20.3% token savings confirmed via ContextGraph (avg 283 tokens/turn)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…mory command

Rich's updates (2026-03-19):
- HIGH-01 fix: prompt injection sanitization at /ingest API layer
- assembler: always include first recency/topic message (budget edge case)
- tagger: 6 new rules (memory, trading, compute, agents, monitoring)
- plugin: /memory status command + graph/ghost mode toggles
- README: shadow mode documentation

Security hardening by Agent: Vera:
- HIGH-02 fix: bind API to 127.0.0.1 (was 0.0.0.0)
- MEDIUM-01 fix: zero-width Unicode char stripping in sanitizer
- MEDIUM-02 fix: additional injection patterns (from now on, [SYSTEM]:, HTML comments)

Audited by Agent: Vera (grade: B+)
All 139 tests passing.
@rdevaul rdevaul merged commit 98aa4e9 into rdevaul:main Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants