Expand description
Delvewright DSL: serde types, validation, canonical serialization and JSON Schema export for the staged campaign DSL (spec-0001).
Entry points:
parse_campaign/check_campaign: parse the six raw stage documents.validate_campaign: run all spec-0001 v0.2 rule groups on a parsedCampaign, returningDiagnostics (spec-0002--jsonshape).to_canonical_string: the single canonical writer — pretty JSON put throughfmt, so what the compiler WRITES is whatdelvec fmt --checkaccepts. One canonical form, one implementation.fmt: that canonical form as a grammar-level formatter over any authored JSON (stage documents, l10n sidecars, prefab metadata).stage_schema: export a stage’s JSON Schema.
Determinism (ADR-0006): all iteration is over BTreeMap/BTreeSet or slices;
nothing depends on hash order, wall-clock, or absolute paths.
Re-exports§
pub use canonical::to_canonical_string;pub use chrome::Chrome;pub use chrome::ChromeString;pub use chrome::validate_chrome_namespace;pub use design::CONCEPT_DIR;pub use design::DesignContent;pub use design::IMAGE_EXTENSIONS;pub use design::REFERENCE_DIR;pub use design::REFERENCE_DIRS;pub use design::Reference;pub use design::is_image_extension;pub use detailplan::Detail;pub use detailplan::DetailPlanContent;pub use detailplan::FLOOR_COURSE;pub use detailplan::Frame;pub use detailplan::bound_places;pub use detailplan::is_bound;pub use diagnostic::Diagnostic;pub use diagnostic::DwCode;pub use diagnostic::ExitTier;pub use diagnostic::Group;pub use diagnostic::Severity;pub use diagnostic::Subject;pub use diagnostic::codes;pub use effects::EffectRootKind;pub use effects::EffectRootOwner;pub use effects::EffectRootSite;pub use effects::RootBinding;pub use effects::for_each_effect_root;pub use effects::for_each_effect_root_mut;pub use envelope::Campaign;pub use envelope::DSL_VERSION;pub use envelope::Envelope;pub use envelope::RawCampaign;pub use envelope::Stage;pub use envelope::check_campaign;pub use envelope::parse_campaign;pub use gate::Gate;pub use gate::GateBinding;pub use gate::GateConsumer;pub use gate::GateSite;pub use gate::for_each_gate;pub use ids::ActorId;pub use ids::AmbushId;pub use ids::AnchorId;pub use ids::AreaId;pub use ids::BranchId;pub use ids::BranchPointId;pub use ids::CampaignId;pub use ids::ClassId;pub use ids::DatumId;pub use ids::DialogueId;pub use ids::EdgeId;pub use ids::EditBatchId;pub use ids::EndingId;pub use ids::FactId;pub use ids::FlagId;pub use ids::LethalVolumeId;pub use ids::NodeId;pub use ids::NpcId;pub use ids::ObjectiveId;pub use ids::PoolId;pub use ids::PrefabId;pub use ids::QuestId;pub use ids::RegionId;pub use ids::ShortcutId;pub use ids::StateId;pub use ids::TimedGateId;pub use ids::TriggerId;pub use ids::ViewId;pub use ids::VolumeId;pub use ids::WaveId;pub use l10n::ArtNarrate;pub use l10n::CANONICAL_LANG;pub use l10n::L10nDoc;pub use l10n::L10nKind;pub use l10n::MARKER_SIGIL;pub use l10n::OptionLabel;pub use l10n::ScreenNarrate;pub use l10n::SoundRef;pub use l10n::TR_SIGIL;pub use l10n::art_narrates;pub use l10n::bonfire_option_labels;pub use l10n::declared_mc_codes;pub use l10n::dialogue_option_labels;pub use l10n::each_string;pub use l10n::has_tr_sigil;pub use l10n::inventory as l10n_inventory;pub use l10n::key_speaker;pub use l10n::local_id;pub use l10n::localize;pub use l10n::on_screen_narrates;pub use l10n::plain as l10n_plain;pub use l10n::play_sound_actor_refs;pub use l10n::sound_refs;pub use l10n::tag_translatables;pub use l10n::untag as l10n_untag;pub use l10n::validate_l10n;pub use l10n::validate_l10n_provenance;pub use l10n::validate_marker_channel;pub use l10n::validate_tr_sigil;pub use layout::Beat;pub use layout::BriefFact;pub use layout::Closure;pub use layout::Direction;pub use layout::Edge;pub use layout::EdgeGating;pub use layout::GeometryBriefContent;pub use layout::Grant;pub use layout::Grants;pub use layout::LayoutBinding;pub use layout::LayoutGraphContent;pub use layout::OpensFrom;pub use layout::Station;pub use layout::StationKind;pub use mclang::mc_lang_code;pub use placement::Placement;pub use placement::anchor_vocabulary_unknowable;pub use prefab::PrefabMeta;pub use registry::AnchorRegistry;pub use registry::BlockRegistry;pub use registry::EffectRegistry;pub use registry::EntityRegistry;pub use registry::ItemBackedBlockRegistry;pub use registry::ItemRegistry;pub use registry::Lighting;pub use registry::LightingProfile;pub use registry::VendoredAnchorRegistry;pub use registry::VendoredEffectRegistry;pub use registry::VendoredEntityRegistry;pub use registry::VendoredItemRegistry;pub use registry::is_potion_id;pub use registry::is_technical_block;pub use schema::stage_schema;pub use siteplan::Axis;pub use siteplan::Ceiling;pub use siteplan::Cmp;pub use siteplan::Datum;pub use siteplan::ENTRY_ANCHOR;pub use siteplan::Face;pub use siteplan::Floor;pub use siteplan::Identity;pub use siteplan::Measure;pub use siteplan::Offset;pub use siteplan::PackedBox;pub use siteplan::PlanAxis;pub use siteplan::PlanBinding;pub use siteplan::PlanBox;pub use siteplan::Provenance;pub use siteplan::SITE_AREA;pub use siteplan::Seam;pub use siteplan::Sightline;pub use siteplan::SitePlanContent;pub use siteplan::View;pub use siteplan::Volume;pub use siteplan::VolumeRole;pub use siteplan::WorldBox;pub use siteplan::node_anchor;pub use siteplan::owed_anchors;pub use siteplan::placed_boxes;pub use siteplan::placed_seams;pub use siteplan::placements;pub use siteplan::refused_upstream;pub use siteplan::seam_anchor;pub use siteplan::seam_unlock_anchor;pub use siteplan::synthesized_anchor_kinds;pub use siteplan::synthesized_anchors;pub use siteplan::synthesized_gate_block;pub use siteplan::PlacedBox;pub use siteplan::PlacedSeam;pub use stages::Actor;pub use stages::Ambush;pub use stages::Area;pub use stages::AreaLighting;pub use stages::AreaMitigation;pub use stages::BONFIRE_PROMPT_EN;pub use stages::BONFIRE_REST_LABEL_EN;pub use stages::BONFIRE_SAVE_LABEL_EN;pub use stages::BodyTraversal;pub use stages::BonfireLabels;pub use stages::Boundary;pub use stages::BranchDecl;pub use stages::BranchPoint;pub use stages::CameraShot;pub use stages::CameraSubject;pub use stages::CameraTarget;pub use stages::CameraWaypoint;pub use stages::Carrier;pub use stages::CastAbsence;pub use stages::CastBarks;pub use stages::CastDialogue;pub use stages::CastDialogueKeyword;pub use stages::CastEntry;pub use stages::CastPlace;pub use stages::CastPlacement;pub use stages::Class;pub use stages::ClassesContent;pub use stages::CollectBy;pub use stages::CompareOp;pub use stages::DamageKind;pub use stages::DespawnStyle;pub use stages::DialogueContent;pub use stages::DialogueEffect;pub use stages::DialogueNode;pub use stages::DialogueOption;pub use stages::EffectSite;pub use stages::EnchantedItem;pub use stages::EncounterTier;pub use stages::EnvTrigger;pub use stages::EquipItem;pub use stages::EquipSlot;pub use stages::Facing;pub use stages::Fixture;pub use stages::Forfeit;pub use stages::Guard;pub use stages::Happening;pub use stages::HappeningVerb;pub use stages::Horizon;pub use stages::HorizonBase;pub use stages::HorizonSpec;pub use stages::ItemDrop;pub use stages::KitItem;pub use stages::LethalVolume;pub use stages::Lethality;pub use stages::Locomotion;pub use stages::Loot;pub use stages::LootItem;pub use stages::MAX_POTION_AMPLIFIER;pub use stages::MAX_POTION_DURATION_TICKS;pub use stages::MobAttributes;pub use stages::MobDrop;pub use stages::MobEffect;pub use stages::MobEquipment;pub use stages::NarrateStyle;pub use stages::Npc;pub use stages::NpcDialogue;pub use stages::NpcSkin;pub use stages::NpcsContent;pub use stages::Objective;pub use stages::OnFull;pub use stages::Persona;pub use stages::Pieces;pub use stages::PlannedQuest;pub use stages::PotionContents;pub use stages::PotionEffect;pub use stages::Prop;pub use stages::Quest;pub use stages::QuestEffect;pub use stages::QuestPlanContent;pub use stages::QuestsContent;pub use stages::Relationship;pub use stages::Role;pub use stages::SequenceStep;pub use stages::Shop;pub use stages::ShopOffer;pub use stages::Shortcut;pub use stages::ShotStyle;pub use stages::SkinModel;pub use stages::SlotDrop;pub use stages::SoundAt;pub use stages::Stake;pub use stages::StateCompare;pub use stages::StateDecl;pub use stages::StateScope;pub use stages::StateWrite;pub use stages::StealthZone;pub use stages::TimedGate;pub use stages::Trap;pub use stages::TrapDisarm;pub use stages::TrapEffect;pub use stages::TrapReset;pub use stages::TrapTrigger;pub use stages::Trigger;pub use stages::TriggerAudience;pub use stages::TriggerOn;pub use stages::Verb;pub use stages::Wave;pub use stages::WaveLane;pub use stages::WaveMob;pub use stages::WaveSummon;pub use stages::WorldContent;pub use stages::WorldDifficulty;pub use stages::WorldTime;pub use stages::WorldWeather;pub use stages::is_potion_bearing_item;pub use stages::BodyRef;pub use stages::BodySite;pub use stages::BodySkinSite;pub use stages::BodyTraversalSite;pub use stages::body_sites;pub use stages::body_skin_sites;pub use stages::body_traversal_sites;pub use stages::for_each_campaign_effect;pub use stages::EditBatch;pub use stages::EditFrame;pub use stages::FragmentRotation;pub use stages::MorphOp;pub use stages::PaletteBlock;pub use stages::PaletteRecipe;pub use stages::RegionShape;pub use stages::SocketState;pub use stages::TreeKind;pub use stages::WorldEdit;pub use stages::WorldEditsContent;pub use stages::ResolvedHorizon;pub use stages::horizon_base;pub use stages::horizon_defaults;pub use stages::resolved_horizon;pub use validate::validate_campaign;pub use validate::validate_campaign_with;
Modules§
- blocks
- The pinned 1.21.11 block-state registry, and the check every emitter of a structure template owes it.
- blockshape
- What a block state does to a body that walks into it (spec-0056) — the one authority, for every crate in this workspace.
- canonical
- The single canonical JSON writer.
- chrome
- Compiler chrome: the player-visible strings the compiler writes itself, which no campaign authored and no translator was ever asked for (spec-0029 addendum).
- design
- The design record — the machine half of an approved look (spec-0061).
- detailplan
- The detail plan: a place is detailed inside the box the whole gave it (spec-0050) — pipeline stage 6.
- diagnostic
- Diagnostics: the
--jsonshape from spec-0002 and the stableDW01xxcodes. - effects
- The one enumeration of the campaign’s effect roots.
- envelope
- The stage envelope, the assembled
Campaign, and parsing from raw JSON. - fluid
- What a cell does when there is fluid beside it — block knowledge, so it
lives beside
blocksandblockshaperather than beside any one reader of it.delvewright_schem::fluidre-exports it, and the prefab generators reach it through their dependency on this crate: they may not depend ondelvec, and this is the crate every reader of a block fact can reach. What a cell of a piece does when there is fluid beside it. - fmt
delvec fmt— the canonical form for authored Delvewright JSON.- gate
- The one gate.
- ids
- Type-prefixed, kebab-case identifier newtypes (spec-0001 “IDs”).
- l10n
- Native i18n: author-declared languages, l10n sidecar documents, the authoritative key inventory, and the localization pass (spec-0001 i18n addendum).
- layout
- Space is a graph before it is a coordinate (spec-0049 §3, §4.2) — pipeline stages 2 and 3.
- mclang
- The pinned client’s own language set (Minecraft Java 1.21.11, ADR-0009).
- metrics
- The metrics standard (spec-0049 §2) — pipeline stage 0.
- placement
- Where a campaign’s places and anchor names come from — asked once.
- prefab
- The prefab metadata document (
<id>.json, beside the structure.nbt) — the one definition of its shape. - registry
- Registries for data that lives outside the DSL: the vanilla item registry and prefab anchor metadata.
- schema
- JSON Schema export (one full envelope schema per stage) via
schemars. - siteplan
- The whole owns the space and hands out boxes (spec-0049 §4) — pipeline stage 4, the geometric embedding of the layout graph.
- split
- Oversize splitting — the one tiling in this project.
- stages
- serde types for the six stage
contentpayloads (spec-0001 v0.2). - validate
- Campaign validation: all six rule groups from spec-0001.