Skip to content

feat(ids): use queue-scoped decimal resource IDs - #770

Open
behinddwalls wants to merge 4 commits into
preetam/id-uri-rfcfrom
preetam/numeric-resource-ids
Open

behinddwalls wants to merge 4 commits into
preetam/id-uri-rfcfrom
preetam/numeric-resource-ids

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Why?

Queue-prefixed resource IDs contain URL separators and duplicate scope already carried by the queue, route, and typed field. Resource IDs should remain flexible string contracts rather than forcing Go, protobuf, or SQL resource fields to integer types.

What?

  • Store canonical positive decimal strings such as "42" for SubmitQueue request IDs, SubmitQueue batch IDs, and Stovepipe request IDs while keeping resource and reference fields as strings and VARCHAR columns.
  • Keep the existing counter schema and (queue, domain) key unchanged; domain names the sequence (request or batch), not an application. SubmitQueue and Stovepipe have separate storage backends, so no ownerDomain dimension is introduced. Stovepipe uses the durable MySQL counter.
  • Put the shared formatting, validation, and numeric comparison helpers in platform/base/id. Keep domain naming consistent across the counter contract, implementation, callers, mocks, tests, and docs.
  • Validate direct resource-ID inputs and retain the queue-scoped test fixes and cross-queue ID regression coverage from the prior review pass. Provider IDs, URIs, hashes, and derived event IDs keep their contracts.

Test Plan

  • ✅ make build
  • ✅ make test (129 targets passed)
  • ✅ make check-gazelle, make check-mocks, make check-tidy, and make lint
  • ✅ git diff --check
  • ✅ git diff --quiet main -- ':(glob)**/schema/*.sql' (no schema differences from main)
  • ✅ Rebased onto main (5240af60), preserving the RFC → implementation stack and all six commits.
  • ✅ Fresh MySQL counter integration run with test-result caching disabled.
  • ✅ The preceding comment pass also ran SubmitQueue gateway integration, Stovepipe integration, and Stovepipe e2e successfully (4/4 targets including the counter suite).

Stack

  1. docs: define scoped sequential resource IDs #762
  2. @ feat(ids): use queue-scoped decimal resource IDs #770

@behinddwalls
behinddwalls added this pull request to stack #771 October 2, 2026 20:48
@behinddwalls
behinddwalls marked this pull request as ready for review October 2, 2026 22:15
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners October 2, 2026 22:15
## Summary

### Why?

Queue-prefixed resource IDs contain URL separators and duplicate scope already carried by the queue, route, and typed field. Resource IDs should remain flexible string contracts rather than forcing Go, protobuf, or SQL resource fields to integer types.

### What?

- Store canonical positive decimal strings such as "42" for SubmitQueue request IDs, SubmitQueue batch IDs, and Stovepipe request IDs while keeping resource and reference fields as strings and VARCHAR columns.
- Persist counter high-water marks by owner domain, queue, and resource kind; wire Stovepipe to the durable MySQL counter so allocation survives restarts and remains isolated across domains.
- Validate direct resource-ID inputs, compare decimal strings numerically where allocation order matters, and update queue contracts, documentation, fixtures, and generated bindings without changing provider IDs, URIs, hashes, or derived event IDs.

## Test Plan

- ✅ make build
- ✅ make test (127 targets passed)
- ✅ make fmt, make gazelle, make mocks, and make tidy; repeated runs were byte-for-byte stable
- ✅ make lint-binary lint-license lint-message-id lint-queue-shard
- ✅ git diff --check
- ⚠️ Docker-backed integration and end-to-end tests were not run because the Docker daemon socket is unavailable.
## Summary

### Why?

Queue-prefixed resource IDs contain URL separators and duplicate scope already carried by the queue, route, and typed field. Resource IDs should remain flexible string contracts rather than forcing Go, protobuf, or SQL resource fields to integer types.

### What?

- Store canonical positive decimal strings such as "42" for SubmitQueue request IDs, SubmitQueue batch IDs, and Stovepipe request IDs while keeping resource and reference fields as strings and VARCHAR columns.
- Persist counter high-water marks by owner domain, queue, and resource kind; wire Stovepipe to the durable MySQL counter so allocation survives restarts and remains isolated across domains.
- Validate direct resource-ID inputs, compare decimal strings numerically where allocation order matters, and update queue contracts, documentation, fixtures, and generated bindings without changing provider IDs, URIs, hashes, or derived event IDs.
- Address the verified autoreview findings: scope Stovepipe test queries by queue/tenant and topic, use non-colliding decimal gateway fixtures, fail fast on unexpected request-summary RPC errors, repair stale storage assertions, and cover independent queues reusing the same ID.

## Test Plan

- ✅ make build
- ✅ make test (127 targets passed)
- ✅ make check-gazelle, make check-mocks, make check-tidy, and make lint
- ✅ git diff --check
- ✅ Fresh Docker run of all 9 integration targets, Runway e2e, and Stovepipe e2e, including the cross-queue ID regression.
- ⚠️ The complete 12-target integration/e2e run has 11 passing targets. SubmitQueue real-Git e2e still fails because Git rejects the mounted /srv/git/sandbox.git repository as having dubious ownership in this macOS container environment; the non-Git SubmitQueue e2e suite passes.
- ⚠️ aifx verify could not complete its checks: coverage requires a monorepo .arcconfig, the UReview API failed, and the generic Go lint verifier exited without reporting issues. Repository-native checks above passed.
## Summary

### Why?

Queue-prefixed resource IDs contain URL separators and duplicate scope already carried by the queue, route, and typed field. Resource IDs should remain flexible string contracts rather than forcing Go, protobuf, or SQL resource fields to integer types.

### What?

- Store canonical positive decimal strings such as "42" for SubmitQueue request IDs, SubmitQueue batch IDs, and Stovepipe request IDs while keeping resource and reference fields as strings and VARCHAR columns.
- Keep the existing counter schema and (queue, domain) key unchanged; domain stores the resource type (request or batch). SubmitQueue and Stovepipe have separate storage backends, so no ownerDomain dimension is introduced. Stovepipe uses the durable MySQL counter.
- Put the shared formatting, validation, and numeric comparison helpers in platform/base/id. Use resourceType consistently in Go contracts, mocks, tests, and docs without renaming the existing SQL domain column.
- Validate direct resource-ID inputs and retain the queue-scoped test fixes and cross-queue ID regression coverage from the prior review pass. Provider IDs, URIs, hashes, and derived event IDs keep their contracts.

## Test Plan

- ✅ make build
- ✅ make test (127 targets passed)
- ✅ make check-gazelle, make check-mocks, make check-tidy, and make lint
- ✅ git diff --check
- ✅ git diff --quiet 343875c -- ':(glob)**/schema/*.sql' (no schema differences from the RFC branch)
- ✅ Fresh Docker tests: MySQL counter integration, SubmitQueue gateway integration, Stovepipe integration, and Stovepipe e2e (4/4 targets passed).
- ⚠️ The prior full Docker run passed all 9 integration targets and Runway/Stovepipe e2e; SubmitQueue real-Git e2e remains blocked by the mounted sandbox repository's dubious-ownership check. That unrelated Git configuration was not changed or rerun in this comment pass.
- ⚠️ The prior aifx verify run could not complete its monorepo coverage, generic Go lint, and UReview API checks; repository-native checks above passed.
## Summary

### Why?

Queue-prefixed resource IDs contain URL separators and duplicate scope already carried by the queue, route, and typed field. Resource IDs should remain flexible string contracts rather than forcing Go, protobuf, or SQL resource fields to integer types.

### What?

- Store canonical positive decimal strings such as "42" for SubmitQueue request IDs, SubmitQueue batch IDs, and Stovepipe request IDs while keeping resource and reference fields as strings and VARCHAR columns.
- Keep the existing counter schema and (queue, domain) key unchanged; domain names the sequence (request or batch), not an application. SubmitQueue and Stovepipe have separate storage backends, so no ownerDomain dimension is introduced. Stovepipe uses the durable MySQL counter.
- Put the shared formatting, validation, and numeric comparison helpers in platform/base/id. Keep domain naming consistent across the counter contract, implementation, callers, mocks, tests, and docs.
- Validate direct resource-ID inputs and retain the queue-scoped test fixes and cross-queue ID regression coverage from the prior review pass. Provider IDs, URIs, hashes, and derived event IDs keep their contracts.

## Test Plan

- ✅ make build
- ✅ make test (127 targets passed)
- ✅ make check-gazelle, make check-mocks, make check-tidy, and make lint
- ✅ git diff --check
- ✅ git diff --quiet 343875c -- ':(glob)**/schema/*.sql' (no schema differences from the RFC branch)
- ✅ Fresh MySQL counter integration run with test-result caching disabled.
- ✅ The preceding comment pass also ran SubmitQueue gateway integration, Stovepipe integration, and Stovepipe e2e successfully (4/4 targets including the counter suite).
- ⚠️ The prior full Docker run passed all 9 integration targets and Runway/Stovepipe e2e; SubmitQueue real-Git e2e remains blocked by the mounted sandbox repository's dubious-ownership check. That unrelated Git configuration was not changed or rerun for this naming-only update.
- ⚠️ aifx verify could not complete its monorepo coverage, generic Go lint, and UReview API checks; repository-native checks above passed.
@behinddwalls
behinddwalls force-pushed the preetam/numeric-resource-ids branch from 7bb69d3 to fedc7f9 Compare October 2, 2026 22:41

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.

1 participant