{"success":true,"name":"sms-jsonl-tolerant-count","description":"Use when counting sms/data/sent.jsonl ACKs fails with SyntaxError: Unexpected token on NUL characters.","category":"unitary","path":"unitary/sms-jsonl-tolerant-count/SKILL.md","file":"SKILL.md","content":"---\nname: sms-jsonl-tolerant-count\ndescription: Use when counting sms/data/sent.jsonl ACKs fails with SyntaxError: Unexpected token on NUL characters.\n---\n> Imported from [PRIVATE_HOST] `~/unitary/generated/agents/handoff/data/skills/solobro/sms-jsonl-tolerant-count`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n1. Si le comptage de sms/data/sent.jsonl échoue avec « SyntaxError: Unexpected token » sur des caractères NUL, ne pas parser tout le journal avec split(...).map(JSON.parse).\n2. Filtrer les lignes par le préfixe de tag recherché avant de parser ; intercepter séparément chaque erreur et compter les lignes correspondantes illisibles. Exemple Node : const prefix = process.argv[1]; const rows = require('fs').readFileSync('sms/data/sent.jsonl','utf8').split('\\n'); const events=[]; let invalid=0; for(const line of rows){if(!line.includes(prefix))continue; try{const e=JSON.parse(line);if(String(e.tag||'').startsWith(prefix))events.push(e);}catch{invalid++;}} const sent=events.filter(e=>Array.isArray(e.sent)&&e.sent.length); console.log(JSON.stringify({events:events.length,uniqueRecipients:[...new Set(sent.flatMap(e=>e.sent))].length,ackIds:sent.map(e=>e.id),failed:events.filter(e=>Array.isArray(e.failed)&&e.failed.length),invalid}));\n3. Compter les destinataires uniques plutôt que les événements. Rapprocher avec le journal de la vague ; signaler les lignes illisibles et ne pas conclure à un total complet si elles peuvent concerner cette vague.\nPiège observé : une ligne NUL sans rapport peut interrompre un parse global avant même le filtrage par tag. Le comptage filtré a été tenté, mais son résultat n’était pas visible en fin de session.\n\nLinked: S:brimind-send-verification (rapprochement des preuves d’envoi); S:brimind-sms-rail (journal des ACK SMS)\nLearned: 2026-10-20, handoff h_solobro_202610201833_7cc3.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}