aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2026-05-01feat(install): verify lock file satisfies composer.json requiresnsfisis
Mirrors Composer's Installer::doInstall() check: before installing from an existing composer.lock, walk every root require (and require-dev in dev mode) and confirm the lock contains a satisfying package. If any are missing or fail the constraint, print the standard bullet-list diagnostic and exit with LOCK_FILE_INVALID (4) instead of blindly attempting to install and failing later with a misleading "no dist or source information" error. Closes the gap exercised by the outdated-lock-file-fails-install installer fixture. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01refactor: fix clippy warningsnsfisis
Replace if-let/else-return with `?`, swap `as_ref().map(|k| k.as_slice())` for `as_deref()`, and switch test fixtures from `vec\![]` to array literals where ownership is unneeded. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01fix(registry): default missing composer.lock _readme to canonical textnsfisis
Composer treats _readme as write-only metadata: Locker.php injects it on write but the loader never requires it. Mozart's deserializer was strict, so any composer.lock without _readme failed to parse — including most fixtures under composer/tests/.../installer/*.test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01feat(registry): accept v1 (bare array) installed.jsonnsfisis
Composer's FilesystemRepository::initialize branches on isset($data['packages']) — object form is v2, bare array is v1 — and treats dev-package-names/dev as optional. Mirror that in InstalledPackages::read so Mozart consumes shared .test fixtures (which use v1) without harness preprocessing, and so installs over v1-era vendor directories keep working. Drop the v1→v2 wrapper that was added to mozart-test-harness for the same reason. Removes #[ignore] from update_to_empty_from_locked (2/187 green). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01fix(core): default missing composer.json "name" to __root__nsfisis
Composer's RootPackageLoader assigns the root name "__root__" when composer.json omits the "name" field. Mozart was failing deserialization in that case, blocking any installer fixture with a nameless root manifest. Apply the same serde default and unignore update-to-empty-from-blank as the first green entry on the .test scoreboard.
2026-05-01Merge branch 'test/composer-integration-tests'nsfisis
2026-05-01test(test-harness): enumerate Composer installer .test fixturesnsfisis
Add per-fixture #[test] entries (187 total) via a small declarative macro that reads files directly from the composer submodule. For now each test only asserts the file parses; execution and EXPECT-* checks will be layered on as the harness gains comparison helpers.
2026-05-01feat(test-harness): add Composer .test fixture parser and runnernsfisis
Foundation for porting Composer's installer integration fixtures. Parser covers the 13 sections of InstallerTest.php; runner sets up a tempdir from COMPOSER/LOCK/INSTALLED and invokes the mozart binary. No fixtures are migrated in this commit.
2026-02-24fix(cache): enable dist archive caching for all commandsnsfisis
files_cache was Option<&Cache> and install_from_lock always passed None, so downloaded zip/tar archives were never cached. Make the parameter non-optional (&Cache) and wire it through every command that downloads dist archives (install, update, require, remove, create-project, archive). The Cache internally respects --no-cache via its enabled flag, so the Option wrapper was unnecessary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24fix(solver): iterate live watch chain to prevent infinite loop in propagationnsfisis
The watch graph's propagateLiteral used a cloned chain for iteration while checking the live chain for bounds. After move_watch removed a node, the stale clone kept re-reading the same node index, causing an infinite loop on large dependency sets (e.g. laravel/laravel). Now re-fetch the live chain each iteration, matching Composer's SplDoublyLinkedList semantics where remove() advances the iterator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24feat(cache): enable repo cache for all Packagist API callsnsfisis
Remove the Option wrapper from repo_cache in ResolveRequest, LockFileGenerationRequest, and fetch_package_versions. All commands now initialize a Cache via build_cache_config(cli.no_cache), ensuring Packagist metadata is cached to disk (respecting --no-cache flag). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23feat(tracing): instrument network requests with tracing spansnsfisis
Add #[tracing::instrument] and debug logs to all HTTP-calling functions in mozart-registry and mozart-vcs for request-level observability (URL, status code, cache hits, download size). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23refactor(cli): route command output through Console abstractionnsfisis
Replace direct println\!/eprintln\! calls with console.write(), console.info(), and console.write_stdout() across all command handlers to respect verbosity settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(cli): align install/update output with Composer conventionsnsfisis
- Migrate eprintln\! to Console for consistent colored output - Use Composer terminology in lock file operations: Locking instead of Installing, Upgrading/Downgrading instead of Updating - Add is_downgrade() helper to distinguish upgrades from downgrades - Pass Console through install_from_lock for proper output handling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(semver): handle partial upper bounds in hyphen ranges per Composer specnsfisis
`parse_hyphen_range` was using `<=` for all upper bounds, but Composer treats partial versions (1-2 segments) differently: `8.1 - 8.5` should mean `>=8.1.0 <8.6.0-dev`, not `>=8.1.0 <=8.5.0`. This caused constraints like `php 8.1 - 8.5` to reject PHP 8.5.3. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23refactor(cli): replace std::process::exit() with bail_silent in command handlersnsfisis
Improves testability and ensures proper resource cleanup by returning errors through the existing MozartError/exit_code mechanism instead of terminating the process directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(cli): align subcommand help text with Composernsfisis
Sync descriptions with upstream Composer. Replace product name references (Composer/composer) with Mozart. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23refactor(vcs): convert VcsDriver trait to native asyncnsfisis
Replace manual tokio::runtime::Handle::current().block_on() calls with native async/await throughout all VCS drivers. Introduce AnyVcsDriver enum for static dispatch to avoid dyn trait with async methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23feat(vcs): add mozart-vcs crate for VCS repository supportnsfisis
Implement VCS driver/downloader infrastructure mirroring Composer's VCS subsystem. Includes drivers for GitHub, GitLab, Bitbucket, Forgejo, Git, Hg, and SVN with API-based metadata resolution, plus source downloaders for Git/Hg/SVN. Integrates into mozart-registry via vcs_bridge module to scan VCS repositories and feed discovered packages into the SAT resolver. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(validate): warn on orphan scripts-descriptions/aliases and honor config.locknsfisis
- Detect scripts-descriptions and scripts-aliases keys referencing non-existent scripts and emit warnings matching Composer's behavior - Respect config.lock=false in composer.json to skip lock file checks unless --check-lock is explicitly passed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(self-update): preserve backups and improve output messagesnsfisis
- clean-backups now preserves the most recent backup for rollback - Rollback no longer deletes the backup file after restoring - Show version and channel in update/already-up-to-date messages - Print rollback suggestion after successful update - Show version instead of file path in rollback output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(repository): support Composer's associative-key repo formatnsfisis
Composer stores repositories as {"name": {"type":...}} while Mozart only understood [{"name":"name","type":...}]. This adds normalization so Mozart can read both formats for list, get-url, set-url, and remove. Also distinguishes "no URL" from "not found" in get-url errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(prohibits): align behavior with Composer's why-not commandnsfisis
- Use installed packages by default instead of always preferring lock file - Error on unknown needle package instead of misleading "can be installed" - Return exit code 1 when prohibitors are found - Deduplicate output rows in dependency table - Print resolution hint suggesting require/update --dry-run Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(update): implement --with constraints, inline shorthand, and APCu ↵nsfisis
passthrough - Parse and apply --with temporary constraints to the resolver - Support inline constraint shorthand (vendor/pkg:1.0.*) - Reject --lock combined with specific package names - Filter magic keywords (lock/nothing/mirrors) from package list - Pass APCu CLI flags through to InstallConfig instead of hardcoding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(show): validate option combinations and support --ignore wildcardsnsfisis
- Reject invalid option combinations: --direct with --all/--platform/--available, --tree with --all/--available/--latest/--path, --self with package argument - Reject unsupported --format values (only "text" and "json" allowed) - Warn when --ignore is used without --outdated - Support wildcard patterns in --ignore values via matches_wildcard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(require): revert on failure, prevent duplicates, and honor confignsfisis
- Revert composer.json and composer.lock to original content on resolution failure - Detect and remove packages from opposite section to prevent duplicates - Block self-require (requiring the root package itself) - Read sort-packages, optimize-autoloader, classmap-authoritative, and apcu-autoloader from composer.json config as defaults - Pass APCu CLI flags through to InstallConfig instead of hardcoding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(show,outdated): align outdated classification and wildcard handling with ↵nsfisis
Composer - Extract matches_wildcard to mozart-core for reuse across commands - Support wildcard patterns in --package and --ignore arguments - Use ^<installed_version> for semver-safe classification instead of root constraint - Replace std::process::exit(1) with bail_silent for proper cleanup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(suggests): add long help text with documentation URLnsfisis
Match Composer's help output by adding long_about with a description and link to https://getcomposer.org/doc/03-cli.md#suggests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(run-script): whitelist events, improve PHP detection, and fix flag handlingnsfisis
Switch from blocklist to whitelist for script event blocking, detect all namespaced PHP callbacks (not just *Command), use bail_silent for exit codes, remove redundant COMPOSER_DEV_MODE env_overrides, handle --timeout 0 as no timeout, and respect --no-scripts flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(reinstall): add per-pattern warnings, config autoloader defaults, and ↵nsfisis
COMPOSER_DEV_MODE Emit per-pattern warnings for unmatched package names, read optimize-autoloader/classmap-authoritative/apcu-autoloader from composer.json config section, and set COMPOSER_DEV_MODE env var. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(licenses): add table headers and bordered summary outputnsfisis
Match Composer's Symfony Table formatting: add Name/Version/Licenses header row to text output and use bordered ASCII table for summary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(init): support COMPOSER_DEFAULT_* env vars and fix abort handlingnsfisis
- Add COMPOSER_DEFAULT_VENDOR env var support for package name default - Swap USERNAME/USER check order to match Composer (matters on Windows) - Add COMPOSER_DEFAULT_AUTHOR/COMPOSER_DEFAULT_EMAIL env var support - Require both name and email for author (Composer behavior) - Use bail_silent for abort to prevent double error message Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(fund): add ANSI color styling and use Console API for outputnsfisis
Style vendor names with <comment> (yellow) and package names with <info> (green) to match Composer's Symfony Console output. Route all output through Console::write_stdout() so --quiet is respected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(exec): use bail_silent for exit code and style binary listingnsfisis
Replace std::process::exit() with bail_silent() so Rust cleanup runs properly. Style the binary listing output with console_format\! markup to match Composer's Symfony Console styling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(diagnose): use bail_silent for exit code and add git color.ui checknsfisis
Replace std::process::exit() with bail_silent() so Rust cleanup and Drop handlers run properly on non-zero exit. Add a check for git color.ui=always which is known to cause issues with git output parsing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(create-project): fix self.version rewriting and autoloader confignsfisis
- Extend self.version replacement to conflict, provide, and replace link types (previously only require and require-dev) - Only rewrite self.version when VCS metadata is actually removed, matching Composer's behavior - Read optimize-autoloader, classmap-authoritative, and apcu-autoloader from the project's composer.json config section instead of hardcoding false Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(completion): auto-detect shell from $SHELL when argument omittednsfisis
Composer auto-detects the shell from the $SHELL environment variable when the shell argument is not provided. Mozart previously required the argument and errored without it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(clear-cache): add per-directory output, read-only guard, and always exit 0nsfisis
Match Composer's ClearCacheCommand behavior: - Print per-directory status messages (clearing/GC) instead of a single summary - Skip read-only caches with an informational message - Print message for non-existent cache directories instead of silently skipping - Catch filesystem errors and always return exit code 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(audit): write human-readable output to stderr to match Composernsfisis
Composer writes advisory and abandoned-package output to stderr, reserving stdout for JSON format only. Mozart was writing everything to stdout, which breaks piping and scripting workflows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(bump): use exit code 2 for stale lock file to match Composernsfisis
Composer's BumpCommand uses ERROR_LOCK_OUTDATED=2 for stale lock files, but Mozart was using LOCK_FILE_INVALID=4. Define a local constant to avoid conflicting with the global exit code registry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(status): align output with Composer stderr/stdout separation and add ↵nsfisis
symlink detection - Route headers and hints to stderr, package paths to stdout - Show full install path instead of vendor/<name> (M) - Detect symlinked packages and report instead of diffing - Add verbose hint message when not using -v - Replace std::process::exit(1) with bail_silent for proper cleanup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(search): match Composer single-line output format with truncationnsfisis
Replace two-line output (name+counts, indented description) with Composer's single-line aligned format: padded name, abandoned warning, and terminal-width-aware description truncation. Remove summary header and download/faver count display from text output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(remove): wire apcu autoloader flags, add audit-format default, and match ↵nsfisis
output messages - Pass --apcu-autoloader and --apcu-autoloader-prefix through to InstallConfig instead of hardcoding false/None - Set --audit-format default to "summary" matching Composer behavior - Print "./composer.json has been updated" after modification - Print "Running composer update <packages>" before resolution step Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(install): add CLI option validation, download-only wiring, and ↵nsfisis
apcu-prefix implicit enable - Restrict --prefer-install to source/dist/auto and --audit-format to table/plain/json/summary via clap value_parser - Error when --prefer-install is combined with --prefer-source/--prefer-dist - Wire --download-only through InstallConfig to skip autoloader and installed.json - Implicitly enable --apcu-autoloader when --apcu-autoloader-prefix is set - Apply same validation fixes to update, require, remove, create-project commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(global): add ~/.composer fallback, XDG auto-detection, and no-arg handlingnsfisis
Rewrite composer_home() with Composer-compatible resolution: detect XDG environment (any XDG_* var or /etc/xdg), prefer existing directories, and fall back to ~/.composer for legacy systems. Consolidate duplicate composer_home_dir() from global.rs into shared config_helpers. Accept no subcommand gracefully with a helpful error instead of a parse error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(dump-autoload): add config defaults, CLI validation, and class count outputnsfisis
Read optimize-autoloader, classmap-authoritative, apcu-autoloader from composer.json config section. Reject --dev with --no-dev and --strict-psr/ --strict-ambiguous without --optimize. Emit pre/post generation messages with class count in optimized mode. Track ambiguous class mappings and exit with code 2 when --strict-ambiguous detects conflicts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(depends): prefer installed packages over lockfile and add platform supportnsfisis
Without --locked, prefer vendor/composer/installed.json over composer.lock to match Composer's data source priority. Add platform packages (php, ext-*, lib-*) from detect_platform() so queries like `depends php` work. Show a specific error message when a platform package is not found. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(config): add missing keys, implement --absolute, fix output formatnsfisis
Add 18 missing config keys to config_value_type() including cache-read-only (was in defaults but unmanageable), audit.* dotted keys, and bool-or-enum keys like store-auths and bump-after-update. Implement --absolute flag to resolve *-dir values to absolute paths. Fix render_value() to JSON-encode arrays and use lowercase "null", matching Composer output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(check-platform-reqs): add informational messages and empty vendor fallbacknsfisis
Emit Composer-compatible stderr messages indicating which source is used (lock file, vendor dir, or fallback). Detect empty installed.json and fall back to the lock file with a warning instead of silently succeeding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23fix(archive): add format completion, stability suffix parsing, and ↵nsfisis
Composer-compatible output Add value_parser for --format to enable shell completion with valid formats. Parse @stability suffix (e.g. 1.0@beta) from version constraints before resolution. Align output messages with Composer: "Searching for the specified package.", match reporting, and split "Created:" across stderr/stdout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>