Skip to content

feat: implement model domain layer with Echo reference model#2

Merged
stack72 merged 1 commit intomainfrom
model-domain
Jan 28, 2026
Merged

feat: implement model domain layer with Echo reference model#2
stack72 merged 1 commit intomainfrom
model-domain

Conversation

@adamhjk
Copy link
Copy Markdown
Contributor

@adamhjk adamhjk commented Jan 28, 2026

Summary

  • Add foundational model system implementing domain-driven design principles
  • Create domain layer with ModelType, ModelInput, ModelResource entities and model registry
  • Implement Echo model as a reference implementation for testing
  • Add YAML-based persistence with YamlInputRepository and YamlResourceRepository
  • Implement model create <type> <name> CLI command with interactive and JSON output modes
  • Add design documentation for high-level architecture and model specification

Test plan

  • Run deno task test to verify all unit and integration tests pass
  • Run deno check to verify type checking passes
  • Run deno lint to verify linting passes
  • Test model create swamp/echo test-model creates input file correctly
  • Test model create swamp/echo test-model --output json returns JSON output

🤖 Generated with Claude Code

Add the foundational model system for swamp, implementing domain-driven design
principles with a clean separation between domain, infrastructure, and
presentation layers.

Domain layer:
- ModelType: value object for model type identifiers with normalized paths
- ModelInput: entity for model input data stored as YAML
- ModelResource: entity for resource data with lifecycle tracking
- Model registry for registering and looking up model implementations
- Echo model as a reference implementation for testing

Infrastructure layer:
- YamlInputRepository: persists model inputs to inputs/<type>/<id>.yaml
- YamlResourceRepository: persists resources to resources/<type>/<id>.yaml

CLI:
- `model create <type> <name>` command to create new model inputs
- Supports both interactive and JSON output modes

Presentation:
- ModelCreateOutput component for displaying creation results
- ErrorOutput component for consistent error presentation

Design documentation:
- High-level architecture overview
- Detailed model specification with types, inputs, methods, and resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@stack72 stack72 merged commit 0e8a066 into main Jan 28, 2026
@stack72 stack72 deleted the model-domain branch January 28, 2026 20:27
stack72 added a commit that referenced this pull request Mar 17, 2026
… bundling failure

- Move bundleSourceFactory call inside the non-raw driver branch so raw
  executions never trigger self-contained bundling (HIGH #2)
- Switch to promise-based memoization to avoid duplicate concurrent builds
- Restore error handling: log a warning and rethrow on bundling failure,
  resetting the cached promise so subsequent calls can retry (HIGH #1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants