[object Object]

← back to Terminal Status

terminal_status.py: set-variant --if-blocked (only 🔵-mark needs-Steve stops)

1f88b72b229ec5feb12c596e4fa520d2ff469b35 · 2026-09-11 10:54:06 -0700 · Steve Abrams

Gates the additive 🔵 stopped-marker to blocked base colours (yellow/purple/orange)
via a cheap record read — so the Stop hook marks only stops that actually need
Steve, not green/pink stops. Verified: purple→🟣🔵, green→no-op.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 1f88b72b229ec5feb12c596e4fa520d2ff469b35
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Fri Sep 11 10:54:06 2026 -0700

    terminal_status.py: set-variant --if-blocked (only 🔵-mark needs-Steve stops)
    
    Gates the additive 🔵 stopped-marker to blocked base colours (yellow/purple/orange)
    via a cheap record read — so the Stop hook marks only stops that actually need
    Steve, not green/pink stops. Verified: purple→🟣🔵, green→no-op.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 terminal_status.py | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/terminal_status.py b/terminal_status.py
index 14a644e..8b9e6cc 100644
--- a/terminal_status.py
+++ b/terminal_status.py
@@ -635,6 +635,14 @@ def main(argv=None):
     sub = parser.add_subparsers(dest="command", required=True)
     sv = sub.add_parser("set-variant")
     sv.add_argument("variant", nargs="?", default="", choices=["", "monitoring", "stopped"])
+    sv.add_argument("--if-blocked", action="store_true",
+                    help="only apply when the base dot is a NEEDS-STEVE colour (yellow/purple/"
+                         "orange); a cheap no-op otherwise. Used by the Stop hook so the 🔵 "
+                         "umbrella marks only stops that actually need Steve, not every stop.")
+    sv.add_argument("--tty", default="",
+                    help="target ANOTHER live session (e.g. ttys018) so an external supervisor "
+                         "can mark it. assert_owner() still verifies the owner record against "
+                         "the live process table, so a dead/reassigned tty is refused.")
     for name in ("set", "clear", "repaint", "current", "start", "ticket", "status", "headers"):
         cmd = sub.add_parser(name)
         if name == "set":
@@ -704,8 +712,18 @@ def main(argv=None):
         # Use the already-resolved caller + the real store instance (the branch shipped calling
         # a nonexistent Owner.detect()/STORE, so set-variant crashed in EVERY session — the
         # auto-🔵 stopped-marker never fired). Matches every other command's resolution. (2026-09-11)
-        record = store.set_variant(caller, args.variant)
-        print(f'/terminal-status → /dev/{caller.tty} {record["title"] or "CLEARED"}')
+        target = caller
+        if getattr(args, "tty", ""):
+            _t = args.tty.removeprefix("/dev/")
+            if _t not in owners(rows):
+                raise StatusError("No unique live main agent owns this tty")
+            target = owners(rows)[_t]
+        if getattr(args, "if_blocked", False):
+            prev, _r = store.read(target)
+            if not prev or prev.get("state") not in ("yellow", "purple", "orange"):
+                return 0  # not a needs-Steve stop → no 🔵 umbrella (cheap read, no paint)
+        record = store.set_variant(target, args.variant)
+        print(f'/terminal-status → /dev/{target.tty} {record["title"] or "CLEARED"}')
         return 0
 
     if args.command == "current":

← 43fe598 terminal_status.py: fix set-variant — was calling nonexisten  ·  back to Terminal Status  ·  set-variant: --tty targeting + don't require caller ancestry 1bc426c →