Skip to content

Releases: contriboss/pubgrub-go

v0.3.4

13 Jan 19:47
f8084a0

Choose a tag to compare

feat(solver): prefer highest versions + fix caching/dedupe (#1)

v0.3.3

01 Nov 00:04

Choose a tag to compare

v0.3.3

v0.3.2

31 Oct 23:52

Choose a tag to compare

v0.3.2

v0.3.1

31 Oct 20:55

Choose a tag to compare

Changes

  • add structured logging hooks across solver and state to emit slog traces when configured
  • expose partial solution snapshots and pending package helpers for diagnostics
  • document WithLogger usage in README and align attribution version
  • add regression test covering previousDecisionLevel logic

v0.3.0

27 Oct 12:08

Choose a tag to compare

Refactored codebase to follow ore-ecosystem philosophy with focused, Ruby-style modules.

v0.2.0 - Custom Condition Support

27 Oct 11:13

Choose a tag to compare

What's New

Custom Condition Support 🎯

This release adds the VersionSetConverter interface, enabling custom version conditions to work seamlessly with the CDCL solver.

New Interface

type VersionSetConverter interface {
    ToVersionSet() VersionSet
}

Custom conditions can now implement this optional interface to participate in set operations (union, intersection, complement) required by the solver's conflict analysis.

Example: npm-style Caret Constraint

type CaretCondition struct {
    Base *SemanticVersion
}

func (cc CaretCondition) String() string {
    return fmt.Sprintf("^%s", cc.Base)
}

func (cc CaretCondition) Satisfies(ver Version) bool {
    sv, ok := ver.(*SemanticVersion)
    if !ok { return false }
    return sv.Major == cc.Base.Major && sv.Sort(cc.Base) >= 0
}

// Enable CDCL solver support
func (cc CaretCondition) ToVersionSet() VersionSet {
    rangeStr := fmt.Sprintf(">=%d.%d.%d, <%d.0.0",
        cc.Base.Major, cc.Base.Minor, cc.Base.Patch,
        cc.Base.Major+1)
    set, _ := ParseVersionRange(rangeStr)
    return set
}

// Use with solver
base, _ := ParseSemanticVersion("1.2.0")
condition := CaretCondition{Base: base}  // ^1.2.0
root.AddPackage("mylib", condition)
solver.Solve(root.Term())  // Works!

Benefits

  • Non-breaking - All existing code continues to work
  • Opt-in - Custom conditions choose to implement the interface
  • Efficient - Algebraic conversion, not version testing
  • Well-documented - README, godoc, and working examples

Installation

go get github.com/contriboss/pubgrub-go@v0.2.0

Full Changelog

Added:

  • VersionSetConverter interface for custom condition support
  • Comprehensive CaretCondition example with tests
  • Custom condition documentation in README

Changed:

  • termAllowedSet() and termForbiddenSet() now check for VersionSetConverter

Compatibility: 100% backward compatible with v0.1.0

v0.1.0 - Initial Release

27 Oct 10:33

Choose a tag to compare

PubGrub-Go v0.1.0

Initial Release

A comprehensive Go implementation of the PubGrub version solving algorithm.

Features

  • CDCL Solver: Full Conflict-Driven Clause Learning implementation with unit propagation
  • Semantic Versioning: Complete semver support with prerelease/build metadata
  • Version Ranges: Complex constraints (>=, >, <=, <, ==, !=, AND/OR logic)
  • Enhanced Error Messages: Human-readable derivation trees explaining resolution failures
  • CachedSource: Optional caching wrapper for expensive I/O sources
  • Production Ready: Microsecond-level performance for complex dependency graphs

Requirements

  • Go 1.25 or later

Installation

go get github.com/contriboss/pubgrub-go@v0.1.0

Credits

Derived from tinyrange/pubgrub v0.2.6 with significant enhancements.

Based on the PubGrub algorithm by Natalie Weizenbaum.