Skip to content

Commit 981f4f1

Browse files
committed
docs(stovepipe): clarify authoritative URI history
1 parent be1fd97 commit 981f4f1

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

api/stovepipe/proto/stovepipe.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ message GetRequestHistoryByRequestIDRequest {
6767
string page_token = 4;
6868
}
6969

70-
// GetRequestHistoryByURIRequest selects one request history by its exact commit URI.
70+
// GetRequestHistoryByURIRequest selects the authoritative request history for an exact commit URI.
7171
message GetRequestHistoryByURIRequest {
7272
// Logical queue containing the request.
7373
string queue = 1;
74-
// Exact VCS-agnostic commit URI supplied by the selected request.
74+
// Exact VCS-agnostic commit URI whose authoritative request is selected.
7575
string uri = 2;
7676
// Maximum entries to return. Zero selects the server default.
7777
int32 page_size = 3;
@@ -132,7 +132,7 @@ message GetRequestHistoryByRequestIDResponse {
132132
string next_page_token = 2;
133133
}
134134

135-
// GetRequestHistoryByURIResponse contains one page of request history.
135+
// GetRequestHistoryByURIResponse contains one page of the authoritative request's history.
136136
message GetRequestHistoryByURIResponse {
137137
// Selected request history and immutable context.
138138
RequestHistory history = 1;
@@ -149,6 +149,6 @@ service Stovepipe {
149149
rpc Ingest(IngestRequest) returns (IngestResponse) {}
150150
// GetRequestHistoryByRequestID returns retained history for one request ID.
151151
rpc GetRequestHistoryByRequestID(GetRequestHistoryByRequestIDRequest) returns (GetRequestHistoryByRequestIDResponse) {}
152-
// GetRequestHistoryByURI returns retained history for one exact commit URI.
152+
// GetRequestHistoryByURI returns retained history for an exact commit URI's authoritative request.
153153
rpc GetRequestHistoryByURI(GetRequestHistoryByURIRequest) returns (GetRequestHistoryByURIResponse) {}
154154
}

api/stovepipe/protopb/stovepipe.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/stovepipe/protopb/stovepipe_grpc.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/rfc/stovepipe/request-history-api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Summary
44

5-
Stovepipe exposes retained request history through queue-scoped point lookups by request ID and exact URI. Both selectors return the same ordered, cursor-paginated history.
5+
Stovepipe exposes retained request history through queue-scoped point lookups by request ID and exact URI. URI lookup resolves the newest authoritative request for that commit. Both selectors return the same ordered, cursor-paginated history.
66

77
The API reads the append-only model defined by [Stovepipe Request Event History](request-event-history.md) directly. It does not replay history into current state or introduce a second persisted history projection. Current commit status remains a separate read concern derived from operational entities rather than request history.
88

@@ -15,7 +15,7 @@ The API supports the same selectors as [SubmitQueue Gateway Request History APIs
1515

1616
Both methods require a queue because Stovepipe storage and authorization are queue-scoped. A selector belonging to another queue is not found rather than resolved across shards.
1717

18-
SubmitQueue's URI method returns several histories because the same change may be submitted repeatedly. Stovepipe ingest permanently deduplicates `(queue, URI)` to one request, so its URI method returns exactly one history. Relaxing that invariant later would require a new plural method rather than changing this method's cardinality in place.
18+
SubmitQueue's URI method returns several histories because the same change may be submitted repeatedly. Stovepipe's URI method instead returns exactly one history: the request selected by the queue's durable authoritative mapping for that URI. The current insert-once mapping selects the only request; future revalidation advances the mapping to the newest accepted request without changing this API's cardinality. Older attempts remain addressable by request ID, and discovering every attempt can be added later as a separate list API.
1919

2020
## Representative Contract
2121

@@ -83,9 +83,9 @@ Entry IDs and page tokens are opaque. Clients may compare entry IDs and pass pag
8383

8484
Request-ID lookup validates the queue, ID, page size, and optional token; loads the queue's `Request` to validate the selector and supply immutable wrapper context; and lists one bounded page of its `RequestHistoryStore` entries.
8585

86-
URI lookup resolves the existing `RequestURIStore` primary key and delegates to the same paginated request-ID path. It does not scan history by an entry's `URI` field and requires no new storage index. A missing mapping is not found; a mapping whose Request is missing is an internal consistency error.
86+
URI lookup resolves the authoritative request ID from the existing `RequestURIStore` primary key and delegates to the same paginated request-ID path. Authority is explicit stored state rather than a timestamp comparison. The current mapping is insert-once; supporting revalidation later requires a versioned conditional update that advances it only after the newer Request is durable. It does not scan history by an entry's `URI` field and requires no new storage index. A missing mapping is not found; a mapping whose Request is missing is an internal consistency error.
8787

88-
The request-URI mapping must be repaired and retained with its Request and history. Otherwise URI lookup could lose coverage while request-ID lookup still succeeds. The loaded Request supplies URI, build strategy, and base URI once on the `RequestHistory` wrapper; these immutable values are not duplicated on every entry.
88+
The request-URI mapping must be repaired and retained with its Request and history. Otherwise URI lookup could lose coverage while request-ID lookup still succeeds. Once a newer request becomes authoritative, a later failure does not fall back to an older successful attempt. The loaded Request supplies URI, build strategy, and base URI once on the `RequestHistory` wrapper; these immutable values are not duplicated on every entry.
8989

9090
## Public Projection
9191

@@ -133,7 +133,7 @@ Request-ID and URI lookup return the same stored entries, ordering, and paginati
133133

134134
The public shape follows SubmitQueue's queue `List` convention: an empty token selects the first page, zero page size selects the server default, and the response returns an opaque `next_page_token` that is empty on the last page. The initial default is 50 entries and the maximum is 200. The controller requests one more entry than the effective page size, returns only the requested page, and issues a token only when the extra entry proves that another page exists.
135135

136-
Pagination uses the immutable keyset `(timestamp_ms ASC, entry_id ASC)`. The versioned token represents the last returned ordering tuple and is bound to the original selector kind and value, queue, and resolved request ID. The binding does not prescribe whether those values are embedded or fingerprinted in the token. Reusing a token with another method, queue, request ID, or URI is invalid. Page size is not bound into the token, so a caller may change it between pages within the server maximum. The controller decodes the public token into the storage contract's typed exclusive cursor; storage implementations never parse wire tokens.
136+
Pagination uses the immutable keyset `(timestamp_ms ASC, entry_id ASC)`. The versioned token represents the last returned ordering tuple and is bound to the original selector kind and value, queue, and resolved request ID. Binding URI pagination to the resolved request ID keeps an in-progress traversal on the same history if a newer request becomes authoritative between pages. The binding does not prescribe whether those values are embedded or fingerprinted in the token. Reusing a token with another method, queue, request ID, or URI is invalid. Page size is not bound into the token, so a caller may change it between pages within the server maximum. The controller decodes the public token into the storage contract's typed exclusive cursor; storage implementations never parse wire tokens.
137137

138138
Tokens are traversal cursors rather than snapshot handles. A new occurrence ordered after the cursor can appear on a later page. A repair that inserts an older occurrence at or before an already-consumed cursor may be observed only by starting a fresh traversal. This is the paginated form of the API's existing eventual-consistency guarantee: a token prevents duplicates from stable retained entries but does not freeze history while pipeline writers and repair are active.
139139

@@ -177,7 +177,7 @@ Rejected because it would add query-by-attribute capability to `RequestHistorySt
177177

178178
### Return several histories by URI
179179

180-
Rejected while ingest enforces one request per `(queue, URI)`. A repeated field would imply cardinality the domain does not permit and make a future deduplication change silently alter existing responses.
180+
Rejected because URI lookup answers which request is authoritative for the commit. Returning every attempt would mix audit discovery with one request's independently paginated history. A future attempt-listing API can return request IDs without changing this point lookup.
181181

182182
### Return every entry in one response
183183

0 commit comments

Comments
 (0)