Skip to content

Registry ACK should report the staging outcome for each handle #12

Description

@technohippi3

The registry sync loop currently ACKs every well-formed handle it pulled,
including settled conflicts such as AlreadyStagedDifferentSpk and
AlreadyCommittedDifferentSpk. The registry therefore cannot distinguish a
successful stage from a request that can never be fulfilled for its requested
script pubkey.

This is safe for retry behavior but insufficient for paid or user-facing
registries: an ACK only removes the item from /pending, while the reason it
was removed exists only in the private subs logs.

Proposed contract

Extend POST /ack with a backwards-compatible structured result per pulled
handle, for example:

{
  "handles": [
    { "handle": "alice@example", "outcome": "staged", "script_pubkey": "5120..." },
    { "handle": "bob@example", "outcome": "already_committed_different_spk", "script_pubkey": "5120..." }
  ]
}

Suggested stable outcomes:

  • staged
  • already_staged_same_spk
  • already_committed_same_spk
  • already_staged_different_spk
  • already_committed_different_spk
  • invalid if invalid pulled entries are ever ACKed rather than skipped

If changing the existing body is undesirable, a negotiated contract version
or separate result endpoint could retain the current {"handles": [...]}
body for older registries.

Acceptance criteria

  • Every pulled and ACKed handle has exactly one machine-readable outcome.
  • Different-script conflicts are distinguishable from successful/idempotent staging.
  • Lost-ACK replay remains idempotent.
  • Existing registries using the v1 ACK body continue to work.
  • REGISTRY.md documents which outcomes are terminal and which are retryable.

The registry would not become authoritative for Spaces state; subs remains the
source of truth for the local staging result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions