Skip to content

feat(conflict): Add target signature and dictionary store contracts - #850

Open
manjari25 wants to merge 2 commits into
mainfrom
manjari/tango-signature-entities-and-contracts
Open

manjari25 wants to merge 2 commits into
mainfrom
manjari/tango-signature-entities-and-contracts

Conversation

@manjari25

@manjari25 manjari25 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Why?

The Tango-backed conflict analyzer needs to persist each batch's affected-target signature, and a dictionary that maps the 64-bit target IDs back to their labels. This is the first PR in a stack that builds that storage layer. It defines the vocabulary and contracts only.

What?

Everything is added under submitqueue/extension/conflict/tango, the extension that owns the data:

  • Adds the TargetSignature, SignatureTarget and TargetLabel entities.
  • Adds SignatureReader and SignatureStore:
    • Get: returns (signature, found, error).
    • Create: write-once, returns an already-exists error on a repeat.
    • SignatureStore embeds SignatureReader, so a consumer such as conflict relaxation can take the read-only view and cannot write.
  • Adds DictionaryReader and DictionaryStore, keyed by (queue, ID), with the same read/write split:
    • Create: write-once, returns an already-exists error if the ID is already recorded, even with a different label, so the first label stays.
    • Get: returns (label, found, error). A label that differs from the caller's means a hash collision.
  • Adds the generated mock for these interfaces. It sits in the tango package, not a mock/ subpackage, so the analyzer's same-package tests do not create an import cycle.
  • No behavior changes. Nothing implements or consumes the contracts yet, and neither service's storage aggregate exposes them.

Test Plan

make check-gazelle
make check-mocks
make lint
./tool/bazel test //submitqueue/extension/conflict/...
CI

Issue

@manjari25
manjari25 requested review from a team and sbalabanov as code owners October 13, 2026 19:41
@manjari25
manjari25 marked this pull request as draft October 13, 2026 19:47
@manjari25
manjari25 force-pushed the manjari/tango-signature-entities-and-contracts branch from 5b5e9d2 to 5afc805 Compare October 14, 2026 02:03
@manjari25
manjari25 marked this pull request as ready for review October 14, 2026 02:26
@manjari25
manjari25 added this pull request to stack #872 October 14, 2026 21:02
Label string

// CreatedAt is the Unix milliseconds timestamp when the record was created.
CreatedAt int64

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maywant to add version as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both records are write-once (Create → ErrAlreadyExists, no update path), so there's no concurrent writer for a version to guard against. Per the immutable-records convention they're created, not versioned.

Targets []SignatureTarget

// CreatedAt is the Unix milliseconds timestamp when the record was created.
CreatedAt int64

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may want to add version as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

// See the License for the specific language governing permissions and
// limitations under the License.

package storage

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think these belong in storage.. these stores are extension impl specific

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated per offline discussion

@manjari25 manjari25 changed the title feat(storage): Add target signature and dictionary store contracts feat(conflict): Add target signature and dictionary store contracts Oct 15, 2026

This branch has not been deployed

No deployments
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.

2 participants