delimit-cli 4.5.13 → 4.6.0
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.
- package/CHANGELOG.md +45 -0
- package/README.md +9 -8
- package/bin/delimit-cli.js +162 -1
- package/bin/delimit-setup.js +46 -6
- package/gateway/ai/_compile_status.py +154 -0
- package/gateway/ai/agent_dispatch.py +36 -0
- package/gateway/ai/backends/tools_infra.py +150 -10
- package/gateway/ai/daemon.py +10 -0
- package/gateway/ai/daily_digest.py +1 -2
- package/gateway/ai/delimit_daemon.py +67 -0
- package/gateway/ai/dispatch_gate.py +399 -0
- package/gateway/ai/hot_reload.py +1 -2
- package/gateway/ai/led193_daemon/executor.py +9 -0
- package/gateway/ai/ledger_manager.py +9 -0
- package/gateway/ai/license_core.cpython-310-x86_64-linux-gnu.so +0 -0
- package/gateway/ai/notify.py +39 -0
- package/gateway/ai/outreach_substantive.py +676 -0
- package/gateway/ai/reaper.py +70 -0
- package/gateway/ai/reddit_scanner.py +10 -5
- package/gateway/ai/sensing/schema.py +1 -1
- package/gateway/ai/sensing/signal_store.py +0 -1
- package/gateway/ai/server.py +5171 -1462
- package/gateway/ai/social_capability/fit_floor.py +114 -12
- package/gateway/ai/tdqs_lint.py +611 -0
- package/gateway/ai/usage_allowlist.py +198 -0
- package/gateway/ai/workers/base.py +2 -2
- package/gateway/ai/workers/executor.py +32 -3
- package/gateway/ai/workers/outreach_drafter.py +0 -1
- package/gateway/ai/workers/pr_drafter.py +0 -1
- package/gateway/ai/x_ranker.py +12 -2
- package/gateway/core/json_schema_diff.py +25 -1
- package/lib/auth-signin.js +136 -0
- package/lib/auth-signout.js +169 -0
- package/lib/delimit-template.js +11 -0
- package/lib/migration-2092-banner.js +213 -0
- package/package.json +2 -2
- package/server.json +4 -4
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
import logging
|
|
3
|
+
import json
|
|
4
|
+
import time
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Dict, Any, List
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("delimit.reaper")
|
|
11
|
+
|
|
12
|
+
def reap_agent_tasks(project_path: str = "/home/delimit/delimit-gateway") -> List[str]:
|
|
13
|
+
"""Reap completed agent arms by checking for commits and merging."""
|
|
14
|
+
from ai.agent_dispatch import get_agent_status, complete_task
|
|
15
|
+
from ai.ledger_manager import update_item
|
|
16
|
+
|
|
17
|
+
# 1. Get all dispatched tasks
|
|
18
|
+
res = get_agent_status()
|
|
19
|
+
tasks = res.get("tasks", [])
|
|
20
|
+
if not isinstance(tasks, list):
|
|
21
|
+
tasks = list(tasks.values())
|
|
22
|
+
|
|
23
|
+
reaped = []
|
|
24
|
+
for task in tasks:
|
|
25
|
+
if task.get("status") != "dispatched":
|
|
26
|
+
continue
|
|
27
|
+
|
|
28
|
+
task_id = task.get("id")
|
|
29
|
+
desc = task.get("description", "")
|
|
30
|
+
|
|
31
|
+
# 2. Extract branch from description
|
|
32
|
+
match = re.search(r'branch ([\w/-]+)', desc)
|
|
33
|
+
if not match:
|
|
34
|
+
continue
|
|
35
|
+
branch = match.group(1)
|
|
36
|
+
|
|
37
|
+
# 3. Check for new commits on the branch
|
|
38
|
+
try:
|
|
39
|
+
cmd = ["git", "-C", project_path, "log", f"main..${branch}", "--oneline"]
|
|
40
|
+
p = subprocess.run(cmd, capture_output=True, text=True)
|
|
41
|
+
if p.returncode == 0 and p.stdout.strip():
|
|
42
|
+
logger.info(f"Reaper: Found activity on ${branch} for task ${task_id}")
|
|
43
|
+
|
|
44
|
+
# 4. RUN TESTS
|
|
45
|
+
test_cmd = ["python3", "-m", "pytest", "tests/", "-v", "--maxfail=3"]
|
|
46
|
+
env = {"DELIMIT_TEST_MODE": "1", "PATH": f"/root/.delimit/shims:${os.environ['PATH']}"}
|
|
47
|
+
test_p = subprocess.run(test_cmd, cwd=project_path, capture_output=True, text=True, env={**os.environ, **env})
|
|
48
|
+
|
|
49
|
+
if test_p.returncode == 0:
|
|
50
|
+
# 5. MERGE
|
|
51
|
+
subprocess.run(["git", "-C", project_path, "checkout", "main"], check=True)
|
|
52
|
+
subprocess.run(["git", "-C", project_path, "merge", branch], check=True)
|
|
53
|
+
|
|
54
|
+
# 6. COMPLETE
|
|
55
|
+
complete_task(task_id, result="Reaper: Actually built and merged to main.")
|
|
56
|
+
|
|
57
|
+
# 7. Update Ledger
|
|
58
|
+
ctx = task.get("context", "")
|
|
59
|
+
led_match = re.search(r'LED-(\d+)', ctx)
|
|
60
|
+
if led_match:
|
|
61
|
+
led_id = led_match.group(0)
|
|
62
|
+
update_item(item_id=led_id, status="done", note=f"Arm ${task_id} merged.")
|
|
63
|
+
|
|
64
|
+
reaped.append(task_id)
|
|
65
|
+
else:
|
|
66
|
+
logger.warning(f"Reaper: Tests failed for ${branch}, skipping merge.")
|
|
67
|
+
except Exception as e:
|
|
68
|
+
logger.warning(f"Reaper: Failed to reap task ${task_id}: ${e}")
|
|
69
|
+
|
|
70
|
+
return reaped
|
|
@@ -470,14 +470,19 @@ def score_and_classify(
|
|
|
470
470
|
final_score = engagement * fresh_mult * comment_opp * relevance_mult
|
|
471
471
|
is_karma = group == "karma_building"
|
|
472
472
|
|
|
473
|
-
# Classification
|
|
474
|
-
|
|
473
|
+
# Classification (LED-1335 freshness tightening 2026-05-12: founder
|
|
474
|
+
# explicit "we want fresh posts for highest visibility." Comment
|
|
475
|
+
# visibility decays sharply after 6h, marginal after 12h, ~zero
|
|
476
|
+
# after 24h. Old behavior let 12-48h posts through as medium and
|
|
477
|
+
# the daemon drafted on them. New thresholds: hard-skip > 24h,
|
|
478
|
+
# high_priority < 6h, medium_priority < 12h, low_priority < 24h.)
|
|
479
|
+
if post.get("stickied") or age_h > 24 or comments > 100:
|
|
475
480
|
priority = "skip"
|
|
476
|
-
elif final_score >= 30 and age_h <
|
|
481
|
+
elif final_score >= 30 and age_h < 6 and comments < 50:
|
|
477
482
|
priority = "high_priority"
|
|
478
|
-
elif final_score >= 10 or (len(tags) >= 2 and age_h <
|
|
483
|
+
elif (final_score >= 10 and age_h < 12) or (len(tags) >= 2 and age_h < 12):
|
|
479
484
|
priority = "medium_priority"
|
|
480
|
-
elif final_score >= 3:
|
|
485
|
+
elif final_score >= 3 and age_h < 24:
|
|
481
486
|
priority = "low_priority"
|
|
482
487
|
else:
|
|
483
488
|
priority = "skip"
|
|
@@ -10,7 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
import hashlib
|
|
11
11
|
import re
|
|
12
12
|
from dataclasses import dataclass, field, asdict
|
|
13
|
-
from typing import Any, Dict, List
|
|
13
|
+
from typing import Any, Dict, List
|
|
14
14
|
from urllib.parse import urlparse, urlunparse, parse_qsl, urlencode
|
|
15
15
|
|
|
16
16
|
|