Skip to content

fix(serviceoffer): restore ERC-8004 registration aggregation#367

Merged
bussyjd merged 1 commit intomainfrom
fix/restore-shared-registration-aggregation
Apr 22, 2026
Merged

fix(serviceoffer): restore ERC-8004 registration aggregation#367
bussyjd merged 1 commit intomainfrom
fix/restore-shared-registration-aggregation

Conversation

@bussyjd
Copy link
Copy Markdown
Collaborator

@bussyjd bussyjd commented Apr 22, 2026

Summary

Re-applies 0f7d553 ("fix: aggregate ERC-8004 registration services") on top of current main. That commit was silently reverted when PR #364 (autorefill) was squash-merged from a stale base — see context below.

Without this, reconcileRegistrationStatus returns SingletonConflict for every ServiceOffer after the first, which means (a) only one service per stack can reach Ready while registration is enabled, and (b) PR #355's obol sell demo hello/blocks/oracle flow cannot produce a populated storefront with registration on by default.

What broke

When Commit Effect
Apr 22 02:32 JST 0f7d553 "fix: aggregate ERC-8004 registration services" Landed on main. Added applySharedRegistrationStatus, multi-offer fan-out in enqueueOfferFromRegistration, multi-offer render in buildActiveRegistrationDocument. Replaced SingletonConflict with shared-agent logic.
Apr 23 03:43 JST a819df3 "feat(buy): add agent-managed autorefill reconcile loop (#364)" Squash-merged to main. The PR branch was cut before 0f7d553 landed. The squash silently reverted 0f7d553's lines in controller.go and render.go (no merge conflict surfaced because the squash rebuilds the diff against the current tip).
Apr 23 04:43 JST b5eba81 "fix(serviceoffer): drop orphan shared-registration tests (#366)" Package stopped compiling because controller_test.go still referenced applySharedRegistrationStatus. I deleted the orphan tests to get CI green, with a commit-message note that the fix needed its own restore PR. This is that PR.

What this PR does

Exact contents of 0f7d553, re-applied:

  • internal/serviceoffercontroller/controller.go — restore applySharedRegistrationStatus, multi-offer fan-out in enqueueOfferFromRegistration, registrationOffers() helper, deletion-path hand-off to next owner, and the shared-agent branch in reconcileRegistrationStatus / reconcileRegistrationActive.
  • internal/serviceoffercontroller/controller_test.go — restore the two TestApplySharedRegistrationStatus_* tests that fix(serviceoffer): drop orphan shared-registration tests #366 deleted.
  • internal/serviceoffercontroller/render.go — restore 4-arg buildActiveRegistrationDocument, buildRegistrationServices, offerPublishedForRegistration.
  • internal/serviceoffercontroller/render_test.go — restore fan-out render coverage.

Other silent reverts in the same squash (NOT in this PR)

While auditing, I found a819df3 also silently reverted three unrelated commits. Those are not included here because one of them is non-trivial to restore safely:

  1. 499e0e4 "fix(erc8004): use canonical string signer contract" — SignTxRequest.ChainID reverted stringint64 in internal/erc8004/signer.go. 499e0e4's commit body says the server accepts strings (canonical). The post-squash comment on main says "sending it as a string causes HTTP 422". These two statements can't both be right against the same remote-signer. Someone with recent hands-on experience with the Rust remote-signer needs to decide which wire format it actually accepts today before this one gets restored.
  2. 6c8d786 "docs(erc8004): tighten remote-signer string contract" — reverted in signer.py. Same blocker: depends on the signer contract decision.
  3. 899c605 "docs: point stack consumers at signer schema" — reverted CLAUDE.md + SKILL.md pointers to the canonical schema URL. Again, depends on (1).

I'll open follow-ups once the signer-contract question is resolved.

Verification

  • go test ./... — green, including the two restored TestApplySharedRegistrationStatus_* cases and all pre-existing autorefill tests.
  • Cherry-picked cleanly onto current origin/main with one conflict in controller_test.go (same file block that a819df3 + b5eba81 churned); resolved by keeping both autorefill and shared-registration tests.

Test plan

  • go test ./internal/serviceoffercontroller/...
  • On a live stack: two ServiceOffers in different namespaces with registration.enabled: true; confirm both reach Ready and share the same AgentID instead of one returning SingletonConflict.
  • Delete the owner offer; confirm ownership transfers to the next offer without dropping the on-chain agent record.

Follow-ups

  • First commit towards a demo sell command #355 (demo sell) rebases onto this once merged.
  • Separate PR for the signer wire-format question (see above).
  • Process suggestion: GitHub's squash-merge doesn't flag "my base is 12 commits behind main" as a hazard. Worth considering a required update-branch step before merge on PRs that touch heavily-shared files (serviceoffercontroller/, erc8004/, x402/).

@bussyjd bussyjd force-pushed the fix/restore-shared-registration-aggregation branch from 2ff6ad3 to 140ceba Compare April 22, 2026 21:18
@bussyjd bussyjd merged commit 69b3181 into main Apr 22, 2026
5 checks passed
@bussyjd bussyjd deleted the fix/restore-shared-registration-aggregation branch April 22, 2026 21:19
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