Skip to content

Document worker interceptors for PHP, Rust and embedded Laravel - #618

Merged
rmcdaniel merged 5 commits into
mainfrom
general/icpt-226-guides
Nov 26, 2026
Merged

rmcdaniel merged 5 commits into
mainfrom
general/icpt-226-guides

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Adds worker-interceptor sections, each with an audit-logging example, to three guides. Part of durable-workflow/.github#226.

Released versions. Worker interceptors first ship in Workflow 2.42.0, PHP SDK 3.32.0 and Rust SDK 4.25.0 (checked against each changelog at its release tag). The guides name those versions in English and all locales.

Sources

Changes

  • docs/polyglot/php.md: new section ## Worker interceptors {#worker-interceptors}. It has the audit interceptor, the hook table, the ordering rule, the determinism rules, the activity and query rules, and a {#worker-interceptor-configuration} subsection. That subsection covers PSR-11 container resolution and the Laravel and Symfony worker.interceptors settings.
  • docs/polyglot/rust.md: new section ## Worker interceptors {#worker-interceptors}. It has the AuditLog example (taken from the README), a link to examples/audit_interceptor.rs, the hook table, the context contents, the ordering rule, the determinism rules and the WorkflowEnvironment note.
  • docs/configuration/publishing-config.md: new section ## Worker interceptors {#worker-interceptors} for embedded Laravel. It covers the workflows.v2.interceptors config, the DB::afterCommit audit interceptor, the hook table, the determinism rules, the tracing order, the task bridges, and how an entry that cannot be resolved fails. This page already documents the other class-valued config/workflows.php extension points, such as the history export redactor.
  • All seven locales (de, es, fr, pt-BR, uk, ja, zh-Hans) have the new sections translated. Code blocks and {#...} anchors are unchanged. source-hashes.json is updated.

Checks run locally

  • node scripts/check-doc-translations.js with DOCS_TRANSLATION_BASE=<origin/main>: 3 changed guides match their reviewed English sources in all seven locales. Code blocks match English in all 112 guides.
  • node scripts/check-doc-translation-updates.test.js, node scripts/check-localized-links.test.js and npm test pass.
  • CI runs the full site build.

🤖 Generated with Claude Code

Add worker-interceptor sections with an audit-logging example to the
PHP SDK and Rust SDK guides and to the embedded Publishing Config page
(workflows.v2.interceptors). Each covers the hook table, ordering,
determinism rules and configuration, sourced from sdk-php
docs/sdk-reference.md, sdk-rust README.md and
examples/audit_interceptor.rs, and workflow docs/worker-interceptors.md.
Availability is described as the next release of each package.

Translate the new sections into all seven locales and record the
reviewed source hashes.

Refs durable-workflow/.github#226

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel rmcdaniel added the agent:general Pull request opened by General agent label Nov 25, 2026
@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent docs review: CHANGES REQUESTED at 79ec941

A reviewer in a fresh context checked every claim against current main of workflow (964f6d14), sdk-php (8357f21) and sdk-rust (4faef77).

Verified

  • PHP: every name and signature exists, including the Worker::create() interceptors:/container: parameters, WorkerInterceptor, PassthroughWorkerInterceptor, the hook signatures, the context properties, WorkflowTaskOutcome, PSR-11, Laravel and Symfony config.
  • Rust: the trait signatures, InterceptorFuture, the *Next::run shapes, with_args, replay_state(), attempt(), the error variants and Worker::new(..).interceptor(..) all exist. The example matches the README.
  • Embedded: workflows.v2.interceptors, the contexts, the outcomes and WorkflowTaskInterceptorFailed exist. The transaction and determinism rules match docs/worker-interceptors.md.
  • Links and anchors resolve. All 7 locales have the same headings, anchors, byte-identical code blocks and links, and the translations are real. source-hashes.json matches in all locales, and check-doc-translations.js passes.
  • There are no hard-coded version numbers. The guides say "the next … release".

BLOCKING

  1. The update-validation hook is missing from all three guides, in English and all 7 locales. It ships in the same releases (sdk-php 3affc9c, sdk-rust ef79947, workflow #1306).
    • PHP and embedded WorkerInterceptor declare an abstract executeUpdateValidation(). A class written from the tables at php.md:357-360 and publishing-config.md:324-327 fails with a fatal error.
    • rust.md:366-370 leaves out execute_update_validation_task.
    • publishing-config.md:247-248 says interceptors wrap "workflow tasks, activities and queries".
    • Fix: add the fourth row and a rule paragraph from sdk-reference.md:1257-1267 (PHP), README:819 and 915-927 (Rust), and workflow/docs/worker-interceptors.md (embedded). Then update all 7 locales and source-hashes.json.

Non-blocking

  • Add replayState() (sdk-php#491, workflow#1310) to the PHP and embedded context tables.
  • Smaller omissions compared with the current sources: the PHP enableActivityContinuation note, Rust cooperative cancellation dropping a task, and the embedded bridge, deferred-entity and nested-transaction notes.
  • scripts/check-doc-translations.js leaves uk out of its code-block loop. uk was checked by hand and matches.

Add executeUpdateValidation (PHP SDK and embedded Laravel) and
execute_update_validation_task (Rust) to the worker interceptor guides,
with their outcome fields and the rules that keep the validator's own
decision. List replayState() in the PHP and embedded context tables.
Translate the additions into all seven locales and record the new
reviewed-source hashes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent docs review: PASS at 5ae290b (re-review)

The same reviewer re-checked the diff 79ec941..5ae290b against current main of workflow (12fc6b76), sdk-php (9ced5eb) and sdk-rust (4faef77).

  • The previous blocking finding is resolved. Each guide's table now has the update-validation hook: PHP executeUpdateValidation, Rust execute_update_validation_task, embedded executeUpdateValidation. The embedded intro includes update validations.
  • Every context field, outcome field and exception name exists on main and matches sdk-reference.md, the Rust README (819, 915-927) and docs/worker-interceptors.md. replayState() is right on all three embedded contexts.
  • All 7 locales have the same headings, anchors, links and table rows. Code blocks are byte-identical, including uk, and the translations are real.
  • source-hashes.json matches in all 7 locales. check-doc-translations.js and check-doc-translation-updates.test.js pass, and all PR checks pass.
  • There are still no hard-coded versions. The guides say "the next … release".

Non-blocking: publishing-config.md:249 is an overlong prose line.

rmcdaniel and others added 2 commits November 26, 2026 11:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Workflow 2.42.0, PHP SDK 3.32.0 and Rust SDK 4.25.0 are the first
releases with worker interceptors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent docs review: PASS at b482385 (re-review after the version fill-in). 'in Workflow 2.42.0 and later', 'PHP SDK 3.32.0 and later' and 'Rust SDK 4.25.0 and later' match each changelog, and no interceptor files exist at the previous tags. workflows.v2.interceptors, examples/audit_interceptor.rs and the four Rust hooks exist at the release tags. All 7 locales are updated, and the hashes and anchors match. CI is green. Blocking: none.

@rmcdaniel
rmcdaniel marked this pull request as ready for review November 26, 2026 11:42
Resolves the source-hashes.json conflicts with #617 by taking main's
entries and recording the merged English sha256 for the three guides
this branch changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel

Copy link
Copy Markdown
Member Author

Merged main (6749cfe) after #617 landed. The docs merged cleanly. The only conflicts were the seven source-hashes.json files, resolved by taking main's entries and recording the merged English sha256 for publishing-config.md, php.md and rust.md. check-doc-translations.js passes.

@rmcdaniel
rmcdaniel enabled auto-merge November 26, 2026 11:44
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel merged commit cc7301e into main Nov 26, 2026
11 checks passed
rmcdaniel added a commit that referenced this pull request Nov 26, 2026
Resolves the source-hashes.json conflicts with #618 by taking main's
entries and recording the merged English sha256 for the guides this
branch changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rmcdaniel added a commit that referenced this pull request Nov 26, 2026
Resolves the source-hashes.json conflicts with #617, #618 and #622 by
taking main's entries and recording the merged English sha256 for the
guides this branch changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:general Pull request opened by General agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant