Architecture summary

Aikido architecture

This document summarizes the implemented system, the locked target architecture, and the migration boundary between them. It does not replace the versioned architecture documents in the repository.

1. Target flow

Git
  code, schemas, versioned contracts

market + discovery          research_control
  facts + evidence           queues + operational boards
        |                              |
        +-------------+----------------+
                      |
                      v
             pack compiler / publication
                      |
                      v
            immutable PolicyStatePack
                      |
                      v
PolicyStatePack -> Policy -> RequestedTargetExposure
                                      |
                                      v
                             Runtime / Realizer
                                      |
                                      v
                              ExecutionReport
                                      |
                                      v
                           Evaluation / EpisodeResult

Point-in-time compilation occurs at one publication boundary. Once a pack is loaded, policy and runtime do not depend on live warehouse reads. Policy produces intent; runtime applies executable mechanics; evaluation judges realized outcomes.

2. Authority model

The architecture distinguishes three forms of authority:

QuestionAuthorityIncludes
What research evidence exists? discovery Config payloads, exact evaluations, trades, daily evidence, provenance
What was available to policy? Frozen PolicyStatePack Decision-time slice, cutoff, identity, hashes, lineage, allowed context
What actually happened? Runtime and evaluator output Executable state, fills, account ledger, drawdown, episode outcome

Scores, dashboards, mutable current views, compatibility snapshots, and leaderboards are projections. They are not substitutes for one of these authority surfaces.

3. Current implementation

ConcernCurrent surfaceTarget roleStatus
Market facts Legacy and market.* compatibility surfaces market Converging
Signal research evidence discovery.signal_* and legacy discovery surfaces discovery Converging
Research operations research_control jobs, plans, and boards Operational control plane Aligned
Decision publication Pack registry, manifests, builders, and active pointer Single pack compiler and publication boundary Converging
Policy and simulation policy-kernel, policy-sim, policy-sim-env Pack input to requested exposure Converging
Realization and accounting Runtime and shared simulation/evaluation components One execution and account truth core Converging
Historical PIT snapshots portfolio.snapshot* and compatibility views Optional rebuildable cache only Transitional

4. Core contracts

Policy input and output

PolicyStatePack -> Policy -> RequestedTargetExposure

The policy state pack is an immutable point-in-time input. The policy output expresses desired exposure; it is not a fill or an account fact.

Runtime realization and audit

RequestedTargetExposure
    -> ExecutableExposure
    -> RealizedExecutionState
    -> ExecutionReport

Contract binding, rounding, continuity, fill representation, and accounting belong to the realizer. Policy-specific selection or sizing logic does not.

Evaluation

ExecutionReport + account path -> EpisodeResult -> promotion gates

Only realized runtime/evaluator output can support claims about deployability. Research-screening scores and constituent-level results cannot substitute for account-path replay.

5. Storage roles

Git
Code, schemas, contracts, documentation, and deliberately reviewed small manifests.
ClickHouse
Market facts, canonical research evidence, and large immutable warehouse data.
Postgres
Queues, operational control state, publication pointers, deployment state, and runtime coordination.
Artifact storage
Immutable generated pack payloads, manifests, checksums, and lineage sidecars.

Postgres is not a second research warehouse. ClickHouse is not a hot decision-loop dependency. Git is not used as bulk evidence storage.

6. Runtime and research invariants

7. Migration order

  1. Keep the target boundaries and authority rules fixed.
  2. Ground research inventory and boards in canonical discovery evidence.
  3. Move one real baseline end to end through the frozen pack contract.
  4. Demonstrate parity with the legacy scheduled path using realized outcomes.
  5. Move downstream consumers from live PIT reads to pack consumption.
  6. Drain or minimize transitional portfolio.* surfaces.
  7. Continue converging runtime, simulation, and evaluation on one truth core.

Source documents