@rulereplay/php
v0.1.0
Published
Persistent PHP worker bridge and native PHP law integration for RuleReplay
Readme
@rulereplay/php
Persistent PHP worker bridge for the RuleReplay execution engine.
Install
npm install --save-dev @rulereplay/cli @rulereplay/php
composer require --dev rulereplay/rulereplayCreate a root rulereplay.php with the Composer SDK. @rulereplay/cli discovers it
automatically, starts a bounded worker pool, runs the exported laws, and closes
every process after the command:
npx rulereplay run
vendor/bin/rulereplay runThe package loads native laws from the rulereplay/rulereplay Composer SDK,
compiles portable generator descriptors into fast-check, and proxies all
five law kinds into @rulereplay/core. Generation, shrinking, caching, receipts,
and replay remain owned by the existing RuleReplay runner.
Workers communicate through the strict @rulereplay/protocol v1 NDJSON
contract. Worker pools preserve case affinity, allow genuine concurrent race
contenders, enforce timeouts, and forward PHP probes and race checkpoints to
the runner.
For programmatic ownership, call loadPhpProject() and always close the
returned project:
const project = await loadPhpProject({
project: 'rulereplay.php',
workers: 4,
});
try {
// project.laws and project.environment are ready for @rulereplay/core.
} finally {
await project.close();
}Requires Node.js 20.11 or newer and PHP 8.2 through 8.5. Licensed under MIT.
