From 2797d26732f86b2195290f582ee20b1a87602055 Mon Sep 17 00:00:00 2001 From: PsySlayer Date: Mon, 16 Mar 2026 18:43:10 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20v2.1.10=20=E2=80=94=20output-dir=20saves?= =?UTF-8?q?=20all=20due=20jobs=20+=20rich=20JSON,=20.env.example=20POOL=5F?= =?UTF-8?q?SIZE=20guidance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 ++ CHANGELOG.md | 19 +++++++++++++++++++ pipeline.py | 29 +++++++++++++++++++++++------ sicry.py | 2 +- sync_sicry.py | 2 +- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index e46bcbc..40ed531 100644 --- a/.env.example +++ b/.env.example @@ -50,6 +50,8 @@ SICRY_SEARCH_CACHE_TTL=1800 # TTL for engine health check cache (seconds) SICRY_ENGINE_CACHE_TTL=3600 # TorPool circuit count (0 = disabled, use single Tor) +# Recommended: 2–4 circuits; each uses ~50 MB RAM and one Tor entry guard. +# Example: SICRY_POOL_SIZE=3 ← good starting point for most investigations. SICRY_POOL_SIZE=0 # Base SOCKS port for TorPool circuits (9060, 9061, …) SICRY_POOL_BASE_PORT=9060 diff --git a/CHANGELOG.md b/CHANGELOG.md index 89efd27..f311fce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,25 @@ Versioning follows [Semantic Versioning](https://semver.org). --- +## [2.1.10] — 2026-03-16 + +### Fixed +- **[1]** `pipeline.py --watch-check --output-dir`: was only writing a file + when `new=True` AND results were non-empty. Now saves **all due jobs** to + `/.json`, unconditionally. Enriched JSON payload: + `"new"`, `"result_count"`, `"mode"`, `"last_run"`, `"last_run_ts"`, + `"next_run"`. `Saved N file(s)` summary line added; note printed when + `--output-dir` is set but no jobs were due. + +### Improved +- **[2]** `.env.example`: `SICRY_POOL_SIZE` now carries a + "Recommended: 2–4 circuits" comment with a concrete example. + +### Bundled SICRY™ +- Version 2.1.10 (`__version__` bump only; no logic changes in sicry.py) + +--- + ## [2.1.9] — 2026-03-16 ### Fixed diff --git a/pipeline.py b/pipeline.py index 9c14cb4..6ac123d 100755 --- a/pipeline.py +++ b/pipeline.py @@ -173,9 +173,13 @@ if args.check_update: if args.watch_check: print("[watch-check] Running all due watch jobs…") alerts = sicry.watch_check() + _n_saved = 0 if not alerts: - print(" No due jobs or no new results.") + print(" No due jobs.") + if args.output_dir: + print(f" --output-dir: no files written (no due jobs).") else: + import json as _json for a in alerts: new_flag = "[NEW]" if a.get("new") else "[unchanged]" last_run = a.get("last_run") @@ -197,15 +201,28 @@ if args.watch_check: _tc = f"[conf={_conf:.2f}] " if _conf is not None else "" print(f" {_tc}{_tr.get('title', '(no title)')[:70]}") print(f" {_tr.get('url', '')}") - # IMPROVE-7: --output-dir saves each triggered alert as .json - if args.output_dir and a.get("new") and a.get("results"): - import json as _json + # [1] v2.1.10: --output-dir saves ALL due jobs (new or unchanged) so + # automated pipelines always receive a file regardless of delta status. + # Payload enriched with 'new', schedule fields, and 'mode'. + if args.output_dir: os.makedirs(args.output_dir, exist_ok=True) _wout = os.path.join(args.output_dir, f"{a['job_id']}.json") with open(_wout, "w") as _wf: - _json.dump({"job_id": a["job_id"], "query": a["query"], - "results": a["results"]}, _wf, indent=2) + _json.dump({ + "job_id": a["job_id"], + "query": a.get("query", ""), + "new": a.get("new", False), + "result_count": a.get("result_count", 0), + "mode": a.get("mode", "threat_intel"), + "last_run": last_str, + "last_run_ts": last_run, + "next_run": next_str, + "results": a.get("results") or [], + }, _wf, indent=2) print(f" saved → {_wout}") + _n_saved += 1 + if args.output_dir: + print(f" Saved {_n_saved} file(s) to {args.output_dir!r}") # [2] v2.1.9: also list waiting (non-due) jobs so every job's health is # visible — not just the ones that ran today. _due_ids = {a["job_id"] for a in alerts} diff --git a/sicry.py b/sicry.py index d9fbd71..fe6db2d 100644 --- a/sicry.py +++ b/sicry.py @@ -2,7 +2,7 @@ # Copyright (c) 2026 JacobJandon — https://github.com/JacobJandon/Sicry from __future__ import annotations -__version__ = "2.1.9" +__version__ = "2.1.10" """ SICRY — Tor/Onion Network Access Layer for AI Agents diff --git a/sync_sicry.py b/sync_sicry.py index 0d92ee5..eefe770 100644 --- a/sync_sicry.py +++ b/sync_sicry.py @@ -62,7 +62,7 @@ def _fetch_sicry_tags() -> str: def main(): parser = argparse.ArgumentParser(description="Sync bundled sicry.py from upstream SICRY™") - parser.add_argument("--version", action="version", version="OnionClaw sync_sicry 2.1.9") + parser.add_argument("--version", action="version", version="OnionClaw sync_sicry 2.1.10") parser.add_argument("--tag", default="main", help="git ref / tag to fetch (default: main)") parser.add_argument("--dry-run", action="store_true", help="print what would happen without writing") parser.add_argument("--check-bundled", action="store_true",