Skip to content

Hexagonal - #182

Open
davidabram wants to merge 5 commits into
mainfrom
hexagonal
Open

Hexagonal#182
davidabram wants to merge 5 commits into
mainfrom
hexagonal

Conversation

@davidabram

Copy link
Copy Markdown
Member

No description provided.

davidabram and others added 5 commits August 4, 2026 00:31
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>
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