Skip to main content

Crate kobold_json

Crate kobold_json 

Source
Expand description

§kobold-json – forensic JSON evidence packets for COBOL record migration

Export a raw COBOL record + its copybook into a deterministic JSON packet that preserves both the semantic value AND the storage truth (offset / length / pic / raw_hex / encoding / copybook_hash / record_hash / findings / roundtrip), and import it back to the exact original bytes. Parsing and re-encoding are fail-closed: a value too long for its field, or a non-numeric value into a numeric field, yields a model::Finding – never a silent truncation or coercion.

§Non-claim

kobold-json is clean-room and zero-libcob. It links no COBOL runtime, contains no libcob-derived or GnuCOBOL-derived code, and depends on no gnucobol-rs* crate. It is not a generic JSON library and not a GnuCOBOL 3.2 parity claim. It answers “what should a forensic JSON evidence packet for a COBOL record migration look like?” Evidence here is the COURT_NAMESPACE (KOBOLD.JSON.*) court.

§Courts

  • KOBOLD.JSON.EXPORT.1export::export: record + copybook -> audit packet.
  • KOBOLD.JSON.PARSE.1parse::parse_into: packet + copybook -> reconstructed bytes (fail-closed).
  • KOBOLD.JSON.ROUNDTRIP.1 – bytes -> Evidence packet -> parse::parse_into -> identical bytes.
  • KOBOLD.JSON.REDACTION.1redact::redact: mask / hash / remove named fields.
  • KOBOLD.JSON.DIFF.1diff::diff: per-path differences between two packets.

No crate dependencies; SHA-256 is the pure-Rust sha256 module.

Re-exports§

pub use diff::diff;
pub use diff::DiffEntry;
pub use diff::DiffKind;
pub use export::export;
pub use export::Mode;
pub use json::parse;
pub use json::serialize;
pub use json::to_string;
pub use json::JsonValue;
pub use json::ParseError;
pub use json::SerializeOptions;
pub use model::Copybook;
pub use model::DecodedField;
pub use model::FieldDecl;
pub use model::FieldKind;
pub use model::Finding;
pub use parse::parse_into;
pub use redact::redact;
pub use redact::Redaction;

Modules§

diff
KOBOLD.JSON.DIFF.1 – a per-path structural diff between two packets (or any two JSON values).
export
KOBOLD.JSON.EXPORT.1 – build a forensic JSON evidence packet from a raw COBOL record + its copybook.
json
A small, deterministic, self-contained JSON value model + serializer + fail-closed parser.
model
The clean-room COBOL-record data model for kobold-json.
parse
KOBOLD.JSON.PARSE.1 (FAIL-CLOSED) – reconstruct the original record bytes from a packet + copybook.
redact
KOBOLD.JSON.REDACTION.1 – redact named fields in a packet while preserving its structure.
sha256
A small, pure-Rust SHA-256 – used for copybook_hash / record_hash in the KOBOLD.JSON.EXPORT.1 Evidence packet. No crate dependency; #![forbid(unsafe_code)]-clean.

Constants§

COURT_NAMESPACE
The court namespace this crate’s evidence is filed under.