Skip to content

Bug: ModelProfile is missing current() / latest() constructors and SpecificationRevision::CURRENT constant present on ExprProfile #212

@mwiebe

Description

@mwiebe

Describe the bug

ExprProfile exposes a small but useful API for "default" profile construction:

  • ExprRevision::CURRENT — a pub const pointing at the current default revision (today: V2026_02).
  • ExprProfile::current() — a constructor that builds a profile at ExprRevision::CURRENT with no extensions and no host context. Documented as "Shortcut for ExprProfile::new(ExprRevision::CURRENT)."
  • ExprProfile::latest() — a constructor that builds a profile at the latest revision with every known extension enabled. Documented as "Intentionally unstable across crate versions."

ModelProfile does not expose any of these, but it should.

Expected Behaviour

ModelProfile should mirror the API shape of ExprProfile:

impl SpecificationRevision {
    pub const CURRENT: SpecificationRevision = SpecificationRevision::V2023_09;
}

impl ModelProfile {
    /// Shortcut for `ModelProfile::new(SpecificationRevision::CURRENT)`.
    pub fn current() -> Self {
        Self::new(SpecificationRevision::CURRENT)
    }

    /// Build a profile with the latest revision and every known
    /// model extension enabled.
    ///
    /// **Intentionally unstable across crate versions.** As new
    /// extensions are added to `ModelExtension::ALL` and new revisions
    /// land at `SpecificationRevision::CURRENT`, the set of enabled
    /// features grows. For behavior that is stable across crate
    /// versions, construct an explicit profile via
    /// `ModelProfile::new(...)` instead.
    pub fn latest() -> Self {
        let mut p = Self::new(SpecificationRevision::CURRENT);
        // populate with all known ModelExtension variants
        ...
        p
    }
}

This would let callers write ModelProfile::current() for "the standard default" or ModelProfile::latest() for "everything turned on", matching the established pattern from openjd-expr. The hardcoded V2023_09 literal would live in exactly one place: SpecificationRevision::CURRENT.

Current Behaviour

ModelProfile only offers ModelProfile::new(revision), which requires the caller to name a specific revision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions