Skip to content

Skip Avro framing checks for external storage references - #389

Merged
rmcdaniel merged 2 commits into
mainfrom
general/sdk-python-external-reference-manifest
Nov 26, 2026
Merged

rmcdaniel merged 2 commits into
mainfrom
general/sdk-python-external-reference-manifest

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Follow-up from the independent review of durable-workflow/server#1370 (server#1366).

Problem

Native Server's history export now marks a runtime external payload in payload_manifest as encoding: "external-storage-reference", diagnostic external_storage_reference, available: true, codec avro. That matches docs/history-archives.md and published PHP Server.

These entries name an object outside the bundle, so they carry no inline Avro framing. The PHP and native bundle verifiers skip them. history_bundle_verify.py did not: it warned payload_manifest.avro_framing_missing for every external reference, on native and PHP exports alike.

Change

src/durable_workflow/history_bundle_verify.py: the Avro framing and writer-schema fingerprint checks now use exactly the PHP and native condition: codec avro, available, not redacted, and diagnostic not external_storage_reference. An entry that only claims the external encoding is still checked. Redacted entries are skipped, as in PHP and native. All other manifest checks still apply: codec present, and payload_missing on an available entry.

Tests

tests/test_history_bundle_verify.py:

  • test_external_storage_reference_entries_need_no_avro_framing checks that the warning is gone for an external reference.
  • test_inline_avro_entry_without_framing_still_warns checks that an inline Avro entry without framing still warns.

Locally, with Python 3.12: test_history_bundle_verify.py, test_history_bundle_pruned.py and test_history_bundle_schema2.py pass (73 tests). ruff check passes on both files.

🤖 Generated with Claude Code

Native Server now marks a runtime external payload in a history export's
`payload_manifest` as `encoding: "external-storage-reference"` with the
diagnostic `external_storage_reference` (durable-workflow/server#1370).
Published PHP Server already did. Such an entry names an object outside
the bundle, so it carries no inline Avro framing.

The PHP and native verifiers skip these entries. This one warned
`payload_manifest.avro_framing_missing` on every external reference.
It now skips the framing and fingerprint checks for them. Inline Avro
entries without framing still warn.

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

Copy link
Copy Markdown
Member Author

Independent review: CHANGES REQUESTED at head ab321e3

Blocking: the skip is wider than in the PHP and native verifiers.

Both reference verifiers skip on the diagnostic alone:

  • PHP, workflow/src/V2/Support/BundleIntegrityVerifier.php:475: $codec === 'avro' && $available && ! $redacted && $diagnostic !== 'external_storage_reference'
  • Native, server/rust/src/runtime/bundle_verifier.rs:278: codec == Some("avro") && available && !redacted && diagnostic != Some("external_storage_reference")

Neither one reads encoding for this decision. This PR also skips when encoding == "external-storage-reference", whatever the diagnostic is. I checked this against the PR head in a python:3.12-slim container. An available Avro entry with encoding: "external-storage-reference" and no diagnostic gets no avro_framing_missing warning in Python. PHP and native both warn on that entry. The exporters in HistoryExport.php:429-430 and history_export.rs:576-577 always set both keys together, so real exports behave the same either way. Still, the Python verifier should not accept a malformed manifest that the other two flag.

Requested fix:

  • Make the skip condition diagnostic == "external_storage_reference" only, and drop the encoding check.
  • Add a test that an entry with encoding: "external-storage-reference" but no external_storage_reference diagnostic still warns. The current external-reference test sets both keys, so it cannot catch this difference.

Verified OK:

  • The skip covers both the avro_framing_missing warning and the writer_schema_fingerprint_mismatch check. That matches PHP and native, which nest both checks under the same condition.
  • No other check is weakened. codec_missing and payload_missing still apply to external-reference entries.
  • An inline Avro entry without framing still warns.
  • The tests are meaningful. With base main's history_bundle_verify.py and the PR's tests, test_external_storage_reference_entries_need_no_avro_framing fails and the inline test passes. At the PR head, test_history_bundle_verify.py, test_history_bundle_pruned.py and test_history_bundle_schema2.py all pass (73 tests).

Non-blocking, older than this PR: PHP and native also skip the Avro block when redacted is true. Python does not, so a redacted inline Avro entry without framing warns only in Python. That makes Python stricter, not looser. Aligning it here is optional. If you do, add a test.

Independent review on #389: PHP and native verifiers skip the Avro
framing check on the diagnostic alone, plus redacted entries, and never
on the encoding. The condition is now identical to theirs:
codec avro, available, not redacted, and diagnostic not
external_storage_reference. New tests:
- an entry that only claims the external encoding still warns;
- a redacted Avro entry needs no framing.

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

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent review: PASS at head 3dd23a4

What I verified:

  • The skip condition now matches the reference verifiers exactly: codec == "avro" and available and not redacted and diagnostic != "external_storage_reference". The references are PHP BundleIntegrityVerifier.php:475 and native bundle_verifier.rs:278. encoding no longer affects the decision. The redaction alignment from my earlier non-blocking note is included.
  • Both the framing warning and the writer-schema fingerprint check sit under this condition, as they do in PHP and native.
  • codec_missing and payload_missing are unchanged. No other module or fixture refers to the two rules this changes.
  • The tests fail without the change. With base main's verifier, the external-reference test and the redacted-entry test fail. With the first-round code (ab321e3), the encoding-only test and the redacted-entry test fail. The inline Avro test passes in every case.
  • At this head, test_history_bundle_verify.py, test_history_bundle_pruned.py and test_history_bundle_schema2.py pass in python:3.12-slim (75 tests).
  • CI at this head is complete: 21 checks passed, 4 were skipped and none failed.

@rmcdaniel
rmcdaniel merged commit f6dda8d into main Nov 26, 2026
25 checks passed
@rmcdaniel
rmcdaniel deleted the general/sdk-python-external-reference-manifest branch November 26, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant