You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/adr/0004-cloud-multi-kernel.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,8 +64,10 @@ Two deployable applications:
64
64
65
65
### 2. `KernelManager` + `ProjectKernelFactory` (new in `@objectstack/runtime`)
66
66
67
-
-**`KernelManager`** ([`packages/runtime/src/kernel-manager.ts`](../../packages/runtime/src/kernel-manager.ts)): LRU+TTL cache of `Map<projectId, CachedKernel>`. Exposes `getOrCreate(projectId)` (concurrent-safe, single-flight per id) and `evict(projectId)` (calls `kernel.shutdown()`). Configurable `maxSize` and `ttlMs`.
68
-
-**`DefaultProjectKernelFactory`** ([`packages/runtime/src/project-kernel-factory.ts`](../../packages/runtime/src/project-kernel-factory.ts)): given a `projectId`, reads project + credential + package-install rows from the control-plane driver, clones the base stack config, overrides the `default` datasource mapping to point at the project's driver, instantiates an `AppPlugin` per installed bundle, and calls `kernel.bootstrap()`.
67
+
> **Path note (2026-08):** the two paths below are historical and deliberately unlinked — neither file is in this repository any more. `kernel-manager.ts` was moved to `packages/runtime/src/cloud/` on 2026-05-18 (`7dcde27c1`, "decouple runtime from service-cloud"), where `project-kernel-factory.ts` was also superseded by `cloud/artifact-kernel-factory.ts`; the whole `packages/runtime/src/cloud/` tree was then removed by #1600 (`feat(runtime)!: remove multi-tenant runtime; keep single-env + contracts`). Multi-kernel runtime code is no longer maintained here.
68
+
69
+
-**`KernelManager`** (`packages/runtime/src/kernel-manager.ts`): LRU+TTL cache of `Map<projectId, CachedKernel>`. Exposes `getOrCreate(projectId)` (concurrent-safe, single-flight per id) and `evict(projectId)` (calls `kernel.shutdown()`). Configurable `maxSize` and `ttlMs`.
70
+
-**`DefaultProjectKernelFactory`** (`packages/runtime/src/project-kernel-factory.ts`): given a `projectId`, reads project + credential + package-install rows from the control-plane driver, clones the base stack config, overrides the `default` datasource mapping to point at the project's driver, instantiates an `AppPlugin` per installed bundle, and calls `kernel.bootstrap()`.
69
71
70
72
Both are exported from `@objectstack/runtime`. Self-hosted mode never imports `KernelManager`.
### 5. Studio surfaces hostname as a first-class field
92
94
93
-
- Project list ([`apps/studio/src/routes/projects.index.tsx`](../../apps/studio/src/routes/projects.index.tsx)) renders a globe icon + hostname inline with the project card.
94
-
- Project detail ([`apps/studio/src/routes/projects.$projectId.index.tsx`](../../apps/studio/src/routes/projects.$projectId.index.tsx)) adds a **Domains** card with inline edit (Enter to save, Escape to cancel, toast on success/conflict).
95
+
> **Path note (2026-08):** the two route paths below are historical and deliberately unlinked — Studio is not in this repository any more. `apps/studio/` was collapsed to a single-package metadata browser on 2026-05-22 (`6bacbced2`) and then migrated to the upstream `@object-ui/studio` package on 2026-05-24 (`06ad57f63`); `apps/` here now holds only `docs/`.
96
+
97
+
- Project list (`apps/studio/src/routes/projects.index.tsx`) renders a globe icon + hostname inline with the project card.
98
+
- Project detail (`apps/studio/src/routes/projects.$projectId.index.tsx`) adds a **Domains** card with inline edit (Enter to save, Escape to cancel, toast on success/conflict).
Copy file name to clipboardExpand all lines: docs/adr/0020-state-machine-converge-and-enforce.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,12 +40,12 @@ The design intent is a **runtime guardrail**: declare which `status` transitions
40
40
41
41
**Zero enforcement — verified across `packages/{runtime,objectql,services,core,metadata*,plugins}` and the whole repo:**
42
42
43
-
-`IWorkflowService` ([`workflow-service.ts:58`](../../packages/spec/src/contracts/workflow-service.ts#L58)) has **no concrete implementation**.
43
+
-`IWorkflowService` (`packages/spec/src/contracts/workflow-service.ts:58` — unlinked: the contract file was deleted on 2026-08-01 by #4451 / #4473, which retired the `workflow` service slot outright, closing the follow-up this record left open below) has **no concrete implementation**.
44
44
- There is **no XState interpreter** anywhere (no `createMachine` / `interpret` / transition engine).
45
45
- The write-path validator [`validateRecord`](../../packages/objectql/src/validation/record-validator.ts#L198) reads only `objectSchema.fields` and validates **field data types** (string/number/date/…). It **never reads `objectSchema.validations`** at all — so *not one* of the nine validation-rule types (`state_machine`, `cross_field`, `script`, `unique`, `format`, `json_schema`, `async`, `custom`, `conditional`) is enforced by it.
46
46
-**Nothing reads `object.stateMachines`.**
47
47
48
-
So the guardrail goal is currently unmet at runtime. The only artefacts that exist are declarations — e.g. [`examples/app-crm/src/workflows/stale-opportunity.workflow.ts:19`](../../examples/app-crm/src/workflows/stale-opportunity.workflow.ts#L19) (`StateMachineConfig`), which additionally **mixes orchestration into the machine** (it carries `email_alert` / `task_creation` actions that no engine executes — that orchestration belongs to a record-triggered Flow per ADR-0019).
48
+
So the guardrail goal is currently unmet at runtime. The only artefacts that exist are declarations — e.g. `examples/app-crm/src/workflows/stale-opportunity.workflow.ts:19` (`StateMachineConfig`; unlinked — this file describes the pre-ADR state and was itself removed by this record's own implementation, see the checklist below), which additionally **mixes orchestration into the machine** (it carries `email_alert` / `task_creation` actions that no engine executes — that orchestration belongs to a record-triggered Flow per ADR-0019).
49
49
50
50
#### The prior-state plumbing gap (the real implementation constraint)
51
51
@@ -135,7 +135,7 @@ The transition declaration stays a flat, recognizable FSM (`field` + `{ from: [t
135
135
-[~]`spec`: `IWorkflowService` — **kept as a documented follow-up**, not removed (see Implementation notes).
136
136
-[x]`objectql`: wire the `validations` union into the write path — new [`rule-validator.ts`](../../packages/objectql/src/validation/rule-validator.ts) (`evaluateValidationRules` / `needsPriorRecord` / `legalNextStates`), with the prior record plumbed into [`engine.ts`](../../packages/objectql/src/engine.ts) on single-row update. Enforces `state_machine`, `cross_field`, and `script` together.
-[x]`examples/app-crm`: rewrote `src/workflows/*.workflow.ts` — transition tables already live as the `opp_stage_transitions``state_machine` rule on the opportunity object; side-effect actions became record-triggered / scheduled Flows ([`high-value-deal.flow.ts`](../../examples/app-crm/src/flows/high-value-deal.flow.ts), [`stale-opportunity.flow.ts`](../../examples/app-crm/src/flows/stale-opportunity.flow.ts)); removed the `workflows` registration from `objectstack.config.ts`.
138
+
-[x]`examples/app-crm`: rewrote `src/workflows/*.workflow.ts` — transition tables already live as the `opp_stage_transitions``state_machine` rule on the opportunity object; side-effect actions became record-triggered / scheduled Flows (`examples/app-crm/src/flows/high-value-deal.flow.ts`, `examples/app-crm/src/flows/stale-opportunity.flow.ts` — unlinked: both flow files were later dropped on 2026-07-05 by `751cf0161`, "refactor(crm): slim back to the loading-pipeline smoke core", which trimmed the CRM example to its loading-pipeline core; the surviving `state_machine` rule is unaffected); removed the `workflows` registration from `objectstack.config.ts`.
139
139
-[x]`examples/app-showcase`: carries the surviving shape — `state_machine` rules on `Task`, `Project`, `Account`. Predicate conditions corrected to the `record.<field>` CEL scope form so enforcement actually fires.
0 commit comments