-
Notifications
You must be signed in to change notification settings - Fork 0
Phase 2 Local Environment Manager
A developer can clone a supported project and run it locally without manually installing its service runtimes or databases. StackCendra generates an editable, Git-friendly environment proposal and manages its runtime lifecycle.
- Capability phase: 2
- First marketed in: release 0.2, with a constrained demonstration potentially included in 0.1
- Primary owners: Rust local agent and shared React interface
- Execution boundary: the user device and its local container runtime
- Phase 1 has produced a reviewed project and service graph.
- Docker Engine and Compose availability can be detected.
- File writes and process execution require separate, explicit capabilities.
- Generated artifacts carry provenance and can be previewed before application.
- Select a confirmed project snapshot.
- Review proposed services, images, commands, ports, networks, and volumes.
- Resolve missing inputs and port conflicts.
- Preview the exact files and commands StackCendra will use.
- Generate into an isolated StackCendra area or an approved repository path.
- Start the environment and watch health, logs, and dependencies converge.
- Open a service, inspect it, stop it, or restore a saved snapshot.
flowchart TD
Catalog["Confirmed project catalog"] --> Plan["Environment plan"]
Plan --> Conflicts["Port and dependency checks"]
Conflicts --> Preview["Editable file and command preview"]
Preview --> Approve{"User approves?"}
Approve -->|No| Plan
Approve -->|Yes| Generate["Atomic generation"]
Generate --> Run["Compose runtime"]
Run --> Observe["Health, logs, resources"]
Observe --> Snapshot["Environment snapshot"]
- Dockerfiles and
.dockerignorefiles; -
compose.yaml; -
.env.examplecontaining placeholders only; - health checks;
- named volumes and isolated networks;
- development hot reload;
- inferred startup commands and dependency ordering;
- editable previews and minimal diffs;
- stable formatting suitable for version control.
- start, stop, restart, and rebuild;
- per-service status and health;
- container log streaming;
- terminal access with explicit authorization;
- CPU, memory, network, and storage observations;
- volume and network inspection;
- dependency-graph state overlay;
- saved local environment snapshots.
- identify port conflicts before startup;
- identify the owning process where operating-system permissions allow;
- propose reuse, remapping, or stopping the conflicting process;
- update all affected generated references consistently;
- preserve project-specific mappings;
- open service URLs;
- optionally generate local reverse-proxy domains.
- Next.js with PostgreSQL;
- NestJS with PostgreSQL and Redis;
- FastAPI with PostgreSQL;
- Django with PostgreSQL;
- Spring Boot with PostgreSQL;
- Go with PostgreSQL;
- MERN;
- mixed-service microservices fixture.
Environment generation is a compiler pipeline:
- normalize a confirmed project snapshot;
- select and version a template strategy;
- resolve variables, ports, health checks, and dependencies;
- produce an intermediate environment plan;
- validate the plan against policy and host capabilities;
- render a deterministic file set;
- show a semantic and textual diff;
- apply approved writes atomically;
- verify Compose configuration before runtime execution.
Generated files include a machine-readable provenance block or companion manifest. User-owned edits are detected and preserved; regeneration produces a three-way proposal rather than silently overwriting them.
- Docker access remains local through the Rust agent.
- Destructive operations name the exact project, service, volume, or image.
- Deleting persistent volumes is never implied by “stop” or “rebuild.”
- Image pulls and builds display network and disk consequences.
- Terminals are attached only after user intent and are fully auditable.
- Commands are built from structured arguments, not concatenated shell strings.
Phase 2 adds:
-
EnvironmentPlan,GeneratedArtifact, andGenerationRevision; -
LocalEnvironment,ServiceRuntime, andHealthObservation; -
PortAllocation,VolumeReference, andNetworkReference; -
EnvironmentSnapshot.
Important events:
-
environment.plan.created; -
environment.files.approved; -
environment.started; -
service.health.changed; -
port.conflict.detected; -
environment.snapshot.created; -
environment.stopped.
- Define the environment-plan intermediate representation.
- Implement deterministic templates and generation provenance.
- Add preview, semantic diff, atomic write, and regeneration handling.
- Implement Compose lifecycle and streaming observations.
- Build port ownership, remapping, and URL resolution.
- Add status, logs, terminal, resources, networks, and volumes views.
- Implement snapshots and recovery guidance.
- Validate all initial templates against clean-machine scenarios.
- golden tests for every rendered template;
- schema validation for environment plans;
- Compose configuration validation before execution;
- clean-machine end-to-end tests;
- conflict and user-edit preservation tests;
- startup-order and health-transition tests;
- failure injection for unavailable images, ports, and dependencies;
- Windows and Linux filesystem and networking tests;
- volume-preservation and destructive-action tests.
- environment-plan schema;
- template and renderer library;
- preview and regeneration experience;
- local Compose runtime controller;
- port-resolution workflow;
- service status, logs, health, resource, network, and volume views;
- environment snapshot format;
- supported-template compatibility matrix.
Phase 2 is complete when a fresh developer can clone each maintained fixture, approve a generated environment, resolve any detected port conflict, start it without installing service runtimes or databases directly, observe healthy services, open the application, stop it without data loss, and reproduce the result from committed generated files.
| Risk | Control |
|---|---|
| Generated files overwrite user work | Provenance, semantic diff, atomic writes, three-way regeneration |
| Docker privileges become overly broad | Narrow local API, exact target display, deny destructive defaults |
| Templates hide unsupported assumptions | Compatibility matrix and explicit unresolved inputs |
| Host-specific ports make environments unstable | Persisted project mappings and consistent reference updates |
| “Works on my machine” moves into Compose | Clean-machine CI fixtures and deterministic generation |
- remote deployment;
- production orchestration;
- Kubernetes cluster operations;
- synchronizing real secrets;
- fully general Dockerfile synthesis for unknown stacks;
- deleting user data as part of routine lifecycle actions.
Phase 3 consumes the confirmed project model and generated runtime plan to discover configuration requirements, compare environments, and separate schemas and secret references from local literal values.
StackCendra is currently in Phase 0. The complete Phase 0–13 plan is versioned in the main repository under docs/wiki; later-phase pages describe intended behavior, not current implementation.
- Phase 0 foundation
- Phase 0 backlog
- Release 0.1 discovery
- Phase delivery framework
- Roadmap
- Wiki review guide
- Risks and decisions