v0.7.2: tag stack — trigger counts + PRIVACY_FILTER_TAGS fallback — TDD

*tag-trigger-count* hash table tracks per-session tag triggers.
tag-trigger-record increments count, called from
dispatcher-privacy-severity on each matched tag. /tags shows
trigger count per tag.

tag-categories-load now falls back to PRIVACY_FILTER_TAGS env var
when TAG_CATEGORIES is not set (backward compat). All entries
default to :block severity.

- security-dispatcher: *tag-trigger-count*, tag-trigger-record,
  updated tag-categories-load, wired dispatcher-privacy-severity
  +2 tests (trigger record, privacy fallback)
- channel-tui-main: /tags shows trigger counts
- Core: 88/88  TUI Main: 102/102
This commit is contained in:
2026-05-08 21:20:06 -04:00
parent 4e756aeaa1
commit 8aed017ccd
3 changed files with 89 additions and 10 deletions

View File

@@ -251,13 +251,16 @@ Event handlers + daemon I/O + main loop.
(subseq (or (getf info :hash) "(none)") 0 16)))
(add-msg :system (format nil "Node ~a not found" node-id))))
(add-msg :system "Memory audit not available")))
;; /tags command — tag stack
;; /tags command — tag stack
;; /tags command — tag stack with trigger counts
((string-equal text "/tags")
(let ((cats passepartout::*tag-categories*))
(let ((cats passepartout::*tag-categories*)
(counts passepartout::*tag-trigger-count*))
(if cats
(dolist (entry cats)
(add-msg :system (format nil "~a: ~a" (car entry) (cdr entry))))
(let* ((tag (car entry))
(sev (cdr entry))
(n (gethash (string-downcase tag) counts 0)))
(add-msg :system (format nil "~a: ~a (~d trigger~:p this session)" tag sev n))))
(add-msg :system "No tags configured. Set TAG_CATEGORIES env var."))))
;; /context command — section breakdown with token estimates
((string-equal text "/context")