aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin-class-classifier
AgeCommit message (Collapse)Author
2026-08-31feat(plugin): carry Http\Response across as a materialized valuensfisis
A response is built for one request and the graph never retains it, so there is no entity for a handle to point at. The child holds a real instance instead, revived from the object record the wire carries, and collect() frees the copy each world holds — which is what that method is for. The value-object rule rejects the class only because collect() assigns to $this, so the category comes from an overrides.list entry. HttpDownloader::get() and copy() answer with one. Two gaps stay: decodeJson() reaches Composer\Json\JsonFile, which a guard shadows, and Composer answers a curl request with the CurlResponse subclass where this port flattens the value into a Response. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30feat(plugin): serve ProcessExecutor as a proxy stubnsfisis
Composer reaches this class two ways: the object graph hands one out through Composer::getLoop()->getProcessExecutor(), and plugins write `new ProcessExecutor($io)` freely. Both bind to a Rust-side entity, so the timeout the run shares -- seeded from process-timeout and rewritten while the run is in flight -- has one value instead of one per world, and the executor can still be passed to the classes that take one (`new Filesystem($process)`). Three things the stub generator was missing came with it: - By-ref parameters. The call carries their positions and the answer carries what each holds afterwards; a position the answer omits was never assigned to, which is what PHP does with an untouched by-ref parameter. ProcessExecutor::execute is the only one on a proxied class. - Argument arity, reproduced where the real body reads func_num_args(). execute($cmd) forwards the child's output and execute($cmd, $out) captures it, and nothing but the argument count separates the two. - Static methods that cannot run in the worker. One that reads a static property the Rust side owns, or that reaches a guarded class, forwards through __shirabeCallStatic instead of being materialized. That also fixes Filesystem::isLocalPath and getPlatformPath, whose materialized bodies called the guarded Composer\Util\Platform. The async surface stays an explicit error. executeAsync resolves its promise with a Symfony Process, whose proc_open() resource and pipes belong to whichever process called start(), so a Rust-side spawn has none to hand back; running the real start() in the worker needs a promise representation that crosses the boundary unresolved. The fixture project drives the whole synchronous surface from plugin code and compares the trace against upstream Composer byte for byte. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-23fix(plugin-class-classifier): reach docblock-only generic payload typesnsfisis
The reachability closure only consults @phpstan-return/@param/@var docblocks when the native type is array/iterable/mixed/object/absent. For a concrete wrapper class whose payload is expressed only via a phpstan generic (PromiseInterface<Process>), the payload type was silently dropped: Symfony\Component\Process\Process never appeared as reached even though ProcessExecutor::executeAsync() hands one to plugin callbacks. Treat known generic wrapper types the same as array/iterable/mixed/object so their docblock payload is folded into the closure.
2026-07-23feat(plugin-class-classifier): add query helper for single-class lookupsnsfisis
Answers how a given class is treated at the plugin boundary, accepting a PHP source file, a Rust source file, or a (short or fully qualified) class name. Reads report.json and generates it first when missing. Rust paths resolve by normalized segment matching because the snake_case mapping is not reversible for acronyms (io_interface.rs -> IOInterface). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23feat(plugin-class-classifier): add deterministic plugin-boundary classifiernsfisis
Decides, for every composer/composer class, how it is treated at the plugin boundary (rust-proxy / rust-snapshot / contract / two-world / php-native / unsupported) so that upstream updates re-classify new or rewritten classes without re-deriving the design by hand. Rules and category definitions live in docs/dev/plugin-class-classification.md; the tool (PHP + nikic/PHP-Parser) implements them as a reachability closure with direction marks, per-method pure/mutator analysis, and a leaf-first fixed point for unreachable classes, with three small versioned exception lists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>