Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.
Closed
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
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run test suite
working-directory: kernel/tests
run: python -m unittest discover -s . -p 'test_*.py' -v
run: |
export PYTHONPATH=.
python quickstart.py --init-only
touch kernel/authority_queue.json kernel/court_records.json economy/transactions.jsonl economy/revenue.json
python -m unittest discover kernel/tests -v

- name: Run governance simulation
run: python examples/simulate_governance.py
4 changes: 4 additions & 0 deletions kernel/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,8 @@ def snapshot(self, *, bound_org_id='', admission_registry=None):


def _default_http_post_json(url, data):
if not url.lower().startswith(('http://', 'https://')):
raise FederationDeliveryError('Invalid URL scheme: must be http or https')
request = urllib.request.Request(
url,
data=json.dumps(data).encode('utf-8'),
Expand All @@ -1080,6 +1082,8 @@ def _default_http_post_json(url, data):


def _default_http_get_json(url):
if not url.lower().startswith(('http://', 'https://')):
raise FederationDeliveryError('Invalid URL scheme: must be http or https')
request = urllib.request.Request(url, method='GET')
try:
with urllib.request.urlopen(request, timeout=10) as response:
Expand Down
2 changes: 2 additions & 0 deletions kernel/treasury.py
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,8 @@ def _json_rpc_request(rpc_url, method, params=None, *, timeout_seconds=10):
rpc_url = str(rpc_url or '').strip()
if not rpc_url:
raise ValueError('rpc_url is required')
if not rpc_url.lower().startswith(('http://', 'https://')):
raise ValueError('Invalid RPC URL scheme: must be http or https')
payload = {
'jsonrpc': '2.0',
'id': f'rpc_{uuid.uuid4().hex[:12]}',
Expand Down
2 changes: 2 additions & 0 deletions kernel/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,8 @@ def _federation_claims_dict(claims):
return dict(claims)
if hasattr(claims, 'to_dict'):
return claims.to_dict()
if hasattr(claims, '__dict__'):
return vars(claims)
return {}


Expand Down
Loading