Repository navigation
Releases
v2.0.2
What's Changed
- chore(deps): update step-security/harden-runner action to v2.22.3 by @renovate[bot] in #108
- chore(deps): update sigstore/cosign-installer action to v4.1.3 by @renovate[bot] in #111
- chore(deps): update softprops/action-gh-release action to v3.0.4 by @renovate[bot] in #112
- chore(deps): update step-security/harden-runner action to v2.22.4 by @renovate[bot] in #113
- fix: drop mixed returns and duplicate lsp import in benchmarks by @CybotTM in #114
- docs(benchmarks): what to count when the hook is installed by @CybotTM in #116
- chore(release): v2.0.2 by @CybotTM in #117
Full Changelog: v2.0.1...v2.0.2
v2.0.1
What's Changed
- ci: sync with netresearch/.github templates by @CybotTM in #104
- ci: run CodeQL from security.yml (sync with templates/skill) by @CybotTM in #106
- chore(deps): update step-security/harden-runner action to v2.22.2 by @renovate[bot] in #105
- fix: run the Python scripts through uv on Python 3.11 or later by @CybotTM in #107
- docs(changelog): describe the unreleased changes since v2.0.0 by @CybotTM in #109
- chore(release): v2.0.1 by @CybotTM in #110
Full Changelog: v2.0.0...v2.0.1
v2.0.0
What's Changed
- ci: enrol in the netresearch/.github skill template by @CybotTM in #96
- chore(deps): update step-security/harden-runner action to v2.22.0 by @renovate[bot] in #97
- chore(deps): update step-security/harden-runner action to v2.22.1 by @renovate[bot] in #98
- chore(deps): update shivammathur/setup-php action to v2.40.0 by @renovate[bot] in #99
- fix: require Python 3.11 and pass ruff 0.17 by @CybotTM in #100
- ci: report the required checks for merge queue entries by @CybotTM in #101
- docs(changelog): record the Python 3.11 floor for 2.0.0 by @CybotTM in #102
- chore(release): v2.0.0 by @CybotTM in #103
Full Changelog: v1.0.1...v2.0.0
What's Changed
- ci: enrol in the netresearch/.github skill template by @CybotTM in #96
- chore(deps): update step-security/harden-runner action to v2.22.0 by @renovate[bot] in #97
- chore(deps): update step-security/harden-runner action to v2.22.1 by @renovate[bot] in #98
- chore(deps): update shivammathur/setup-php action to v2.40.0 by @renovate[bot] in #99
- fix: require Python 3.11 and pass ruff 0.17 by @CybotTM in #100
- ci: report the required checks for merge queue entries by @CybotTM in #101
- docs(changelog): record the Python 3.11 floor for 2.0.0 by @CybotTM in #102
- chore(release): v2.0.0 by @CybotTM in #103
Full Changelog: v1.0.1...v2.0.0
v1.0.1
Security
- Fixes GHSA-w99g-65rp-3q5f: php-ast-edit read .php-ast-edit.json from directories above the project, so a file another user placed there could supply the commands it runs. Found by @CybotTM.
.php-ast-edit.json names commands the editor runs, and it is now read only from the edited file's own project: the search stops at the nearest directory holding .git, outside version control at the nearest holding composer.json, and outside both it checks only the file's own (or deepest existing) directory. A declaration owned by somebody else is refused; the owner and the bytes come from the same open file (#94).
Other changes
- SPDX licence and copyright notices on source files, a security assurance case (
docs/SECURITY-ASSURANCE.md), and README sections on tests, dependencies and organisation policies (#93).
What's Changed
- chore: implement OpenSSF best-practice measures by @CybotTM in #93
- fix(config): read .php-ast-edit.json only from the edited file's project by @CybotTM in #94
- chore(release): v1.0.1 by @CybotTM in #95
Full Changelog: v1.0.0...v1.0.1
v1.0.0
What's Changed
- test: measure lossless shared metadata in rename reports by @CybotTM in #89
- test: measure evidence-bound final responses on new rename tasks by @CybotTM in #90
- docs(changelog): record the two benchmark campaigns under Unreleased by @CybotTM in #91
- chore(release): v1.0.0 by @CybotTM in #92
Full Changelog: v0.9.0...v1.0.0
v0.9.0
What's Changed
- feat(cli): execute method rename intent as one guarded command by @CybotTM in #78
- fix: preserve guards during project rename expansion by @CybotTM in #80
- docs: distinguish transaction diffs from Git workspace diffs by @CybotTM in #81
- bench: measure instruction scope and delegated discovery by @CybotTM in #82
- fix: accept positional project paths for method renames by @CybotTM in #83
- test: publish matched exact invocation experiment by @CybotTM in #84
- test: measure bounded rename review excerpts by @CybotTM in #85
- test: publish the negative unchanged-context experiment by @CybotTM in #86
- test: measure the limits of check-reuse guidance by @CybotTM in #87
- chore(release): v0.9.0 by @CybotTM in #88
Full Changelog: v0.8.1...v0.9.0
v0.8.1
v0.8.0
Highlights
PHP AST Edit v0.8.0 adds project-wide method renames, edits inside named scopes, integrated project-check evidence and executable release packages. The changes from @CybotTM also correct the command-line flag form so supplied source guards are enforced and failed project checks return exit code 1.
- Ask for the change by name. One edit can use flags without a payload file. Related edits still fit in one JSON transaction.
replace_expressionandreplace_statementaccept structuralmatchcode inside a named method, andadd_useadds imports idempotently. - Rename beyond one file. With the separately installed, digest-pinned Phpactor resolver, eligible method renames follow project hierarchies and resolved PHP call sites. Unresolved or external contracts can be refused. Remaining PHP strings and configuration/template mentions are reported; opt-in
mocks: truealso changes matching PHPUnit mock names. Mock strings are not resolved to a specific class, so review unrelated methods sharing the name. - Reuse an observed check result. Configure a project check once and
applyruns it and reports its identity and verdict.alreadyRunidentifies successful project checks; reuse assumes unchanged relevant inputs and environment. Parser success and passing tests do not prove exhaustive reference completeness. - Choose the evidence you need. The default report retains the diff; compact reports avoid repeated verification output. Optional
report: "agent"highlights unresolved work and check evidence while omitting the diff. It is not recommended universally: a measured case cost more when the model fetched the diff again. - Install a working engine. Both skill and plugin archives now bundle the runtime PHAR. The standalone PHAR, runtime dependency manifest, checksums, Sigstore bundle and GitHub build attestations are published together after installation tests. Phpactor is optional and is not bundled.
- Keep formatting optional. Ordinary edits preserve formatting by default unless the project declares canonical printing. The canonical printer can break over-width method chains, and
doctorreports remaining width overruns and resolver/check setup.
Upgrade notes
The flag form now rejects unsupported flags instead of silently ignoring them. A method-declaration set_name that would leave named calls behind is refused with a rename_method suggestion; explicit declarationOnly: true retains intentional declaration-only changes. Failed project checks retain the edit for repair and return exit code 1; rejected transactions return exit code 2.
Project-wide renames require Git and the separately installed Phpactor 2026.07.22.0 PHAR, with PHP 8.2+, mbstring, posix and tokenizer. See the installation instructions for the pinned digest and configuration. Use WSL for this resolver on Windows.
Measured behavior
A 24-session comparison on two small tasks with Haiku and Sonnet found manual post-edit checking in 12/12 separate-check sessions and 0/12 integrated-check sessions. Median combined tokens, including cache tokens, were 60,443.5 versus 45,499 and wall time 17.3 versus 13.0 seconds. The task oracle passed in 12/12 controls and 11/12 treatments; one treatment left a forbidden payload file despite correct PHP edits. These results cover successful, cheap checks and do not establish universal savings. Complete report and evidence.
Earlier negative and mixed experiments remain published, including the entrypoint instruction that did not meet its adoption rule. The older 90.2% median token reduction belongs to a selected experimental resolver/AST/checking workflow and is not a measurement of every feature in this release.
Raw data from the planned 120-run powered experiment have not been recovered. Its repaired driver, analyzer and recovery instructions preserve that evidence gap; they establish no additional savings, and no replacement campaign was run for this release.
Download and verify
gh release download v0.8.0 --repo netresearch/php-ast-edit-skill --dir php-ast-edit-v0.8.0
cd php-ast-edit-v0.8.0
sha256sum --check SHA256SUMS.txt
gh attestation verify php-ast-edit.phar --repo netresearch/php-ast-edit-skill \
--cert-identity 'https://github.com/netresearch/php-ast-edit-skill/.github/workflows/release.yml@refs/tags/v0.8.0'
php php-ast-edit.phar helpTo authenticate the checksum file for all packaged assets, verify its Sigstore bundle with Cosign:
cosign verify-blob \
--bundle SHA256SUMS.txt.sigstore.json \
--certificate-identity 'https://github.com/netresearch/php-ast-edit-skill/.github/workflows/release.yml@refs/tags/v0.8.0' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
SHA256SUMS.txtFull Changelog: v0.7.0...v0.8.0
v0.7.0
Everything here came out of measuring what an agent actually does with the tool, rather than what it could do. Twelve controlled runs — separate claude -p processes, byte-identical worktrees, tool calls and cost read from each run's own JSON — and then reading the transcripts to find out where the calls went.
The catalogue says what each operation takes
contexts listed operation names and nothing else, so a caller had to guess the argument names, and guessed by analogy with whatever it had seen last. Asked to rename a variable, a model sent expect and value — set_name's shape — three times over, met Expected node name $nonce, got createChallengeToken each time, and then abandoned selectors for hand-guessed refs and renamed one scope at a time, leaving two of eleven occurrences behind. A confusing message did not only cost turns; it cost the result.
operationArguments is published, the check runs before the target's own expect so the message is about the edit, and the message shows the shape rather than listing field names — naming them was not enough, the same model then put from and to inside value. Same task, same model, against this build: 15 turns and a wrong result became 6 turns with no failed apply at all.
Two operations that were missing
rename_method moves a declaration and the calls to it in one edit. What counts as a call to this method is decided structurally — $this->, self::, static::, parent:: inside the declaring class, and not inside a nested anonymous class — with names compared the way PHP resolves them, without regard to ASCII case. A call on any other receiver is counted, not touched. Locating call sites by hand had cost four inspect calls per rename; that task went from 13 turns to 5.
property: now finds promoted constructor properties. On the extension this was measured against, 58 of 65 properties are promoted and 7 are declared in the class body, so the selector had been finding the exception and missing the rule.
The write answers for itself
verify lets a repository declare the checks it wants run — PHPStan, the coding-standards check — executed after the formatter on what will be committed, reported as ok with the output of anything that failed. A failing check does not roll the write back: the code is written and it parses, and what failed is an opinion about it.
The report also carries valid, effects — what each edit did, and for a rename how much of the old name the file still holds — and diff. INCOMPLETE_RENAME appears beside the result rather than only in the count, because a model read remainingInFile: 2 and stopped anyway.
Thanks to @CybotTM for the reviews across this series, which caught a hand-written argument table that was wrong where it mattered, verifyResults leaking between calls, and both the nested-class and the case-sensitivity holes in rename_method.
Upgrading
Nothing is removed. verify is opt-in; without it the write behaves as before. The report gains fields, so a consumer parsing it strictly should expect valid, effects, diff and verify to appear.
Full Changelog: v0.6.1...v0.7.0
v0.6.1
parseAs: "stmts" accepts more than one statement.
It was mapped straight onto stmt at the top of ContextParser::parse() and then met the single-statement check, so the context could not do the one thing its name promises — while operations.md had been documenting "one or more Stmt" for it all along. The documentation was right and the code was not.
The cost was concrete. Inserting a guard needs two statements: an assignment and the if that reads it. With stmts unusable that took two edits, and the second shifted the index the first had just moved — the pair landed in the wrong order and had to be repaired by hand. That happened twice while building 0.5.0 and 0.6.0.
stmts is now stmt with the arity relaxed: same host, same template, several statements returned as they came. The stmt error names it, so the next caller to meet the limit is told what to use rather than left to split the edit. And the name a caller passed stays in every message — a snippet that asks for stmts and fails to parse is no longer told it does not fit the stmt context, which sent the reader to the wrong contract. Thanks to @CybotTM for catching both that and a test assertion that would have passed with the second statement dropped.
Upgrading
Nothing is removed and nothing behaves differently for callers who were not using stmts. Anyone who split an insertion into two edits to get around this can put it back together — and should, since the second edit shifts the index the first has just moved.
Full Changelog: v0.6.0...v0.6.1