Skip to content

Runtime controls and repository boundaries#4

Draft
JSYoo5B wants to merge 23 commits into
codex/02-core-crud-resourcesfrom
codex/03-runtime-repository-boundaries
Draft

Runtime controls and repository boundaries#4
JSYoo5B wants to merge 23 commits into
codex/02-core-crud-resourcesfrom
codex/03-runtime-repository-boundaries

Conversation

@JSYoo5B

@JSYoo5B JSYoo5B commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Splits larger app services by resource-oriented files.
  • Adds injectable clock and ID generator support.
  • Adds admin reset and request recording behavior.
  • Introduces repository interfaces before durable storage implementations.

Main Review Points

  • Dependency direction between api, app, store, and platform packages.
  • Admin reset and request log behavior.
  • Repository boundary shape for image, network, compute, and volume.

Verification

  • go test ./...

Comment thread internal/api/router.go
func NewRouter(cfg config.Config) http.Handler {
router := chi.NewRouter()
router.Use(requestID)
requests := requestlog.NewService()

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request recording is created at the top router composition level because it is cross-service SandStack behavior. It should not leak into individual OpenStack service handlers.

Comment thread internal/api/router.go
networkService := appnetwork.NewService()
volumeService := appvolume.NewService()

router.Mount("/_sandstack", admin.NewRouterWithState(func() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reset endpoint receives a single composed reset function. This keeps admin routing separate from the concrete services while still making reset behavior cover all in-memory runtime state.

)
}

func NewServiceWithRepository(

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constructor is the main app-layer boundary introduced in this PR: callers can supply a repository, clock, and ID generator without changing handler code. Other services follow the same replacement-friendly direction.

}

return nil
func (s *Service) Reset() {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reset is intentionally part of the runtime contract because SandStack needs disposable test state. It is not an OpenStack API behavior; the admin router is the only caller that should expose it.

@JSYoo5B JSYoo5B marked this pull request as draft July 2, 2026 21:09
@JSYoo5B JSYoo5B force-pushed the codex/02-core-crud-resources branch from 9964df1 to 791c424 Compare July 4, 2026 17:39
@JSYoo5B JSYoo5B force-pushed the codex/03-runtime-repository-boundaries branch from ba99115 to 6a40197 Compare July 5, 2026 12:48
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