[object Object]

← back to Ticket System

TK-11676: mechanically cap masterdot-* tk-new authority (dedup + burst ceiling)

30a93d61c9d3e85cabfd279d3c70b17fb0393dd7 · 2026-09-13 23:55:38 -0700 · Steve Abrams

masterdot-green (a free-judgment LLM supervisor) minted 24 per-tty tickets
(TK-11579..11602) in ~19s off a signal it recorded it COULD NOT verify.
The TK-11631 mitigations were all prose (subagent brief / loop prompt),
which an LLM under time pressure can ignore. This puts the cap in the tool.

tk 'new' now, ONLY for agents matching /^masterdot[-_]/:
 (1) dedup an OPEN masterdot ticket of the same normalized SHAPE (ttysN /
     digit-run normalization -> per-tty variants collapse to ONE), and
 (2) a hard burst ceiling (3 / rolling 15m) -> a bad signal costs <=3, not 24.
Both return the running ticket id on stdout (so $(tk new ...) still captures a
clean id and evidence lands on one sweep ticket); note goes to stderr.
Fail-open: any guard error falls through to a normal create.

Verified in an isolated TICKET_DATA_DIR: 5 per-tty -> 1 ticket; 4 distinct ->
3; two identical-title NON-masterdot creates -> two different ids (zero
collateral to approval-agent / yoloforever / claude-run-* / humans).

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

Files touched

Diff

commit 30a93d61c9d3e85cabfd279d3c70b17fb0393dd7
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun Sep 13 23:55:38 2026 -0700

    TK-11676: mechanically cap masterdot-* tk-new authority (dedup + burst ceiling)
    
    masterdot-green (a free-judgment LLM supervisor) minted 24 per-tty tickets
    (TK-11579..11602) in ~19s off a signal it recorded it COULD NOT verify.
    The TK-11631 mitigations were all prose (subagent brief / loop prompt),
    which an LLM under time pressure can ignore. This puts the cap in the tool.
    
    tk 'new' now, ONLY for agents matching /^masterdot[-_]/:
     (1) dedup an OPEN masterdot ticket of the same normalized SHAPE (ttysN /
         digit-run normalization -> per-tty variants collapse to ONE), and
     (2) a hard burst ceiling (3 / rolling 15m) -> a bad signal costs <=3, not 24.
    Both return the running ticket id on stdout (so $(tk new ...) still captures a
    clean id and evidence lands on one sweep ticket); note goes to stderr.
    Fail-open: any guard error falls through to a normal create.
    
    Verified in an isolated TICKET_DATA_DIR: 5 per-tty -> 1 ticket; 4 distinct ->
    3; two identical-title NON-masterdot creates -> two different ids (zero
    collateral to approval-agent / yoloforever / claude-run-* / humans).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01UVgEj4WxSqB62ieGpgrixR
---
 tk | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/tk b/tk
index 1f0e5795..5ba824be 100755
--- a/tk
+++ b/tk
@@ -59,6 +59,36 @@ if (cmd === 'new') {
   const project = opt('-p') || opt('--project') || '';
   const body = opt('-b') || opt('--body') || '';
   const title = argv.join(' ').trim(); if (!title) die('usage: tk new "title" [-p project] [-a agent]');
+  // TK-11676: mechanical cap on the masterdot per-colour subagents' tk-new authority.
+  // A free-judgment LLM supervisor once minted 24 per-tty tickets in ~19s off a signal it
+  // recorded it COULD NOT verify. Prose briefs can't stop an LLM under time pressure, so the
+  // cap lives in the tool. SCOPED to masterdot-* agents ONLY -> zero effect on any other
+  // creator (approval-agent, yoloforever, claude-run-*, humans, etc.). Two guards, both
+  // return the id of the running ticket on stdout (so `$(tk new ...)` still captures a clean
+  // id and the supervisor logs its evidence THERE instead of minting): (1) dedup an OPEN
+  // masterdot ticket of the same normalized SHAPE (per-tty variants collapse to one), and
+  // (2) a hard burst ceiling per rolling window. Fail-open: any guard error falls through to
+  // a normal create, so a guard bug can never break `tk new`.
+  if (/^masterdot[-_]/i.test(agent)) {
+    try {
+      const shapeOf = s => String(s || '').toLowerCase()
+        .replace(/ttys?\d+/g, 'ttysN').replace(/\b\d{2,}\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));
+      const dup = openMd.find(t => shapeOf(t.title) === shapeOf(title));
+      if (dup) {
+        console.error(`# masterdot dedup (TK-11676): an OPEN masterdot ticket of the same shape exists — reusing ${dup.id}; log evidence there, don't mint one per tty.`);
+        console.log(dup.id); process.exit(0);
+      }
+      const recent = openMd.filter(t => { const c = Date.parse(t.created_at || ''); return Number.isFinite(c) && (nowMs - c) <= WINDOW_MS; });
+      if (recent.length >= CAP) {
+        recent.sort((a, b) => Date.parse(b.created_at) - Date.parse(a.created_at));
+        console.error(`# masterdot burst cap (TK-11676): ${recent.length} masterdot tickets opened in the last 15m (cap ${CAP}) — reusing running sweep ticket ${recent[0].id}; log evidence there instead of minting more.`);
+        console.log(recent[0].id); process.exit(0);
+      }
+    } catch { /* fail-open: fall through to a normal create */ }
+  }
   const ev = withLock(() => append({ ts, type: 'create', id: nextId(title), title, project, agent, body }));
   console.log(ev.id);
   titleWindow(ev.id);

← ae3c0a34 beacon: filter dead-tty ghost orange dots so screen-1 PASTE  ·  back to Ticket System  ·  beacon: pin to Steve's screen 1 by display ID (LG ULTRAWIDE, 0616e22b →