Skip to content

Refuse a too-long migration option and tighten the hook grammar - #67

Merged
ahegyes merged 2 commits into
trunkfrom
feat/hook-grammar-and-gpl3
Oct 30, 2026
Merged

ahegyes merged 2 commits into
trunkfrom
feat/hook-grammar-and-gpl3

Conversation

@ahegyes

@ahegyes ahegyes commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Summary. The two review commits of #66, which merged before they were pushed:

  • Migration runner: the scheduled hook {option}/migration/run is longer than the lock {option}_lock through which the constructor validated the option, so an option of 178 to 186 bytes passed construction and threw only when a batched step first scheduled its continuation, leaving the migration stuck. The runner builds its ScheduledHook in the constructor, which refuses a hook name over 191 bytes there, and schedules that instance.
  • Wording:
    • AGENTS.md says that a hook built from an id or option name the consumer passes takes it whole as its first level, which covers {option}/migration/run;
    • the updater's hook docblock loses a semicolon;
    • the consumer request's record key initialized becomes boot_succeeded, after the hook it counts.

Production code +18 −8 (2 files), tests +13 −5 (6 files), docs +1 −1 (AGENTS.md).

Testing.

  • The tree equals the one Name every hook by the slash grammar and move to GPL-3.0-or-later #66's final gate ran on: composer quality-check with Unit 192 and Integration 1,346, composer test:integration:multisite (41) and composer test:integration:php74 (2).
  • Before the change: the runner's new row, a 177-byte option accepted and a 178-byte one refused, failed until the constructor built the hook.

The runner validated its option only through the lock it names,
{option}_lock, which used to be longer than the scheduled hook
{option}_run. The hook {option}/migration/run is longer, so an option
of 178 to 186 bytes passed construction and threw only when a batched
step first scheduled its continuation, leaving the migration stuck.

The runner builds its ScheduledHook once in the constructor, which
refuses a hook name over 191 bytes there, and schedules that instance.
A new row constructs a runner on a 177-byte option and expects a
178-byte one to throw.

Assisted-by: Claude Code:claude-opus-5-5
Review found three loose ends. The grammar in AGENTS.md read as if an
option-built name such as {option}/migration/run broke it, so it now
says that a hook built from an id or option name the consumer passes
takes it whole as its first level. The updater's hook docblock carried
a semicolon. The consumer request's record kept the key "initialized"
for a count of {prefix}/boot/succeeded, so the key is boot_succeeded.

Assisted-by: Claude Code:claude-opus-5-5
@ahegyes
ahegyes merged commit 54dc2eb into trunk Oct 30, 2026
20 checks passed
@ahegyes
ahegyes deleted the feat/hook-grammar-and-gpl3 branch October 30, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant