DriftReminder counts voice tags toward the closer cap; FormatGate strips them

Aperta Adatta ai principianti
#3,022 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bun, typescript

Direzione di ricerca

Inizia con closerSpokenChars in hooks/DriftReminder.hook.ts e confrontalo con l’uso di stripVoiceTags da LIFEOS/TOOLS/VoiceTags.ts effettuato da FormatGate. Esegui il probe.ts fornito contro l’hook per riprodurre il conteggio errato dei caratteri. La modifica è completata quando i closing con tag riportano solo la propria lunghezza in caratteri parlati e non producono più un falso avviso sul limite di 110 caratteri.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version

LifeOS 8.761.0 · attestation: 9 system file(s) differ from danielmiessler/[email protected]:

  • hooks/lib/lane-rules.ts
  • hooks/DriftReminder.hook.ts
  • skills/LifeOS/SKILL.md
  • agents/Sonnet.md
  • agents/Sol.md
  • LIFEOS/TOOLS/vendor-pricing.json
  • LIFEOS/TOOLS/models.ts
  • LIFEOS/DOCUMENTATION/Notifications/NotificationSystem.md
  • LIFEOS/DOCUMENTATION/ARCHITECTURE_SUMMARY.md
What is broken

The per-turn FORMAT CONTRACT line reports a closer as over the 110-character spoken cap when its spoken words are well under it. closerSpokenChars in DriftReminder counts Fish voice tags ([direction], <emphasis>) toward the cap, while FormatGate strips them with stripVoiceTags before measuring, and the system prompt says the length cap sees only the spoken words. The two hooks disagree on any tagged closer, and the false warning is fed to the model on the next turn.

Where (file:line)

hooks/DriftReminder.hook.ts:188

Repro on a clean tree
1. End a reply with a tagged closer: `🗣️ Nova: [casual, chatting with a friend] Okay, no more stage directions about being chill. [curious] How's <emphasis>this</emphasis> one?`
2. Submit the next prompt and read the FORMAT CONTRACT line.
3. It says `closer 129 chars (spoken cap 110)`. The spoken words are 65 characters.
Negative control

Probe: bun /tmp/claude-1000/-home-<name>-Work/4d3f9697-7e30-43e7-8a1a-285ff614679e/scratchpad/report/probe.ts skills/LifeOS/install/hooks/DriftReminder.hook.ts · exit 1 · captured 2026-11-29T00:14:55.730Z

Red looks like: counts 129, spoken words are 65

DriftReminder counts 129, spoken words are 65, cap 110
Suggested fix

Pass the line through stripVoiceTags (already used by FormatGate) before taking its length.

--- a/hooks/DriftReminder.hook.ts
+++ b/hooks/DriftReminder.hook.ts
@@ -40,6 +40,7 @@
 import { dirname, join } from "node:path";
 import { firstBannedHit } from "./lib/banned-vocab";
 import { getLifeosDir, getSettingsPath } from "./lib/paths";
+import { stripVoiceTags } from "../LIFEOS/TOOLS/VoiceTags";
 import { hookDrawn, hookCovers } from "./lib/function-hooks"; // public issue #1974 @sabo961, PR #1918 @PigLardLord
 import { EM_DASH_MAX, packedBulletPairs } from "./lib/format-caps"; // public issue #2166, @IvanLeontev-stack
 
@@ -188,7 +189,7 @@
 function closerSpokenChars(text: string): number {
   const closers = text.split("\n").filter((l) => l.includes("🗣️"));
   if (closers.length === 0) return 0;
-  return closers[closers.length - 1].replace(/^\s*🗣️\s*[^:]{0,24}:\s*/u, "").trim().length;
+  return stripVoiceTags(closers[closers.length - 1].replace(/^\s*🗣️\s*[^:]{0,24}:\s*/u, "")).length;
 }
 
 function measure(text: string): FormatMeasure {
Environment
  • OS: (x64)
  • Harness: claude-code
  • bun: 1.4.5 · git: 2.56.0
  • Doctor broken: none
Lingua principale
TypeScript
Stelle
20k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di danielmiessler/LifeOS

Tutte le issue di danielmiessler/LifeOS

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.