Skip to content

docs: the V10 registration examples now compile - #136

Merged
iancooper merged 1 commit into
masterfrom
docs/registration-examples-compile
Aug 30, 2026
Merged

docs: the V10 registration examples now compile#136
iancooper merged 1 commit into
masterfrom
docs/registration-examples-compile

Conversation

@iancooper

Copy link
Copy Markdown
Member

Phase 6's compile obligation (task 6.7) measured a defect that is not on any page phase 6 wrote. This is the repair, authorised as its own unit.

The chain

services.AddBrighter().AddProducers(…).AddConsumers(…) does not compile. AddConsumers extends IServiceCollection; AddProducers, Handlers, UseScheduler and AutoFromAssemblies extend the IBrighterBuilder it returns. Chaining AddConsumers off the builder is CS1929 — measured in a project against the pinned 10.7.0 packages, with a control: deleting that one line from the same file builds clean.

So the consumer registration comes first, and everything else chains off it. That is the shape Brighter's own samples use (samples/CommandProcessor/HelloWorldInternalBus/Program.cs), and AddBrighter remains the entry point when there are no consumers.

Eleven blocks across six pages carried the chain, and so did CLAUDE.md's own ✅ V10 — current example — the one place a writer goes to copy the modern form.

DistributedLock.md matched the same grep and is correct. Its chain is rooted at services.AddSingleton<IAmazonDynamoDB>(…), which returns IServiceCollection, so .AddConsumers(…).AddProducers(…).UseOutboxSweeper(…) is legal. A leading-dot .AddConsumers( is not the defect; the receiver is. The tutorials are clean for the same reason — they write builder.Services.AddConsumers(…), which is why 009's compile-and-run pass never met this.

What the repair found once it started

The chain was the entry point, not the extent. The blocks it lives in carried four more invented APIs, each of which stops a reader's build:

The corpus said The assembly says Sites
options.ChannelFactory DefaultChannelFactory 13
options.Inbox InboxConfiguration 6
InboxConfiguration.NoActionOnExists no such member — actionOnExists: OnceOnlyAction.Warn, and the second positional parameter is an InboxScope 5
new InMemoryChannelFactory(bus) the only constructor is (InternalBus, TimeProvider, …) 2
.AutoFromAssemblies().AddHostedService<…>() AddHostedService extends IServiceCollection, not the builder 2

Plus one local to InMemoryOptions.md: two helpers declared their bus parameter IAmABus and passed it where InternalBus is required.

V10MigrationGuide.md's rename table now names the two property changes it was silent about, and its After (V10) block no longer shows the same options.ChannelFactory as its Before (V9) block.

Verification

Four representative corrected shapes were compiled, not reviewed — consumer-only, consumers-then-producers, the inbox configuration, and consumers-then-Handlers — against the same packages optioncheck pins: 0 errors, 0 warnings.

linkcheck.py                 No broken internal links (156 files checked).
pagelint.py                  0 errors, 783 warnings, 154 pages
urlmap.py --check-shape      0 — 153 pages, 12 sections, widest 12 of 20
urlmap.py --check-redirects  0 — 77 entries, 7858 bytes
versioncheck.py              0 stale pins of 18 across 5 page(s)
optioncheck                  0 mismatches across 37 tables and 427 rows
pagelint.py --changed        18 code block(s) strict across 56 hunks, 0 errors

The using-directive debt goes 787 → 783. Nine blocks were pulled into --changed scope by edits of one word; four earned real using directives and five declared // ..., which downgrades and still counts. One of the five was truncatedAzureServiceBusConfiguration.md's consumer example ended mid-lambda with an unbalanced brace — and is now closed.

Full record in spec/012-configuration_reference/tasks.md under Phase 6 as executed.

🤖 Generated with Claude Code

https://claude.ai/code/session_0146UueHL6H3zGBGTYwz7GtL

Task 6.7 measured that `AddBrighter().AddProducers(...).AddConsumers(...)` is
CS1929 — `AddConsumers` extends IServiceCollection and AddProducers extends the
IBrighterBuilder it returns, so the consumer registration comes first. Eleven
blocks across six pages had the chain, and so did CLAUDE.md's own "V10 —
current" example, which is where a writer would go to copy it.

`DistributedLock.md` matched the same grep and is correct: its chain is rooted
at AddSingleton, which returns IServiceCollection. The leading dot is not the
defect; the receiver is.

The blocks carrying the chain carried four more invented APIs, each of which
stops a reader's build: `options.ChannelFactory` for `DefaultChannelFactory`
(13), `options.Inbox` for `InboxConfiguration` (6),
`InboxConfiguration.NoActionOnExists` for `actionOnExists:
OnceOnlyAction.Warn` (5), a one-argument `InMemoryChannelFactory` (2), and
`.AutoFromAssemblies().AddHostedService<>()` (2). V10MigrationGuide.md's
rename table now names the two property changes it was silent about.

Four representative corrected shapes were compiled against the pinned
packages: 0 errors, 0 warnings. Nine blocks were pulled into `--changed` scope
by one-word edits; four gained real `using` directives and five declared
`// ...`, so the debt goes 787 -> 783. One of the five was truncated
mid-lambda and is now closed.

Gates unmoved otherwise: link 156, pagelint 0 errors across 154 pages, shape
153, redirects 77/7858, versioncheck 0 stale of 18, optioncheck 0 across 37
tables and 427 rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0146UueHL6H3zGBGTYwz7GtL
@iancooper
iancooper merged commit 6a03af9 into master Aug 30, 2026
8 checks passed
@iancooper
iancooper deleted the docs/registration-examples-compile branch August 30, 2026 11:19
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