test-runner

A test-running and result-reporting workflow for a PHP library that changes how the PHP engine handles operators.

In plain words
What is it for?
Use it to run the full or individual functional tests, handle the required PHP settings, and explain differences in values, types, dimensions, exceptions, or engine crashes.
Why use it?
It identifies exactly which expected behaviours fail, including failures caused by the PHP engine itself, instead of merely reporting that the test suite is red.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/lisachenko/native-php-matrix/test-runner
Clone the repo
git clone --depth 1 https://github.com/lisachenko/native-php-matrix

Made for: Claude Code.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 689 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.00689
Opus 5 $0.00016 $0.00345
Sonnet 5 $0.00007 $0.00138
Haiku 4.5 $0.00003 $0.00069

Measured 2d ago against content hash 7cfb56d436f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-runner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/test-runner.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You run and interpret the test suite of lisachenko/native-php-matrix, a library that installs Zend Engine operator handlers from userland PHP via z-engine + FFI. Your job is to produce a precise verdict, not to make tests pass.

Running the suite

Preferred:

composer test

If the Composer script is unavailable or its environment lacks the required INI settings, fall back to:

php -d ffi.enable=1 -d opcache.jit=off vendor/bin/phpunit

A single test:

php -d ffi.enable=1 -d opcache.jit=off vendor/bin/phpunit tests/Functional/testCanAddMatrices.phpt

ffi.enable=1 and opcache.jit=off are mandatory in both the parent process and the .phpt children. Every .phpt carries an --INI-- section for the child side. If a test fails with a message about FFI being disabled, check for a missing --INI-- section before suspecting the library.

Interpreting results

  • --EXPECT-- diff. phpt failures print expected vs actual output. Quote the relevant diff lines, then say what the difference means in library terms: wrong dimensions, wrong element values, int where float was expected (PHP's / and ** widen), or an exception where a result was expected. var_dump() output is whitespace- and type-sensitive — int(1) and float(1) are a real difference, not noise.
  • --EXPECTREGEX-- failures usually mean the exception type or message changed. Report the actual message verbatim.
  • Fatal errors from Core::init() mean the PHP version does not match what z-engine was built for. Report the running php -v and stop. Never suggest loosening the ~8.4.0 constraint or skipping initialization.
  • Segmentation fault, bus error, or a child process exiting on a signal is an engine/hook-level bug — memory was read or written at the wrong offset. Do not retry, do not mark the test skipped, do not "work around" it. Report immediately with: the exact command, the test file, php -v, and the last output before the crash. A crash outranks every other finding in your report.

Read the full file on GitHub · 66 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 66 lines · 33 tokens per session scan A 7cfb56d436f5

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository lisachenko/native-php-matrix (43 stars, last pushed 13d ago), licensed MIT. It adds 33 tokens to every session and 689 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.