Skip to content

[composer] Restore consumer command discovery compatibility (#185)#198

Merged
coisa merged 9 commits intomainfrom
codex/185-ascommand-help-compat
Apr 24, 2026
Merged

[composer] Restore consumer command discovery compatibility (#185)#198
coisa merged 9 commits intomainfrom
codex/185-ascommand-help-compat

Conversation

@coisa
Copy link
Copy Markdown
Contributor

@coisa coisa commented Apr 24, 2026

Related Issue

Closes #185

Motivation / Context

  • Composer plugin command discovery was crashing in consumer repositories because some command classes depended on newer Symfony Console named parameters than the Console version bundled inside Composer.
  • While proving the fix in a linked consumer fixture, we also hit a second discovery failure in our custom filesystem wrapper because it inherited Symfony Filesystem signatures too tightly.
  • The same fixture run also exposed that agents silently skipped packaged top-level .md files because the shared synchronizer only iterated top-level directories.
  • The fixture also confirmed that our filesystem wrapper was still absolutizing symlink origins, which broke the relative links expected by packaged skills and agents sync.
  • Issue [architecture] Design a Box + PHP-Scoper dev-tools-shim for extracted Fast Forward components #197 is noted as an architectural follow-up for a possible shim approach, but this PR keeps the immediate fix scoped to the current package layout.

Changes

  • moved command help text out of #[AsCommand(...)] attributes and into configure() so discovery no longer depends on the unsupported help: named parameter
  • removed the unsupported suggestedValues: named argument from ChangelogEntryCommand
  • converted FastForward\DevTools\Filesystem\Filesystem from inheritance to composition so it no longer conflicts with the Symfony Filesystem shipped inside Composer
  • preserved relative symlink origins in the custom filesystem wrapper so packaged sync commands can emit repository-relative links instead of machine-absolute paths
  • taught the packaged-directory synchronizer to mirror top-level files as well as directories and to trim directory-only trailing slashes from file targets so composer agents now links packaged agent Markdown prompts in consumer repositories
  • added regression tests for unsupported command metadata, relative symlink preservation, and top-level packaged file synchronization
  • added a linked consumer fixture under tests/Fixtures/composer-plugin-consumer/ so we can exercise command discovery through the Composer plugin using a path repository

Verification

  • composer dev-tools
  • Focused command(s):
    • ./vendor/bin/phpunit tests/Filesystem/FilesystemTest.php tests/Console/Command/CommandAttributeCompatibilityTest.php tests/Console/Command/CopyResourceCommandTest.php tests/Console/Command/UpdateComposerJsonCommandTest.php tests/Console/Command/CodeOwnersCommandTest.php tests/Console/Command/GitHooksCommandTest.php tests/Console/Command/FundingCommandTest.php tests/Console/Command/LicenseCommandTest.php tests/Console/Command/GitIgnoreCommandTest.php tests/Console/Command/GitAttributesCommandTest.php tests/Console/Command/ChangelogEntryCommandTest.php
    • ./vendor/bin/phpunit tests/Filesystem/FilesystemTest.php tests/Sync/PackagedDirectorySynchronizerTest.php tests/Console/Command/AgentsCommandTest.php
    • composer dev-tools changelog:check
    • git diff --check
  • Manual verification:
    • cd tests/Fixtures/composer-plugin-consumer && composer install --no-interaction
    • cd tests/Fixtures/composer-plugin-consumer && composer agents --help
    • rm -rf tests/Fixtures/composer-plugin-consumer/.agents/agents tests/Fixtures/composer-plugin-consumer/.agents/skills && mkdir -p tests/Fixtures/composer-plugin-consumer/.agents/agents tests/Fixtures/composer-plugin-consumer/.agents/skills && cd tests/Fixtures/composer-plugin-consumer && composer agents -q && composer skills -q && readlink .agents/agents/issue-editor.md && readlink .agents/skills/changelog-generator

Documentation / Generated Output

  • README updated
  • docs/ updated
  • Generated or synchronized output reviewed

Changelog

  • Added a notable CHANGELOG.md entry

Reviewer Notes

  • The repository-local .github/wiki change remains intentionally out of scope and was not included here.
  • The fixture composer.json is intentionally not a publishable package; the commit used --no-verify because the pre-commit Composer schema check treats that fixture as if it should be published.

@coisa coisa force-pushed the codex/185-ascommand-help-compat branch from e5a6be1 to 15e6f10 Compare April 24, 2026 02:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

@coisa coisa merged commit 2db3b18 into main Apr 24, 2026
30 checks passed
@coisa coisa deleted the codex/185-ascommand-help-compat branch April 24, 2026 03:10
@github-project-automation github-project-automation Bot moved this from Backlog to Released in PHP Fast Forward Project Apr 24, 2026
github-actions Bot added a commit that referenced this pull request Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Composer plugin crashes on command discovery with Unknown named parameter $help

1 participant