docs: godoc and package-doc pass#161
Merged
Merged
Conversation
Add root and schema package doc.go files and document the highest-value author-facing contracts: the Processor lifecycle, ProcessedRecord error propagation semantics, and the standalone (WASM) vs built-in hosting model. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Docs-only pass on the processor SDK. No behavior, signature, or logic changes.
New
doc.gofiles (2):doc.go— rootsdkpackage. Covers purpose, how to implement aProcessor(embedUnimplementedProcessor), the method lifecycle and ordering, theProcessedRecordreturn/error-propagation contract, the standalone (WASM) vs built-in hosting model, the schema encode/decode middleware, and neighboring packages.schema/doc.go—schemapackage. CoversGet/Create, howSchemaServicediffers between standalone (host registry) and built-in/test (in-memory) hosting, and caching.Godoc added/improved on exported symbols (~9):
ErrFilterRecord— sentinel semantics (filter vs. fail) forNewProcessorFuncfunctions.ProcessorFunc.Process— documents the truncate-on-first-error behavior (returned slice is shorter than input; remaining records are left for reprocessing), which is non-obvious from the signature.schema:Get,Create,TypeAvro,SchemaService,ErrSubjectNotFound,ErrVersionNotFound,ErrInvalidSchema,InMemoryService,NewInMemoryService.Highest-value contracts documented
ProcessedRecordtype (SingleRecord/MultiRecord/FilterRecord/ErrorRecord) routes a record — continue / split / ack-and-drop / nack-to-DLQ — and that dropping an unprocessable record instead of returningErrorRecordviolates at-least-once.GOOS=wasip1 GOARCH=wasmand callRunas their entry point; built-in processors are invoked directly and skip the WebAssembly boundary; author code is identical in both modes.Deliberately not documented
Skipped one-liner getters like
SchemaPayloadEnabledParameterName/SchemaKeyEnabledParameterNameand thewasm/pprocutilsinternal plumbing (their package docs already say "DO NOT use directly") — adding comments there would restate the name without adding information, against the "say something the signature doesn't" bar.Verification
go build ./...— cleango test ./... -count=1— passGOOS=wasip1 GOARCH=wasm go build ./...— cleanmake lint(golangci-lint v2.12.2) — 0 issues (baseline was also 0)Risk tier: Tier 3 (docs/comments only). No data-path or contract change.