Skip to content

docs: land architecture grilling corpus (ADRs 0001–0025)#45

Merged
NotAProfDev merged 11 commits into
mainfrom
docs/from-scratch-architecture
Jun 27, 2026
Merged

docs: land architecture grilling corpus (ADRs 0001–0025)#45
NotAProfDev merged 11 commits into
mainfrom
docs/from-scratch-architecture

Conversation

@NotAProfDev

@NotAProfDev NotAProfDev commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Closes #44

What

Lands the full from-scratch architecture grilling corpus on main:

  • ADRs 0001–0025 (docs/adr/) — topology, backend-agnostic Bus contract,
    event-sourced single-writer Core, strategy runtime, three-plane observability,
    frontend, numeric types, multi-broker Environments (0024), symbology (0025).
  • CONTEXT.md — ubiquitous-language glossary (InstrumentId, Symbol,
    Instrument, Account, Position, …).
  • Grilling spec (docs/superpowers/specs/) with the parked-questions list.

Why

main had none of the canonical ADRs, so README/CLAUDE docs/adr/* links dangled
and the first implementation step (oath-model) had nothing to cite. This unblocks
sequence step 2.

Notes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive glossary defining OATH’s canonical trading-engine terminology and constraints.
    • Added multiple architecture decision records covering system topology, message/BUS semantics, deterministic core design, strategy execution boundaries, risk/recovery, observability model, frontend control-plane behavior, and symbology/numeric model.
    • Added supporting design/reference notes and a workspace implementation plan for the updated crate/topology structure.
    • Updated expanded architecture documentation capturing the finalized “from-scratch” direction and resolved vs. remaining decisions.

NotAProfDev and others added 9 commits June 24, 2026 18:32
Capture the from-scratch architecture grilling: a single-host, multi-process, event-sourced design. ADRs 0001-0006 (topology, Bus, canonical model, risk control loop, single-writer Core, broker reconciliation) plus 0007 (binding time: no hot-path dyn), 0008 (single-owner Kernel + stateless Policies over a StateView, emitting Decisions into a sink), and 0009 (spine-inverted, process-aligned crate topology). CONTEXT.md holds the ubiquitous language; the grilling summary tracks parked questions and the remaining branches (B strategy runtime, C Frontend/CLI). The 0009 topology is the decided target; the crates are not yet restructured.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Close grilling Branch B (strategy runtime & multi-topic-join).

- ADR-0010: strategies are out-of-Core deterministic folds in Strategy
  Nodes (supersedes ADR-0001 co-location); capability-derived backtest
  fidelity (DetCtx/IoCtx), not a gate.
- ADR-0011: trading mode = (data feed x execution backend); Simulated
  Broker as an adapter backend; each mode an isolated Environment
  (Backtest/Shadow/Paper/Live); Core + Strategy mode-agnostic.
- ADR-0012: event-time-ordered fusion + latest-value view; per-Environment
  lateness bound L (L=0 live); ingestion-order logging for bit-exact
  session replay.
- ADR-0013: one push framework; Signal = idempotent target + freshness +
  StrategyId; two-part registration; fault isolation.

CONTEXT.md: sharpen Strategy/Strategy Node/Core/Signal; add Backtest and
the Execution environments section. Spec: status, parked leaves, Extism.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes Branch (C) of the from-scratch architecture grilling — three-plane observability (Business State / Domain Events / Telemetry) on a push-spine + narrow query; off-thread split egress; req/reply over the Bus (resolves the parked req/resp leaf); operational-only control with halt-via-risk; frontend-core library + two scopes + persistent session; host-OS trust boundary for MVP. Updates CONTEXT.md (Business State, Domain Event, Telemetry, Emergency Halt) and the grilling spec. All architecture branches now closed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Close the Bus-contract parked-question cluster from the from-scratch
architecture grilling.

- ADR-0020: Bus trait — two delivery classes (LatestValue keyed store /
  Reliable stream) x two access patterns; Serialize universal bound
  (zero-copy/POD a backend capability); loan-guard receive + three-boundary
  copy-out; publish(&M) + opt-in loan-to-write; (namespace, type, role,
  instance-key) identity with typed Key structs. Refines ADR-0002.
- ADR-0021: two-level routing (coarse backend shard + in-process demux).
- ADR-0022: Reliable order-path graduated failure; drain-fast adapter
  capability; risk-trip vs channel-death halt split. Amends ADR-0006/0017.
- docs/design/bus-backend-realization.md: per-backend mechanism reference.
- CONTEXT.md: add Source, LatestValue, Reliable; clarify Symbol.
- ADR-0002: refinement pointer; spec: mark cluster closed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Close the numeric-types parked question. Drop rust_decimal; Price/Quantity are
fixed-point always-i128 on the wire (Price signed, Quantity unsigned magnitude +
Side). Two-domain split (exact i128 / analytical f64, convert at the strategy
boundary); precision is instrument metadata, raw-only wire; money ops are checked
with widen-to-256 notional; layered float-determinism scope (refines ADR-0012).

Couples to the symbology thread (precision/tick/lot are instrument metadata).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Symbology grilling thread (ADR-0025): InstrumentId is the self-identifying
canonical identity (externally anchored ISIN/FIGI/OCC where it exists,
venue-qualified fallback, never guess a collapse); Symbol demoted to the venue
ticker; off-wire Instrument record keyed (InstrumentId, Source) is the single
home for ADR-0023 precision; fixed-size self-identifying name on the wire;
deterministic rule + curated mapping with a cross-Source price-plausibility
monitor; logged resolution + lifecycle (immutable id + logged succession,
corporate actions as Core inputs).

It reopened ADR-0011 -> ADR-0024: an Environment binds one-or-more
same-safety-class execution backends, so cross-broker risk is in-fold; shadow/
live/off is per-strategy targeting, not an in-Core tag.

Glossary gains InstrumentId, Instrument, Account, Position; Symbol redefined.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fd7d8807-0765-439a-ac79-49177a2b1d6d

📥 Commits

Reviewing files that changed from the base of the PR and between f20b61c and 796dc01.

📒 Files selected for processing (8)
  • docs/adr/0002-backend-agnostic-bus-canonical-message-model.md
  • docs/adr/0003-canonical-model-adapter-translation.md
  • docs/adr/0009-crate-topology-spine-inverted-process-aligned.md
  • docs/adr/0012-strategy-input-fusion-event-time-parity.md
  • docs/adr/0017-frontend-control-plane-operational-only.md
  • docs/adr/0020-bus-trait-delivery-classes-access-patterns.md
  • docs/adr/0024-environment-multi-broker-binding-shadow-targeting.md
  • docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md
✅ Files skipped from review due to trivial changes (5)
  • docs/adr/0009-crate-topology-spine-inverted-process-aligned.md
  • docs/adr/0020-bus-trait-delivery-classes-access-patterns.md
  • docs/adr/0024-environment-multi-broker-binding-shadow-targeting.md
  • docs/adr/0003-canonical-model-adapter-translation.md
  • docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/adr/0002-backend-agnostic-bus-canonical-message-model.md
  • docs/adr/0017-frontend-control-plane-operational-only.md
  • docs/adr/0012-strategy-input-fusion-event-time-parity.md

📝 Walkthrough

Walkthrough

Adds CONTEXT.md, ADRs 0001–0025, a bus backend realization note, an ADR-0009 implementation plan, and an architecture grilling spec. No executable code is changed.

Changes

OATH Architecture ADR Corpus

Layer / File(s) Summary
CONTEXT.md canonical glossary
CONTEXT.md
Adds a 320-line ubiquitous-language glossary defining domain primitives, process/topology roles, execution environments, messages/decisions, observability, persistence/recovery, and transport delivery semantics.
Core topology, bus, and event-sourced kernel ADRs (0001–0008)
docs/adr/0001-*.md, docs/adr/0002-*.md, docs/adr/0003-*.md, docs/adr/0004-*.md, docs/adr/0005-*.md, docs/adr/0006-*.md, docs/adr/0007-*.md, docs/adr/0008-*.md
Defines single-host multi-process topology, backend-agnostic Bus with canonical message model, adapter translation boundary, continuous risk control loop, single-writer event-sourced core with deterministic replay, broker reconciliation contract, compile-time binding rule, and single-owner Kernel with stateless Policies.
Crate topology ADR (0009)
docs/adr/0009-crate-topology-spine-inverted-process-aligned.md
Specifies the spine-inverted process-aligned crate layout, naming conventions, dependency-direction rules, and restructuring consequences.
Strategy, environment, and input fusion ADRs (0010–0013)
docs/adr/0010-*.md, docs/adr/0011-*.md, docs/adr/0012-*.md, docs/adr/0013-*.md
Establishes strategies as out-of-Core deterministic folds, per-environment isolation, event-time ordered input fusion with lateness handling, and push-based strategy runtime with Signal-as-target registration.
Observability, egress, and query ADRs (0014–0016)
docs/adr/0014-*.md, docs/adr/0015-*.md, docs/adr/0016-*.md
Defines three-plane observability across Core's deterministic boundary, off-thread split egress with per-payload delivery policies, and request/reply correlation over Bus pub/sub with query tiering.
Frontend control plane, architecture, and trust boundary ADRs (0017–0019)
docs/adr/0017-*.md, docs/adr/0018-*.md, docs/adr/0019-*.md
Specifies frontend as operational-only with a Supervisor-mediated kill-switch, a reusable frontend-core library with two observation scopes, and MVP trust boundary delegated to host OS permissions.
Bus trait, routing, and order-path failure (ADRs 0020–0022 + design note)
docs/adr/0020-*.md, docs/adr/0021-*.md, docs/adr/0022-*.md, docs/design/bus-backend-realization.md
Defines Bus trait delivery classes and typed routing model, two-level in-process demux, graduated failure ladder for Reliable order-topic overflow, and a backend realization mapping table across iceoryx2/Kafka/Zenoh/Aeron.
Numeric types, multi-broker environments, and symbology (ADRs 0023–0025)
docs/adr/0023-*.md, docs/adr/0024-*.md, docs/adr/0025-*.md
Establishes fixed-point i128/u128 numeric model replacing rust_decimal, multi-broker environment binding with shadow-as-targeting, and InstrumentId-centered symbology with off-wire Instrument reference data.
ADR-0009 implementation plan and architecture grilling spec
docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md, docs/superpowers/specs/2026-06-23-from-scratch-architecture-grilling.md
11-task crate-topology restructure plan with step-by-step workspace edits and verification steps, plus the grilling spec recording finalized ADR decisions, prior-art comparison, open branches, and parked sub-questions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #44 — This PR directly fulfills the issue's objective of landing ADRs 0001–0025, CONTEXT.md, the grilling spec, and the crate-topology plan onto main.
  • #39 — The crate-topology ADR-0009 and its 11-task implementation plan added here directly address the workspace reorganization scope described in that issue.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The added docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md plan is outside the linked issue's requested corpus. Remove or split out the implementation plan document unless it is explicitly required by the issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses a valid Conventional Commits docs prefix and accurately summarizes the ADR corpus landing.
Linked Issues check ✅ Passed The PR adds ADRs 0001–0025, CONTEXT.md, and the grilling spec, matching the linked issue requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/from-scratch-architecture

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/adr/0002-backend-agnostic-bus-canonical-message-model.md`:
- Around line 22-24: Update the payload contract wording in the ADR section so
it matches ADR-0020: in the canonical Bus model, describe the shared requirement
as Serialize only, and move any fixed-layout/POD/zero-copy language out of the
universal contract or rephrase it as backend-specific discipline. Keep the
wording consistent with the nearby refinement note and the canonical message
model section so the Bus contract is no longer self-contradictory.

In `@docs/adr/0003-canonical-model-adapter-translation.md`:
- Around line 16-19: Update the numeric-type example in the ADR text so it
matches the settled numeric-types decision and does not mention conflicting
alternatives like i64 or bignum. Keep the sentence generic about swappable inner
numeric types, or reference the actual fixed-point i128/u128 model used
elsewhere so the documentation stays consistent with the numeric-types ADR.

In `@docs/adr/0009-crate-topology-spine-inverted-process-aligned.md`:
- Around line 23-59: The crate layout tree in this ADR is missing a language tag
on the fenced block, so update the fence around the layout listing to use a text
code block. Keep the content unchanged and apply the fix in the documentation
snippet that contains the crate tree so markdownlint recognizes the block as
intentionally plain text.

In `@docs/adr/0012-strategy-input-fusion-event-time-parity.md`:
- Around line 7-11: Clarify the latency guarantee in the strategy input fusion
ADR by updating the paragraph around the lateness bound L so it does not imply
zero buffering latency for all values of L. In the relevant text about
configurable per-Environment lateness and the live decision path, make it
explicit that no buffering latency applies only when L = 0 for latency-critical
Live, while L > 0 may introduce buffering; keep the references to ingestion
order and replay behavior intact.

In `@docs/adr/0017-frontend-control-plane-operational-only.md`:
- Around line 13-16: Clarify the Supervisor halt flow so the effectful trip and
the recorded “halt as-of seq N” fact are described as a durable, atomic boundary
rather than “then emits” semantics. Update the wording in the ADR section
referenced by the Supervisor/Event Log description to state that the halt action
is only considered committed once the log fact is durably recorded, or otherwise
make clear the replay claim does not rely on a crash-prone gap between trip and
append.

In `@docs/adr/0020-bus-trait-delivery-classes-access-patterns.md`:
- Around line 21-29: The bus-trait wording in the ADR conflates the general
`Serialize`-only message allowance with a boundary rule that sounds like it
requires `M: Copy` at every loan boundary. Update the “Receive is a loan guard”
and boundary explanation in the ADR to state that non-`Copy` payloads are still
valid on the public API, and that only the act of crossing retention, thread
hand-off, or `.await` requires copying out to an owned value when the payload is
copyable or otherwise materializing ownership before the loan is dropped. Refer
to the `Sample<M>` loan-guard description and the boundary rule paragraph so the
contract is consistent throughout.

In `@docs/adr/0024-environment-multi-broker-binding-shadow-targeting.md`:
- Around line 15-21: The ADR text is using Symbol in the cross-broker
risk/position semantics where InstrumentId should be used instead; update the
affected wording in the risk-fold and position-keying sections to consistently
reference InstrumentId instead of Symbol. Make the terminology change throughout
the relevant clauses in this document, including the statement about positions
being keyed by (Account, InstrumentId) and any mentions of global per-identifier
tracking or cross-asset budget rules, so the language aligns with ADR-0025.

In `@docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md`:
- Around line 1458-1475: The literal package-name output blocks in this ADR
should be marked as text rather than left as untagged code fences. Update the
expected-output snippets in the affected section, including the final
package-path block, by adding the text language tag so the markdownlint warning
is resolved and the intent is clear. Use the surrounding fenced blocks in the
document to locate the snippets and apply the same change consistently.
- Around line 1324-1351: The Mermaid dependency graph is missing the direct
ooth-model edges for the core and strategy host crates, so update the graph in
the topology ADR to match the dependency table. Add the omitted links involving
oath-core and oath-strategy-host, using the existing Mermaid node symbols such
as core, kernel, risk, exe, por, strathost, and model, and keep the surrounding
explanatory note consistent with the corrected graph.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7f3fd1c9-20f9-4a3f-aa69-2fbe93fe32ac

📥 Commits

Reviewing files that changed from the base of the PR and between c517ee4 and f20b61c.

📒 Files selected for processing (29)
  • CONTEXT.md
  • docs/adr/0001-single-host-multi-process-topology.md
  • docs/adr/0002-backend-agnostic-bus-canonical-message-model.md
  • docs/adr/0003-canonical-model-adapter-translation.md
  • docs/adr/0004-risk-as-continuous-control-loop.md
  • docs/adr/0005-single-writer-event-sourced-core.md
  • docs/adr/0006-broker-reconciliation-contract.md
  • docs/adr/0007-binding-time-runtime-pluggable-iff-cross-process.md
  • docs/adr/0008-single-owner-kernel-stateless-policies.md
  • docs/adr/0009-crate-topology-spine-inverted-process-aligned.md
  • docs/adr/0010-strategies-out-of-core-deterministic-folds.md
  • docs/adr/0011-execution-environments-mode-isolation.md
  • docs/adr/0012-strategy-input-fusion-event-time-parity.md
  • docs/adr/0013-strategy-runtime-push-signal-target-registration.md
  • docs/adr/0014-observability-three-planes-deterministic-boundary.md
  • docs/adr/0015-off-thread-split-egress-observable-outputs.md
  • docs/adr/0016-request-reply-over-bus-query-tiering.md
  • docs/adr/0017-frontend-control-plane-operational-only.md
  • docs/adr/0018-frontend-architecture-scopes-library-session.md
  • docs/adr/0019-frontend-trust-boundary-host-os-mvp.md
  • docs/adr/0020-bus-trait-delivery-classes-access-patterns.md
  • docs/adr/0021-two-level-routing-in-process-demux.md
  • docs/adr/0022-reliable-order-path-graduated-failure.md
  • docs/adr/0023-numeric-types-fixed-point-exact-analytical-split.md
  • docs/adr/0024-environment-multi-broker-binding-shadow-targeting.md
  • docs/adr/0025-symbology-instrument-id-reference-data.md
  • docs/design/bus-backend-realization.md
  • docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md
  • docs/superpowers/specs/2026-06-23-from-scratch-architecture-grilling.md

Comment thread docs/adr/0002-backend-agnostic-bus-canonical-message-model.md Outdated
Comment thread docs/adr/0003-canonical-model-adapter-translation.md Outdated
Comment thread docs/adr/0009-crate-topology-spine-inverted-process-aligned.md Outdated
Comment thread docs/adr/0012-strategy-input-fusion-event-time-parity.md
Comment thread docs/adr/0017-frontend-control-plane-operational-only.md Outdated
Comment thread docs/adr/0020-bus-trait-delivery-classes-access-patterns.md
Comment thread docs/adr/0024-environment-multi-broker-binding-shadow-targeting.md
Comment thread docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md
Comment thread docs/superpowers/plans/2026-06-27-crate-topology-adr-0009.md Outdated
NotAProfDev and others added 2 commits June 27, 2026 18:38
Address internal cross-ADR inconsistencies surfaced in review:

- 0002: payload contract is `Serialize`-only; POD is backend-specific
  zero-copy discipline (ADR-0020), not the universal Bus contract.
- 0003: drop stale `i64`/bignum numeric example; point at the settled
  fixed-point `i128`/`u128` model (ADR-0023).
- 0012: clarify that the live path is buffering-free only when `L = 0`;
  `L > 0` buffers up to `L`.
- 0017: record the "halt as-of seq N" fact before/with the effectful
  trip so the deterministic-replay claim survives a crash window.
- 0020: loan boundary materializes to an owned payload; `Copy` POD is a
  backend fast-path discipline, not a public-API bound.
- 0024: key risk/positions by `InstrumentId`, not `Symbol` (demoted to a
  venue ticker by ADR-0025), so cross-broker collapse holds.
- 0009 + crate-topology plan: tag plain-text fences as `text`; add the
  missing `oath-model` edges for `oath-core`/`oath-strategy-host` so the
  Mermaid graph matches the dependency table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@NotAProfDev NotAProfDev merged commit 797a70c into main Jun 27, 2026
5 checks passed
@NotAProfDev NotAProfDev deleted the docs/from-scratch-architecture branch June 27, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: land architecture grilling corpus (ADRs 0001–0025) on main

1 participant