Skip to content

Contracts

Every boundary in Astrolabe is a TypeScript interface in @astl/core (no runtime dependencies). Implementations live in other packages and can be replaced. This page maps the contracts; the source files are the reference.

ComponentManifest (data, one per type) links to ComponentDefinition (engine side), PlayerElementApi (player side) and EditorDescriptor (authoring side), which link to the Engine, <astl-player> and EditorAdapter (your WYSIWYG). The Engine sends the view to <astl-player>, and EditorAdapter points to <astl-player> too. The Engine links to the AnswerKey, and <astl-player> to the Checker (local or HTTP: grading protocol), which grades against the AnswerKey.
Contracts (file) Implemented by Purpose
ComponentManifest, AttributeSpec, ChildSpec, ScoringSpec (manifest.ts) each component the only per-type schema: attributes with visibility, children, scoring modes, issue codes, a11y pattern, CSS parts
ComponentDefinition, ValidateContext, CompileContext, SlotSpec (definition.ts) each component validate an element, produce slots + keys, produce the public view element
SlotKind, NormalisationProfile, GradeContext (slots.ts) engine built-ins + yours open registry of grading semantics
ScoringRule, ScoringGroup (scoring.ts) engine all-correct / per-slot / proportional
Engine, EngineOptions, CompileResult, ValidationReport (engine.ts) @astl/engine validate, compile, grade, solution, describe
AnswerKey, Metadata, Compilation (compiled.ts) engine compile outputs
Answers (answers.ts) everyone strings keyed by slot id
GradeResult, GroupResult, Solution (result.ts) engine what students and hosts see; no key data
Checker, CheckRequest, CheckResponse, SubmitRequest, SubmitResponse, HintRequest, HintResponse, ResultHelp, CheckerError (checker.ts) localChecker (engine), httpChecker (player), yours how a player gets verdicts, hints, feedback texts and explanations
ProblemDetails, ProblemCode, ProtocolPath (protocol.ts) @astl/server, yours HTTP binding of the checker (protocol 1)
AttemptPolicy, helpPolicy (policy.ts) hosts practice / test / review, navigation, checks, deadline, pass mark, reveal, and help for students (hints, checks of one interaction, when feedback and explanations come), with defaults by mode
ElementHelp, Feedback, help tags (help.ts) engine, player what a view offers of help, what a checker sends of it
Snapshot (snapshot.ts) player restore an attempt after reload
PlayerElementApi, ElementContext, ElementFeedback, PlayerEvent (player.ts) each component element how <astl-player> talks to elements
SourceCompiler (player.ts) astrolabe.js, yours turns a light-DOM source with answers into a view and a checker (HTML with answers)
EditorDescriptor, InspectorField, EditorAdapter (authoring.ts) components; your WYSIWYG editor-agnostic authoring
Issue, IssueLocation, EngineIssue (issues.ts) engine + definitions validation results as codes + params
MessageCatalog, MessageFormatter, I18n (i18n/types.ts) core (createI18n, icuFormatter) UI strings, ICU MessageFormat 1
ElementNode, TextNode (ast.ts) engine the document tree definitions work on
  • Contracts are versioned with the packages (semver). Wire formats carry their own versions: content format (<astl-doc format="1">), element v, AnswerKey.format, Snapshot.format, PROTOCOL_VERSION.
  • Stored views and keys are immutable. A newer player must render every older view version of its elements; ComponentDefinition.migrations upgrades old sources.
  • Conformance fixtures (packages/components/src/<type>/fixtures) are the executable contract for engine ports.