diff --git a/.gitignore b/.gitignore index bf74a4a2d..8a77ae309 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ __pycache__/ *.pyc +.mypy_cache/ .venv/ .env *.egg-info/ diff --git a/cli/tests/test_dispatch.py b/cli/tests/test_dispatch.py index 6ccc2af8f..263059dd3 100644 --- a/cli/tests/test_dispatch.py +++ b/cli/tests/test_dispatch.py @@ -116,7 +116,7 @@ def test_github_actions_lane_requires_configured_workflow(tmp_path: Path, monkey gh = tmp_path / "gh" gh.write_text( "#!/bin/sh\n" - "if [ \"$1\" = workflow ] && [ \"$2\" = view ]; then\n" + 'if [ "$1" = workflow ] && [ "$2" = view ]; then\n' " echo 'workflow missing' >&2\n" " exit 1\n" "fi\n" diff --git a/fetch_shahnameh_full.py b/fetch_shahnameh_full.py index 4f785bd23..ee6cc9ef3 100644 --- a/fetch_shahnameh_full.py +++ b/fetch_shahnameh_full.py @@ -6,13 +6,12 @@ import urllib.request import urllib.error -import json import time import sys import re from pathlib import Path from html.parser import HTMLParser -from typing import List, Dict, Optional +from typing import Dict, Optional class PoetryExtractor(HTMLParser): """Extract poetry lines from ganjoor.net HTML.""" @@ -196,9 +195,9 @@ def fetch_all_cycles(self) -> Dict[str, str]: print(f"✓ ({len(content):6d} chars)", file=sys.stderr) break else: - print(f"~ (HTML fetched, low content)", file=sys.stderr, end='\r') + print("~ (HTML fetched, low content)", file=sys.stderr, end='\r') else: - print(f"✗ (no/low HTML)", file=sys.stderr, end='\r') + print("✗ (no/low HTML)", file=sys.stderr, end='\r') if content: self.fetched_content[slug] = { @@ -225,7 +224,7 @@ def save_to_file(self, output_path: Path, include_metadata=True) -> bool: f.write("=" * 80 + "\n") f.write("شاهنامه فردوسی - Shahnameh of Ferdowsi\n") f.write("Complete Persian Original Text\n") - f.write(f"Fetched from: https://ganjoor.net/ferdousi/shahname/\n") + f.write("Fetched from: https://ganjoor.net/ferdousi/shahname/\n") f.write(f"Date: {time.strftime('%Y-%m-%d')}\n") f.write(f"Cycles fetched: {len(self.fetched_content)}/50\n") f.write("=" * 80 + "\n\n") @@ -279,7 +278,7 @@ def main(): if fetcher.save_to_file(output_path): # Check file size file_size = output_path.stat().st_size - print(f"✓ Successfully saved Shahnameh corpus", file=sys.stderr) + print("✓ Successfully saved Shahnameh corpus", file=sys.stderr) print(f" File size: {file_size:,} bytes ({file_size/1024/1024:.2f} MB)", file=sys.stderr) # Report stats @@ -289,7 +288,7 @@ def main(): return 0 else: - print(f"✗ Failed to save Shahnameh corpus", file=sys.stderr) + print("✗ Failed to save Shahnameh corpus", file=sys.stderr) return 1 if __name__ == '__main__': diff --git a/fetch_shahnameh_improved.py b/fetch_shahnameh_improved.py index 44efe8564..251a7a951 100644 --- a/fetch_shahnameh_improved.py +++ b/fetch_shahnameh_improved.py @@ -6,12 +6,11 @@ import urllib.request import urllib.error -import json import time import sys import re from pathlib import Path -from typing import List, Dict, Optional +from typing import Dict, Optional class GanjoorFetcher: """Fetch Shahnameh with improved Persian text extraction.""" @@ -124,7 +123,7 @@ def discover_and_fetch(self) -> Dict[str, str]: return {} print(f"✓ Discovered {len(urls)} cycles", file=sys.stderr) - print(f"Fetching and extracting Persian text...\n", file=sys.stderr) + print("Fetching and extracting Persian text...\n", file=sys.stderr) # Fetch each cycle for idx, path in enumerate(sorted(urls), 1): @@ -161,7 +160,7 @@ def save_to_file(self, output_path: Path) -> bool: f.write("=" * 80 + "\n") f.write("شاهنامه فردوسی\n") f.write("Shahnameh of Ferdowsi — Complete Persian Original Text\n") - f.write(f"Source: https://ganjoor.net/ferdousi/shahname/\n") + f.write("Source: https://ganjoor.net/ferdousi/shahname/\n") f.write(f"Fetched: {time.strftime('%Y-%m-%d %H:%M:%S')}\n") f.write(f"Cycles: {len(self.fetched_content)}\n") f.write(f"Total Characters: {sum(d['size'] for d in self.fetched_content.values()):,}\n") @@ -198,16 +197,16 @@ def main(): file_size = output_path.stat().st_size total_chars = sum(d['size'] for d in fetcher.fetched_content.values()) - print(f"\n✓ Successfully saved to:") + print("\n✓ Successfully saved to:") print(f" {output_path}", file=sys.stderr) - print(f"\nStats:", file=sys.stderr) + print("\nStats:", file=sys.stderr) print(f" File size: {file_size:,} bytes ({file_size/1024/1024:.2f} MB)", file=sys.stderr) print(f" Total Persian text: {total_chars:,} characters", file=sys.stderr) print(f" Cycles: {len(content)}", file=sys.stderr) return 0 else: - print(f"✗ Failed to save", file=sys.stderr) + print("✗ Failed to save", file=sys.stderr) return 1 if __name__ == '__main__': diff --git a/fetch_shahnameh_smart.py b/fetch_shahnameh_smart.py index 231841c0c..83a0be890 100644 --- a/fetch_shahnameh_smart.py +++ b/fetch_shahnameh_smart.py @@ -6,12 +6,11 @@ import urllib.request import urllib.error -import json import time import sys import re from pathlib import Path -from typing import List, Dict, Optional, Tuple +from typing import Dict, Optional class GanjoorFetcher: """Fetch Shahnameh content from ganjoor.net.""" @@ -33,9 +32,9 @@ def fetch_html(self, path: str) -> Optional[str]: req = urllib.request.Request(url, headers=self.session_headers) with urllib.request.urlopen(req, timeout=20) as response: return response.read().decode('utf-8', errors='replace') - except urllib.error.HTTPError as e: + except urllib.error.HTTPError: return None - except Exception as e: + except Exception: return None def discover_shahnameh_urls(self) -> Dict[str, str]: @@ -157,7 +156,7 @@ def save_to_file(self, output_path: Path) -> bool: f.write("=" * 80 + "\n") f.write("شاهنامه فردوسی\n") f.write("Shahnameh of Ferdowsi - Complete Persian Original Text\n") - f.write(f"Source: https://ganjoor.net/ferdousi/shahname/\n") + f.write("Source: https://ganjoor.net/ferdousi/shahname/\n") f.write(f"Fetched: {time.strftime('%Y-%m-%d %H:%M:%S')}\n") f.write(f"Cycles: {len(self.fetched_content)} fetched\n") f.write("=" * 80 + "\n\n") @@ -196,20 +195,20 @@ def main(): if fetcher.save_to_file(output_path): file_size = output_path.stat().st_size - print(f"✓ Successfully saved Shahnameh corpus", file=sys.stderr) + print("✓ Successfully saved Shahnameh corpus", file=sys.stderr) print(f" File size: {file_size:,} bytes ({file_size/1024/1024:.2f} MB)", file=sys.stderr) total_chars = sum(d['size'] for d in fetcher.fetched_content.values()) print(f" Total text: {total_chars:,} characters", file=sys.stderr) # List all discovered cycles - print(f"\n Cycles fetched:", file=sys.stderr) + print("\n Cycles fetched:", file=sys.stderr) for idx, slug in enumerate(sorted(fetcher.fetched_content.keys()), 1): print(f" {idx:2d}. {slug}", file=sys.stderr) return 0 else: - print(f"✗ Failed to save", file=sys.stderr) + print("✗ Failed to save", file=sys.stderr) return 1 if __name__ == '__main__': diff --git a/institutio/governance/undeclared-params-baseline.txt b/institutio/governance/undeclared-params-baseline.txt index 37c54aca7..84d7a669f 100644 --- a/institutio/governance/undeclared-params-baseline.txt +++ b/institutio/governance/undeclared-params-baseline.txt @@ -107,6 +107,8 @@ LIMEN_GEMINI_OAUTH LIMEN_GEN_MAX LIMEN_GH_OWNER LIMEN_GITHUB_ACTIONS_BIN +LIMEN_GITHUB_ACTIONS_HEALTH_REPO +LIMEN_GITHUB_ACTIONS_REPO LIMEN_GITHUB_ACTIONS_WORKFLOW LIMEN_GITHUB_API LIMEN_GITHUB_BRANCH @@ -139,6 +141,7 @@ LIMEN_LOCAL_LIMIT LIMEN_LOOP_MAX LIMEN_LOOP_MIN LIMEN_MAIL_DRAFTS +LIMEN_MAIL_ENVELOPE_INDEX LIMEN_MAIL_SWEEP LIMEN_MAIL_SWEEP_LIMIT LIMEN_MAX_AGENT_CALLS @@ -188,6 +191,7 @@ LIMEN_POSITIONING LIMEN_POSITIONING_DIR LIMEN_POSITIONING_SEEDS LIMEN_POSITIONING_TIMEOUT +LIMEN_PRIVATE_MAIL_STORY LIMEN_PROBE_CLIENT_TOKEN LIMEN_PROBE_OWNER_TOKEN LIMEN_PROBE_PORT diff --git a/organs/financial/consolidate.py b/organs/financial/consolidate.py index 3681a67bc..1b171a6d1 100644 --- a/organs/financial/consolidate.py +++ b/organs/financial/consolidate.py @@ -25,7 +25,6 @@ import os import re import sys -from collections import defaultdict from datetime import datetime, timezone, timedelta from pathlib import Path @@ -284,7 +283,7 @@ def build_balance_sheet( if nw is not None: lines.append("### Net Worth Summary") lines.append("") - lines.append(f"| | Amount |") + lines.append("| | Amount |") lines.append("|---|---|") lines.append(f"| Total Assets | ${total_a:,.2f} |") lines.append(f"| Total Liabilities | ${total_l:,.2f} |") @@ -512,7 +511,7 @@ def build_dashboard( lines.append(f"- **Net worth:** {nw_str}{trend}") lines.append(f"- **Balance snapshots:** {sc}") lines.append( - f"- **First dollar path:** ChatGPT Exporter → MONETA/Ko-fi (deploy-ready, principal-gated)" + "- **First dollar path:** ChatGPT Exporter → MONETA/Ko-fi (deploy-ready, principal-gated)" ) lines.append("") lines.append("## Artifacts") diff --git a/organs/social/validate-social.py b/organs/social/validate-social.py index 5d0ee77b7..956b0c5fe 100755 --- a/organs/social/validate-social.py +++ b/organs/social/validate-social.py @@ -96,7 +96,6 @@ def _validate_one(path: Path) -> list[str]: "Rule #2 violation: governance.never_autonomous must list forbidden autonomous acts" ) - standard = doc.get("standard") evidence = doc.get("artifacts", {}).get("evidence") if isinstance(doc.get("artifacts"), dict) else None if not isinstance(evidence, list) or not evidence: violations.append("Rule #4 violation: artifacts.evidence must list at least one evidence item") diff --git a/patch_heartbeat.py b/patch_heartbeat.py index ca1c7a184..d74b68088 100644 --- a/patch_heartbeat.py +++ b/patch_heartbeat.py @@ -1,4 +1,3 @@ -import sys with open('/tmp/atlas_worktree/scripts/heartbeat-loop.sh', 'r') as f: lines = f.readlines() diff --git a/patch_heartbeat_c.py b/patch_heartbeat_c.py index e1e6350c9..d93e40478 100644 --- a/patch_heartbeat_c.py +++ b/patch_heartbeat_c.py @@ -1,4 +1,3 @@ -import sys with open('/tmp/atlas_worktree/scripts/heartbeat-loop.sh', 'r') as f: lines = f.readlines() diff --git a/scripts/agent-code-review-queue.py b/scripts/agent-code-review-queue.py index 424287ecd..93513b4ae 100644 --- a/scripts/agent-code-review-queue.py +++ b/scripts/agent-code-review-queue.py @@ -14,7 +14,7 @@ import os import re import subprocess -from collections import Counter, defaultdict +from collections import Counter from pathlib import Path from typing import Any diff --git a/scripts/agent-reconstruction-review.py b/scripts/agent-reconstruction-review.py index a1a66d128..8a80cfd26 100644 --- a/scripts/agent-reconstruction-review.py +++ b/scripts/agent-reconstruction-review.py @@ -13,7 +13,7 @@ import json import os import subprocess -from collections import Counter, defaultdict +from collections import Counter from pathlib import Path from typing import Any diff --git a/scripts/agent-session-full-stack-review.py b/scripts/agent-session-full-stack-review.py index 693c05cb5..92f84990c 100644 --- a/scripts/agent-session-full-stack-review.py +++ b/scripts/agent-session-full-stack-review.py @@ -14,7 +14,6 @@ import os import re import sqlite3 -import sys import unicodedata from collections import Counter, defaultdict from pathlib import Path diff --git a/scripts/overnight-watch.py b/scripts/overnight-watch.py index 1ccf08641..7571bb57d 100755 --- a/scripts/overnight-watch.py +++ b/scripts/overnight-watch.py @@ -16,7 +16,6 @@ import os import re import subprocess -import sys import time from pathlib import Path from typing import Any diff --git a/scripts/vltima-prior-excavations.py b/scripts/vltima-prior-excavations.py index dd6f20503..a6657c606 100644 --- a/scripts/vltima-prior-excavations.py +++ b/scripts/vltima-prior-excavations.py @@ -19,7 +19,7 @@ import os import re from collections import Counter -from dataclasses import dataclass, field +from dataclasses import dataclass from pathlib import Path from typing import Any