[object Object]

← back to Ticket System

tk: masterdot shape dedup collapses single-digit count variants (\d+ was \d{2,}) (TK-11965)

d5203550411803d2deabd509bdbea7f483341a11 · 2026-09-20 19:42:48 -0700 · Steve Abrams

shapeOf only normalized 2+-digit numbers, so 'backlog grew 4->7' and
'...grew 11->12' had different shapes and the TK-11676 same-shape dedup never
fired while counts were single-digit early-night. \b\d+\b collapses all count
pairs to one shape. Scoped to the masterdot-agent block; ttys? runs first so
its N is already a letter. No effect on any other creator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6ZuXNdrcmKH31Z28Ntag1

Files touched

Diff

commit d5203550411803d2deabd509bdbea7f483341a11
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun Sep 20 19:42:48 2026 -0700

    tk: masterdot shape dedup collapses single-digit count variants (\d+ was \d{2,}) (TK-11965)
    
    shapeOf only normalized 2+-digit numbers, so 'backlog grew 4->7' and
    '...grew 11->12' had different shapes and the TK-11676 same-shape dedup never
    fired while counts were single-digit early-night. \b\d+\b collapses all count
    pairs to one shape. Scoped to the masterdot-agent block; ttys? runs first so
    its N is already a letter. No effect on any other creator.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01W6ZuXNdrcmKH31Z28Ntag1
---
 tk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tk b/tk
index 8441fe5d..c814a550 100755
--- a/tk
+++ b/tk
@@ -135,8 +135,13 @@ if (cmd === 'new') {
   // a normal create, so a guard bug can never break `tk new`.
   if (/^masterdot[-_]/i.test(agent)) {
     try {
+      // TK-11965: \d+ (was \d{2,}) so single-digit count variants collapse too —
+      // "backlog grew 4->7" and "…grew 11->12" must share ONE shape or the dedup
+      // never fires early-night while counts are single-digit. ttys? runs first,
+      // so its N is already a letter and won't be re-touched. Scoped to the
+      // masterdot-agent block, so no effect on any other creator.
       const shapeOf = s => String(s || '').toLowerCase()
-        .replace(/ttys?\d+/g, 'ttysN').replace(/\b\d{2,}\b/g, 'N').replace(/\s+/g, ' ').trim();
+        .replace(/ttys?\d+/g, 'ttysN').replace(/\b\d+\b/g, 'N').replace(/\s+/g, ' ').trim();
       const CAP = 3, WINDOW_MS = 15 * 60 * 1000, nowMs = Date.parse(ts);
       const openMd = [...tickets().values()].filter(t =>
         /^masterdot[-_]/i.test(t.agent || '') && !['done', 'stopped'].includes(t.status));

← 3ca99fae TK-11951: needs-Steve tab backlog triage/fire-list (6 tabs a  ·  back to Ticket System  ·  auto-data-snapshot: 2026-09-22T12:15:47 (1 data files) — dat 802dbd64 →