Skip to main content

Crate cbcl_parser

Crate cbcl_parser 

Source
Expand description

cbcl-parser: Pure S-expression parser and pipeline for CBCL.

This crate implements the hand-rolled recursive-descent parser (ADR-001) and the full verified pipeline (parse -> parse_message -> validate -> verify).

Re-exports§

pub use contract::compile_contract_str;
pub use describe::define_text_str;
pub use describe::describe_dialect_str;
pub use describe::read_act_str;
pub use dialect_parser::parse_dialect;
pub use dialect_parser::parse_meta_define;
pub use message_parser::parse_message;
pub use message_parser::parse_message_lax;
pub use parser::parse;
pub use parser::ParseError;
pub use pipeline::run_pipeline;
pub use pipeline::run_pipeline_full;
pub use pipeline::PipelineContext;
pub use pipeline::PipelineResult;
pub use pipeline::ValidationError;
pub use protocol_parser::parse_protocol;
pub use protocol_parser::ProtocolParseError;
pub use read::read_str;
pub use shape_exports::verify_message_shape_str;
pub use shape_parser::parse_shape;
pub use state_exports::parse_and_install_dialect;
pub use state_parser::parse_state;
pub use state_parser::parse_state_bounds;

Modules§

checkpoint_dialect
Bundled native checkpoint coordination dialect (SPEC-035 CON-3504). Installation proves native well-formedness, never checkpoint truth. Exact payload recognition and independently pinned policy checks belong to the certificate verifier; the source label is not an authority identifier.
contract
SPEC-087: the JSON authoring contract and its compilation to one CBCL dialect carrying the state clause (SPEC-019). A contract is data an agent writes; the dialect it compiles to is what every host installs, verifies, and folds. One implementation, so every host that authors from JSON gets the same dialect, and therefore the same self-address, for the same contract (SPEC-087 REQ-001, REQ-002).
describe
Reading dialects and acts for a host, so no host re-encodes CBCL’s grammar to look inside one (SPEC-013 REQ-018, SPEC-010 REQ-002). Three reads, each the parser’s and the installed structures’ view, returned as JSON:
dialect_parser
Dialect definition parser.
message_parser
Message parser: SExpr → Message.
parser
Hand-rolled recursive-descent S-expression parser.
pipeline
Full verified pipeline.
protocol_parser
Causal protocol parser (REQ-201, SPEC-015 REQ-704).
read
read: the parser’s tree for a host that must look inside a frame without recognising it again (SPEC-010 REQ-002: one parser). A client dispatches on a performative, reads :thread, or lifts a (define …) out of a teach frame; each of those is a read, not a judgement, and every host makes it through this export rather than a reader of its own, so no two readers of one frame can disagree (SPEC-013 REQ-018).
shape_exports
verify_message_shape: a message against a dialect’s (shape …) clauses, as one implementation every binding wraps (SPEC-010 REQ-002). A host that admits frames judges their shape here, never with predicates of its own: the hub and the browser must agree on what a well-shaped frame is (cbcl-rs issue #14).
shape_parser
Shape constraint parser (REQ-221).
state_exports
SPEC-019 R.7: the state-layer exports, as one implementation every binding wraps (SPEC-010 REQ-002: a binding adds term translation and crash containment, never semantics).
state_parser
State clause parser (SPEC-019 R.1, CON-1900).

Functions§

recipient_of
Parse once and return the canonical signed-envelope audience (@ retained). No dialect installation or field declaration order is required.
recipient_of_lax
Audience accessor for hosts that already allow bare custom control verbs. This recognizes syntax only; the host must still authorize the verb.