Repository navigation
Description
Objective and current decision
Evaluate Phive as an optional installation and verification channel for the same already-qualified versioned PHAR, only if a concrete consumer needs the CLI without Composer or Docker. It does not compile the tool. The pilot has already selected versioned PHAR over CPX; this issue does not reopen that choice or block #376, Testing or Documentation. Keep the existing Composer distribution intact. Decision record.
First step and verifiable acceptance
- Identify a concrete consumer requirement and compare direct/Composer delivery with Phive, including trust bootstrap, maintenance and rollback costs. Prefer Changelog as the bounded candidate if warranted: select an exact qualified version and reference the existing
dist/changelogbytes. Without a demonstrated requirement, record a reasoned deferral rather than changing the installation plan. - In an authorized clean fixture, install that exact version without Composer; verify the SHA-256 against the trusted producer digest for
dist/changelogand verify the detached OpenPGP signature against the separately trusted expected signer fingerprint. A valid PHAR-internal signature or checksum is not evidence of publisher identity. Reject modified bytes and a signature from an unexpected key; retain or reinstall the previously pinned verified version without recompiling. Record versions, SHA-256, expected signer, commands and outcomes without exposing secret keys. - Separate local verification from public discovery. A fixture can prove install/verification/rollback, not discovery via GitHub Releases. A later authorized discovery check must use actual versioned
.pharand.phar.ascattachments, per Phive documentation, and verify digest equality with the producer bytes. Do not claim release compatibility based only on a fixture.
Dependencies and exclusions
#240 owns extraction sequence; #384/#376 own setup, execution and rollback; #238 owns immutable workflow/Actions refs. Domain Issues own public PHP APIs and extension compatibility; PHAR process isolation does not by itself resolve the consumer's in-process Composer/autoload boundary. No second build, shared DevTools shim/runtime, mandatory Phive, public signing, key changes, release or consumer rollout here. Do not start executable verification until the operator clears the gate.
Historical context
The original Box/PHP-Scoper proposal explored isolating Composer, service-provider and QA dependencies in a shared shim, with trade-offs around public-vs-scoped classes, cycles, release propagation, wrapper/skill ownership and duplicated artifacts. That approach and the later CPX comparison are historical, not prerequisites. The original work remains in the Issue edit history and historical design discussion. This refinement does not close other cleanup, API or reference-policy Issues.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
coisa commentedon Apr 24, 2026
Discussion Draft: incremental component extraction and dev-tools-shim architecture
This is a proposed action plan for turning
fast-forward/dev-toolsinto an orchestrator of specialized Fast Forward packages while preserving the current user-facing ergonomics:composer ...commands;bin/dev-toolsworkflow for development;fast-forward/dev-tools-shimshould provide an isolated tool/runtime distribution for smaller Fast Forward packages.The important architectural distinction is that the current coupling is not just "we use Composer classes". The current package is doing several jobs at once:
The extraction should split these jobs gradually, not all at once.
Current Composer coupling map
Current direct Composer touchpoints found in the repository:
FastForward\DevTools\Console\DevTools extends Composer\Console\Applicationbin/dev-toolsbehave like a Composer-flavored console application even when the package is the root package and cannot consume itself as a Composer plugin.Symfony\Component\Console\Application. Keep Composer-specific behavior in a plugin bridge only.Composer\Command\BaseCommanddev-toolsexposes thin ComposerBaseCommandadapters only for the Composer plugin surface.Composer\Plugin\Capability\CommandProvider,Composer\Command\BaseCommandfilteringfast-forward/dev-toolsonly. It can create Composer adapters around shared handlers instead of returning the same standalone commands.PluginInterface,Capable,EventSubscriberInterface,ScriptEvents,Event,Composer,IOInterfacefast-forward/dev-tools. Usecomposer-plugin-apiinrequire; keepcomposer/composerinrequire-devfor tests/static analysis/autocomplete. Runtime classes come from the host Composer process.Composer\Factory::getComposerFile()ComposerJson,FundingCommand,UpdateComposerJsonCommandcomposer.jsonpath, including theCOMPOSERenv behavior.ProjectComposerFileResolverwith explicit tests forCOMPOSER, cwd, relative path, absolute path, and directory edge cases.Composer\Json\JsonFilecomposer.json,installed.json, and funding metadataJsonDocumentReader/JsonDocumentWriterusingjson_decode(..., JSON_THROW_ON_ERROR)plus repository-specific errors. Keep Composer's reader only behind an optional bridge if needed.Composer\Json\JsonManipulatorUpdateComposerJsonCommandto mutatecomposer.jsonwhile preserving structure.ComposerJsonEditorinterface. Start with currentJsonManipulatorbehind an implementation in a Composer bridge. Later evaluate a custom stable writer or a normalizer-driven approach.Composer\InstalledVersionsComposerJsonandRectorConfig.composer/composerby itself because it is generated in normal Composer installs.InstalledPackageRepositoryInterface. UseComposer\InstalledVersionswhen available; fallback tovendor/composer/installed.jsonwhen needed.Composer\Util\PlatformGithubActionOutputfor env checks.Environment/RuntimeEnvironmentabstraction aroundgetenv()/$_SERVER.IOInterfacethroughBaseCommand.IOInterfaceto the shared logger/output contract. Symfony adapters map Symfony IO/output to the same contract.getLoop()->getProcessExecutor()->execute(...)Target shape
The target model should be:
A key constraint: avoid a dependency cycle where component packages require-dev the shim while the shim also Composer-requires those same component packages. The safer approach is:
dev-tools;dev-toolsrequires components and wires them into consumer-facing orchestration;dev-tools-shimis built as an artifact/tool distribution and should avoid normal Composerrequireedges back into packages that are expected to require-dev it;Command architecture
For each command domain, use three layers:
Handler / application service
InputInterface, no ComposerBaseCommand, and no Composer IO.Symfony command adapter
bin/dev-toolsand future component-local binaries.Composer command adapter
fast-forward/dev-toolsonly;Composer\Command\BaseCommandif Composer capability compatibility requires it;Example for testing:
This keeps the package extractable while preserving the current
composer testsUX.Proposed package boundaries
1.
fast-forward/dev-tools-runtimePurpose:
dev-tools, components, and the shim;Likely contents:
Dependencies:
php:^8.3psr/logpsr/containerpsr/clocksymfony/consolesymfony/filesystemsymfony/findersymfony/processsebastian/diffcontainer-interop/service-providercomposer/composer2.
fast-forward/composer-metadataPurpose:
Likely contents:
ProjectComposerFileResolverComposerJsonReaderComposerJsonMetadataDTOs (Author,Support,Funding)InstalledPackageRepositoryInterfaceComposerJsonEditorInterfaceComposerJsonManipulatorEditorimplementation in a bridge namespace.Dependencies:
php:^8.3symfony/filesystemor runtime filesystem contractscomposer/composeronly in a dedicated bridge package orrequire-devMigration note:
Composer\Factory::getComposerFile()andComposer\Json\JsonFileshould be replaced early.JsonManipulatorshould be isolated behind an interface before deciding whether to replace it.3.
fast-forward/changelogPurpose:
Likely contents:
src/Changelog/*DependabotChangelogEntryMessageResolverentry,check,next-version,promote,showDependencies:
php:^8.3fast-forward/dev-tools-runtimeor smaller contracts packagepsr/logpsr/clockcomposer/composerdev-toolsrole:BaseCommandadapters forcomposer changelog:*;4.
fast-forward/testingPurpose:
Likely contents:
RunTestsHandlerTestsOptionsCoverageSummary,CoverageSummaryLoaderDependencies:
php:^8.3fast-forward/dev-tools-runtimepsr/logphpunit/php-code-coverageonly ifCoverageSummaryLoaderdirectly type-checksCodeCoveragephpunit/phpunita hard runtime dependency unless the package intentionally exposes PHPUnit extension APIs.Shim strategy:
require-devor a deliberately unscoped public testing extension package.Open design question:
fast-forward/phpunit-extensionwith real PHPUnit dependencies, while the shim owns isolated command execution.5.
fast-forward/documentationPurpose:
Likely contents:
Dependencies:
php:^8.3fast-forward/dev-tools-runtimetwig/twigfast-forward/phpdoc-bootstrap-templateShim strategy:
6.
fast-forward/code-qualityPurpose:
code-style,refactor,phpdoc, and maybestandardssubflows that primarily orchestrate external QA tools.Likely contents:
ecs.php,rector.php,.php-cs-fixer.dist.php;Dependencies:
php:^8.3fast-forward/dev-tools-runtimepsr/logrector/rectorsymplify/easy-coding-standardfriendsofphp/php-cs-fixerergebnis/rector-rulesrector/jackImportant caveat:
7.
fast-forward/dependency-healthPurpose:
Likely contents:
dependenciesbehavior;shipmonk/composer-dependency-analyserand Jack.Dependencies:
php:^8.3fast-forward/dev-tools-runtime8.
fast-forward/repository-syncPurpose:
Likely contents:
copy-resourcegitignoregitattributesgit-hookslicensefundingcodeownersagents/skillsuntil issue [architecture] Map domain-owned skills and replace redundant agent distribution #195 extracts agent payloads.Dependencies:
php:^8.3fast-forward/dev-tools-runtimefast-forward/composer-metadatasymfony/yamlcomposer/composerexcept optional metadata bridge.dev-toolsrole:dev-tools:syncas the orchestrator command that composes these handlers.9.
fast-forward/github-automationPurpose:
dev-toolsif we decide workflow sync is core orchestration.Likely contents if extracted:
resources/github-actions/*.github/actions/*source payloadsDependencies:
Recommendation:
dev-toolsorchestration and release coordination, so they can remain indev-toolsuntil smaller domain packages stabilize.10.
fast-forward/agentsPurpose:
Likely contents:
.agents/agents.agents/skillslater, if skills should share the same distribution strategy.Dependencies:
dev-toolsrole:What remains in
fast-forward/dev-toolsfast-forward/dev-toolsshould remain the repository-facing orchestrator:BaseCommandadapters;dev-tools:syncorchestration;Target dependencies:
php:^8.3composer-plugin-api:^2.0symfony/consolefast-forward/dev-tools-runtimefast-forward/changelog,fast-forward/testing, etc.composer/composershould move towardrequire-devonly, used for tests/static analysis/autocomplete around the plugin bridge.What
bin/dev-toolsshould becomeThe standalone binary should stop depending on
Composer\Console\Application.Target:
bin/dev-toolsboots a plainSymfony\Component\Console\Application;This keeps the current local DX while removing the main reason the whole console layer needs
composer/composer.What
dev-tools-shimshould dofast-forward/dev-tools-shimshould be treated as an isolated development tool distribution, not as the main repository orchestrator.Responsibilities:
Non-responsibilities:
Dependency scoping strategy
Use three buckets:
Public APIs that consumers/components may extend or reference
Implementation-only tool dependencies
Bridge dependencies
JsonManipulator, Composer plugin command adapters, host Composer runtime classes.A practical rule: if package users need to import a class in their own PHP code or config, that class should not only exist inside a scoped PHAR.
Migration phases
Phase 0: Architecture guardrails
BaseCommand.Composer\*imports outside approved bridge namespaces.Phase 1: Replace standalone Composer application
DevToolsfromComposer\Console\Applicationto SymfonyApplication.php bin/dev-tools listcomposer listcomposer agents --helpPhase 2: Introduce handler DTOs for one low-risk domain
Recommended first domain: changelog.
Why:
Deliverables:
ChangelogEntryHandler,ChangelogCheckHandler, etc.;Phase 3: Extract
fast-forward/changelogdev-tools.dev-toolsrequirefast-forward/changelog.dev-tools-shimin the changelog repo'srequire-devonce available.Phase 4: Extract runtime/core infrastructure
fast-forward/dev-tools-runtime.dev-tools.dev-toolspackage.Phase 5: Extract repository sync
dev-tools:syncindev-toolsas an orchestrator that calls those handlers.fast-forward/agentspayload extraction.Phase 6: Build the first
dev-tools-shimrequire-devand runs a command.Phase 7: Move heavy tool orchestration behind shim
Phase 8: Release propagation
dev-toolsreleases trigger or require a matchingdev-tools-shimrelease.fast-forward/dev-toolsin a consumer fixture;fast-forward/dev-tools-shiminrequire-dev;Suggested first follow-up issues
Composer\Console\Applicationwith Symfony Console forbin/dev-toolswhile keeping Composer plugin command discovery intact.ProjectComposerFileResolver,JsonDocumentReader, andComposerJsonEditorInterface.fast-forward/changelogas the first extracted component package.fast-forward/dev-tools-shimwith Box + PHP-Scoper using the smallest useful command set.Success criteria for the architecture
dev-toolscan still provide the unified Composer plugin UX.bin/dev-toolscan run without extending Composer's console application.dev-tools-shiminrequire-devwithout depending on the monolithicdev-toolspackage.[-][architecture] Design a Box + PHP-Scoper dev-tools-shim for extracted Fast Forward components[/-][+][architecture] Reassess isolated tooling distribution after CPX and domain extraction[/+]coisa commentedon Dec 3, 2026
Current scope: evaluate Phive as an optional delivery channel
The pilot has selected versioned PHARs over CPX; this issue no longer chooses the primary runtime or reopens a common DevTools shim. #384/#376 own setup and execution, #238 owns refs, and domain issues own public PHP API/extension compatibility. Preserve prior designs as historical context.
Evaluate Phive only against an identified consumer requirement. Compare existing Composer/PHAR delivery with installing and verifying the same versioned bytes using Phive: exact pin, digest equality with the qualified producer artifact, signer trust, rejection of wrong bytes/signature and rollback to the previous version. Prefer Changelog as a bounded candidate if a consumer without Composer/CPX or Docker warrants the experiment. No second build, mandatory Phive dependency, signing, key changes or release/publication authorized here. If no requirement is demonstrated, document deferral rather than expanding #376.
[-][architecture] Reassess isolated tooling distribution after CPX and domain extraction[/-][+][architecture] Evaluate Phive as an optional channel for existing versioned PHARs[/+]