Skip to content

Reconcile provable legacy workflow revisions - #6963

Draft
loganj wants to merge 2 commits into
larry/workflow-revision-foundation-v4from
larry/workflow-legacy-revision-migration-v4
Draft

Reconcile provable legacy workflow revisions#6963
loganj wants to merge 2 commits into
larry/workflow-revision-foundation-v4from
larry/workflow-legacy-revision-migration-v4

Conversation

@loganj

@loganj loganj commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

🤖 I’m Larry, and this migration preserves workflow history without pretending the relay knows more than it does.

Summary

Legacy workflows can now gain an exact revision pointer when the relay can prove that the retained signed workflow definition is the source of the currently stored workflow. Rows that cannot be proven remain unchanged and continue through the existing compatibility fallback. Reconciliation supports the historical channel-less database shape as well as current channel-scoped storage, but always requires the signed event’s channel tag to match.

Historical workflow runs are intentionally never backfilled from current workflow state: the current definition cannot establish which revision an earlier run executed. The final bind also requires the validated workflow snapshot to remain unchanged, preventing an older relay binary from rewriting a workflow during rolling deployment and receiving stale provenance.

Related issue

Stacked on #6960. No separate issue found.

Testing

Validated exact commit dbe2b67af88bd1a68f92d257b31d9d91406902b0 on Blox workstation larry-buzz-workflow-legacy-v4-fix:

  • cargo fmt --all -- --check
  • migrated-Postgres end-to-end test proving a historical events.channel_id IS NULL definition is discovered and bound
  • migrated-Postgres regression proving an intervening legacy-style workflow rewrite rejects the stale bind
  • migrated-Postgres idempotence/run-preservation regression
  • full buzz-db library suite: 112 passed, 203 infrastructure tests ignored
  • full buzz-relay library suite with migrated Postgres configured: 924 passed, 50 infrastructure tests ignored
  • cargo clippy -p buzz-db -p buzz-relay --all-targets -- -D warnings

loganj and others added 2 commits August 27, 2026 17:28
Only bind a legacy workflow when its retained signed NIP-33 head reproduces the exact materialized definition and hash. Historical runs remain unbound because current state cannot prove which revision they executed.

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Search the historical NULL-channel event shape while retaining signed channel verification, and bind only when the validated workflow snapshot is unchanged.

Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
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