Skip to content

Commit fd66b73

Browse files
Jonathan D.A. Jewellclaude
andcommitted
feat: implement package manager (Enhancement #2)
Adds Cargo-style dependency management for Ephapax projects. Features: - Manifest parsing (ephapax.toml) with TOML validation - Dependency resolution using backtracking algorithm - Local package registry (~/.ephapax/registry/) - Version constraint satisfaction (SemVer) - Transitive dependency resolution - Mode-specific dependencies (affine/linear) - CLI commands: init, install, search, list New crate: ephapax-package (4 modules, 875 lines, 14 tests) - manifest.rs: TOML parsing and validation - registry.rs: Local package storage and indexing - resolver.rs: Dependency resolution with backtracking - lib.rs: Public API CLI integration: - ephapax package init <name>: Initialize new projects - ephapax package install: Install from manifest - ephapax package search <query>: Search packages - ephapax package list: List installed packages Testing: - All 14 unit tests passing - Integration test verified (init, manifest editing) Documentation: - docs/PACKAGE-MANAGER.md (complete guide) - ENHANCEMENTS-STATUS.md updated (40% complete, 2/5 done) Future enhancements: - Phase 2: Remote registry (publish/download from central repo) - Phase 3: Module import syntax in language - Phase 4: Lockfile generation (ephapax.lock) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 6962b83 commit fd66b73

11 files changed

Lines changed: 2779 additions & 12 deletions

File tree

Cargo.lock

Lines changed: 890 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ members = [
1616
"src/ephapax-cli",
1717
"src/ephapax-stdlib",
1818
"src/ephapax-lsp",
19+
"src/ephapax-package",
1920
# "src/ephapax-vram-cache", # Disabled: requires ephapax-proven repo
2021
]
2122

@@ -42,6 +43,7 @@ ephapax-interp = { path = "src/ephapax-interp" }
4243
ephapax-repl = { path = "src/ephapax-repl" }
4344
ephapax-stdlib = { path = "src/ephapax-stdlib" }
4445
ephapax-lsp = { path = "src/ephapax-lsp" }
46+
ephapax-package = { path = "src/ephapax-package" }
4547
ephapax-vram-cache = { path = "src/ephapax-vram-cache" }
4648

4749
# External dependencies

ENHANCEMENTS-STATUS.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Ephapax Enhancement Suite - Implementation Status
22

33
**Date**: 2026-02-07
4-
**Overall Completion**: 20% (1/5 enhancements completed)
4+
**Overall Completion**: 40% (2/5 enhancements completed)
55

66
This document tracks the implementation status of the 5 optional enhancements planned for Ephapax after reaching 100% core language completion.
77

@@ -110,12 +110,58 @@ ephapax compile test.eph --debug --mode linear
110110

111111
---
112112

113-
## Enhancement #2: Package Manager ⏳ NOT STARTED
113+
## Enhancement #2: Package Manager ✅ COMPLETED
114114

115115
**Priority**: 2
116-
**Status**: Planned
117-
**Completion**: 0%
118-
**Effort**: 2-3 weeks
116+
**Status**: Complete
117+
**Completion**: 100%
118+
**Effort**: ~4 hours (implemented 2026-02-07)
119+
120+
### What Was Implemented
121+
122+
#### ✅ Core Features
123+
- **Manifest Parsing**: Full `ephapax.toml` support with validation
124+
- **Local Registry**: Package storage in `~/.ephapax/registry/`
125+
- **Dependency Resolution**: Backtracking algorithm with SemVer constraints
126+
- **Version Selection**: Automatic latest compatible version selection
127+
- **Transitive Dependencies**: Recursive dependency tree resolution
128+
- **Mode-Specific Dependencies**: Support for `mode = "affine"` specification
129+
130+
#### ✅ CLI Commands
131+
- `ephapax package init <name>` - Initialize new projects
132+
- `ephapax package install` - Install from manifest
133+
- `ephapax package search <query>` - Search local registry
134+
- `ephapax package list` - List installed packages
135+
136+
#### ✅ New Crate: `ephapax-package`
137+
**Modules**:
138+
- `manifest.rs` - TOML parsing and validation (275 lines)
139+
- `registry.rs` - Local package storage (280 lines)
140+
- `resolver.rs` - Dependency resolution (230 lines)
141+
- `lib.rs` - Public API (90 lines)
142+
143+
**Tests**: 14 unit tests covering:
144+
- Manifest parsing (valid/invalid cases)
145+
- Dependency specifications (simple, detailed, path, git)
146+
- Registry operations (install, search, versions)
147+
- Resolution (simple, transitive, version selection)
148+
149+
### What Remains (Future Enhancements)
150+
151+
#### ⏳ Phase 2: Remote Registry
152+
- HTTP API for package upload/download
153+
- Authentication with API tokens
154+
- `ephapax package publish` command
155+
- Central package repository
156+
157+
#### ⏳ Phase 3: Module Import Syntax
158+
- Parser: Add `import` statement
159+
- Type checker: Resolve module paths
160+
- Codegen: Link multiple modules
161+
162+
#### ⏳ Phase 4: Lockfile Generation
163+
- Generate `ephapax.lock` for reproducibility
164+
- Pin exact dependency versions
119165

120166
### Design
121167

0 commit comments

Comments
 (0)