Skip to content

test(startup): build the host composition in CI, not only when somebody runs it - #388

Merged
BechsteinDigital merged 1 commit into
mainfrom
feat/composition-gate
Sep 3, 2026
Merged

test(startup): build the host composition in CI, not only when somebody runs it#388
BechsteinDigital merged 1 commit into
mainfrom
feat/composition-gate

Conversation

@BechsteinDigital

@BechsteinDigital BechsteinDigital commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Found while checking whether the three merged PRs (#385, #386, #387) actually hold up outside the test hosts.

The gap

src/Host/Dev/Program.cs carries this claim:

if someone breaks AddCalloraHost or the order these have to run in, this stops building rather than the next distribution finding out

That held for compile errors only. A missing DI registration compiles cleanly and fails at builder.Build() — and nothing in CI ever made that call. AddCalloraHost had exactly one caller in the repository, and it runs when a person presses F5.

So a service registered by hand in a test host and absent from the real composition came through the suite green and would have taken down the dev stack at startup. That is precisely the shape of the last three PRs: WorkspaceReach, PluginSelfService and ITenantPluginDelegationStore are registered manually in every test host that uses them.

What the gate covers

AddCalloraHost sets ValidateScopes and ValidateOnBuild, so the build itself says something: every registered dependency is checked for resolvability and for a scoped service captured by a singleton.

And that is where it stops — measured, not assumed. Remove PluginSelfService from the composition and the host still builds: a service registered nowhere is not validated either, and a controller's [FromServices] parameter resolves only when it is called. Only the second test — the one naming the tenant-level services — goes red.

I had written the opposite in the test comment first ("covers everything that comes later, nobody has to extend it"). The experiment showed it was wrong, and the comment now says what actually holds: whatever is consumed only through [FromServices] has to be listed explicitly or nothing covers it.

Also

The Program.cs comment is corrected in the same move and points at the test, so the two stay in step — the test makes the same calls in the same order, and a composition that drifts from it would be testing something nobody ships.

Callora.Core.Tests      1841 passed, 0 failed, 0 skipped
Callora.Analyzers.Tests   34 passed, 0 failed, 0 skipped

…er runs it

src/Host/Dev/Program.cs carries the claim that it notices "if someone breaks
AddCalloraHost or the order these have to run in". That held for compile errors only.
A missing registration compiles cleanly and fails at builder.Build() — and nothing in
CI ever made that call. A service registered by hand in a test host and absent from
the real composition therefore came through the suite green and would have taken down
the dev stack at startup.

AddCalloraHost sets ValidateScopes and ValidateOnBuild, so the build itself says
something: every registered dependency is checked for resolvability and for a scoped
service captured by a singleton.

And that is where it stops — measured, not assumed. Remove PluginSelfService from the
composition and the host still builds: a service registered nowhere is not validated
either, and a controller's [FromServices] parameter resolves only when it is called.
Hence the second test naming the tenant-level services explicitly. Whatever is
consumed only through [FromServices] has to be listed there or nothing covers it. The
comment in the test says so, so the next person does not read more into the first one
than it delivers.

The Program.cs comment is corrected in the same move, and points at the test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011iSX3geDv7PNRmiusRr1xd
@BechsteinDigital
BechsteinDigital merged commit abed2ae into main Sep 3, 2026
5 checks passed
@BechsteinDigital
BechsteinDigital deleted the feat/composition-gate branch September 3, 2026 22:09
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