Skip to content

Restamp the discovery link instead of appending - #9

Merged
samlown merged 1 commit into
bearer-party-envelopesfrom
discovery-link-restamp
Aug 11, 2026
Merged

Restamp the discovery link instead of appending#9
samlown merged 1 commit into
bearer-party-envelopesfrom
discovery-link-restamp

Conversation

@samlown

@samlown samlown commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Found live: the verifier round trip completed (four signatures aboard, auto-verify fired), but lookup's delivery back to the subject failed with HTTP 422 — the returned envelope already carried the round-1 discovery link, Register appended a second identical one, and duplicate link keys fail envelope validation at the subject's inbox. Visible on the public record: /parties/019fedd8-… currently serves two identical verification/lookup links.

  • stampDiscoveryLink strips every existing copy and stamps one fresh link, before countersigning, in both Register and Verify.
  • Running it pre-sign also heals poisoned records: countersigning a stored duplicate-link envelope would otherwise fail Envelope.Sign's post-validation and wipe its signatures, wedging the recovery path.
  • Regression tests: the verifier round trip leaves exactly one link and a Validate()-clean envelope; Verify recovers a record seeded with duplicates.

Stacked on #8 — retarget to main once it merges. Recovery for the wedged samtest.sandbox.invopop.net record after deploy: gobl.lookup verify samtest.sandbox.invopop.net (or re-run the kyb confirmation link), which restamps and re-delivers.

🤖 Generated with Claude Code

Every countersign round appended another copy of the discovery link,
so an envelope returning from a verification provider went out with
duplicate link keys — invalid, and the subject's inbox answered 422.
The link is now stripped and restamped before countersigning, in both
Register and Verify, which also heals stored records that already
carry duplicates (countersigning those would fail post-sign
validation and wipe the envelope's signatures).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@samlown
samlown merged commit 74c3c19 into bearer-party-envelopes Aug 11, 2026
2 checks passed
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