Skip to content

Split server startup, wiring, and runtime adapters - #215

Merged
matthewpeterkort merged 11 commits into
mainfrom
refactor/server-split
Nov 18, 2026
Merged

matthewpeterkort merged 11 commits into
mainfrom
refactor/server-split

Conversation

@matthewpeterkort

Copy link
Copy Markdown
Collaborator

Summary

  • Finish the phased split of internal/server into configuration, process lifecycle, and dependency wiring.
  • Move strict HTTP handlers, Explorer and recipe runtime adapters, and their tests to the owning packages.
  • Extract the remaining source publication, release activation, recipe execution read, and Arango query callbacks from startup.
  • Preserve OpenAPI routes, status coverage, and response contracts. Refresh the package audit and remove three unused server test helpers.

Verification

  • go build ./..., go vet ./..., make lint-go-comments, and make test-go
  • Package audits, importer comparison, make openapi-check, and negative HTTP 500 audit tests
  • make test-integration against owned ArangoDB and ClickHouse fixtures
  • Server startup, health, readiness, and SIGTERM shutdown with ClickHouse enabled and disabled
  • Staticcheck U1000 clean in internal/server. Six diagnostics in destination packages match the Phase 7c baseline.
  • Independent review of startup and shutdown, Arango preview and recipe reads, and source publication. No confirmed regressions.

The integration runner reported six opt-in external Arango cases as unverified.

Phase 1 of the server package split. Keep preview response error mapping on the transport side and inject it into the Arango query adapter.

Verified build, vet, comment lint, Go package tests, unchanged OpenAPI tests, package audit consistency and maintenance checks. Reused the passing standalone artifact filesystem suite for its long reconciliation case. The only production importers of server remain main and cmd/arango-fhir-server.
Phase 2 of the server package split. Share recipe authorization and combine fixtures in testkit/recipefixtures to avoid importing the domain graph from generic testkit.

Passed go build, go vet, comment lint, focused and full Go checks, package audit and maintenance checks. OpenAPI inventory and status coverage are unchanged and passed. Reused the Phase 1 pass for the unchanged long artifact filesystem test.
Phase 3 of the server package split. Preserve the receipt mismatch sentinel while relocating scope validation, and share capability test fixtures through a dedicated testkit package.

Passed build, vet, comment lint, focused tests, make test-go, full package audit and maintenance tests. Unchanged OpenAPI tests pass. Only main and cmd/arango-fhir-server import server. Reused the unchanged long artifact filesystem test.
Phase 4 of the server package split. Share the compiled stage-to-receipt conversion through Explorer compilation and keep callable source-stage and resolve seams.

Passed build, vet, comment lint, focused and complete Go checks, unchanged OpenAPI tests, full audit and maintenance checks, and make test-integration on dedicated ArangoDB and ClickHouse. Reused the unchanged long artifact filesystem test. The server importers remain main and cmd/arango-fhir-server.
Phase 5 of the server package split. Keep the strict HTTP route in server pending Phase 7 and share catalog fixtures in testkit/constructionfixtures.

Passed build, vet, comment lint, make test-go, full package audit and maintenance checks. The unchanged OpenAPI tests pass and only main and cmd/arango-fhir-server import server. Reused the unchanged long artifact filesystem test.
Phase 6 of the server package split. Wire the constructed receipt runtime into lifecycle callbacks and share receipt test fixtures in testkit/recipetest.

Passed build, vet, comment lint, Go tests, unchanged OpenAPI coverage and route inventory, full package audit, and owned ArangoDB and ClickHouse integration. Reused the unchanged long artifact filesystem test. The only server importers are main and cmd/arango-fhir-server.

Interrogate reviewed tree 1d9cdc1 with three GPT-6.1 Sol reviewers. No verified findings.
Phase 7a of the server package split. Keep the composition type while it embeds the API handlers. Follow the moved source in the status and 500-response discovery with existing assertions intact.

Passed build, vet, comment lint, Go tests, full package audit and maintenance checks, unchanged route inventory, status coverage, and OpenAPI ownership and 500 audit with its fixture tests. Reused the unchanged long artifact filesystem test. Only main and cmd/arango-fhir-server import server.
Phase 7b of the server package split. Keep Explorer transport and error mapping together and preserve the original named integration cases across their new package boundaries. Restore the Phase 5 denied-metadata regression case.

Passed go build ./..., go vet ./..., make lint-go-comments, make test-go, package audit before/after and --full, OpenAPI inventory/status/ownership/500 audits and negative cases, and make test-integration against owned ArangoDB and ClickHouse. Reused the passing unchanged artifact-filesystem case. The final integration rerun passed after fixing profile discovery and the migrated denied-reference assertion.

pstack:interrogate reviewed the initial transport snapshot and later verification-only deltas. Three independent same-model reviewers found no confirmed transport defects. Reviewed runtime tree 5264fdf2967f154bde0837295bb5b8b3bee67ce2; final tree differs only in generated Markdown inventory.
Phase 7c of the server package split. Assemble the existing handler packages through a private composition type and register them with the generated registrar. Preserve the original inventory test and the existing wire contracts.

Passed go build ./..., go vet ./..., make lint-go-comments, make test-go plus the standalone artifact filesystem lock case, focused and full package audits, OpenAPI inventory/status/ownership/500 and negative checks, and make test-integration against owned ArangoDB and ClickHouse.

pstack:interrogate covered registration, startup and mixed API contracts on tree 08e6328. Three independent same-model reviewers found no confirmed defects.
Phase 8. Move request-time source publication, release, recipe execution read, and Arango query adapters into owning packages. Split server into config, run lifecycle and dependency wiring. Preserve OpenAPI inventory and status coverage, update the moved recipe reader source guard, and refresh the package audit.

Passed go build ./..., go vet ./..., make lint-go-comments, make test-go, focused and full package audits, OpenAPI inventory/status/500 checks, Staticcheck U1000 in internal/server, and make test-integration against owned ArangoDB and ClickHouse. Startup and SIGTERM smoke passed with ClickHouse enabled and disabled. Same-model independent review on the runtime snapshot and test-only delta found no confirmed defects.
Move route, contract, compiler, protocol and real database tests with their existing fixtures. Keep server composition coverage and retain every existing test declaration. Update integration selectors to require the same database cases at their new locations.

Passed Go build, vet, comment lint, Go suite, focused and full package audits, OpenAPI gates, runner tests, server Staticcheck U1000 and make test-integration against owned ArangoDB and ClickHouse.
@matthewpeterkort
matthewpeterkort merged commit 62475dc into main Nov 18, 2026
8 checks passed
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