Skip to main content

Crate pointlock_ir

Crate pointlock_ir 

Source
Expand description

§pointlock-ir

All Typed IR types of Pointlock as Rust DTOs (serde + schemars) — the single source of truth for types (spine R12). CI generates from this crate: the JSON Schema (Draft 2020-12), the type-only npm package @pointlock/ir-types, and golden fixtures.

Authoritative design documents:

  • docs/design/00-architecture-spine.md §3/§7/§9 and Appendix A
  • docs/design/02-typed-ir.md (the anchor document for IR semantics)
  • schema/flow-ir.v0.1.schema.json (acceptance baseline for the wire shape; the generated schema must be behaviorally equivalent to it over the golden fixture corpus, 02 §1.1)

§Serde discipline

  • Wire shape is camelCase (rename_all); enum literals align verbatim with spine Appendix A.4 (error classes and canonical verbs are snake_case by decree).
  • Objects the baseline closes with additionalProperties: false carry #[serde(deny_unknown_fields)]. The seven step variants compose StepBase via #[serde(flatten)], which serde cannot combine with deny_unknown_fields; there the schema-only #[schemars(deny_unknown_fields)] closes the generated schema (mirroring the baseline’s unevaluatedProperties: false) while the serde loader stays lenient — see the note in step.
  • Absent optional fields are omitted (skip_serializing_if), never null — the single-representation rule that content addressing depends on (02 §2.4/§12.1).

The golden fixture corpus lives in schema/fixtures/ (positive + negative), and tests/behavioral_equivalence.rs judges the generated schema against the acceptance baseline over it (accept/reject parity, 02 §1.1) plus the serde round-trip guarantee. Normalization and hashing (irHash/effectHash/judgeHash) live in canonical and hash; the canonical RunPath string rendering and parsing (07 §2.1) live in run_path.

Re-exports§

pub use assertion::AssertionIR;
pub use assertion::PredicateIR;
pub use canonical::to_canonical_json;
pub use expr::Expr;
pub use expr::ExprMap;
pub use expr::FnExpr;
pub use expr::LitExpr;
pub use expr::PureFn;
pub use expr::RefExpr;
pub use flow::FlowIR;
pub use flow::FlowRef;
pub use flow::OutputDecl;
pub use flow::ParamDecl;
pub use flow::ProviderRef;
pub use handler::BackoffMs;
pub use handler::BackoffSchedule;
pub use handler::HandlerAction;
pub use handler::HandlerBinding;
pub use handler::RetryPolicy;
pub use hash::domain_hash;
pub use hash::effect_hash;
pub use hash::effect_hash_domain_tag;
pub use hash::ir_hash;
pub use hash::ir_hash_domain_tag;
pub use hash::judge_hash;
pub use hash::judge_hash_domain_tag;
pub use hash::judge_subdomain_sans_preflight;
pub use primitives::ActionName;
pub use primitives::AssertId;
pub use primitives::FeatureId;
pub use primitives::FlowId;
pub use primitives::Hash;
pub use primitives::Identifier;
pub use primitives::IrVersion;
pub use primitives::JsonPointer;
pub use primitives::JsonSchemaDocument;
pub use primitives::OnMissingInput;
pub use primitives::OnTimeout;
pub use primitives::Protection;
pub use primitives::ProviderName;
pub use primitives::RefPath;
pub use primitives::StepId;
pub use primitives::ValidationError;
pub use record::ActionOutcomeKind;
pub use record::AlignmentEntry;
pub use record::AlignmentReport;
pub use record::AssertionOutcomeRecord;
pub use record::AttemptRecord;
pub use record::AttestationSnapshot;
pub use record::BindingState;
pub use record::CallFrame;
pub use record::CheckpointView;
pub use record::EventCursor;
pub use record::Frontier;
pub use record::HumanPending;
pub use record::IterState;
pub use record::ObservationRecord;
pub use record::PendingIntent;
pub use record::ProviderStateSummary;
pub use record::RequiresConfirmation;
pub use record::SessionHealthSnapshot;
pub use record::StepRecord;
pub use record::VisionJudgeRecord;
pub use run_log::RunLogEvent;
pub use run_log::RunLogPayload;
pub use run_path::ParsedPathFrame;
pub use run_path::PathFrame;
pub use run_path::RunPath;
pub use run_path::RunPathParseError;
pub use run_path::parse_run_path;
pub use run_path::render_parsed_run_path;
pub use run_path::render_run_path;
pub use runtime::ActionExecution;
pub use runtime::ActionOutcome;
pub use runtime::ActionResult;
pub use runtime::AssetRef;
pub use runtime::ErrorInfo;
pub use runtime::EvidenceGap;
pub use runtime::EvidenceRef;
pub use runtime::Observation;
pub use runtime::ReconcileResult;
pub use runtime::StepVerdict;
pub use runtime::UiContextRef;
pub use runtime::UiNodeRef;
pub use runtime::UiSnapshotRef;
pub use runtime::Verdict;
pub use runtime::Viewport;
pub use selector::ElementSelectorIR;
pub use selector::RectIR;
pub use selector::SelectorContext;
pub use selector::TextMatchIR;
pub use source_map::MacroOriginFrame;
pub use source_map::SourceMapEntry;
pub use source_map::SourceSpan;
pub use step::ActionBinding;
pub use step::ActionStepIR;
pub use step::AssertStepIR;
pub use step::BoundAttempt;
pub use step::CallStepIR;
pub use step::ForeachStepIR;
pub use step::HumanStepIR;
pub use step::IfStepIR;
pub use step::LetStepIR;
pub use step::ObservationFromStep;
pub use step::ObservationSource;
pub use step::StepBase;
pub use step::StepIR;
pub use vocab::ActChannel;
pub use vocab::AlignmentClass;
pub use vocab::CanonicalVerb;
pub use vocab::Channel;
pub use vocab::CoordinateFallbackReason;
pub use vocab::EffectClass;
pub use vocab::EffectClassAction;
pub use vocab::ElementState;
pub use vocab::ErrorClass;
pub use vocab::ExecutionMode;
pub use vocab::HandlerHook;
pub use vocab::HumanMode;
pub use vocab::HumanPurpose;
pub use vocab::ObservationWhich;
pub use vocab::Phase;
pub use vocab::ScreenshotOmissionReason;
pub use vocab::StepState;
pub use vocab::SupervisePolicy;
pub use vocab::SupervisionDecision;
pub use vocab::TextMatchMode;
pub use vocab::UiContextKind;
pub use vocab::UiSnapshotOmissionReason;
pub use vocab::VerdictPolicy;
pub use vocab::VerdictStatus;
pub use vocab::VerifyChannel;

Modules§

assertion
Assertions: the “questions” of the IR (02 §5.3, §9.1).
canonical
JCS-style canonical JSON serialization — the byte form all IR hashes are computed over (02 §12.1).
expr
The non-Turing-complete expression AST (spine §7, 02 §8).
flow
The flow root type and its contract declarations (spine §3, 02 §2–§3).
handler
Handlers and retry policies (02 §10).
hash
Content addressing: irHash / effectHash / judgeHash (02 §12, spine §3 dual-hash constitutional clause).
primitives
Validated string primitives of the IR.
record
Durable execution records and the checkpoint materialization view.
run_log
The RunLog event vocabulary: the append-only single source of truth of a run (spine §6.1, closed 17-event union).
run_path
failedStepPath: the structured RunPath representation (spine §9) and its canonical human-readable string form (07 §2.1).
runtime
Runtime wire types shared between the runner and providers.
schema_gen
FlowIR JSON Schema generation — the first leg of the R12 codegen pipeline (02 §1.1):
selector
Element selectors and geometric types.
source_map
Source mapping: IR path → YAML span, plus macro origin traces (02 §7).
step
Steps: the closed 7-kind vocabulary (02 §4) plus the act-chain binding types (02 §5).
vocab
Closed vocabulary enums (spine Appendix A.4).