docs(spec): reconcile interface sketches and layout with the code - #20
Merged
Conversation
ekalinin
force-pushed
the
feat/rate-limit
branch
from
August 17, 2026 19:26
c6a8d17 to
7935cbd
Compare
ekalinin
force-pushed
the
docs/spec-code-alignment
branch
2 times, most recently
from
August 17, 2026 19:35
aae0f6c to
f55f04a
Compare
ekalinin
force-pushed
the
feat/rate-limit
branch
from
August 17, 2026 19:35
7935cbd to
9a30b32
Compare
The interface sketches in sections 5.1 through 5.3 predate the implementation and had drifted: the service methods are named after the RPCs in section 7, a driver takes a DSN string and a pool size, a RowStream reports column names because no supported driver offers portable type metadata before the first row, and a ResultStore Writer mints the ResultRef rather than receiving one, since only the backend knows the locator it is about to write to. Section 12 now matches the tree, including the two departures from the original sketch and why they were made: idempotency has no package of its own, and internal/state is flat. Section 13 records what the code actually depends on, including why the config layer is plain yaml.v3 rather than viper or koanf, and section 11 describes the single metrics pipeline and the span link that stands in for the parent I1 makes impossible.
ekalinin
force-pushed
the
feat/rate-limit
branch
from
August 18, 2026 09:47
9a30b32 to
f7f9299
Compare
ekalinin
force-pushed
the
docs/spec-code-alignment
branch
from
August 18, 2026 09:47
f55f04a to
64cdda2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spec.mdgives interface sketches, and the implementation refined names and signatures as it went. The drift had accumulated to the point where the document contradicted itself: section 5.1 did not agree with section 7.5.1 QueryService
Method names align with the RPC names in section 7 (
GetQueryStatus,GetQueryStats,DownloadResult,WatchQuery), which is what keeps a transport a pure mapping.CanIBeStoppedis added, along with the byte window onDownloadResultthat backs both HTTPRangeand the gRPC offset/limit. It now records that every read path resolves the record first and checks its subject, so a transport never has to know about authorization.5.2 Drivers
Opentakes a DSN string and a pool size - every supported driver parses the DSN itself anyway.RowStreamreports column names rather than[]ColumnMeta: none of the supported drivers offers portable type metadata before the first row.5.3 ResultStore
Writer(ctx, queryID, format)returns theResultRefinstead of receiving one, because only the backend knows the locator it is about to write to.Registeris called frommainonce the backend has been built from config rather than atinit()time, since every backend needs configuration (a root directory, a bucket, a DSN). It records thatCloseon a writer is where S3 and ClickHouse wait for the upload or commit, so its error decides whether the query succeeded (I4).12 Repository structure
Brought in line with the tree, including the two deliberate departures from the original sketch and the reasoning: idempotency has no package of its own (it is two MetaStore calls and a rollback inside
SubmitQuery, and a package holding that would only move the sequencing away from the code that has to get it right), andinternal/stateis flat becauseredisandmemoryimplement one interface and share its error values.13 Stack
Records what the code actually depends on, including why the config layer is plain
yaml.v3with${VAR}expansion rather than viper or koanf: a single file, an atomic snapshot swap and an explicitReloadReportis the whole requirement, and neither library adds anything to it.11 Telemetry
Describes the single metrics pipeline and the span link that stands in for the parent I1 makes impossible. It also notes that a series appears at its first observation rather than at startup, which is how OTel reports, so alerts must use
rate()orincrease()rather thanabsent().Sections 9 to 14 shift to 10 to 15 to make room for the new Security section; the section references in code, in OpenAPI and in the proto are updated accordingly.