marketcompiler-verifiable-d.../AGENTS.md

1.7 KiB

Agents and Architecture

  • Language: Python (production-ready, packaging via pyproject.toml)
  • Core concepts:
    • LocalProblem: DSL-typed description of assets, objectives, and constraints for a portfolio/strategy task.
    • PlanDelta: incremental updates to a LocalProblem, with cryptographic tags for provenance.
    • AuditLog: cryptographic attestations of decisions and transformations.
    • Signer: simple HMAC-based signer to prove integrity of plan deltas (no external dependencies).
    • Adapters: pluggable interfaces that translate device-specific data into the canonical IR and perform actions (readState, exposeLocalProblemData, applyCommand).
    • Graph-of-Contracts registry: lightweight in-process registry tracking adapters and contract versions.
    • Backtester: deterministic simulator to validate learned strategies against historical data in offline mode.

Repo structure

  • marketcompiler_verifiable_dsl_edge_compi/
    • init.py
    • core.py # DSL data models (LocalProblem, PlanDelta, AuditLog)
    • signer.py # Sign/verify utilities (HMAC-based)
    • adapters.py # AbstractAdapter + two starter adapters (PriceFeedAdapter, MockBrokerAdapter)
    • registry.py # Graph-of-Contracts (registry) and contract/version storage
    • backtest.py # Simple offline backtester tests/
  • test_core.py # Core unit tests for serialization, signing, and backtesting
  • init.py

Development workflow

  • Run tests with: ./test.sh
  • Publish planning artifacts once tests pass and READY_TO_PUBLISH is present.

Notes

  • This is a skeleton MVP. It intentionally emphasizes portability, auditability, and offline testing while keeping the implementation approachable for extension.