Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ extend-exclude = [
".limen",
".git",
]

[lint]
ignore = ["E701", "E702", "E741", "E402"]
4 changes: 2 additions & 2 deletions scripts/batch-dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from __future__ import annotations

import subprocess, sys, yaml, json
import sys
import yaml
from pathlib import Path
from datetime import datetime, timezone

# route every tasks.yaml write through the ONE atomic primitive (see limen/io.py) so a
# concurrent heartbeat read can never observe a truncated/empty queue.
Expand Down
4 changes: 2 additions & 2 deletions scripts/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def fmt_n(n):
def read_pulse():
"""current beat #, tempo, and recent events from the daemon log."""
log = ROOT / "logs" / "heartbeat.out.log"
beat, tempo, events, alive = 0, "?", [], False
beat, tempo, events, _alive = 0, "?", [], False
try:
lines = log.read_text(errors="ignore").splitlines()[-400:]
for ln in lines:
Expand Down Expand Up @@ -203,7 +203,7 @@ def render(d, ticks, usage=None):
cells += C["c"] + "●" + C["x"]
else:
cells += C["gray"] + "·" + C["x"]
nextin = sub - (beat % sub) if (beat % sub) else 0
sub - (beat % sub) if (beat % sub) else 0
p(f" {name:8} {cells} {C['gray']}/{sub} {phase}{C['x']}")
if events:
p("")
Expand Down
2 changes: 1 addition & 1 deletion scripts/claude-workflow-guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _workflow_violations(path: Path, wf: dict[str, Any], *, max_opus_agents: int
violations: list[str] = []
name = wf.get("workflowName") or wf.get("summary") or path.name
progress = wf.get("workflowProgress") or []
agent_count = int(wf.get("agentCount") or len(progress) or 0)
int(wf.get("agentCount") or len(progress) or 0)
models = [str(p.get("model", "")) for p in progress if isinstance(p, dict)]
opus_agents = sum(1 for m in models if "opus" in m.lower())

Expand Down
8 changes: 5 additions & 3 deletions scripts/consolidate-github.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
python3 scripts/consolidate-github.py --apply # ⚠ GATED: actually transfer + topic
python3 scripts/consolidate-github.py --apply --allow-partial # ⚠ extra-gated partial move
"""
import json, subprocess, sys
import json
import subprocess
import sys
from collections import defaultdict

TARGET = "organvm"
Expand Down Expand Up @@ -58,15 +60,15 @@ def main():
print(f" name collisions (must rename before transfer): {len(collisions)}")
for n, v in sorted(collisions.items()):
print(f" ⚠ '{n}': {', '.join(v)}")
print(f"\n sample transfers (first 20):")
print("\n sample transfers (first 20):")
for owner, name, topic, arch in plan[:20]:
flag = " [archived]" if arch else ""
print(f" {owner}/{name}{flag} → {TARGET}/{name} +topic:{topic}")
if len(plan) > 20:
print(f" … +{len(plan)-20} more")

if not APPLY:
print(f"\nDRY-RUN — nothing executed. Collisions above must be resolved first.")
print("\nDRY-RUN — nothing executed. Collisions above must be resolved first.")
print("After collisions are 0, re-run with --apply (GATED) to transfer repos + set topics.")
return 0

Expand Down
1 change: 0 additions & 1 deletion scripts/library-preserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""
from __future__ import annotations

import hashlib
import json
import os
import shutil
Expand Down
8 changes: 7 additions & 1 deletion scripts/merge-drain.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
--limit N max PRs to merge this run (default 10)
--dry-run assess + report only (cursor untouched)
"""
import argparse, json, os, subprocess, sys, datetime, concurrent.futures as cf
import argparse
import json
import os
import subprocess
import sys
import datetime
import concurrent.futures as cf
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent)) # sibling scripts/ for _pr_scan
Expand Down
2 changes: 1 addition & 1 deletion scripts/prompt-packet-ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import datetime as dt
import json
import os
from collections import Counter, defaultdict
from collections import Counter
from pathlib import Path
from typing import Any

Expand Down
7 changes: 6 additions & 1 deletion scripts/reclaim-worktrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
LIMEN_RECLAIM_WORKSPACE_ROOTS, LIMEN_RECLAIM_MAX (50), LIMEN_RECLAIM_EVERY_MIN (30).
"""
from __future__ import annotations
import json, os, shutil, subprocess, sys, time
import json
import os
import shutil
import subprocess
import sys
import time
from pathlib import Path

SCRIPT_ROOT = Path(__file__).resolve().parents[1]
Expand Down
1 change: 0 additions & 1 deletion scripts/resolve-legacy-session-batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def build_receipt(batch_id: str) -> dict[str, Any]:
status_counts = Counter(str(row.get("status") or "unknown") for row in roots)
unique_keys = {str(row.get("session_key")) for row in roots}
source_exists = sum(1 for row in scan.get("sessions") or [] if row.get("source_exists"))
owner_lanes = scan.get("batch_summary", {}).get("owner_lanes") or {}
anchor_kinds = scan.get("batch_summary", {}).get("anchor_kinds") or {}
repo_refs = scan.get("batch_summary", {}).get("repo_refs") or {}
sensitive_rows = [row for row in scan.get("sessions") or [] if sensitive_total(row)]
Expand Down
2 changes: 1 addition & 1 deletion scripts/rewrite-owners.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def main() -> int:
print(f"\n⚠ --apply: writing tasks.yaml ({n_tasks} refs) + deploy-api.yml …")
if n_tasks:
apply_tasks(lf)
print(f" ✓ tasks.yaml rewritten via atomic save_limen_file")
print(" ✓ tasks.yaml rewritten via atomic save_limen_file")
if need_fix and apply_deploy():
print(f" ✓ deploy-api.yml LIMEN_GITHUB_REPO → {TARGET}/limen")
print(" (git remotes NOT touched — run the emitted commands manually post-transfer.)")
Expand Down
2 changes: 1 addition & 1 deletion scripts/session-attack-paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import json
import os
import sys
from collections import Counter, defaultdict
from collections import Counter
from pathlib import Path
from typing import Any

Expand Down
1 change: 0 additions & 1 deletion scripts/session-corpus-ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def count_jsonl(path: Path, *, source_counts: bool = False) -> dict[str, Any]:
def substrate_snapshot() -> dict[str, Any]:
sm = WORKSPACE / "session-meta"
kc = WORKSPACE / "knowledge-corpus"
cce = WORKSPACE / "conversation-corpus-engine"
one = kc / "00-THE-ONE.md"
reduced = kc / "reduced"
return {
Expand Down
6 changes: 4 additions & 2 deletions scripts/setup-rulesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
python3 scripts/setup-rulesets.py --repo owner/name [...] # limit to specific repos
python3 scripts/setup-rulesets.py --contexts pr-gate,python,web # force these check names (skip detection)
"""
import json, subprocess, sys
import json
import subprocess
import sys
from collections import OrderedDict

APPLY = "--apply" in sys.argv
Expand Down Expand Up @@ -126,7 +128,7 @@ def main():
ok = r.returncode == 0
print(f" {'✓ protected + auto-merge on' if ok else '✗ ' + r.stderr.strip()[:70]}")
else:
print(f" ✓ allow_auto_merge set (no protection — no CI to gate on)")
print(" ✓ allow_auto_merge set (no protection — no CI to gate on)")

print(f"\n{len(repos)-len(no_ci)} repos gateable via CI; {len(no_ci)} have no CI "
f"(auto-merge moot — they merge on creation).")
Expand Down
1 change: 0 additions & 1 deletion scripts/studium.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def advance_cursor(state, today):
w = today["work"]
divs = w.get("divisions", {}) or {}
kind = today["division_kind"]
per_day = (today.get("pace_divs") or {}).get(kind)
# Simple, honest model: each division takes ~ (typical lines / lines_per_day) days; we don't parse
# every corpus file each run, so advance one division per day at intensive, else track day_in_division.
day = pos.get("day_in_division", 1)
Expand Down
4 changes: 3 additions & 1 deletion scripts/verify-whole.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ step "Compile Python modules and validate shell syntax"
cd "$ROOT"
python3 -m py_compile web/api/main.py cli/src/limen/*.py scripts/probe-runtime-adapter.py scripts/validate-lifecycle-adapters.py scripts/validate-task-board.py scripts/worktree-debt.py scripts/session-corpus-ledger.py scripts/prompt-lifecycle-ledger.py scripts/prompt-priority-map.py scripts/prompt-batch-review-ledger.py scripts/prompt-packet-ledger.py scripts/capability-substrate-ledger.py scripts/consolidation-gates.py scripts/network-health.py scripts/dispatch-health.py scripts/live-root-gate.py scripts/session-blockers-ledger.py scripts/session-lifecycle-pressure.py scripts/session-attack-paths.py scripts/conductor-tranche.py scripts/session-value-review.py
bash -n scripts/preflight-cloud-run.sh scripts/probe-local-runtime.sh scripts/probe-local-worker.sh scripts/verify-whole.sh scripts/merge-policy.sh scripts/tests/merge-policy.test.sh scripts/hooks/session-lifecycle-pressure.sh scripts/netmode.sh
plutil -lint container/launchd/com.user.netmeter.plist
if command -v plutil >/dev/null; then
plutil -lint container/launchd/com.user.netmeter.plist
fi

step "Verify the merge-policy predicate (verdict matrix regression test)"
bash scripts/tests/merge-policy.test.sh
Expand Down
6 changes: 5 additions & 1 deletion scripts/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
python3 scripts/watch.py --once # one frame (for piping / cron)
python3 scripts/watch.py -n 5 # custom interval
"""
import json, os, subprocess, sys, time
import json
import os
import subprocess
import sys
import time
from collections import Counter, defaultdict
from pathlib import Path

Expand Down
Loading