Skip to content

loom: implement a parser and constraint solver for semver#1081

Open
aatxe wants to merge 12 commits into
primaryfrom
awe/semver-impl
Open

loom: implement a parser and constraint solver for semver#1081
aatxe wants to merge 12 commits into
primaryfrom
awe/semver-impl

Conversation

@aatxe
Copy link
Copy Markdown
Member

@aatxe aatxe commented May 8, 2026

Implements a semver library for loom, covering the two concerns needed for dependency resolution: version parsing and constraint satisfaction. Integration of this is left to follow-up work.

Parser (semver/parser.luau)

  • Strict SemVer 2.0.0 parsing with full validation (leading zeros, empty identifiers, malformed pre-release/build metadata)
  • Pre-release identifier comparison per the spec (numeric vs. string precedence, field-by-field)
  • Constraint syntax includes: bare versions, comparison operators (>=, <=, >, <, =), caret (^), tilde (~), wildcards (*/x/X), and space-separated AND ranges
  • Pre-release opt-in: pre-release versions are excluded from range matches unless the constraint explicitly names a pre-release on the same M.m.p tuple

Solver (semver/solver.luau)

  • Greedy BFS dependency resolver: selects the highest satisfying version for each package, propagates transitive constraints, and retracts stale constraints when a selection changes
  • Conflict detection with a human-readable error message listing all conflicting requirements and their sources
  • Circular dependency detection
  • Deterministic resolution order (root requirements sorted by alias)

@aatxe aatxe self-assigned this May 8, 2026
@aatxe aatxe added infra Infrastructure improvements cli The lute command-line interface labels May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli The lute command-line interface infra Infrastructure improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants