-
Notifications
You must be signed in to change notification settings - Fork 1
Architecture Charter
Principles that govern every design decision. Implementation details belong in module-level documentation.
dsh-edge is an adapter layer, not a fork. It runs published upstream packages on Cloudflare Workers. Upstream owns all business logic. Edge owns only the transport and storage that make those packages work in a serverless environment.
The application logic stays identical; only the plumbing changes.
If upstream provides a plugin, install it. If upstream provides an extension point, use it. If upstream provides an abstract class, implement it. Never reimplement what upstream already ships. If you're writing business logic in Edge code, you're probably doing it wrong.
Upstream was designed for a single process — services call each other in memory, clients read state directly. Edge's only job is to add network transport where upstream assumes locality. Every Edge-owned component falls into exactly one of three categories:
- Direct reuse — upstream plugin installed as-is, zero Edge code.
- Minimal replacement — platform-specific implementation of an upstream seam (abstract class or capability interface).
- Transport bridge — forwarding in-process signals over the network, containing zero business logic.
Upstream runs two cordis Contexts in one process — server-side and client-side — connected by in-process plugins. Edge separates them into two physical runtimes connected by WebSocket and HTTP. The architecture is unchanged; only the communication medium is different.
A patch is a last resort. Every retained patch needs a version-bound filename, a failing-without-it test, a rationale, and a documented removal condition. Composition and extension points are always preferred.
-
Install the upstream plugin. Check its
injectrequirements — if all dependencies are satisfiable, install it directly. This is the default and requires no justification. - Implement an upstream seam. When upstream provides an abstract class or capability seam that needs a platform-specific backend, write the smallest conforming implementation.
- Add a transport bridge. When upstream assumes in-process communication, capture the signal through an upstream extension point and forward it over the network. The bridge should contain zero business logic.
- Patch upstream. When none of the above can work due to a hard platform incompatibility. Document the removal condition — every patch should be deletable when upstream evolves.
Edge owns: Platform entry points. Durable Object lifecycle. Network transport between server and browser. Storage backends. File system delegation. Owner authentication. HTTP route dispatch.
Upstream owns: Agent behavior. Tool definitions. System prompts. Model orchestration. Session event format. Goal tracking logic. Compaction strategy. All user-facing interaction design. All client-side UI plugins.
When a new upstream capability arrives, the first question is not "how do we implement this" but "what prevents this from working as-is?" The answer is almost always one of: missing storage backend, missing network transport, or a Node.js API unavailable in Workers. Fix that specific gap — nothing more.
- Home
- Architecture
- Core & Scope
- Session & Persistence
- Model & Context
-
Execution & Tools
- Tools
- Bash
- Subprocess 🚫
- PTY Session 🚫
- Background Jobs 🚫
- Filesystem
- LSP Navigation 🚫
- Code Runtime 🚫
-
Web Access
⚠️ -
Skills
⚠️ - Workflow 🚫
- Subagent 🚫
-
Policy & Interaction
- Goal
- Approval 🚫
- Permission Presets 🚫
-
Sandbox
⚠️ - Plan Mode 🚫
- User Interaction 🚫
- Commands 🚫
- Schedule 🚫
- Message Feedback 🚫
- Platform & Access
- Development
- 首页
- 架构
- 核心与作用域
- 会话与持久化
- 模型与上下文
- 执行与工具
- 策略与交互
- 平台与接入
- 开发