Skip to main content

Crate kobold_data_shim

Crate kobold_data_shim 

Source
Expand description

§kobold-data-shim

A verifiable COBOL record-decoding shim for data-migration pipelines. Given a copybook and a raw record dump, it answers “what did this COBOL record actually mean?” — byte-exactly — by composing the oracle-proven gnucobol_rs courts:

Every numeric value this shim emits is decoded by a court that is proven byte-identical to GnuCOBOL 3.2’s libcob under a differential sweep. Fields outside the sealed subset fail closed — they are reported as unsupported, never silently guessed (the reconciliation signal that migrations need).

§License

This crate’s source is Apache-2.0. It links gnucobol-rs, which is LGPL-3.0-or-later — see NOTICE for the obligations that places on distributed binaries (relink-ability + notice).

Re-exports§

pub use bank_reconcile::bank_reconcile_report;
pub use bank_reconcile::BankReconcileInputs;
pub use bank_reconcile::BankReconcileReport;
pub use banking::reconcile_banking;
pub use banking::BankingResult;
pub use banking::BankingSummary;
pub use banking::ControlSpec;
pub use banking::Variant;
pub use banking::VariantSpec;
pub use currency::currency_validate;
pub use currency::CurrencyFieldProfile;
pub use currency::CurrencyManifest;
pub use currency::CurrencyProfile;
pub use date_profile::date_validate;
pub use date_profile::DateFieldProfile;
pub use date_profile::DateFormat;
pub use date_profile::DateManifest;
pub use date_profile::DateProfile;
pub use db2host::db2host_evaluate;
pub use db2host::Db2HostResult;
pub use db2host::IndicatorManifest;
pub use db2host::IndicatorPair;
pub use db2host::NullState;
pub use diff::diff_artifacts;
pub use diff::DiffInput;
pub use diff::DiffReport;
pub use diff::DiffTarget;
pub use diff::OracleStatus;
pub use extract::extract_manifest;
pub use extract::ExtractManifest;
pub use extract::ExtractMethod;
pub use extract::ExtractProfile;
pub use extract::FileOrganization;
pub use extract::RecordLengthSource;
pub use file::ingest;
pub use file::ExitCode;
pub use file::Ingest;
pub use file::IngestPolicy;
pub use file::PartialRecord;
pub use file::TrailingNewline;
pub use fixture::replay_fixture;
pub use fixture::Fixture;
pub use fixture::FixtureOutcome;
pub use fixture::FixtureResult;
pub use fixture::FixtureVerdict;
pub use pilot::pilot_packet;
pub use pilot::PilotArtifact;
pub use pilot::PilotInputs;
pub use pilot::PilotPacket;
pub use posting::posting_manifest;
pub use posting::PostingManifest;
pub use posting::PostingProfile;
pub use privacy::redact_record;
pub use privacy::DefaultAction;
pub use privacy::FieldRule;
pub use privacy::RedactionAction;
pub use privacy::RedactionPolicy;
pub use privacy::RedactionResult;
pub use recon2::reconcile_transform;
pub use recon2::ReconTransformResult;
pub use recon2::Transform;
pub use recon2::TransformOp;
pub use redefines::redefines_manifest;
pub use redefines::RedefinesDiscriminator;
pub use redefines::RedefinesManifest;
pub use sentinel::sentinel_scan;
pub use sentinel::SentinelManifest;
pub use sentinel::SentinelMatch;
pub use sentinel::SentinelProfile;
pub use sentinel::SentinelRule;
pub use tooling::tooling_export;
pub use tooling::ToolingExport;
pub use operator::control_totals;
pub use operator::explain_field;
pub use operator::DirtyMode;
pub use operator::STALE_COPYBOOK_RISK;

Modules§

bank_reconcile
KOBOLD.BANK.RECONCILE.1 — opinionated generated operator view over existing evidence.
banking
KOBOLD.BANK.1 — header/detail/trailer banking court: declared-vs-observed control totals.
batch_chain
KOBOLD.BATCH.CHAIN.1 — tamper-evident batch custody chain.
batch_control
KOBOLD.BATCH.CONTROL.1 — header/trailer control-total validation.
currency
KOBOLD.CURRENCY.PROFILE.1 — declared currency/amount-profile evidence.
date_profile
KOBOLD.DATE.PROFILE.1 — declared date-format evidence.
db2host
KOBOLD.DB2HOST.1 — declared Db2 host-variable null/truncation indicator manifest.
diff
KOBOLD.DIFF.1 — structural comparison against a declared expected artifact.
extract
KOBOLD.EXTRACT.PROFILE.1 (CUSTODY.1) — declared extraction provenance + copybook freshness.
file
Fixed-record container ingest (KOBOLD.FILE.1): split a raw byte stream into records of an explicit, caller-declared length, with stable offsets, named trailing/partial policies, a file-level audit, and stable exit codes.
fixture
NIST-STYLE-FIXTURE-FORMAT.1 — a small, named, replayable fixture format for KOBOLD/GNURUST courts.
operator
Operator trust layer (KOBOLD.OPERATOR.1): make every decoded field accountable.
pilot
KOBOLD.PILOT-PACKET.1 — a hash-bound PILOT evidence packet for a reviewer/operator.
posting
KOBOLD.POSTING.1 — declared posting-unit custody manifest.
privacy
KOBOLD.PRIVACY.REDACTION.1 — declared evidence-preserving redaction.
recon
End-to-end fixed-record reconciliation (KOBOLD.RECON.1).
recon2
KOBOLD.RECON.2 — declared transformed-record reconciliation.
redefines
KOBOLD.LAYOUT.REDEFINES.2 — explicit overlapping-view manifest.
sentinel
KOBOLD.SENTINEL.PROFILE.1 — declared sentinel-marker evidence.
sha256
A small, dependency-free SHA-256 (FIPS 180-4), for byte-stable audit hashes. Independent implementation; this file, like the rest of this crate, is Apache-2.0.
tooling
KOBOLD.TOOLING.EXPORT.1 — generated evidence export for downstream tools (IDE / LSP / auditor UI / migration dashboard).
variant
KOBOLD.VARIANT.1 — header/detail/trailer record-discriminator routing.

Structs§

DecodedCondition
A decoded LEVEL-88 condition: its truth (or an error marker) for the current record.
DecodedField
A decoded elementary field.
DecodedRecord
A fully decoded record: its fields and condition-name truths.
NoCopy
A resolver that finds nothing (for copybooks with no nested COPY).

Enums§

Encoding
The record’s declared character encoding (KOBOLD.DATA.3). Never auto-detected — the caller states it. Cp500 decodes alphanumeric DISPLAY fields through the sealed GNURUST.15 table; binary and packed fields are raw storage domains and are never text-converted.
ShimError
What went wrong decoding a record against a copybook.

Traits§

CopyResolver
Re-exported so callers can implement a custom copybook search path for decode_with_resolver. Resolves a copybook name to its source text (the caller owns the search path / filesystem; the expander itself is pure given a resolver).

Functions§

decode
Decode a record against a copybook with no nested COPY.
decode_all
Decode a buffer of fixed-length records into one DecodedRecord per record (fields + conditions). A higher-level iterator over data.chunks(record_len); a trailing partial record is decoded as-is (its short fields are reported unsupported, never guessed).
decode_record
Decode a record into its fields and its LEVEL-88 condition-name truths (eval_88), as native ASCII. For EBCDIC, use decode_record_encoded.
decode_record_encoded
Decode a record under an explicit Encoding (KOBOLD.DATA.3). Under Encoding::Cp500, alphanumeric DISPLAY fields (and the parent bytes feeding eval_88) are decoded through the sealed GNURUST.15 cp500 table; binary/packed fields pass through as raw storage.
decode_with_resolver
Decode record against a copybook (data-division item lines, possibly with COPY), using resolver to find copybooks. Returns one DecodedField per named item (groups included).