44eb6436c1
Sostituisce la grammatica S-expression con uno schema JSON stretto. La grammatica S-expression falliva il parsing nel 64% delle generazioni del modello Qwen3-235B sul run reale; JSON e' nativo per gli LLM moderni e si parsa con json.loads. Cambiamenti principali: - grammar.py: costanti rinominate LOGICAL_OPS / COMPARATOR_OPS / CROSSOVER_OPS / ACTION_VALUES / KIND_VALUES. - parser.py: nuovo AST a dataclass tipizzato (OpNode, IndicatorNode, FeatureNode, LiteralNode, Rule, Strategy); parse_strategy ora consuma JSON tramite json.loads. - validator.py: walk dispatchato per tipo (isinstance) invece di pattern-matching su 'kind'; arity check su operatori e indicator. - compiler.py: traversal del nuovo AST tipizzato, dispatch per isinstance; logica indicator/feature/literal invariata. - hypothesis.py: prompt SYSTEM riscritto con esempi JSON e vincoli espliciti su no-nesting; estrazione via fence ```json``` + fallback brace-balanced. - __init__.py: re-export pubblico delle entita' del protocollo. - Tutti i test (parser, validator, compiler, hypothesis_agent, falsification, adversarial, e2e, smoke_run) migrati a JSON. - Rimossa dipendenza sexpdata da pyproject.toml + uv.lock. Test: 135 passed (era 122; aggiunti casi parser/validator). ruff + mypy strict clean. Smoke run end-to-end OK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
60 lines
1.2 KiB
TOML
60 lines
1.2 KiB
TOML
[project]
|
|
name = "multi-swarm"
|
|
version = "0.1.0"
|
|
description = "Multi-Swarm Coevolutive PoC trading swarm — Phase 1 lean spike"
|
|
authors = [{ name = "Adriano Dal Pastro", email = "adrianodalpastro@tielogic.com" }]
|
|
requires-python = ">=3.13"
|
|
dependencies = [
|
|
"pandas>=2.2",
|
|
"numpy>=2.1",
|
|
"scipy>=1.14",
|
|
"pydantic>=2.9",
|
|
"pydantic-settings>=2.6",
|
|
"sqlmodel>=0.0.22",
|
|
"openai>=1.55",
|
|
"httpx>=0.28",
|
|
"requests>=2.32",
|
|
"tenacity>=9.0",
|
|
"pyyaml>=6.0",
|
|
"streamlit>=1.40",
|
|
"plotly>=5.24",
|
|
"pyarrow>=18.0",
|
|
]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=8.3",
|
|
"pytest-mock>=3.14",
|
|
"pytest-asyncio>=0.24",
|
|
"responses>=0.25",
|
|
"ruff>=0.7",
|
|
"mypy>=1.13",
|
|
"types-requests>=2.32",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/multi_swarm"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py313"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "I", "N", "UP", "B", "RUF"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.13"
|
|
strict = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
addopts = "-v --tb=short"
|
|
markers = [
|
|
"integration: tests that require external services (Cerbero, LLM API)",
|
|
"slow: tests that take more than 5 seconds",
|
|
]
|