refactor: debloat the Lexicon clients, Admin, Aspire hosting and Lexicon tool #199

Merged
Grandiras merged 1 commit from issue-196-lexicon-debloat into main 2026-10-05 02:52:35 +00:00
Owner

Closes #196.

Line reduction in the Lexicon surface, with no public API or behaviour change (PublicAPI.*.txt untouched; every public member keeps its XML doc).

  • Request building, ~70 methods in 35 clients plus PdsAdminClient. The var parameters = new XrpcParams()…; return _xrpc.QueryAsync(…) blocks are now single expression-bodied members. Methods that only awaited a procedure now return the Task directly, which saves a state machine per call. Every dropped async was checked: none wrapped a using or try.
  • The 40 internal client constructors are expression-bodied. They are not primary constructors, because those would change the constructors' accessibility.
  • Owner style. Lone-return members became =>, and needless braces were dropped (PdsAdminClient, the Aspire hosting extensions, LexiconDiffer).
  • Test. The upstream drift guard (SdkSource.Parameters.cs) now also recognises an inline new XrpcParams() at the call site.

Net: src + tools −673 lines. Build has 0 warnings; 4964 unit tests pass.

🤖 Generated with Claude Code

Closes #196. Line reduction in the Lexicon surface, with no public API or behaviour change (`PublicAPI.*.txt` untouched; every public member keeps its XML doc). - **Request building, ~70 methods in 35 clients plus `PdsAdminClient`.** The `var parameters = new XrpcParams()…; return _xrpc.QueryAsync(…)` blocks are now single expression-bodied members. Methods that only awaited a procedure now return the `Task` directly, which saves a state machine per call. Every dropped `async` was checked: none wrapped a `using` or `try`. - **The 40 internal client constructors** are expression-bodied. They are not primary constructors, because those would change the constructors' accessibility. - **Owner style.** Lone-`return` members became `=>`, and needless braces were dropped (`PdsAdminClient`, the Aspire hosting extensions, `LexiconDiffer`). - **Test.** The upstream drift guard (`SdkSource.Parameters.cs`) now also recognises an inline `new XrpcParams()` at the call site. Net: `src` + `tools` −673 lines. Build has 0 warnings; 4964 unit tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
refactor: debloat the Lexicon clients, Admin, Aspire hosting and Lexicon tool (closes #196)
All checks were successful
CI / pds-integration (pull_request) Successful in 48s
CI / build-and-test (pull_request) Successful in 1m22s
Sync Closures to GitHub / sync-closure (pull_request) Successful in 7s
ce117a746a
Request builders become single expressions, trivial constructors and
single-return members expression-bodied, single-statement blocks lose their
braces. Public API unchanged; the Lexicon drift test now also reads inline
XrpcParams builders.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator

🤖 Reviewing this PR — the review will link the full session transcript.

📜 Live transcript — updating every ~5 minutes while the review runs.

🤖 Reviewing this PR — the review will link the full session transcript. <!-- opencode-run:review --> 📜 [Live transcript](https://git.grandiras.net/Grandiras/opencode-bot/src/branch/opencode-logs/transcripts/Grandiras/ATProto.NET/pr-199/run-2026-10-05T02-20-58-840Z.md) — updating every ~5 minutes while the review runs.
opencode-reviewer left a comment

✅ Verdict: approve — no blocking issues found.

Clean mechanical debloat. I verified the risky parts of the refactor directly:

  • Dropped async: every remaining async Task member in the Lexicon surface is one with real surrounding logic (validation like ThrowIfNull, result unwrapping, retry/polling loops, using/try). None of the converted passthroughs wrapped a using, try, or argument validation that would have moved from deferred (faulted task) to eager throwing, so the observable behaviour is unchanged. Removing the internal .ConfigureAwait(false) is correct — for a pure passthrough with no state machine the decision rightly moves to the caller.
  • Signatures: async Task → Task is signature-identical, and the PublicAPI.*.txt files are indeed untouched; all XML docs were kept on the converted members.
  • Drift-guard test: the new inline new XrpcParams() recognition composes correctly with the existing var parameters = … declaration path — the inline branch only scans the statement starting at the call line, so declaration-style call sites can't be double-counted, and line locations are computed at test runtime so nothing goes stale with the line shifts.
  • Brace removals in the Aspire hosting extensions, PdsAdminClient, and LexiconDiffer are all single-statement bodies; no dangling-else or multi-statement hazards.

The CHANGELOG entry fits the file's existing conventions. Approving; nothing blocking.


⏱ 1m 58s · 13 steps · $0.0374 · tokens: 128.6k in / 1.3k out (+484.1k cache-read) · Go: 5h 0% · wk 0% · mo 90%
📜 Full session transcript

✅ **Verdict: approve** — no blocking issues found. Clean mechanical debloat. I verified the risky parts of the refactor directly: - **Dropped `async`**: every remaining `async Task` member in the Lexicon surface is one with real surrounding logic (validation like `ThrowIfNull`, result unwrapping, retry/polling loops, `using`/`try`). None of the converted passthroughs wrapped a `using`, `try`, or argument validation that would have moved from deferred (faulted task) to eager throwing, so the observable behaviour is unchanged. Removing the internal `.ConfigureAwait(false)` is correct — for a pure passthrough with no state machine the decision rightly moves to the caller. - **Signatures**: `async Task` → `Task` is signature-identical, and the `PublicAPI.*.txt` files are indeed untouched; all XML docs were kept on the converted members. - **Drift-guard test**: the new inline `new XrpcParams()` recognition composes correctly with the existing `var parameters = …` declaration path — the inline branch only scans the statement starting at the call line, so declaration-style call sites can't be double-counted, and line locations are computed at test runtime so nothing goes stale with the line shifts. - **Brace removals** in the Aspire hosting extensions, `PdsAdminClient`, and `LexiconDiffer` are all single-statement bodies; no dangling-`else` or multi-statement hazards. The CHANGELOG entry fits the file's existing conventions. Approving; nothing blocking. --- ⏱ 1m 58s · 13 steps · $0.0374 · tokens: 128.6k in / 1.3k out (+484.1k cache-read) · Go: 5h 0% · wk 0% · mo 90% 📜 [Full session transcript](https://git.grandiras.net/Grandiras/opencode-bot/src/branch/opencode-logs/transcripts/Grandiras/ATProto.NET/pr-199/run-2026-10-05T02-20-58-840Z.md) <!-- opencode-reviewed-head:ce117a746ab1140d03737ba6c1bd645f60dc0685 --> <!-- opencode-verdict:approve -->
Grandiras deleted branch issue-196-lexicon-debloat 2026-10-05 02:52:35 +00:00
Sign in to join this conversation.
No description provided.