Refresh docs/arch/ to match current codebase#5388
Merged
Merged
Conversation
The architecture docs had drifted since the v1beta1 graduation and the migration of several packages into toolhive-core. This refresh cross-references every claim against the current code in both repos and brings the docs back in sync. Highlights: - Repoint moved packages: pkg/permissions, pkg/registry/types, pkg/registry/data/registry.json, secrets/aes key derivation, runtime monitor, and the registry-api manager - Expand the operator CRD inventory: add EmbeddingServer (Auxiliary, StatefulSet) and MCPWebhookConfig; rename ToolConfig -> MCPToolConfig - Fix CRD field paths: spec.config.compositeToolRefs; spec.incomingAuth.oidcConfigRef on VirtualMCPServer; MCPGroupRef consumers expanded to all four CRDs - Rewrite vMCP middleware order to match server.go wrap order; correct Reporter interface naming; note logging reporter is Debug-level - Add Cluster mode to the auth-server storage doc; flatten the timeouts CRD shape; fix sentinelTls casing; surface DCRCredentialStore - Replace stale registry pieces: built-in catalog source, legacy top-level JSON examples, registry-API endpoint paths (/v0.1/servers, /v0.1/servers/:name/versions/latest), deprecation of thv group run - Expand transport docs: NamedMiddleware constructor type; MCP env vars emitted only by pkg/runtime/setup.go; 127.0.0.1 default lives in the config builder; SSE rewrite in sse_response_processor.go - Complete middleware enumeration in 02 and 05 (upstreamswap, awssts, obo, ratelimit, usagemetrics, recovery, header-forward, validating- webhook, mutating-webhook); fix authz -> authorization constant - Restore pkg/secrets/types.go reference (EnvVarPrefix + Provider interface); point pod builder at pkg/controllerutil - Skills: replace nonexistent skillsvc.go with real file inventory; add GET /content endpoint; mark oci_tags as reserved; correct OCI artifact name-match (last path component) - Smaller fixes: OrbStack across runtime lists; runtime detection order Podman -> Docker -> Colima; drop bogus TOOLHIVE_DETACHED env var and SENTRY_TRACES_SAMPLE_RATE env-var fallback; add unknown and policy_stopped lifecycle states; add inspector transport - Preserve correct StatefulSet wording throughout (proxy-runner is a Deployment; the MCP server pod is a StatefulSet created via pkg/container/kubernetes/client.go applyStatefulSet) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5388 +/- ##
==========================================
- Coverage 68.84% 68.77% -0.07%
==========================================
Files 627 627
Lines 63644 63644
==========================================
- Hits 43816 43774 -42
- Misses 16574 16617 +43
+ Partials 3254 3253 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rdimitrov
approved these changes
May 28, 2026
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
The architecture documentation under
docs/arch/had drifted since the v1beta1 CRD graduation and the migration of several packages (permissions,registry/types, redis client construction, etc.) into the siblingtoolhive-corerepository. This PR refreshes all 15 affected docs so that every code reference, field path, and behavioural claim resolves against the current code in bothtoolhiveandtoolhive-core.The refresh was produced by a two-pass review: one read-only cross-reference pass per doc (verifying every claim against the codebase), followed by a fix pass that applies confirmed drifts only.
Highlights:
pkg/permissions,pkg/registry/types,pkg/registry/data/registry.json, runtime monitor, registry-api manager.EmbeddingServer(Auxiliary, StatefulSet) andMCPWebhookConfig; renameToolConfigtoMCPToolConfigin tables and relationship diagram.spec.config.compositeToolRefs,spec.incomingAuth.oidcConfigRefonVirtualMCPServer,MCPGroupRefconsumers expanded to all four CRDs that reference it.pkg/vmcp/server/server.go; correctReporterinterface naming; note that the CLI logging reporter is Debug-level.timeoutsCRD diagram into sibling fields; fixsentinelTlscasing; surfaceDCRCredentialStore.types.Registryshape vs on-diskUpstreamRegistry), registry-API endpoint paths (/v0.1/servers,/v0.1/servers/:name/versions/latest); deprecation note onthv group run.NamedMiddlewareconstructor type; MCP env vars emitted only bypkg/runtime/setup.go;127.0.0.1default lives in the config builder; SSE rewrite functions insse_response_processor.go.02-core-concepts.mdand05-runconfig-and-permissions.md(adds upstreamswap, awssts, obo, ratelimit, usagemetrics, recovery, header-forward, validating-webhook, mutating-webhook); fixauthz->authorizationconstant.pkg/secrets/types.goreference forEnvVarPrefix+Providerinterface; point the pod builder atpkg/controllerutil/.skillsvc.goreferences with the real file inventory; document theGET /contentREST endpoint; markoci_tagsas reserved; correct the OCI artifact name-match rule (last path component).Podman->Docker->Colima); drop bogusTOOLHIVE_DETACHEDenv var andSENTRY_TRACES_SAMPLE_RATEenv-var fallback claim; addunknownandpolicy_stoppedto the workload lifecycle states; addinspectortransport.thv-proxyrunnerruns as a Deployment, but the MCP server pod itself is a StatefulSet created viapkg/container/kubernetes/client.goapplyStatefulSet. An earlier audit got this wrong; this PR does not repeat that.Type of change
Test plan
toolhiveandtoolhive-core(read-only verification pass).applyStatefulSet).Does this introduce a user-facing change?
No — docs only.
Special notes for reviewers
This PR is bigger than the usual 400-line / 10-file limit, which is acceptable for docs-only changes per
.claude/rules/pr-creation.md. Per-file diffs are small except for09-operator-architecture.md, which had the largest structural drift (MCPRegistry source-handler section had referred to apkg/sources/tree that no longer exists). The new section reflects the current model whereconfigYAMLis passed verbatim to the registry-api server.One adjacent code drift was noted but not fixed here (out of scope):
cmd/thv-operator/controllers/mcpexternalauthconfig_controller.go:192— theIdentitySynthesizedInactivemessage still says "All OAuth2 upstreams have userInfo configured" even though the predicate now also acceptsidentityFromToken. Worth a follow-up.🤖 Generated with Claude Code