0.1.0
This commit is contained in:
6
kb-lib/src/materializer/admin.rs
Normal file
6
kb-lib/src/materializer/admin.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/admin.rs
|
||||
// version: 1
|
||||
|
||||
//! `admin` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/admin/core.rs
Normal file
10
kb-lib/src/materializer/admin/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/admin/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_admin`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_admin";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
31
kb-lib/src/materializer/api.rs
Normal file
31
kb-lib/src/materializer/api.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
// file: kb-lib/src/materializer/api.rs
|
||||
// version: 2
|
||||
|
||||
//! Materializer contracts consolidated from `kb_materializer_api`.
|
||||
|
||||
pub mod contracts;
|
||||
pub mod materializer;
|
||||
/// Stable decoded observation materializer contract used by the common pipeline.
|
||||
pub use crate::materializer::api::contracts::EventMaterializer;
|
||||
/// Explicit policy applied to successful and failed source transactions.
|
||||
pub use crate::materializer::api::contracts::MaterializationTransactionPolicy;
|
||||
/// Stable processor-owned business output derived from one decoded observation.
|
||||
pub use crate::materializer::api::contracts::MaterializedOutput;
|
||||
/// Structured materializer diagnostic without generic error wrappers.
|
||||
pub use crate::materializer::api::contracts::MaterializerDiagnostic;
|
||||
/// Complete explicit result produced by one materializer invocation.
|
||||
pub use crate::materializer::api::contracts::MaterializerExecutionResult;
|
||||
/// Stable identity of one decoded event materializer.
|
||||
pub use crate::materializer::api::contracts::MaterializerIdentity;
|
||||
/// Terminal materializer result status.
|
||||
pub use crate::materializer::api::contracts::MaterializerOutcomeStatus;
|
||||
/// Returns true when a materializer explicitly accepts one decoded family.
|
||||
pub use crate::materializer::api::contracts::materializer_accepts_family;
|
||||
/// Returns true when a materializer accepts one exact decoded observation.
|
||||
pub use crate::materializer::api::contracts::materializer_accepts_observation;
|
||||
/// Applies the mandatory source transaction policy before materialization.
|
||||
pub use crate::materializer::api::contracts::validate_materialization_policy;
|
||||
/// Rejects mutable business outputs derived from failed or uncommitted observations.
|
||||
pub use crate::materializer::api::contracts::validate_materialized_output_policy;
|
||||
/// Exposes the legacy common business materializer trait.
|
||||
pub use crate::materializer::api::materializer::Materializer;
|
||||
412
kb-lib/src/materializer/api/contracts.rs
Normal file
412
kb-lib/src/materializer/api/contracts.rs
Normal file
@@ -0,0 +1,412 @@
|
||||
// file: kb-lib/src/materializer/api/contracts.rs
|
||||
// version: 7
|
||||
|
||||
//! Backend-neutral decoded observation materialization contracts.
|
||||
|
||||
/// Stable identity of one decoded event materializer.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MaterializerIdentity {
|
||||
/// Stable lower snake case processor name.
|
||||
pub name: std::string::String,
|
||||
/// Semantic or deterministic implementation version.
|
||||
pub version: std::string::String,
|
||||
}
|
||||
|
||||
impl MaterializerIdentity {
|
||||
/// Builds a validated materializer identity.
|
||||
pub fn new(
|
||||
name: impl std::convert::Into<std::string::String>,
|
||||
version: impl std::convert::Into<std::string::String>,
|
||||
) -> kb_core::Result<Self> {
|
||||
let value = Self {
|
||||
name: name.into(),
|
||||
version: version.into(),
|
||||
};
|
||||
if value.name.trim().is_empty() || value.version.trim().is_empty() {
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"materializer identity fields must not be empty",
|
||||
));
|
||||
}
|
||||
return std::result::Result::Ok(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// Explicit policy applied to successful and failed source transactions.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
pub enum MaterializationTransactionPolicy {
|
||||
/// Accept committed observations from successful transactions only.
|
||||
SuccessfulCommittedOnly,
|
||||
/// Accept successful observations and failed audit-only observations.
|
||||
SuccessfulOrFailedAudit,
|
||||
/// Accept failed observations for a specifically declared non-mutating family.
|
||||
ExplicitFailedObservation,
|
||||
}
|
||||
|
||||
/// Terminal materializer result status.
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
pub enum MaterializerOutcomeStatus {
|
||||
/// One or more new stable outputs were inserted.
|
||||
Inserted,
|
||||
/// One or more processor-owned outputs were deterministically replaced.
|
||||
Replaced,
|
||||
/// The decoded observation was intentionally ignored.
|
||||
Ignored,
|
||||
/// The decoded observation was rejected by the declared policy.
|
||||
Refused,
|
||||
/// Materialization failed and diagnostics were produced.
|
||||
Failed,
|
||||
}
|
||||
|
||||
/// Structured materializer diagnostic without generic error wrappers.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MaterializerDiagnostic {
|
||||
/// Stable machine-readable diagnostic code.
|
||||
pub code: std::string::String,
|
||||
/// Human-readable diagnostic message.
|
||||
pub message: std::string::String,
|
||||
/// Whether retrying the same version and input may succeed.
|
||||
pub retriable: bool,
|
||||
}
|
||||
|
||||
impl MaterializerDiagnostic {
|
||||
/// Builds a validated materializer diagnostic.
|
||||
pub fn new(
|
||||
code: impl std::convert::Into<std::string::String>,
|
||||
message: impl std::convert::Into<std::string::String>,
|
||||
retriable: bool,
|
||||
) -> kb_core::Result<Self> {
|
||||
let value = Self {
|
||||
code: code.into(),
|
||||
message: message.into(),
|
||||
retriable,
|
||||
};
|
||||
if value.code.trim().is_empty() || value.message.trim().is_empty() {
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"materializer diagnostic code and message must not be empty",
|
||||
));
|
||||
}
|
||||
return std::result::Result::Ok(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// Stable processor-owned business output derived from one decoded observation.
|
||||
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MaterializedOutput {
|
||||
/// Stable processor-owned output key within one decoded observation.
|
||||
pub output_key: std::string::String,
|
||||
/// Business output family.
|
||||
pub family: crate::MaterializedEventFamily,
|
||||
/// Typed business payload serialized as deterministic JSON.
|
||||
pub payload_json: serde_json::Value,
|
||||
}
|
||||
|
||||
impl MaterializedOutput {
|
||||
/// Validates stable output identity.
|
||||
pub fn validate(&self) -> kb_core::Result<()> {
|
||||
if self.output_key.trim().is_empty() {
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"materialized output key must not be empty",
|
||||
));
|
||||
}
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
/// Complete explicit result produced by one materializer invocation.
|
||||
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
|
||||
pub struct MaterializerExecutionResult {
|
||||
/// Terminal materializer status.
|
||||
pub status: MaterializerOutcomeStatus,
|
||||
/// Stable business outputs.
|
||||
pub outputs: std::vec::Vec<MaterializedOutput>,
|
||||
/// Structured diagnostics.
|
||||
pub diagnostics: std::vec::Vec<MaterializerDiagnostic>,
|
||||
}
|
||||
|
||||
impl MaterializerExecutionResult {
|
||||
/// Builds a policy refusal result.
|
||||
pub fn refused(code: &str, message: &str) -> Self {
|
||||
return Self {
|
||||
status: MaterializerOutcomeStatus::Refused,
|
||||
outputs: std::vec::Vec::new(),
|
||||
diagnostics: std::vec![MaterializerDiagnostic {
|
||||
code: code.to_string(),
|
||||
message: message.to_string(),
|
||||
retriable: false,
|
||||
}],
|
||||
};
|
||||
}
|
||||
|
||||
/// Builds an ignored result.
|
||||
pub fn ignored() -> Self {
|
||||
return Self {
|
||||
status: MaterializerOutcomeStatus::Ignored,
|
||||
outputs: std::vec::Vec::new(),
|
||||
diagnostics: std::vec::Vec::new(),
|
||||
};
|
||||
}
|
||||
|
||||
/// Validates status and output consistency.
|
||||
pub fn validate(&self) -> kb_core::Result<()> {
|
||||
let output_status = self.status == MaterializerOutcomeStatus::Inserted
|
||||
|| self.status == MaterializerOutcomeStatus::Replaced;
|
||||
if output_status && self.outputs.is_empty() {
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"inserted or replaced materializer status requires outputs",
|
||||
));
|
||||
}
|
||||
if !output_status && !self.outputs.is_empty() {
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"ignored, refused or failed materializer status must not contain outputs",
|
||||
));
|
||||
}
|
||||
if self.status == MaterializerOutcomeStatus::Failed && self.diagnostics.is_empty() {
|
||||
return std::result::Result::Err(kb_core::Error::invalid_state(
|
||||
"failed materializer status requires at least one diagnostic",
|
||||
));
|
||||
}
|
||||
for output in &self.outputs {
|
||||
let validation_result = output.validate();
|
||||
if let std::result::Result::Err(error) = validation_result {
|
||||
return std::result::Result::Err(error);
|
||||
}
|
||||
}
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
/// Stable decoded observation materializer contract used by the common pipeline.
|
||||
pub trait EventMaterializer: std::marker::Send + std::marker::Sync {
|
||||
/// Returns the stable materializer identity.
|
||||
fn identity(&self) -> MaterializerIdentity;
|
||||
/// Returns every decoded event family explicitly accepted by this materializer.
|
||||
fn accepted_families(&self) -> &'static [crate::EventFamily];
|
||||
/// Returns whether this materializer accepts one exact decoded observation.
|
||||
fn accepts_observation(&self, observation: &crate::DecodedObservation) -> bool {
|
||||
let family = observation.event.event_family;
|
||||
return self.accepted_families().iter().any(|accepted| return *accepted == family);
|
||||
}
|
||||
/// Returns the failed/successful transaction policy for one accepted family.
|
||||
fn transaction_policy(&self, family: crate::EventFamily) -> MaterializationTransactionPolicy;
|
||||
/// Materializes one validated decoded observation.
|
||||
fn materialize(&self, observation: &crate::DecodedObservation) -> MaterializerExecutionResult;
|
||||
}
|
||||
|
||||
/// Returns true when a materializer explicitly accepts one decoded family.
|
||||
pub fn materializer_accepts_family(
|
||||
materializer: &dyn EventMaterializer,
|
||||
family: crate::EventFamily,
|
||||
) -> bool {
|
||||
return materializer
|
||||
.accepted_families()
|
||||
.iter()
|
||||
.any(|accepted| return *accepted == family);
|
||||
}
|
||||
|
||||
/// Returns true when a materializer accepts one exact decoded observation.
|
||||
pub fn materializer_accepts_observation(
|
||||
materializer: &dyn EventMaterializer,
|
||||
observation: &crate::DecodedObservation,
|
||||
) -> bool {
|
||||
return materializer.accepts_observation(observation);
|
||||
}
|
||||
|
||||
/// Applies the mandatory source transaction policy before materialization.
|
||||
pub fn validate_materialization_policy(
|
||||
materializer: &dyn EventMaterializer,
|
||||
observation: &crate::DecodedObservation,
|
||||
) -> std::result::Result<(), MaterializerExecutionResult> {
|
||||
let family = observation.event.event_family;
|
||||
if !crate::materializer_accepts_observation(materializer, observation) {
|
||||
return std::result::Result::Err(MaterializerExecutionResult::refused(
|
||||
"unsupported_decoded_observation",
|
||||
"materializer does not accept the decoded observation surface and entry",
|
||||
));
|
||||
}
|
||||
let policy = materializer.transaction_policy(family);
|
||||
if observation.transaction_failed || !observation.observation_committed {
|
||||
if family == crate::EventFamily::Trade
|
||||
|| family == crate::EventFamily::Liquidity
|
||||
|| family == crate::EventFamily::Lifecycle
|
||||
{
|
||||
return std::result::Result::Err(MaterializerExecutionResult::refused(
|
||||
"failed_transaction_mutation_refused",
|
||||
"failed or uncommitted observations cannot create successful mutable business outputs",
|
||||
));
|
||||
}
|
||||
if policy == MaterializationTransactionPolicy::SuccessfulCommittedOnly {
|
||||
return std::result::Result::Err(MaterializerExecutionResult::refused(
|
||||
"failed_transaction_policy_refused",
|
||||
"materializer accepts committed observations from successful transactions only",
|
||||
));
|
||||
}
|
||||
if policy == MaterializationTransactionPolicy::SuccessfulOrFailedAudit
|
||||
&& family != crate::EventFamily::Audit
|
||||
&& family != crate::EventFamily::ComplianceAudit
|
||||
&& family != crate::EventFamily::Risk
|
||||
{
|
||||
return std::result::Result::Err(MaterializerExecutionResult::refused(
|
||||
"failed_transaction_non_audit_refused",
|
||||
"failed transaction materialization is limited to declared audit or risk families",
|
||||
));
|
||||
}
|
||||
}
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
/// Rejects successful mutable business outputs derived from failed or uncommitted observations.
|
||||
pub fn validate_materialized_output_policy(
|
||||
observation: &crate::DecodedObservation,
|
||||
result: &MaterializerExecutionResult,
|
||||
) -> std::result::Result<(), MaterializerExecutionResult> {
|
||||
if !observation.transaction_failed && observation.observation_committed {
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
let forbidden_output = result.outputs.iter().any(|output| {
|
||||
return output.family != crate::MaterializedEventFamily::ComplianceAudit
|
||||
&& output.family != crate::MaterializedEventFamily::TokenMetadataRisk
|
||||
&& output.family != crate::MaterializedEventFamily::Risk;
|
||||
});
|
||||
if forbidden_output {
|
||||
return std::result::Result::Err(MaterializerExecutionResult::refused(
|
||||
"failed_transaction_output_refused",
|
||||
"failed or uncommitted observations may only produce audit or risk outputs",
|
||||
));
|
||||
}
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
struct TradeMaterializer;
|
||||
|
||||
impl crate::EventMaterializer for TradeMaterializer {
|
||||
fn identity(&self) -> crate::MaterializerIdentity {
|
||||
return crate::MaterializerIdentity {
|
||||
name: "trade_materializer".to_string(),
|
||||
version: "1".to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::EventFamily] {
|
||||
return &[crate::EventFamily::Trade];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::EventFamily,
|
||||
) -> crate::MaterializationTransactionPolicy {
|
||||
return crate::MaterializationTransactionPolicy::SuccessfulCommittedOnly;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DecodedObservation,
|
||||
) -> crate::MaterializerExecutionResult {
|
||||
return crate::MaterializerExecutionResult::ignored();
|
||||
}
|
||||
}
|
||||
|
||||
fn failed_trade_observation() -> crate::DecodedObservation {
|
||||
return crate::DecodedObservation {
|
||||
event_key: "trade".to_string(),
|
||||
event: crate::DecodedProtocolEvent {
|
||||
signature: crate::Signature("signature".to_string()),
|
||||
slot: crate::Slot(42),
|
||||
instruction_path: crate::InstructionPath("0".to_string()),
|
||||
program_id: crate::ProgramId("program".to_string()),
|
||||
protocol_code: crate::ProtocolCode("protocol".to_string()),
|
||||
surface_code: crate::SurfaceCode("surface".to_string()),
|
||||
event_code: crate::EventCode("trade".to_string()),
|
||||
event_name: crate::EventName("trade".to_string()),
|
||||
event_family: crate::EventFamily::Trade,
|
||||
source_kind: crate::EventSourceKind::Instruction,
|
||||
confidence: crate::DecoderConfidence::Exact,
|
||||
},
|
||||
payload_json: serde_json::json!({}),
|
||||
transaction_failed: true,
|
||||
transaction_error: std::option::Option::Some(
|
||||
serde_json::json!({"InstructionError": [0, "Custom"]}),
|
||||
),
|
||||
observation_committed: false,
|
||||
proof: crate::DecoderProof {
|
||||
kind: crate::DecoderProofKind::ExactLayout,
|
||||
confidence: crate::DecoderConfidence::Exact,
|
||||
evidence: std::vec!["layout".to_string()],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_trade_is_refused_before_materialization() {
|
||||
let result =
|
||||
crate::validate_materialization_policy(&TradeMaterializer, &failed_trade_observation());
|
||||
assert!(result.is_err());
|
||||
let refusal = match result {
|
||||
std::result::Result::Ok(()) => panic!("failed trade unexpectedly accepted"),
|
||||
std::result::Result::Err(value) => value,
|
||||
};
|
||||
assert_eq!(refusal.status, crate::MaterializerOutcomeStatus::Refused);
|
||||
assert_eq!(refusal.diagnostics[0].code, "failed_transaction_mutation_refused");
|
||||
}
|
||||
|
||||
struct FailedAuditToTradeMaterializer;
|
||||
|
||||
impl crate::EventMaterializer for FailedAuditToTradeMaterializer {
|
||||
fn identity(&self) -> crate::MaterializerIdentity {
|
||||
return crate::MaterializerIdentity {
|
||||
name: "failed_audit_to_trade".to_string(),
|
||||
version: "1".to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
fn accepted_families(&self) -> &'static [crate::EventFamily] {
|
||||
return &[crate::EventFamily::Audit];
|
||||
}
|
||||
|
||||
fn transaction_policy(
|
||||
&self,
|
||||
_family: crate::EventFamily,
|
||||
) -> crate::MaterializationTransactionPolicy {
|
||||
return crate::MaterializationTransactionPolicy::SuccessfulOrFailedAudit;
|
||||
}
|
||||
|
||||
fn materialize(
|
||||
&self,
|
||||
_observation: &crate::DecodedObservation,
|
||||
) -> crate::MaterializerExecutionResult {
|
||||
return crate::MaterializerExecutionResult {
|
||||
status: crate::MaterializerOutcomeStatus::Inserted,
|
||||
outputs: std::vec![crate::MaterializedOutput {
|
||||
output_key: "trade".to_string(),
|
||||
family: crate::MaterializedEventFamily::Trade,
|
||||
payload_json: serde_json::json!({}),
|
||||
}],
|
||||
diagnostics: std::vec::Vec::new(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn failed_audit_observation() -> crate::DecodedObservation {
|
||||
let mut observation = failed_trade_observation();
|
||||
observation.event.event_family = crate::EventFamily::Audit;
|
||||
return observation;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failed_audit_cannot_emit_successful_trade_output() {
|
||||
let materializer = FailedAuditToTradeMaterializer;
|
||||
let observation = failed_audit_observation();
|
||||
let policy_result = crate::validate_materialization_policy(&materializer, &observation);
|
||||
assert!(policy_result.is_ok());
|
||||
let materialized = crate::EventMaterializer::materialize(&materializer, &observation);
|
||||
let output_result = crate::validate_materialized_output_policy(&observation, &materialized);
|
||||
assert!(output_result.is_err());
|
||||
let refusal = match output_result {
|
||||
std::result::Result::Ok(()) => panic!("failed audit unexpectedly emitted a trade"),
|
||||
std::result::Result::Err(value) => value,
|
||||
};
|
||||
assert_eq!(refusal.status, crate::MaterializerOutcomeStatus::Refused);
|
||||
assert_eq!(refusal.diagnostics[0].code, "failed_transaction_output_refused");
|
||||
}
|
||||
}
|
||||
22
kb-lib/src/materializer/api/materializer.rs
Normal file
22
kb-lib/src/materializer/api/materializer.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
// file: kb-lib/src/materializer/api/materializer.rs
|
||||
// version: 2
|
||||
|
||||
//! Materializer API contract used by business materializer crates.
|
||||
|
||||
/// Common contract implemented by all business materializer crates.
|
||||
pub trait Materializer {
|
||||
/// Returns the stable materializer name.
|
||||
fn materializer_name(&self) -> &'static str;
|
||||
|
||||
/// Returns the materializer version.
|
||||
fn materializer_version(&self) -> &'static str;
|
||||
|
||||
/// Tests whether this materializer accepts a decoded event.
|
||||
fn accepts_event(&self, event: &crate::DecodedProtocolEvent) -> bool;
|
||||
|
||||
/// Materializes a decoded event into zero or more business events.
|
||||
fn materialize_event(
|
||||
&self,
|
||||
event: &crate::DecodedProtocolEvent,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MaterializedEvent>>;
|
||||
}
|
||||
6
kb-lib/src/materializer/bridge.rs
Normal file
6
kb-lib/src/materializer/bridge.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/bridge.rs
|
||||
// version: 1
|
||||
|
||||
//! `bridge` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/bridge/core.rs
Normal file
10
kb-lib/src/materializer/bridge/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/bridge/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_bridge`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_bridge";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/compliance.rs
Normal file
6
kb-lib/src/materializer/compliance.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/compliance.rs
|
||||
// version: 1
|
||||
|
||||
//! `compliance` materializer family.
|
||||
|
||||
pub mod audit;
|
||||
10
kb-lib/src/materializer/compliance/audit.rs
Normal file
10
kb-lib/src/materializer/compliance/audit.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/compliance/audit.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_compliance_audit`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_compliance_audit";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/fees.rs
Normal file
6
kb-lib/src/materializer/fees.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/fees.rs
|
||||
// version: 1
|
||||
|
||||
//! `fees` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/fees/core.rs
Normal file
10
kb-lib/src/materializer/fees/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/fees/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_fees`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_fees";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/governance.rs
Normal file
6
kb-lib/src/materializer/governance.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/governance.rs
|
||||
// version: 1
|
||||
|
||||
//! `governance` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/governance/core.rs
Normal file
10
kb-lib/src/materializer/governance/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/governance/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_governance`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_governance";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/lending.rs
Normal file
6
kb-lib/src/materializer/lending.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/lending.rs
|
||||
// version: 1
|
||||
|
||||
//! `lending` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/lending/core.rs
Normal file
10
kb-lib/src/materializer/lending/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/lending/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_lending`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_lending";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/lifecycle.rs
Normal file
6
kb-lib/src/materializer/lifecycle.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/lifecycle.rs
|
||||
// version: 1
|
||||
|
||||
//! `lifecycle` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/lifecycle/core.rs
Normal file
10
kb-lib/src/materializer/lifecycle/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/lifecycle/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_lifecycle`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_lifecycle";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/liquidity.rs
Normal file
6
kb-lib/src/materializer/liquidity.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/liquidity.rs
|
||||
// version: 1
|
||||
|
||||
//! `liquidity` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/liquidity/core.rs
Normal file
10
kb-lib/src/materializer/liquidity/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/liquidity/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_liquidity`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_liquidity";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/metadata.rs
Normal file
6
kb-lib/src/materializer/metadata.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/metadata.rs
|
||||
// version: 1
|
||||
|
||||
//! `metadata` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/metadata/core.rs
Normal file
10
kb-lib/src/materializer/metadata/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/metadata/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_metadata`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_metadata";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/nft.rs
Normal file
6
kb-lib/src/materializer/nft.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/nft.rs
|
||||
// version: 1
|
||||
|
||||
//! `nft` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/nft/core.rs
Normal file
10
kb-lib/src/materializer/nft/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/nft/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_nft`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_nft";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/oracle.rs
Normal file
6
kb-lib/src/materializer/oracle.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/oracle.rs
|
||||
// version: 1
|
||||
|
||||
//! `oracle` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/oracle/core.rs
Normal file
10
kb-lib/src/materializer/oracle/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/oracle/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_oracle`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_oracle";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/orderbook.rs
Normal file
6
kb-lib/src/materializer/orderbook.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/orderbook.rs
|
||||
// version: 1
|
||||
|
||||
//! `orderbook` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/orderbook/core.rs
Normal file
10
kb-lib/src/materializer/orderbook/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/orderbook/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_orderbook`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_orderbook";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/perpetuals.rs
Normal file
6
kb-lib/src/materializer/perpetuals.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/perpetuals.rs
|
||||
// version: 1
|
||||
|
||||
//! `perpetuals` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/perpetuals/core.rs
Normal file
10
kb-lib/src/materializer/perpetuals/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/perpetuals/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_perpetuals`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_perpetuals";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/pool.rs
Normal file
6
kb-lib/src/materializer/pool.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/pool.rs
|
||||
// version: 1
|
||||
|
||||
//! `pool` materializer family.
|
||||
|
||||
pub mod state;
|
||||
10
kb-lib/src/materializer/pool/state.rs
Normal file
10
kb-lib/src/materializer/pool/state.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/pool/state.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_pool_state`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_pool_state";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/rewards.rs
Normal file
6
kb-lib/src/materializer/rewards.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/rewards.rs
|
||||
// version: 1
|
||||
|
||||
//! `rewards` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/rewards/core.rs
Normal file
10
kb-lib/src/materializer/rewards/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/rewards/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_rewards`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_rewards";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/risk.rs
Normal file
6
kb-lib/src/materializer/risk.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/risk.rs
|
||||
// version: 1
|
||||
|
||||
//! `risk` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/risk/core.rs
Normal file
10
kb-lib/src/materializer/risk/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/risk/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_risk`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_risk";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/routing.rs
Normal file
6
kb-lib/src/materializer/routing.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/routing.rs
|
||||
// version: 1
|
||||
|
||||
//! `routing` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/routing/core.rs
Normal file
10
kb-lib/src/materializer/routing/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/routing/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_routing`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_routing";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/staking.rs
Normal file
6
kb-lib/src/materializer/staking.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/staking.rs
|
||||
// version: 1
|
||||
|
||||
//! `staking` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/staking/core.rs
Normal file
10
kb-lib/src/materializer/staking/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/staking/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_staking`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_staking";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
7
kb-lib/src/materializer/token.rs
Normal file
7
kb-lib/src/materializer/token.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
// file: kb-lib/src/materializer/token.rs
|
||||
// version: 1
|
||||
|
||||
//! `token` materializer family.
|
||||
|
||||
pub mod accounts;
|
||||
pub mod metadata_risk;
|
||||
10
kb-lib/src/materializer/token/accounts.rs
Normal file
10
kb-lib/src/materializer/token/accounts.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/token/accounts.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_token_accounts`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_token_accounts";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
10
kb-lib/src/materializer/token/metadata_risk.rs
Normal file
10
kb-lib/src/materializer/token/metadata_risk.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/token/metadata_risk.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_token_metadata_risk`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_token_metadata_risk";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/trades.rs
Normal file
6
kb-lib/src/materializer/trades.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/trades.rs
|
||||
// version: 1
|
||||
|
||||
//! `trades` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/trades/core.rs
Normal file
10
kb-lib/src/materializer/trades/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/trades/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_trades`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_trades";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/transaction.rs
Normal file
6
kb-lib/src/materializer/transaction.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/transaction.rs
|
||||
// version: 1
|
||||
|
||||
//! `transaction` materializer family.
|
||||
|
||||
pub mod annotations;
|
||||
10
kb-lib/src/materializer/transaction/annotations.rs
Normal file
10
kb-lib/src/materializer/transaction/annotations.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/transaction/annotations.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_transaction_annotations`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_transaction_annotations";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
6
kb-lib/src/materializer/vault.rs
Normal file
6
kb-lib/src/materializer/vault.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
// file: kb-lib/src/materializer/vault.rs
|
||||
// version: 1
|
||||
|
||||
//! `vault` materializer family.
|
||||
|
||||
pub mod core;
|
||||
10
kb-lib/src/materializer/vault/core.rs
Normal file
10
kb-lib/src/materializer/vault/core.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
// file: kb-lib/src/materializer/vault/core.rs
|
||||
// version: 1
|
||||
|
||||
//! Migration boundary for legacy crate `kb_materializer_vault`.
|
||||
|
||||
/// Legacy crate name retained for migration and compatibility tracking.
|
||||
pub const LEGACY_CRATE: &str = "kb_materializer_vault";
|
||||
|
||||
/// Current porting status.
|
||||
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";
|
||||
Reference in New Issue
Block a user