Hexagonal - #182
Open
davidabram wants to merge 5 commits into
Open
Conversation
The sce CLI had no enforced boundary preventing future domain or use-case logic from coupling directly to infrastructure concerns (CLI parsing, filesystem, process, database, HTTP). Establishing that boundary after more code accumulates would be far more expensive than introducing it now. Co-authored-by: SCE <sce@crocoder.dev>
`services::setup::bootstrap_context_baseline` mixed the canonical directory/file manifest, RepoPaths-based path calculation, direct std::fs I/O, and styled success-string rendering into one function, leaving the hexagonal skeleton from a prior commit with no proven vertical slice through it. Carve the operation into domain/application/adapter layers: `ContextBaseline` (cli/src/domain/context/baseline.rs) defines the manifest; `ContextStore` (cli/src/application/ports/context_store.rs) and `EnsureContextBaseline` (cli/src/application/use_cases/ensure_context_baseline.rs) define the port and use case; `FilesystemContextStore` (cli/src/adapters/outbound/filesystem/context_store.rs) performs the actual I/O; `render_context_baseline_report` (cli/src/adapters/inbound/cli/setup.rs) renders the report. `bootstrap_context_baseline` becomes a thin compatibility facade over these layers, so both `sce setup --bootstrap-context` and every normal successful `sce setup` run pick up the new implementation with unchanged output. The now-unused `RepoPaths::context_*` accessors and legacy template constants are removed. Co-authored-by: SCE <sce@crocoder.dev>
install_embedded_setup_assets combined optional-workflow selection, embedded asset installation, config persistence, and CLI rendering in one services::setup module that also owned Git discovery, hook installation, filesystem staging, and prompting. Extract the embedded-asset installation capability into the internal hexagonal architecture, following the pattern established by the context-baseline slice: a pure domain model for integration targets/assets (domain/integration), two application ports (IntegrationAssetCatalog, IntegrationInstaller), one use case (InstallIntegrationAssets), and two outbound adapters (an embedded-asset catalog wrapping the existing generated catalog, and a filesystem installer owning staging/replace/rename/cleanup). Co-authored-by: SCE <sce@crocoder.dev>
Integration asset installation needed adapter-neutral asset bytes, request-level preflight, and end-to-end compatibility coverage. Use `Cow<'static, [u8]>`, preflight once per request, test staging cleanup and facade behavior, and record the resulting architecture and validation evidence. Co-authored-by: SCE <sce@crocoder.dev>
Extract repository-scoped integration configuration persistence from services::setup into a narrow IntegrationConfigRepository port, three application use cases (EnsureRepoConfig, LoadPersistedOptionalWorkflows, RecordIntegrationInstallation), and a filesystem outbound adapter owning .sce/config.json lifecycle, JSON merge, and serialization. IntegrationTarget gains config_id() for canonical target identifiers. Public setup functions remain compatibility facades preserving existing error context, ordering, and best-effort behavior. Co-authored-by: SCE <sce@crocoder.dev>
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.
No description provided.