@m13v/s4l 1.6.200 → 1.6.202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "1.6.200",
3
- "installedAt": "2026-07-04T00:00:21.537Z"
2
+ "version": "1.6.202",
3
+ "installedAt": "2026-07-04T00:16:33.149Z"
4
4
  }
package/mcp/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "dxt_version": "0.1",
3
3
  "name": "social-autoposter",
4
4
  "display_name": "S4L",
5
- "version": "1.6.200",
5
+ "version": "1.6.202",
6
6
  "description": "Draft, review, approve, and autopilot X/Twitter posts.",
7
7
  "long_description": "## **⚠️ The disclaimer above is generic Claude boilerplate.** Anthropic shows the same warning on every plugin regardless of what it does; any plugin has the same level of access as any app you download from the internet.\n\nS4L is an open source product developed by Mediar.ai Incorporated, a VC-backed San Francisco-based startup.\n\nTo get started:\n\n1\\. Copy this prompt: **Set me up on S4L plugin end to end**\n\n2\\. Quit with CMD+Q, reopen Claude, paste into a new chat.\n\nWhat happens next:\n\n* About every 5 minutes S4L scans X for posts that match your topics and drafts replies in your voice.\n* Drafts show up as review cards, usually the first within a few minutes. Nothing is posted automatically; you approve each one.\n* Posting autopilot stays off until you explicitly turn it on.",
8
8
  "author": {
package/mcp/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m13v/s4l-mcp",
3
- "version": "1.6.200",
3
+ "version": "1.6.202",
4
4
  "private": true,
5
5
  "description": "Desktop MCP client for social-autoposter (X/Twitter rail): manual draft/review/approve loop, autopilot control, and stats. Thin wrapper over the existing pipeline scripts.",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m13v/s4l",
3
- "version": "1.6.200",
3
+ "version": "1.6.202",
4
4
  "description": "Automated social posting pipeline for Reddit, X/Twitter, LinkedIn, and Moltbook. Install as a Claude Code agent skill.",
5
5
  "bin": {
6
6
  "social-autoposter": "bin/cli.js",
@@ -57,7 +57,9 @@ RUNNING_STALL_SECONDS = 900
57
57
  # At StartInterval 120 that is ~6 min of continuous stall.
58
58
  ALERT_AFTER = 3
59
59
 
60
- WORKER_TASK_IDS = ("saps-phase1-query", "saps-phase2b-draft")
60
+ # Includes the current universal worker id; legacy phase pair kept for old
61
+ # installs (same stale-checker drift fix as scheduled_tasks_snapshot.py, 2026-07-03).
62
+ WORKER_TASK_IDS = ("s4l-worker", "saps-worker", "saps-phase1-query", "saps-phase2b-draft")
61
63
 
62
64
 
63
65
  def _state_dir() -> str:
@@ -381,21 +381,34 @@ def _bump_drain_timeout() -> None:
381
381
  # never signalled.
382
382
  # * Best-effort throughout: never raises into the caller, never changes the
383
383
  # worker's exit code, never touches the result already written to disk.
384
+ # LOOSE ancestry probe (2026-07-04). The original tuple duplicated the reaper's
385
+ # strict cmdline signature, which Claude Desktop 1.18286.0 broke (Karol's second
386
+ # leak: 53 workers piled up while both the reaper AND this self-reap failed the
387
+ # same parse). Inside our OWN ancestry the strict fingerprint is unnecessary:
388
+ # identification is DETERMINISTIC by construction — claude_job runs as a Bash
389
+ # child of the session that invoked it, so the nearest claude-code agent-mode
390
+ # ancestor IS that session. What the loose probe cannot tell apart is a
391
+ # SCHEDULED WORKER session vs an INTERACTIVE session where someone ran
392
+ # `claude_job next` by hand — that discrimination comes from the cwd gate in
393
+ # _maybe_self_reap (worker tasks run in ~/.s4l-worker; interactive sessions
394
+ # never do), not from cmdline shape.
384
395
  _SELF_REAP_SIG = (
385
396
  "claude-code/",
386
- "/Contents/MacOS/claude ",
387
397
  "--input-format stream-json",
388
- "local-agent-mode-sessions",
389
398
  )
390
- _SELF_REAP_UUID_RE = re.compile(r"local-agent-mode-sessions/[0-9a-fA-F-]{36}")
399
+ _S4L_WORKER_CWD = os.path.join(os.path.expanduser("~"), ".s4l-worker")
391
400
 
392
401
 
393
402
  def _self_reap_enabled() -> bool:
394
- return os.environ.get("S4L_WORKER_SELF_REAP", "").strip().lower() in (
395
- "1",
396
- "true",
397
- "yes",
398
- "on",
403
+ # Default ON since 2026-07-04 (v1.6.202): the dormant flag meant the
404
+ # source-side trim never ran anywhere, leaving the (signature-fragile)
405
+ # launchd reaper as the only defense — and when Desktop changed the cmdline
406
+ # shape, boxes leaked. Opt OUT with S4L_WORKER_SELF_REAP=0.
407
+ return os.environ.get("S4L_WORKER_SELF_REAP", "").strip().lower() not in (
408
+ "0",
409
+ "false",
410
+ "no",
411
+ "off",
399
412
  )
400
413
 
401
414
 
@@ -424,8 +437,10 @@ def _ps_pid_map() -> dict:
424
437
 
425
438
 
426
439
  def _find_own_session(psmap: dict):
427
- """Walk OUR ancestry to the nearest claude agent-mode worker session that
428
- matches the reaper signature. Returns (pid, uuid_token) or None."""
440
+ """Walk OUR ancestry to the nearest claude-code agent-mode ancestor.
441
+ Returns (pid, reverify_token) or None. The token is a stable cmdline prefix
442
+ used to confirm the PID was not recycled before signalling — no UUID/path
443
+ shape assumptions, so a Desktop cmdline change cannot blind this again."""
429
444
  pid = os.getpid()
430
445
  seen: set = set()
431
446
  for _ in range(40): # bounded climb up the process tree
@@ -437,9 +452,7 @@ def _find_own_session(psmap: dict):
437
452
  break
438
453
  ppid, cmd = ent
439
454
  if all(t in cmd for t in _SELF_REAP_SIG) and "Helpers/disclaimer" not in cmd:
440
- m = _SELF_REAP_UUID_RE.search(cmd)
441
- if m:
442
- return pid, m.group(0)
455
+ return pid, cmd[:160]
443
456
  pid = ppid
444
457
  if pid <= 1:
445
458
  break
@@ -447,10 +460,19 @@ def _find_own_session(psmap: dict):
447
460
 
448
461
 
449
462
  def _maybe_self_reap(delay: float = 6.0) -> None:
450
- """Opt-in: terminate our own finished worker session. See block comment above."""
463
+ """Terminate our own finished worker session. See block comment above.
464
+
465
+ The cwd gate is the worker-vs-interactive discriminator: scheduled worker
466
+ tasks run with cwd ~/.s4l-worker (enforced at task creation + menubar cwd
467
+ rewrite), while an interactive/debug session that shells `claude_job` runs
468
+ in a project dir. Interactive sessions are therefore never signalled, no
469
+ matter what their cmdline looks like."""
451
470
  if not _self_reap_enabled():
452
471
  return
453
472
  try:
473
+ cwd = os.getcwd()
474
+ if cwd != _S4L_WORKER_CWD and not cwd.startswith(_S4L_WORKER_CWD + os.sep):
475
+ return
454
476
  found = _find_own_session(_ps_pid_map())
455
477
  if not found:
456
478
  return
@@ -27,7 +27,15 @@ import os
27
27
  import sys
28
28
 
29
29
  # --- Kept in sync with mcp/menubar/s4l_menubar.py ---------------------------
30
- WORKER_TASK_IDS = ("saps-phase1-query", "saps-phase2b-draft")
30
+ # Current installs run ONE universal worker task (s4l-worker). The phase pair
31
+ # is the retired legacy shape kept only so old installs still report. Checking
32
+ # ONLY the legacy names made every current install scream
33
+ # missing_worker_tasks=[saps-phase1-query, saps-phase2b-draft] forever while
34
+ # the real s4l-worker task fired every minute and wasn't even LISTED (Karol,
35
+ # 2026-07-03 — this false alarm derailed the whole onboarding investigation).
36
+ WORKER_TASK_IDS = ("s4l-worker", "saps-worker", "saps-phase1-query", "saps-phase2b-draft")
37
+ CURRENT_WORKER_TASK_IDS = ("s4l-worker", "saps-worker")
38
+ LEGACY_WORKER_TASK_IDS = ("saps-phase1-query", "saps-phase2b-draft")
31
39
  DEPRECATED_TASK_IDS = ("social-autoposter-autopilot",)
32
40
  WORKER_CWD = os.path.join(os.path.expanduser("~"), ".s4l-worker")
33
41
  # "Claude*": the host app can run with a custom --user-data-dir (per-account
@@ -88,11 +96,17 @@ def build_summary() -> dict:
88
96
  })
89
97
 
90
98
  mislocated = sum(1 for t in tasks if not t["in_worker_dir"])
99
+ # "Missing" means NO viable worker lane at all: neither a current universal
100
+ # task nor the complete legacy pair. Naming every absent id was wrong once
101
+ # the id set spanned generations (a healthy current install always "misses"
102
+ # the legacy pair and vice versa).
103
+ have_current = bool(seen_ids & set(CURRENT_WORKER_TASK_IDS))
104
+ have_legacy = set(LEGACY_WORKER_TASK_IDS) <= seen_ids
91
105
  return {
92
106
  "worker_dir_tail": _cwd_tail(WORKER_CWD),
93
107
  "registries": registries,
94
108
  "worker_tasks": len(tasks),
95
- "missing_worker_tasks": sorted(set(WORKER_TASK_IDS) - seen_ids),
109
+ "missing_worker_tasks": [] if (have_current or have_legacy) else ["s4l-worker"],
96
110
  "mislocated": mislocated,
97
111
  # all_in_worker_dir is False when there are zero worker tasks too, since
98
112
  # "no autopilot registered" is itself a state worth seeing centrally.
@@ -62,7 +62,13 @@ REQUIRED_FIELDS = ["name", "website", "description", "icp", "voice", "search_top
62
62
  # only setup can NEVER report setup_complete (any_ready requires a managed product),
63
63
  # leaving the menu bar stuck on "project not set up". (2026-06-30)
64
64
  PERSONA_REQUIRED_FIELDS = ["name", "description", "voice", "search_topics"]
65
- WORKER_TASK_IDS = ("saps-phase1-query", "saps-phase2b-draft")
65
+ # Current installs run ONE universal worker task (s4l-worker); the phase pair
66
+ # is the retired legacy shape. Checking ONLY the legacy pair made every current
67
+ # install read "autopilot off" forever (Karol, 2026-07-03: worker fired every
68
+ # minute while this check reported the tasks missing). Keep in sync with
69
+ # scripts/schedule_state.py and mcp/menubar/s4l_menubar.py.
70
+ CURRENT_WORKER_TASK_IDS = ("s4l-worker", "saps-worker")
71
+ LEGACY_WORKER_TASK_IDS = ("saps-phase1-query", "saps-phase2b-draft")
66
72
  UPDATER_LABEL = "com.m13v.social-autoposter-update"
67
73
  AUTOPILOT_STALL_MS = 180_000
68
74
 
@@ -179,7 +185,15 @@ def _mode_chosen() -> bool:
179
185
  def _autopilot_on() -> bool:
180
186
  base = os.path.join(_claude_cfg_dir(), "scheduled-tasks")
181
187
  try:
182
- return all(os.path.exists(os.path.join(base, t, "SKILL.md")) for t in WORKER_TASK_IDS)
188
+ if any(
189
+ os.path.exists(os.path.join(base, t, "SKILL.md"))
190
+ for t in CURRENT_WORKER_TASK_IDS
191
+ ):
192
+ return True
193
+ return all(
194
+ os.path.exists(os.path.join(base, t, "SKILL.md"))
195
+ for t in LEGACY_WORKER_TASK_IDS
196
+ )
183
197
  except Exception:
184
198
  return False
185
199