Skip to main content

aion_awl/
lib.rs

1//! Front end for the AWL workflow language (rev-2 surface).
2//!
3//! The `.awl` document is the source of truth; the canonical workflow model
4//! is its lossless parse. The lexer is hand-written so the parser can rely
5//! on exact token spans, indentation tokens, and AWL's doc-line data tokens
6//! (`//!`, `///`); the parser and canonical printer are one property:
7//! `parse ∘ print = id`, `print ∘ parse ∘ print = print`.
8
9mod ast;
10pub mod builtins;
11mod checker;
12pub mod command;
13mod compile;
14pub mod doc;
15mod emitter;
16mod fold;
17pub mod guide;
18mod jsontext;
19mod lexer;
20// The AWL-BC bytecode MIR backend (BC-2). Exposed as `#[doc(hidden)] pub` — a
21// tooling/test seam, NOT a supported public API — because the ratified type
22// set (AWL-BC-IR.md Appendix A) includes the intentionally-unused `ResultTry`
23// fallback and a not-yet-complete `lower`, which cannot coexist with a
24// `pub(crate)` module under the workspace's `-D warnings` + no-`#[allow]`
25// discipline (unconstructed private variants are `dead_code`). See
26// `AWL-BC-IR.md` "BC-2 implementation status"; tightening to `pub(crate)` is a
27// panel/operator decision once `lower` constructs the full op surface and the
28// `ResultTry` marker is resolved.
29mod harness_config;
30#[doc(hidden)]
31pub mod mir;
32mod parser;
33mod positions;
34mod printer;
35mod schema;
36pub mod semantic;
37mod spanned;
38mod unlowered;
39mod worker_document;
40mod workspace_root;
41
42pub use ast::{
43    ActionBody, ActionDecl, AfterRef, AnswerStmt, Arg, BinaryOp, Binding, Call, CallStmt,
44    ChildDecl, CollectStmt, CombinatorCall, CombinatorKind, CommandCapture, CommandError,
45    CommandReference, Comment, ConfigLine, ConfigValue, ConstDecl, DeliveryVerb, DistributeStmt,
46    DocLine, Document, DocumentFamily, DurationLiteral, EnumVariant, Expr, FallbackSpec, FieldDecl,
47    ForkHeader, ForkStmt, Guard, HARNESS_ARGS_FIELD, HARNESS_BINARY_FIELD, HARNESS_COMMAND_FIELD,
48    HARNESS_CONCURRENCY_FIELD, HARNESS_CWD_FIELD, HARNESS_ENV_PASS_FIELD, HARNESS_EXIT_GRACE_FIELD,
49    HARNESS_FIELDS, HARNESS_KIND_ACP, HARNESS_KIND_FIELD, HARNESS_KIND_NORN,
50    HARNESS_PERMISSION_ALLOW_ONCE, HARNESS_PERMISSION_DENY, HARNESS_PERMISSION_FIELD,
51    HARNESS_RECONNECT_INITIAL_BACKOFF_FIELD, HARNESS_RECONNECT_MAX_ATTEMPTS_FIELD,
52    HARNESS_RECONNECT_MAX_BACKOFF_FIELD, HARNESS_WORD, HarnessDecl, HarnessInteger, HarnessSetting,
53    HarnessText, HarnessWord, InputDecl, JSON_CAPTURE_WORD, JoinLine, Lead, LoopStmt, LoopTail,
54    MaxVisits, OnFailure, OutcomeClause, OutcomeDecl, ParamDecl, PipeEnd, PipeStage, PipeStmt,
55    PredicateKind, Quantifier, QueryDecl, RetrySpec, RouteDirection, RoutePayload, RouteStmt,
56    RouteTarget, RunCapture, ScannedCommand, SendDecl, SendStmt, SignalDecl, SleepStmt, SpawnStmt,
57    Statement, Step, SubflowDecl, SubflowOutcome, TEXT_CAPTURE_WORD, TypeBody, TypeDecl, TypeRef,
58    WaitStmt, WorkerDecl, WorkflowTimeoutDecl, doc_paragraphs, doc_text, scan_command,
59};
60pub use ast::{
61    ArmDecl, CadenceDecl, CarryDecl, ConfirmsDecl, DetachedDecl, HatchKey, HatchStmt,
62    InvariantDecl, ReportDecl, RetentionDecl, RetireDecl, ToleranceDecl,
63};
64pub use checker::{CheckError, check, check_in};
65pub use compile::{
66    ActionImplementation, ActionRequirement, CompileError, CompiledActionBody, CompiledWorkflow,
67    action_requirements, compile,
68};
69pub use emitter::{
70    EmitError, EmittedArtifact, RETIRE_ARITY, RETIRE_ENTRY, SynthesizedWorkflowEntry, emit,
71    emit_artifact, emit_artifact_in, emit_in,
72};
73pub use harness_config::{
74    CompiledHarness, CompiledHarnessKind, CwdSource, HarnessConfigError, HarnessPermission,
75    compile_harness,
76};
77pub use lexer::{
78    ALLOWS_WORD, ANSWER_WORD, ARTIFACT_WORD, CAPTURES_WORD, COMMAND_WORD, CONFIRMS_WORD,
79    DERIVES_WORD, DIGEST_WORD, DurationUnit, EXCLUDES_WORD, EXPECTING_WORD, EXPORT_WORD,
80    EXTRACT_WORD, FIRES_WORD, FOR_WORD, IN_WORD, KEY_WORD, Keyword, LexError, PARAMETER_WORD,
81    POSITIONAL_WORDS, QUERY_WORD, RECIPE_WORD, REPORT_WORD, REQUIRES_WORD, RESTORES_WORD, RUN_WORD,
82    RUNS_WORD, SEND_WORD, SET_WORD, START_WORD, Span, TO_WORD, Token, TokenKind, UNCONFIRMED_WORD,
83    WALL_WORD, lex,
84};
85pub use parser::{DocSite, DocVerdict, ParseError, parse};
86pub use positions::{
87    Utf16Position, Utf16Range, byte_offset_at_utf16, utf16_position_at, utf16_range_for_span,
88};
89pub use printer::{expr_text, print};
90pub use schema::{
91    ContractBundle, SchemaError, SchemaSources, contract_bundle, schema_for_outcomes,
92    schema_for_outcomes_in, schema_for_params_in, schema_for_queries, schema_for_queries_in,
93    schema_for_type, schema_for_type_in, schema_for_type_ref_in, schema_for_workflow,
94    schema_for_workflow_in,
95};
96pub use spanned::Spanned;
97pub use worker_document::{
98    CompiledWorkerAction, CompiledWorkerBody, CompiledWorkerDocument, compile_worker_document,
99};
100pub use workspace_root::{
101    HarnessPathForm, HarnessPathRefusal, WORKSPACE_ROOT_PLACEHOLDER, harness_path_form,
102};