intent

    Pure canonical intent and reading packet domain model for specification-driven workflows

    intent
    openspec
    sdd
    reading-packet
    Download zip
    Author
    Version
    0.7.0
    License
    Apache-2.0
    Last updated
    12 hours ago
    Downloads
    12

    #moonrockz/intent

    Pure, four-target (wasm, wasm-gc, js, native) canonical intent and reading packet domain model for Mission Control.

    Unifies specification-driven changes, workflow artifacts, requirement deltas, task checklists, and diagnostics across adapters (openspec, bmad, or custom SDD adapters) through the open IntentAdapter trait and deterministic compose_projections combiner.

    IntentAdapter

    pub(open) trait IntentAdapter {
    fn adapter_id(Self) -> AdapterId
    fn project(Self, workspace_urn~ : String, files : ReadOnlyArray[(DocumentPath, String)]) -> IntentProjection
    }

    Open extension point for SDD adapters (OpenSpec, BMAD, or custom formats) that project pure workspace file snapshots into canonical IntentProjection values without performing I/O.

    AdapterIdError

    pub suberror AdapterIdError {
    InvalidAdapterId(input~ : String, rule~ : SlugRule)
    } derive(Eq,
    Debug
    )

    Parse error for AdapterId.

    AdapterIdError::equal

    automatically derived

    AdapterIdError::not_equal

    fn AdapterIdError::not_equal(x : AdapterIdError, y : AdapterIdError) -> Bool
    automatically derived

    AdapterIdError::to_repr

    automatically derived

    DocumentPathError

    pub suberror DocumentPathError {
    InvalidDocumentPath(input~ : String, rule~ : DocumentPathRule)
    } derive(Eq,
    Debug
    )

    Parse error for DocumentPath.

    DocumentPathError::equal

    automatically derived

    DocumentPathError::not_equal

    fn DocumentPathError::not_equal(x : DocumentPathError, y : DocumentPathError) -> Bool
    automatically derived

    DocumentPathError::to_repr

    automatically derived

    IntentIdError

    pub suberror IntentIdError {
    InvalidIntentId(input~ : String, rule~ : IntentIdRule)
    } derive(Eq,
    Debug
    )

    Parse error for IntentId.

    IntentIdError::equal

    automatically derived

    IntentIdError::not_equal

    fn IntentIdError::not_equal(x : IntentIdError, y : IntentIdError) -> Bool
    automatically derived

    IntentIdError::to_repr

    automatically derived

    IntentTitleError

    pub suberror IntentTitleError {
    InvalidIntentTitle(input~ : String, rule~ : IntentTitleRule)
    } derive(Eq,
    Debug
    )

    Parse error for IntentTitle.

    IntentTitleError::equal

    automatically derived

    IntentTitleError::not_equal

    fn IntentTitleError::not_equal(x : IntentTitleError, y : IntentTitleError) -> Bool
    automatically derived

    IntentTitleError::to_repr

    automatically derived

    StageIdError

    pub suberror StageIdError {
    InvalidStageId(input~ : String, rule~ : SlugRule)
    } derive(Eq,
    Debug
    )

    Parse error for StageId.

    StageIdError::equal

    automatically derived

    StageIdError::not_equal

    fn StageIdError::not_equal(x : StageIdError, y : StageIdError) -> Bool
    automatically derived

    StageIdError::to_repr

    automatically derived

    AdapterId

    pub struct AdapterId {
    // private fields
    } derive(Compare, Eq, Hash,
    Debug
    )

    Validated open identifier for an SDD adapter (for example "openspec" or "bmad").
    impl Show for AdapterId

    AdapterId::AdapterId

    fn AdapterId::AdapterId(text : String) -> AdapterId raise AdapterIdError

    Parses a lowercase ASCII adapter identifier (1..32 chars, starting with a lowercase letter).

    AdapterId::as_str

    fn AdapterId::as_str(self : AdapterId) -> String

    Returns the underlying string representation.

    AdapterId::compare

    fn AdapterId::compare(AdapterId, AdapterId) -> Int
    automatically derived

    AdapterId::equal

    fn AdapterId::equal(AdapterId, AdapterId) -> Bool
    automatically derived

    AdapterId::hash_combine

    fn AdapterId::hash_combine(AdapterId, Hasher) -> Unit
    automatically derived

    AdapterId::not_equal

    fn AdapterId::not_equal(x : AdapterId, y : AdapterId) -> Bool
    automatically derived

    AdapterId::openspec

    fn AdapterId::openspec() -> AdapterId

    Built-in canonical adapter identifier for OpenSpec ("openspec").

    AdapterId::to_repr

    automatically derived

    ArtifactRole

    pub(all) enum ArtifactRole {
    Proposal
    Design
    SpecDelta
    Tasks
    MainSpec
    Custom(AdapterId)
    } derive(Eq,
    Debug
    )

    Role of a document inside a canonical reading packet. Built-in roles cover standard SDD artifacts while Custom keeps the axis open for additional adapters.

    ArtifactRole::equal

    automatically derived

    ArtifactRole::label

    fn ArtifactRole::label(self : ArtifactRole) -> String

    Human-readable label for an ArtifactRole.

    ArtifactRole::not_equal

    fn ArtifactRole::not_equal(x : ArtifactRole, y : ArtifactRole) -> Bool
    automatically derived

    ArtifactRole::to_repr

    automatically derived

    DocumentInput

    pub struct DocumentInput {
    // private fields
    } derive(Eq,
    Debug
    )

    Input payload for constructing a document in a ReadingPacket. Step numbers are assigned monotonically by ReadingPacket::ReadingPacket.

    DocumentInput::DocumentInput

    fn DocumentInput::DocumentInput(role~ : ArtifactRole, title~ : IntentTitle, path~ : DocumentPath, summary? : String, source_lines? : Array[String], requirements? : Array[RequirementDelta], tasks? : Array[TaskItem]) -> DocumentInput

    Creates an immutable DocumentInput. summary and source_lines carry raw prose/source lines without structural restrictions.

    DocumentInput::equal

    automatically derived

    DocumentInput::not_equal

    fn DocumentInput::not_equal(x : DocumentInput, y : DocumentInput) -> Bool
    automatically derived

    DocumentInput::to_repr

    automatically derived

    DocumentPath

    pub struct DocumentPath {
    // private fields
    } derive(Compare, Eq, Hash,
    Debug
    )

    Normalized workspace-relative path guaranteed to remain lexically confined inside its workspace root (1..256 Unicode scalar values).

    DocumentPath::DocumentPath

    fn DocumentPath::DocumentPath(raw : String) -> DocumentPath raise DocumentPathError

    Parses a workspace-relative document path, rejecting traversal, drive letters, backslashes, leading slashes, empty segments, and control chars.

    DocumentPath::as_str

    fn DocumentPath::as_str(self : DocumentPath) -> String

    Returns the normalized relative path string.

    DocumentPath::compare

    automatically derived

    DocumentPath::equal

    automatically derived

    DocumentPath::hash_combine

    fn DocumentPath::hash_combine(DocumentPath, Hasher) -> Unit
    automatically derived

    DocumentPath::not_equal

    fn DocumentPath::not_equal(x : DocumentPath, y : DocumentPath) -> Bool
    automatically derived

    DocumentPath::to_repr

    automatically derived

    DocumentPathRule

    pub(all) enum DocumentPathRule {
    Empty
    TooLong
    ControlCharacter
    BackslashNotAllowed
    ColonNotAllowed
    AbsolutePath
    EmptySegment
    DotSegment
    PathTraversal
    } derive(Eq,
    Debug
    )

    Reason why a DocumentPath failed confinement validation.

    DocumentPathRule::equal

    automatically derived

    DocumentPathRule::not_equal

    fn DocumentPathRule::not_equal(x : DocumentPathRule, y : DocumentPathRule) -> Bool
    automatically derived

    DocumentPathRule::to_repr

    automatically derived

    FnIntentAdapter

    pub struct FnIntentAdapter {
    // private fields
    }

    Functional adapter wrapper turning a closure into an IntentAdapter for lightweight composition and testing.

    FnIntentAdapter::FnIntentAdapter

    fn FnIntentAdapter::FnIntentAdapter(id~ : AdapterId, run : (String, ReadOnlyArray[(DocumentPath, String)]) -> IntentProjection) -> FnIntentAdapter

    Constructs a functional IntentAdapter.

    IntentDiagnostic

    pub struct IntentDiagnostic {
    // private fields
    } derive(Eq,
    Debug
    )

    Structured diagnostic emitted during intent projection or composition.

    IntentDiagnostic::IntentDiagnostic

    fn IntentDiagnostic::IntentDiagnostic(kind~ : IntentDiagnosticKind, path? : DocumentPath?, message~ : String) -> IntentDiagnostic

    Constructs an immutable IntentDiagnostic.

    IntentDiagnostic::equal

    automatically derived

    IntentDiagnostic::kind

    Structured kind of the diagnostic.

    IntentDiagnostic::message

    fn IntentDiagnostic::message(self : IntentDiagnostic) -> String

    Human-readable explanation of the diagnostic.

    IntentDiagnostic::not_equal

    fn IntentDiagnostic::not_equal(x : IntentDiagnostic, y : IntentDiagnostic) -> Bool
    automatically derived

    IntentDiagnostic::path

    Optional workspace-relative path associated with the diagnostic.

    IntentDiagnostic::to_repr

    automatically derived

    IntentDiagnosticKind

    pub(all) enum IntentDiagnosticKind {
    MissingArtifact(ArtifactRole)
    ParseProblem(String)
    EmptySpec
    DuplicateId(IntentId)
    } derive(Eq,
    Debug
    )

    Non-fatal diagnostic kind emitted while projecting workspace intent.

    IntentDiagnosticKind::equal

    automatically derived

    IntentDiagnosticKind::not_equal

    automatically derived

    IntentDiagnosticKind::to_repr

    automatically derived

    IntentId

    pub struct IntentId {
    // private fields
    } derive(Compare, Eq, Hash,
    Debug
    )

    Deterministic workspace-scoped RFC 8141 URN for a canonical intent item (urn:mc:intent:<slug>-<fnv1a32hex>).
    impl Show for IntentId

    IntentId::IntentId

    fn IntentId::IntentId(text : String) -> IntentId raise IntentIdError

    Parses a validated urn:mc:intent:<slug>-<8-hex> identifier.

    IntentId::as_str

    fn IntentId::as_str(self : IntentId) -> String

    Returns the full URN text.

    IntentId::compare

    fn IntentId::compare(IntentId, IntentId) -> Int
    automatically derived

    IntentId::equal

    fn IntentId::equal(IntentId, IntentId) -> Bool
    automatically derived

    IntentId::for_origin

    fn IntentId::for_origin(workspace_urn~ : String, adapter~ : AdapterId, label~ : String, origin_key~ : String) -> IntentId

    Derives a deterministic IntentId scoped to workspace_urn, adapter, and origin_key.

    IntentId::hash_combine

    fn IntentId::hash_combine(IntentId, Hasher) -> Unit
    automatically derived

    IntentId::not_equal

    fn IntentId::not_equal(x : IntentId, y : IntentId) -> Bool
    automatically derived

    IntentId::to_repr

    automatically derived

    IntentIdRule

    pub(all) enum IntentIdRule {
    MissingPrefix
    MissingHashSuffix
    InvalidSlug
    InvalidHashHex
    } derive(Eq,
    Debug
    )

    Reason why an IntentId URN failed parsing.

    IntentIdRule::equal

    automatically derived

    IntentIdRule::not_equal

    fn IntentIdRule::not_equal(x : IntentIdRule, y : IntentIdRule) -> Bool
    automatically derived

    IntentIdRule::to_repr

    automatically derived

    IntentItem

    pub struct IntentItem {
    // private fields
    } derive(Eq,
    Debug
    )

    A canonical work item (change, proposal, or epic slice) projected from a workspace source by an IntentAdapter.

    IntentItem::IntentItem

    fn IntentItem::IntentItem(id~ : IntentId, slug~ : String, title~ : IntentTitle, adapter~ : AdapterId, stage~ : StageId, status~ : IntentStatus, origin_path~ : DocumentPath, packet~ : ReadingPacket) -> IntentItem

    Constructs an immutable IntentItem.

    IntentItem::adapter

    fn IntentItem::adapter(self : IntentItem) -> AdapterId

    Adapter that projected this item.

    IntentItem::equal

    fn IntentItem::equal(IntentItem, IntentItem) -> Bool
    automatically derived

    IntentItem::id

    fn IntentItem::id(self : IntentItem) -> IntentId

    Deterministic workspace-scoped URN of the item.

    IntentItem::not_equal

    fn IntentItem::not_equal(x : IntentItem, y : IntentItem) -> Bool
    automatically derived

    IntentItem::origin_path

    fn IntentItem::origin_path(self : IntentItem) -> DocumentPath

    Confined workspace-relative folder or file path where the item lives.

    IntentItem::packet

    fn IntentItem::packet(self : IntentItem) -> ReadingPacket

    Ordered reading packet for this item.

    IntentItem::slug

    fn IntentItem::slug(self : IntentItem) -> String

    Short folder/change slug of the item.

    IntentItem::stage

    fn IntentItem::stage(self : IntentItem) -> StageId

    Current workflow stage of the item.

    IntentItem::status

    fn IntentItem::status(self : IntentItem) -> IntentStatus

    Lifecycle status of the item.

    IntentItem::task_progress

    fn IntentItem::task_progress(self : IntentItem) -> TaskProgress

    Derived checklist progress across the item's reading packet.

    IntentItem::title

    fn IntentItem::title(self : IntentItem) -> IntentTitle

    Human-readable title of the item.

    IntentItem::to_repr

    automatically derived

    IntentProjection

    pub struct IntentProjection {
    // private fields
    } derive(Eq,
    Debug
    )

    Complete canonical intent projection for a workspace: active/archived work items, main specification documents, and diagnostics.

    IntentProjection::IntentProjection

    fn IntentProjection::IntentProjection(items? : Array[IntentItem], specs? : Array[PacketDocument], diagnostics? : Array[IntentDiagnostic]) -> IntentProjection

    Constructs an immutable IntentProjection.

    IntentProjection::by_stage

    fn IntentProjection::by_stage(self : IntentProjection, stage : StageId) -> Array[IntentItem]

    Returns all items currently in stage.

    IntentProjection::diagnostics

    fn IntentProjection::diagnostics(self : IntentProjection) -> ReadOnlyArray[IntentDiagnostic]

    All diagnostics emitted during projection or composition.

    IntentProjection::empty

    Empty projection with zero items, specs, and diagnostics.

    IntentProjection::equal

    automatically derived

    IntentProjection::find

    Finds an item by its IntentId.

    IntentProjection::items

    fn IntentProjection::items(self : IntentProjection) -> ReadOnlyArray[IntentItem]

    All projected canonical intent items.

    IntentProjection::not_equal

    fn IntentProjection::not_equal(x : IntentProjection, y : IntentProjection) -> Bool
    automatically derived

    IntentProjection::specs

    fn IntentProjection::specs(self : IntentProjection) -> ReadOnlyArray[PacketDocument]

    All standalone main specifications in the workspace.

    IntentProjection::to_repr

    automatically derived

    IntentStatus

    pub(all) enum IntentStatus {
    Active
    ReadyToVerify
    Archived
    Blocked(String)
    } derive(Eq,
    Debug
    )

    Lifecycle status of a canonical intent item.

    IntentStatus::equal

    automatically derived

    IntentStatus::not_equal

    fn IntentStatus::not_equal(x : IntentStatus, y : IntentStatus) -> Bool
    automatically derived

    IntentStatus::to_repr

    automatically derived

    IntentTitle

    pub struct IntentTitle {
    // private fields
    } derive(Compare, Eq,
    Debug
    )

    Trimmed non-empty single-line title (1..200 Unicode scalar values, no control characters).
    impl Show for IntentTitle

    IntentTitle::IntentTitle

    fn IntentTitle::IntentTitle(raw : String) -> IntentTitle raise IntentTitleError

    Parses a trimmed single-line title.

    IntentTitle::as_str

    fn IntentTitle::as_str(self : IntentTitle) -> String

    Returns the normalized title string.

    IntentTitle::compare

    fn IntentTitle::compare(IntentTitle, IntentTitle) -> Int
    automatically derived

    IntentTitle::equal

    fn IntentTitle::equal(IntentTitle, IntentTitle) -> Bool
    automatically derived

    IntentTitle::not_equal

    fn IntentTitle::not_equal(x : IntentTitle, y : IntentTitle) -> Bool
    automatically derived

    IntentTitle::to_repr

    automatically derived

    IntentTitleRule

    pub(all) enum IntentTitleRule {
    Empty
    TooLong
    ControlCharacter
    } derive(Eq,
    Debug
    )

    Reason why an IntentTitle failed validation.

    IntentTitleRule::equal

    automatically derived

    IntentTitleRule::not_equal

    fn IntentTitleRule::not_equal(x : IntentTitleRule, y : IntentTitleRule) -> Bool
    automatically derived

    IntentTitleRule::to_repr

    automatically derived

    PacketDocument

    pub struct PacketDocument {
    // private fields
    } derive(Eq,
    Debug
    )

    One document inside an ordered ReadingPacket, carrying its 1-based monotonic step number.

    PacketDocument::equal

    automatically derived

    PacketDocument::not_equal

    fn PacketDocument::not_equal(x : PacketDocument, y : PacketDocument) -> Bool
    automatically derived

    PacketDocument::path

    Confined workspace-relative path of the document.

    PacketDocument::requirements

    fn PacketDocument::requirements(self : PacketDocument) -> ReadOnlyArray[RequirementDelta]

    Requirement deltas contained in the document.

    PacketDocument::role

    Artifact role of the document.

    PacketDocument::source_lines

    fn PacketDocument::source_lines(self : PacketDocument) -> ReadOnlyArray[String]

    Raw source lines of the document.

    PacketDocument::standalone

    fn PacketDocument::standalone(input : DocumentInput) -> PacketDocument

    Constructs a standalone PacketDocument (such as a main specification outside a change reading packet) at step 1.

    PacketDocument::step

    fn PacketDocument::step(self : PacketDocument) -> Int

    1-based position inside the owning reading packet.

    PacketDocument::summary

    fn PacketDocument::summary(self : PacketDocument) -> String

    Leading summary prose extracted from the document.

    PacketDocument::tasks

    fn PacketDocument::tasks(self : PacketDocument) -> ReadOnlyArray[TaskItem]

    Checklist tasks contained in the document.

    PacketDocument::title

    Display title of the document.

    PacketDocument::to_repr

    automatically derived

    ReadingPacket

    pub struct ReadingPacket {
    // private fields
    } derive(Eq,
    Debug
    )

    Ordered reading packet whose documents are monotonically numbered 1..N.

    ReadingPacket::ReadingPacket

    fn ReadingPacket::ReadingPacket(inputs : Array[DocumentInput]) -> ReadingPacket

    Constructs a ReadingPacket, assigning 1-based monotonic step indices 1..N in document order.

    ReadingPacket::document_at

    fn ReadingPacket::document_at(self : ReadingPacket, step : Int) -> PacketDocument?

    Document at 1-based step number step, if in range.

    ReadingPacket::document_by_role

    fn ReadingPacket::document_by_role(self : ReadingPacket, role : ArtifactRole) -> PacketDocument?

    First document matching role, if present.

    ReadingPacket::documents

    fn ReadingPacket::documents(self : ReadingPacket) -> ReadOnlyArray[PacketDocument]

    All ordered documents in the reading packet.

    ReadingPacket::equal

    automatically derived

    ReadingPacket::not_equal

    fn ReadingPacket::not_equal(x : ReadingPacket, y : ReadingPacket) -> Bool
    automatically derived

    ReadingPacket::step_count

    fn ReadingPacket::step_count(self : ReadingPacket) -> Int

    Number of documents in the reading packet.

    ReadingPacket::task_progress

    fn ReadingPacket::task_progress(self : ReadingPacket) -> TaskProgress

    Aggregates TaskProgress across all tasks in the reading packet.

    ReadingPacket::to_repr

    automatically derived

    RequirementDelta

    pub struct RequirementDelta {
    // private fields
    } derive(Eq,
    Debug
    )

    A requirement delta extracted from a specification or delta document. text holds arbitrary EARS requirement prose.

    RequirementDelta::RequirementDelta

    fn RequirementDelta::RequirementDelta(kind~ : RequirementDeltaKind, title~ : IntentTitle, text~ : String, scenarios? : Array[ScenarioEntry]) -> RequirementDelta

    Constructs an immutable RequirementDelta.

    RequirementDelta::equal

    automatically derived

    RequirementDelta::kind

    Delta kind (Added, Modified, Removed, or Renamed).

    RequirementDelta::not_equal

    fn RequirementDelta::not_equal(x : RequirementDelta, y : RequirementDelta) -> Bool
    automatically derived

    RequirementDelta::scenarios

    fn RequirementDelta::scenarios(self : RequirementDelta) -> ReadOnlyArray[ScenarioEntry]

    Immutable list of scenarios for this requirement.

    RequirementDelta::text

    fn RequirementDelta::text(self : RequirementDelta) -> String

    Requirement EARS prose text.

    RequirementDelta::title

    Requirement heading title.

    RequirementDelta::to_repr

    automatically derived

    RequirementDeltaKind

    pub(all) enum RequirementDeltaKind {
    Added
    Modified
    Removed
    Renamed
    } derive(Eq,
    Debug
    )

    Change operation for a requirement entry in a delta specification.

    RequirementDeltaKind::equal

    automatically derived

    RequirementDeltaKind::not_equal

    automatically derived

    RequirementDeltaKind::to_repr

    automatically derived

    ScenarioEntry

    pub struct ScenarioEntry {
    // private fields
    } derive(Eq,
    Debug
    )

    A single Gherkin-style acceptance scenario attached to a requirement. when_text and then_text hold free prose clauses without structural character restrictions.

    ScenarioEntry::ScenarioEntry

    fn ScenarioEntry::ScenarioEntry(title~ : IntentTitle, when_text~ : String, then_text~ : String) -> ScenarioEntry

    Constructs an immutable ScenarioEntry.

    ScenarioEntry::equal

    automatically derived

    ScenarioEntry::not_equal

    fn ScenarioEntry::not_equal(x : ScenarioEntry, y : ScenarioEntry) -> Bool
    automatically derived

    ScenarioEntry::then_text

    fn ScenarioEntry::then_text(self : ScenarioEntry) -> String

    THEN clause prose of the scenario.

    ScenarioEntry::title

    Title of the scenario.

    ScenarioEntry::to_repr

    automatically derived

    ScenarioEntry::when_text

    fn ScenarioEntry::when_text(self : ScenarioEntry) -> String

    WHEN clause prose of the scenario.

    SlugRule

    pub(all) enum SlugRule {
    Empty
    TooLong
    MustStartWithLowerLetter
    InvalidCharacter
    TrailingHyphen
    DoubleHyphen
    } derive(Eq,
    Debug
    )

    Reason why a lowercase identifier slug failed validation.

    SlugRule::equal

    fn SlugRule::equal(SlugRule, SlugRule) -> Bool
    automatically derived

    SlugRule::not_equal

    fn SlugRule::not_equal(x : SlugRule, y : SlugRule) -> Bool
    automatically derived

    SlugRule::to_repr

    automatically derived

    StageId

    pub struct StageId {
    // private fields
    } derive(Compare, Eq, Hash,
    Debug
    )

    Validated workflow stage identifier (open to custom workspace stages while providing built-in canonical constructors).
    impl Show for StageId

    StageId::StageId

    fn StageId::StageId(text : String) -> StageId raise StageIdError

    Parses a lowercase ASCII stage identifier (1..32 chars, starting with a lowercase letter).

    StageId::as_str

    fn StageId::as_str(self : StageId) -> String

    Returns the underlying string representation.

    StageId::compare

    fn StageId::compare(StageId, StageId) -> Int
    automatically derived

    StageId::equal

    fn StageId::equal(StageId, StageId) -> Bool
    automatically derived

    StageId::explore

    fn StageId::explore() -> StageId

    Canonical Explore stage ("explore").

    StageId::hash_combine

    fn StageId::hash_combine(StageId, Hasher) -> Unit
    automatically derived

    StageId::implement

    fn StageId::implement() -> StageId

    Canonical Implement stage ("implement").

    StageId::not_equal

    fn StageId::not_equal(x : StageId, y : StageId) -> Bool
    automatically derived

    StageId::propose

    fn StageId::propose() -> StageId

    Canonical Propose stage ("propose").

    StageId::release

    fn StageId::release() -> StageId

    Canonical Release stage ("release").

    StageId::to_repr

    automatically derived

    StageId::verify

    fn StageId::verify() -> StageId

    Canonical Verify stage ("verify").

    TaskItem

    pub struct TaskItem {
    // private fields
    } derive(Eq,
    Debug
    )

    One checklist task item extracted from a tasks.md or equivalent artifact.

    TaskItem::TaskItem

    fn TaskItem::TaskItem(code? : String, label~ : IntentTitle, completed~ : Bool) -> TaskItem

    Constructs an immutable TaskItem. code is an optional task reference such as "1.1" (or empty when unnumbered).

    TaskItem::code

    fn TaskItem::code(self : TaskItem) -> String

    Task code prefix (for example "1.1").

    TaskItem::completed

    fn TaskItem::completed(self : TaskItem) -> Bool

    Whether the task checkbox is ticked.

    TaskItem::equal

    fn TaskItem::equal(TaskItem, TaskItem) -> Bool
    automatically derived

    TaskItem::label

    fn TaskItem::label(self : TaskItem) -> IntentTitle

    Task description title.

    TaskItem::not_equal

    fn TaskItem::not_equal(x : TaskItem, y : TaskItem) -> Bool
    automatically derived

    TaskItem::to_repr

    automatically derived

    TaskProgress

    pub struct TaskProgress {
    // private fields
    } derive(Eq,
    Debug
    )

    Derived checklist progress where 0 <= completed <= total holds by construction.

    TaskProgress::all_done

    fn TaskProgress::all_done(self : TaskProgress) -> Bool

    Whether every task is completed (true when total > 0 and completed == total).

    TaskProgress::completed

    fn TaskProgress::completed(self : TaskProgress) -> Int

    Number of completed tasks.

    TaskProgress::equal

    automatically derived

    TaskProgress::from_tasks

    fn TaskProgress::from_tasks(tasks : Array[TaskItem]) -> TaskProgress

    Derives TaskProgress from a sequence of task items.

    TaskProgress::not_equal

    fn TaskProgress::not_equal(x : TaskProgress, y : TaskProgress) -> Bool
    automatically derived

    TaskProgress::percent

    fn TaskProgress::percent(self : TaskProgress) -> Int

    Integer completion percentage in [0, 100]. Returns 100 when total == 0.

    TaskProgress::to_repr

    automatically derived

    TaskProgress::total

    fn TaskProgress::total(self : TaskProgress) -> Int

    Total number of tasks.

    compose_projections

    fn compose_projections(projections : Array[IntentProjection]) -> IntentProjection

    Deterministically combines projections from multiple adapters. Preserves the first IntentItem for each IntentId, emits a DuplicateId diagnostic for any colliding item, sorts items by IntentId and specs by DocumentPath, and retains all diagnostics.

    run_adapters

    fn run_adapters(adapters : Array[&IntentAdapter], workspace_urn~ : String, files : ReadOnlyArray[(DocumentPath, String)]) -> IntentProjection

    Runs every adapter in adapters over the same immutable file snapshot and composes their projections deterministically.