delimit-cli 4.5.13 → 4.6.1
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 +48 -0
- package/README.md +9 -8
- package/bin/delimit-cli.js +179 -4
- package/bin/delimit-setup.js +46 -6
- package/gateway/ai/_compile_status.py +154 -0
- package/gateway/ai/agent_dispatch.py +41 -0
- package/gateway/ai/backends/git_health.py +175 -0
- package/gateway/ai/backends/tools_infra.py +163 -10
- package/gateway/ai/cli_contract.py +185 -0
- 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/governance.py +181 -0
- package/gateway/ai/heartbeat.py +290 -0
- package/gateway/ai/hot_reload.py +1 -2
- package/gateway/ai/led193_daemon/executor.py +9 -0
- package/gateway/ai/ledger_manager.py +90 -4
- package/gateway/ai/ledger_proof.py +127 -0
- package/gateway/ai/license.py +132 -47
- package/gateway/ai/license_core.cpython-310-x86_64-linux-gnu.so +0 -0
- package/gateway/ai/license_core.pyi +1 -1
- package/gateway/ai/notify.py +39 -0
- package/gateway/ai/outreach_loop_daemon.py +349 -0
- package/gateway/ai/outreach_substantive.py +1437 -0
- package/gateway/ai/pro_tools.yaml +167 -0
- package/gateway/ai/reaper.py +70 -0
- package/gateway/ai/reddit_scanner.py +17 -6
- package/gateway/ai/sensing/schema.py +1 -1
- package/gateway/ai/sensing/signal_store.py +0 -1
- package/gateway/ai/server.py +5490 -1602
- package/gateway/ai/social_capability/fit_floor.py +114 -12
- package/gateway/ai/social_queue.py +166 -10
- package/gateway/ai/tdqs_lint.py +611 -0
- package/gateway/ai/tenant_auth.py +329 -0
- package/gateway/ai/tenant_data.py +339 -0
- package/gateway/ai/tenant_paths.py +150 -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 +5 -2
- package/server.json +4 -4
- package/scripts/build-license-core.sh +0 -85
- package/scripts/security-check.sh +0 -66
- package/scripts/test-license-core-so.sh +0 -107
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# LED-1259: Verify that the compiled license_core .so:
|
|
3
|
-
# 1. Compiles cleanly from gateway/ai/license_core.py
|
|
4
|
-
# 2. Imports successfully when the .py is absent
|
|
5
|
-
# 3. Exposes all public functions/constants the shim relies on
|
|
6
|
-
# 4. Returns correct validation verdicts for known-valid / known-expired
|
|
7
|
-
# license dicts
|
|
8
|
-
# 5. Contains zero bypass identifiers in `strings` output
|
|
9
|
-
#
|
|
10
|
-
# Runs in an isolated tmp dir so it doesn't pollute the bundle layout.
|
|
11
|
-
|
|
12
|
-
set -euo pipefail
|
|
13
|
-
|
|
14
|
-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
15
|
-
NPM_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
16
|
-
SRC="$NPM_ROOT/gateway/ai/license_core.py"
|
|
17
|
-
|
|
18
|
-
if [ "$(uname -s)" != "Linux" ]; then
|
|
19
|
-
echo "⏭️ test-license-core-so: non-Linux host — skipping (Linux-only first ship)"
|
|
20
|
-
exit 0
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
if [ ! -f "$SRC" ]; then
|
|
24
|
-
echo "ℹ️ license_core.py not in bundle (already compiled or pre-build) — copying from gateway src for test"
|
|
25
|
-
GW_SRC="${GATEWAY_OVERRIDE:-/home/delimit/delimit-gateway}/ai/license_core.py"
|
|
26
|
-
if [ ! -f "$GW_SRC" ]; then
|
|
27
|
-
echo "❌ No license_core.py source found (bundle or gateway). Cannot test."
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
SRC="$GW_SRC"
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
PY="${PYTHON:-python3}"
|
|
34
|
-
TMP="$(mktemp -d)"
|
|
35
|
-
trap 'rm -rf "$TMP"' EXIT
|
|
36
|
-
|
|
37
|
-
echo "🧪 test-license-core-so: building in $TMP"
|
|
38
|
-
mkdir -p "$TMP/ai"
|
|
39
|
-
touch "$TMP/ai/__init__.py"
|
|
40
|
-
cp "$SRC" "$TMP/license_core.py"
|
|
41
|
-
|
|
42
|
-
cd "$TMP"
|
|
43
|
-
"$PY" -m nuitka --module --quiet --remove-output --output-dir=. license_core.py 2>&1 | tail -3
|
|
44
|
-
|
|
45
|
-
SO_FILE="$(ls -1 license_core.cpython-*-*.so 2>/dev/null | head -1)"
|
|
46
|
-
if [ -z "$SO_FILE" ]; then
|
|
47
|
-
echo "❌ Compile failed — no .so produced"
|
|
48
|
-
exit 1
|
|
49
|
-
fi
|
|
50
|
-
echo " ✅ compiled: $SO_FILE ($(stat -c%s "$SO_FILE") bytes)"
|
|
51
|
-
|
|
52
|
-
# Strings-grep for bypass identifiers
|
|
53
|
-
HITS="$(strings "$SO_FILE" | grep -iE 'DELIMIT_TEST_MODE|DELIMIT_INTERNAL_LICENSE_KEY|JAMSONS' || true)"
|
|
54
|
-
if [ -n "$HITS" ]; then
|
|
55
|
-
echo "❌ Bypass identifiers leaked into .so:"
|
|
56
|
-
echo "$HITS"
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
59
|
-
echo " ✅ strings-grep clean"
|
|
60
|
-
|
|
61
|
-
# Move .so under ai/, drop the .py, run import + behaviour checks
|
|
62
|
-
mv "$SO_FILE" "ai/$SO_FILE"
|
|
63
|
-
rm -f license_core.py
|
|
64
|
-
|
|
65
|
-
"$PY" - <<'PY'
|
|
66
|
-
import os, sys, time
|
|
67
|
-
sys.path.insert(0, ".")
|
|
68
|
-
|
|
69
|
-
# Import via the compiled .so only — no .py present
|
|
70
|
-
from ai.license_core import (
|
|
71
|
-
is_license_valid, revalidate_license, needs_revalidation,
|
|
72
|
-
PRO_TOOLS, LICENSE_FILE, FREE_TRIAL_LIMITS, activate,
|
|
73
|
-
load_license, check_premium, gate_tool,
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
assert isinstance(PRO_TOOLS, frozenset) and len(PRO_TOOLS) > 0, "PRO_TOOLS must be a non-empty frozenset"
|
|
77
|
-
assert FREE_TRIAL_LIMITS.get("delimit_deliberate") == 3, "FREE_TRIAL_LIMITS missing delimit_deliberate=3"
|
|
78
|
-
assert "delimit_deliberate" in PRO_TOOLS, "PRO_TOOLS must include delimit_deliberate"
|
|
79
|
-
assert callable(activate), "activate must be callable"
|
|
80
|
-
assert callable(revalidate_license), "revalidate_license must be callable"
|
|
81
|
-
|
|
82
|
-
# Known-valid: pro tier, recent last_validated_at
|
|
83
|
-
valid_recent = {"tier": "pro", "valid": True, "last_validated_at": time.time()}
|
|
84
|
-
assert is_license_valid(valid_recent) is True, "recent pro license should be valid"
|
|
85
|
-
assert needs_revalidation(valid_recent) is False, "recent pro license should not need revalidation"
|
|
86
|
-
|
|
87
|
-
# Known-invalid: pro tier but last_validated_at > 44 days ago (beyond hard cutoff)
|
|
88
|
-
expired = {"tier": "pro", "valid": True, "last_validated_at": time.time() - 60 * 86400}
|
|
89
|
-
assert is_license_valid(expired) is False, "expired (60d) pro license must be invalid"
|
|
90
|
-
assert needs_revalidation(expired) is True, "expired (60d) pro license must need revalidation"
|
|
91
|
-
|
|
92
|
-
# Free tier never valid for Pro
|
|
93
|
-
free = {"tier": "free", "valid": True}
|
|
94
|
-
assert is_license_valid(free) is False, "free tier must not pass is_license_valid"
|
|
95
|
-
|
|
96
|
-
# valid=False forces invalid even when timestamp is recent
|
|
97
|
-
revoked = {"tier": "pro", "valid": False, "last_validated_at": time.time()}
|
|
98
|
-
assert is_license_valid(revoked) is False, "revoked license must be invalid"
|
|
99
|
-
|
|
100
|
-
# Legacy file with no timestamps — should signal needs_revalidation=True
|
|
101
|
-
legacy = {"tier": "pro", "valid": True}
|
|
102
|
-
assert needs_revalidation(legacy) is True, "legacy license without timestamps must need revalidation"
|
|
103
|
-
|
|
104
|
-
print("ALL_OK")
|
|
105
|
-
PY
|
|
106
|
-
|
|
107
|
-
echo "✅ test-license-core-so: all checks passed"
|