Reconcile provable legacy workflow revisions - #6963
Draft
loganj wants to merge 2 commits into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 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
dbe2b67af88bd1a68f92d257b31d9d91406902b0on Blox workstationlarry-buzz-workflow-legacy-v4-fix:cargo fmt --all -- --checkevents.channel_id IS NULLdefinition is discovered and boundbuzz-dblibrary suite: 112 passed, 203 infrastructure tests ignoredbuzz-relaylibrary suite with migrated Postgres configured: 924 passed, 50 infrastructure tests ignoredcargo clippy -p buzz-db -p buzz-relay --all-targets -- -D warnings