Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__/
*.pyc
.mypy_cache/
.venv/
.env
*.egg-info/
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/test_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 6 additions & 7 deletions fetch_shahnameh_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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] = {
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand All @@ -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__':
Expand Down
13 changes: 6 additions & 7 deletions fetch_shahnameh_improved.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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__':
Expand Down
15 changes: 7 additions & 8 deletions fetch_shahnameh_smart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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]:
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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__':
Expand Down
4 changes: 4 additions & 0 deletions institutio/governance/undeclared-params-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions organs/financial/consolidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import os
import re
import sys
from collections import defaultdict
from datetime import datetime, timezone, timedelta
from pathlib import Path

Expand Down Expand Up @@ -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} |")
Expand Down Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion organs/social/validate-social.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 0 additions & 1 deletion patch_heartbeat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
with open('/tmp/atlas_worktree/scripts/heartbeat-loop.sh', 'r') as f:
lines = f.readlines()

Expand Down
1 change: 0 additions & 1 deletion patch_heartbeat_c.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
with open('/tmp/atlas_worktree/scripts/heartbeat-loop.sh', 'r') as f:
lines = f.readlines()

Expand Down
2 changes: 1 addition & 1 deletion scripts/agent-code-review-queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/agent-reconstruction-review.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion scripts/agent-session-full-stack-review.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import os
import re
import sqlite3
import sys
import unicodedata
from collections import Counter, defaultdict
from pathlib import Path
Expand Down
1 change: 0 additions & 1 deletion scripts/overnight-watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import os
import re
import subprocess
import sys
import time
from pathlib import Path
from typing import Any
Expand Down
2 changes: 1 addition & 1 deletion scripts/vltima-prior-excavations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down