Files
EverOS/.claude/rules/architecture.md
Elliot Chen 518b8eca85 chore: initialize EverOS 1.0.0
md-first memory extraction framework for AI agents.

Markdown is the single source of truth; SQLite holds state and LanceDB
provides the rebuildable vector + BM25 + scalar index. The codebase follows
a single-direction DDD layering (entrypoints -> service -> memory -> infra,
with component / core / config cross-cutting) enforced by import-linter.

Engineering surface:
- Coding conventions in .claude/rules/ (path-scoped) and workflows in
  .claude/skills/ (/commit, /new-branch, /pr).
- GitHub Actions CI runs make lint + test + integration; pre-commit mirrors
  the gates locally (ruff, hygiene hooks, gitlint commit-msg).
- Commit messages follow Conventional Commits, enforced by gitlint.
- make lint also enforces datetime two-zone discipline and OpenAPI drift.
2026-06-06 07:33:17 +08:00

1.6 KiB

Architecture rule (always loaded)

EverOS is a DDD-layered framework. The dependency direction is single, downward only:

entrypoints  →  service  →  memory  →  infra
                              ↓
                        component / core / config
  • entrypoints/ — CLI + HTTP API (presentation). No business logic.
  • service/ — use-case orchestration (memorize / retrieve / evolve / manage).
  • memory/ — domain (extract / search / cascade / prompt_slots / models).
  • infra/ — storage adapters (markdown + sqlite + lancedb) and the OME subsystem.
  • component/ — injectable providers (llm / embedding / config / utils).
  • core/ — runtime base (observability / lifespan / context / persistence primitives).
  • config/ — configuration data (Settings + default TOML).

Hard constraints (enforced by import-linter, run in make lint)

  1. Layering: an outer layer may import an inner layer, never the reverse. entrypoints → service → memory → infra.
  2. Private internals: service, memory, and entrypoints must not import infra.persistence.{markdown,lancedb,sqlite}.** internals — go through the package facade (from everos.infra.persistence.markdown import ...).
  3. OME isolation: infra.ome must not import persistence, memory, service, or entrypoints. It is a low-level scheduler with no domain knowledge.

If a change needs to cross a boundary the wrong way, the design is wrong — refactor, don't add an exception.

Full rationale: docs/architecture.md.