embassy_sec_edgar/lib.rs
1// Copyright 2024-2026 Reflective Labs
2// SPDX-License-Identifier: MIT
3
4//! SEC EDGAR port — US Securities and Exchange Commission filings.
5//!
6//! Sovereign integration in the embassy sense: EDGAR's contract is
7//! *part of the API surface*, not implementation detail. Specifically:
8//!
9//! - **User-Agent required** — anonymous requests are blocked; the SEC
10//! requires a recognizable Reflective Labs research UA with an
11//! email contact.
12//! - **Rate limit 10 req/sec** workspace-wide. Live providers must
13//! throttle; bursty traffic from one app affects every other.
14//! - **CIK normalization** — Central Index Keys are 10-digit
15//! zero-padded; `0000320193` is Apple, not `320193`. The port
16//! normalizes on input.
17//! - **Form types are a closed vocabulary** — 10-K, 10-Q, 8-K, S-1,
18//! etc. — kept open via `FormType::Other(String)` for the long tail.
19//!
20//! This crate ships the typed source domain (CIK, AccessionNumber,
21//! FormType, Filing). App-specific synthesis on top (drift signals,
22//! language analysis, multi-tenant aggregation) stays in the
23//! consuming app.
24//!
25//! Today the port ships:
26//! - `StubSecEdgarProvider` — deterministic, no network, for unit tests
27//! and CI
28//! - `LiveSecEdgarProvider` — behind the `live` feature; fetches SEC
29//! EDGAR over HTTP and returns typed observations through the same
30//! provider trait.
31
32mod error;
33#[cfg(feature = "live")]
34pub mod live;
35mod provenance;
36mod provider;
37mod suggestor;
38mod types;
39
40pub use embassy_pack::{CallContext, Observation, content_hash};
41
42pub use error::SecEdgarError;
43#[cfg(feature = "live")]
44pub use live::LiveSecEdgarProvider;
45pub use provenance::{SEC_EDGAR_PROVENANCE, SecEdgar};
46pub use provider::{SecEdgarProvider, SecEdgarRequest, SecEdgarResponse, StubSecEdgarProvider};
47pub use suggestor::{SecFilingPayload, SecFilingSuggestor};
48pub use types::{AccessionNumber, Cik, Filing, FilingSection, FormType};