Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pipeline Stage Type Compatibility

Auto-generated by cargo run -p xtask-mcpb -- generate-type-tables. Do not edit manually. Source of truth: crates/ledger-core/tests/type_mesh.rs

Stage I/O Matrix

StageInput TypeOutput TypeConfidenceJurisdictionNotes
IngestTransactionInputIngestedTransaction, JournalTransactionDeterministic (1.0)AllBlake3 content-hash IDs
ValidateTransactionInputMetaCtx0.0–1.0AllType checks, constraint evaluation
ClassifySampleTransactionClassificationOutcome, ClassifiedTransaction0.0–1.0US/AU/UKRhai rule waterfall
ReconcileClassifiedTransactionOperationResult0.0–1.0AllXero match/diff
ExportOperationContextrust_xlsxwriter::WorkbookDeterministic (1.0)AllCPA-auditable Excel
VerifyRepairProposalVerificationOutcome0.0–1.0AllMulti-model proposer/reviewer

Cross-Stage Compatibility

From TypeTo TypeCompatible?BridgeTest
TransactionInputSampleTransactionYesdeterministic_tx_id()test_transaction_input_to_sample_transaction_shape
TransactionInputJournalTransactionYesJournalTransaction::from_input()test_transaction_input_to_journal_shape
ClassificationOutcomeClassifiedTransactionYesField mapping + tx_idtest_classification_outcome_to_classified_shape
ClassifiedTransactionTxProjectionRowPartialRequires upstream contexttest_classified_to_projection_row_requires_context
IssueMetaCtxYesMetaCtx::advance()test_validation_pipeline_mesh
MetaCtxStageResult<T>Yesand_then() combinatortest_validation_pipeline_mesh
LegalRule + TransactionFactsZ3ResultYesLegalSolver::verify()
VendorConstraintSetConstraintEvaluationYesVendorConstraintSet::evaluate()

Known Type Gaps

ClassifiedTransactionTxProjectionRow

ClassifiedTransaction lacks account_id, date, amount, description, and source_ref fields that TxProjectionRow requires. The ExportWorkbookOp must reconstruct these from the OperationContext’s upstream ingest data.

Status: Documented in test_classified_to_projection_row_requires_context. Future work should either:

  1. Add missing fields to ClassifiedTransaction, or
  2. Create an explicit ExportContext type that carries full row data.

StageResult<T> constructors use MetaCtx::default()

StageResult::ok() and StageResult::with_issues() initialize meta with MetaCtx::default() (confidence 0.0). The correct way to chain stages is via the and_then() combinator, which properly advances the MetaCtx with multiplicative confidence.

Status: Documented in test_validation_pipeline_mesh.

Type Invariants

All pipeline I/O types must implement Send + Sync for async dispatch:

  • TransactionInput
  • IngestedTransaction
  • SampleTransaction
  • ClassificationOutcome
  • ClassifiedTransaction
  • JournalTransaction
  • TxProjectionRow
  • Issue
  • MetaCtx