Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ main-service/
core-database/ # the schema (above)
index-database/ # extends core; indexes/
transaction-database/ # extends index; transactions/
computed-database/ # extends transaction; computed/
service-database/ # extends computed; services/
action-database/ # extends service; actions/
service-database/ # extends transaction; services/
computed-database/ # extends service; computed/
action-database/ # extends computed; actions/
```

Each exports a namespace mirroring the plugin — the composed object is a
Expand All @@ -121,8 +121,8 @@ export namespace IndexDatabase {

### The assembled database — `MainService`

*Which* layer is topmost varies with the facets a feature uses (computed /
service / action / system). Consumers — `ui/`, the app entry, `services/main-service/conformance/`
*Which* layer is topmost varies with the facets a feature uses (service /
computed / action / system). Consumers — `ui/`, the app entry, `services/main-service/conformance/`
— need the *whole* feature database but must not name that layer, or adding or
dropping a layer rewrites them all. Alias it once from the **folder-eponymous
`main-service.ts`** (per `global/namespace.md`, a folder's primary export lives in
Expand Down Expand Up @@ -155,10 +155,11 @@ two features' `CoreDatabase`s never collide.
transaction-context type. Use **`CoreDatabase.Store`** for a transaction that
reads/writes entities, resources, or archetypes; **`IndexDatabase.Store`** the
moment it reads an index.
- **the whole `Database`** — **computed**, **services**, and **actions** each
- **the whole `Database`** — **services**, **computed**, and **actions** each
take `service: <Layer>` (the lowest layer whose database exposes what they
read/call): computed reads `service.observe.*`; services read observables and
call transactions; actions call `service.services.*` then
read/call): services read observables and call transactions; computed reads
`service.observe.*` and, once it needs a service's own reactive surface,
`service.services.*`; actions call `service.services.*` then
`service.transactions.*`.

Each subfolder has its own rule. Modelling a plugin's authored vs. derived
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ its transactions. This is where the async `services/` contracts (or
framework services like `AgenticService`) are wired to ECS state.

```ts
export const createAgentService = (service: ComputedDatabase, mark: PlayerMark): AgenticService =>
export const createAgentService = (service: TransactionDatabase, mark: PlayerMark): AgenticService =>
/* … reads service.observe.*, calls service.transactions.* … */;
```

Expand Down
Loading