Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Empty file added backend/__init__.py
Empty file.
483 changes: 483 additions & 0 deletions backend/api_contract.py

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions diagnostic/build-00000000.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"generated_at": "2026-06-16T15:23:47.496569+00:00",
"generated_at": "2026-06-25T21:15:13.117438+00:00",
"commit": "00000000",
"diagnostic_logd": "diagnostic/build-00000000.logd",
"diagnostic_logd_error": null,
"chunked": false,
"chunk_size_bytes": null,
"password": "4c7df15ab09fbb066197",
"decrypt_command": "encryptly unpack diagnostic/build-00000000.logd <outdir> --password 4c7df15ab09fbb066197",
"password": "63d10be85f6e9134f0d0",
"decrypt_command": "encryptly unpack diagnostic/build-00000000.logd <outdir> --password 63d10be85f6e9134f0d0",
"total_modules": 1,
"passed": 0,
"failed": 1,
"modules": [
{
"name": "frailbox",
"name": "backend",
"status": "FAIL",
"elapsed_seconds": 0,
"artifact": null,
"output": "Command not found: [Errno 2] No such file or directory: 'make'"
"output": "Command not found: [Errno 2] No such file or directory: 'cargo'"
}
],
"pr_note": "Include this JSON diagnostic report and diagnostic/build-00000000.logd in your PR. Maintainers may ask you to remove these diagnostic artifacts before merging."
"pr_note": "Include the encrypted diagnostic logd artifact(s): diagnostic/build-00000000.logd. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
Binary file modified diagnostic/build-00000000.logd
Binary file not shown.
Empty file added tests/__init__.py
Empty file.
Empty file added tests/backend_api/__init__.py
Empty file.
60 changes: 60 additions & 0 deletions tests/backend_api/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""Shared fixtures for backend API contract edge-case tests."""

from __future__ import annotations

import pytest

from backend.api_contract import (
MessageEnvelope,
PROTOCOL_VERSION,
MIN_COMPATIBLE_VERSION,
MAX_MESSAGE_SIZE,
)


@pytest.fixture
def valid_order_payload():
return {
"side": "buy",
"type": "limit",
"quantity": 10.0,
"price": 150.25,
"time_in_force": "gtc",
}


@pytest.fixture
def valid_market_order_payload():
return {
"side": "sell",
"type": "market",
"quantity": 5.0,
}


@pytest.fixture
def valid_account_payload():
return {
"amount": 1000.00,
"currency": "USD",
}


@pytest.fixture
def valid_envelope():
return MessageEnvelope(
message_id=0x2001,
message_type=0x01,
schema_version=PROTOCOL_VERSION,
timestamp=1700000000000,
payload=b"{}",
)


@pytest.fixture
def minimal_envelope():
return MessageEnvelope(
message_id=0x5001,
message_type=0x01,
schema_version=PROTOCOL_VERSION,
)
Loading