Skip to content

fix: take phiki's own offset fix and drop the local patch - #61

Merged
dereuromark merged 1 commit into
mainfrom
fix/drop-phiki-patch
Aug 27, 2026
Merged

dereuromark merged 1 commit into
mainfrom
fix/drop-phiki-patch

Conversation

@dereuromark

Copy link
Copy Markdown
Contributor

CI is red on every branch, including #58 and #59, and has been since phiki 2.2.1 was released.

patch-phiki-offsets: anchor not found - phiki changed, re-check the upstream fix.
Script php scripts/patch-phiki-offsets.php handling the post-update-cmd event returned with error code 1

The script runs from composer's post-update hook, so its exit 1 fails composer install itself and every job dies before running a single test. composer.lock is not tracked here, so CI always resolves the new phiki and always hits it.

Why the anchor moved

Because the fix is upstream. phiki 2.2.1's PatternSearcher carries the same cursor walk the patch applied - same sibling check, same fallback - under its own names (previousStart / previousEnd). Patching it a second time is neither possible nor wanted.

So the script and its two composer hooks go.

Evidence this is safe

  • The upstream source implements the same algorithm; I read both.
  • composer test (107), stan and cs-check all pass on 2.2.1 with no patch, from a clean composer install.

I also tried to A/B patched 2.2.0 against unpatched 2.2.0 and could not build an input that distinguishes them - so that comparison proves nothing either way, and I am not offering it as support. If you know the input that originally showed the wrong offset, that would be the thing to check.

Merging this unblocks #58 and #59.

CI has been red on every branch since phiki 2.2.1: the post-update hook
ran scripts/patch-phiki-offsets.php, the anchor it rewrites no longer
existed, and the script exited 1 - which fails composer install itself,
so every job died before running anything. composer.lock is not tracked
here, so CI always resolved the new phiki and always hit it.

The anchor moved because the fix is upstream now. phiki 2.2.1's
PatternSearcher carries the same cursor walk the patch applied, down to
the sibling check and the fallback, under its own names (previousStart /
previousEnd). Patching it again is neither possible nor wanted.

Evidence this is safe: the upstream source implements the same
algorithm, and the suite passes on 2.2.1 with no patch. I could not
build an input that tells patched 2.2.0 from unpatched 2.2.0, so the
A/B I ran proves nothing either way and is not offered as support.
Copilot AI lite review requested due to automatic review settings August 27, 2026 23:34
@dereuromark dereuromark added the bug Something isn't working label Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the local phiki offset patching mechanism now that the fix has landed upstream, unblocking composer install and CI by eliminating a failing Composer post-update hook.

Changes:

  • Deletes the scripts/patch-phiki-offsets.php patch script.
  • Removes post-install-cmd / post-update-cmd Composer hooks that executed the patch.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/patch-phiki-offsets.php Removes the now-unneeded local vendor patch script.
composer.json Drops Composer lifecycle hooks that ran the patch script.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread composer.json
Comment on lines 44 to 49
"scripts": {
"cs-check": "phpcs --colors --parallel=16",
"cs-fix": "phpcbf --colors --parallel=16",
"stan": "phpstan analyze",
"test": "phpunit",
"post-install-cmd": [
"php scripts/patch-phiki-offsets.php"
],
"post-update-cmd": [
"php scripts/patch-phiki-offsets.php"
]
"test": "phpunit"
}
@dereuromark
dereuromark merged commit 7f93d2a into main Aug 27, 2026
9 checks passed
@dereuromark
dereuromark deleted the fix/drop-phiki-patch branch August 27, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants