Skip to content

Commit 3df46ee

Browse files
authored
Merge pull request #1 from loopengine/docs/1.0.0-rc.0-source-reconciliation
docs: 1.0.0-rc.0 source reconciliation (Branch A)
2 parents ba42034 + 4559291 commit 3df46ee

24 files changed

Lines changed: 213 additions & 124 deletions

components/home/CodeTabs.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ const checked = validateLoopDefinition(definition)
5050
if (!checked.valid) {
5151
throw new Error(checked.errors.map((e) => e.message).join('; '))
5252
}`,
53-
run: `import { createMemoryLoopStorageAdapter } from '@loop-engine/adapter-memory'
53+
run: `import { memoryStore } from '@loop-engine/adapter-memory'
5454
import { createLoopSystem } from '@loop-engine/sdk'
5555
5656
// assumes \`definition\` from the Define tab
5757
const { engine } = await createLoopSystem({
5858
loops: [definition],
59-
storage: createMemoryLoopStorageAdapter()
59+
store: memoryStore()
6060
})
6161
62-
await engine.startLoop({
62+
await engine.start({
6363
loopId: 'expense.approval',
6464
aggregateId: 'EXP-001',
6565
actor: { type: 'system', id: 'intake' }
@@ -74,7 +74,7 @@ await engine.transition({
7474
events: `// assumes \`createLoopSystem\` returned \`eventBus\` alongside \`engine\`
7575
const { engine, eventBus } = await createLoopSystem({
7676
loops: [definition],
77-
storage: createMemoryLoopStorageAdapter()
77+
store: memoryStore()
7878
})
7979
8080
eventBus.subscribe(async (event) => {
@@ -99,7 +99,7 @@ function renderHighlighted(code: string) {
9999
'<span class="kw">$1</span>'
100100
);
101101
return withKeywords.replace(
102-
/\b(parseLoopYaml|validateLoopDefinition|createLoopSystem|createMemoryLoopStorageAdapter)\b/g,
102+
/\b(parseLoopYaml|validateLoopDefinition|createLoopSystem|memoryStore)\b/g,
103103
'<span class="type">$1</span>'
104104
);
105105
}

content/docs/ai-and-automation/ai-as-actor.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ The full dual-provider walkthrough is in `/docs/examples/ai-replenishment`, with
112112
| [`@loop-engine/adapter-openai`](/docs/packages/adapter-openai) | OpenAI (`gpt-4o`, o-series) |
113113
| [`@loop-engine/adapter-grok`](/docs/packages/adapter-grok) | Grok (`grok-3`, `grok-2`) via xAI |
114114
| [`@loop-engine/adapter-gemini`](/docs/packages/adapter-gemini) | Gemini (`gemini-1.5-pro`, `gemini-2.0-flash`) |
115-
| [`@loop-engine/adapter-perplexity`](/docs/packages/adapter-perplexity) | Perplexity Sonar (`sonar`, `sonar-pro`, …) — `LLMAdapter` with citations for research steps |
115+
| [`@loop-engine/adapter-perplexity`](/docs/packages/adapter-perplexity) | Perplexity Sonar (`sonar`, `sonar-pro`, …) — `ToolAdapter` with citations for research steps |
116116

117-
The Perplexity package implements `LLMAdapter.invoke()` (text + citations), not the actor `createSubmission` flow. Use it where you need grounded retrieval inside a loop; use the actor adapters above for structured signal decisions.
117+
The Perplexity package implements `ToolAdapter.invoke()` (text + citations), not the actor `createSubmission` flow. Use it where you need grounded retrieval inside a loop; use the actor adapters above for structured signal decisions.
118118

119119
## Related
120120

content/docs/changelog.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Versioning: [Semantic Versioning](https://semver.org/)
1414
## Unreleased
1515

1616
### Added
17-
- `@loop-engine/adapter-perplexity` — Perplexity Sonar `LLMAdapter` with citations, retries, and `guardEvidence` integration
18-
- `@loop-engine/core``LLMAdapter`, `AdapterInput` / `AdapterOutput`, and deep `guardEvidence()` for adapter audit redaction
17+
- `@loop-engine/adapter-perplexity` — Perplexity Sonar `ToolAdapter` with citations, retries, and `guardEvidence` integration
18+
- `@loop-engine/core``ToolAdapter`, `AdapterInput` / `AdapterOutput`, and deep `guardEvidence()` for adapter audit redaction
1919
- Docs: `docs/integrations-perplexity.md` (Sonar vs [Perplexity Computer skills](https://www.perplexity.ai/computer/skills))
2020
- Release contract stub: `.rc/adapter-perplexity.json` (RC **DRAFT** until promoted **LOCKED**)
2121

content/docs/examples/postgres-persistence.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ QUERY STATE ---> READ INSTANCE + READ HISTORY
3838

3939
```ts
4040
import { createLoopSystem } from "@loop-engine/sdk";
41-
import { createPostgresStore, createSchema } from "@loop-engine/adapter-postgres";
42-
import { createMemoryLoopStorageAdapter } from "@loop-engine/adapter-memory";
41+
import { postgresStore, createSchema } from "@loop-engine/adapter-postgres";
42+
import { memoryStore } from "@loop-engine/adapter-memory";
4343
import { Pool } from "pg";
4444

4545
// Version A: in-memory (default local dev)
46-
const memoryStore = createMemoryLoopStorageAdapter();
47-
const memoryRuntime = await createLoopSystem({ loops: [definition], store: memoryStore });
46+
const memStore = memoryStore();
47+
const memoryRuntime = await createLoopSystem({ loops: [definition], store: memStore });
4848

4949
// Version B: postgres (durable)
5050
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
5151
await createSchema(pool);
52-
const pgStore = createPostgresStore(pool);
52+
const pgStore = postgresStore(pool);
5353
const postgresRuntime = await createLoopSystem({ loops: [definition], store: pgStore });
5454

5555
// Loop definitions + transition calls are unchanged across adapters.
@@ -79,5 +79,5 @@ pnpm dev
7979
```
8080

8181
<Callout variant="info" title="Adapter pattern">
82-
The same contract pattern extends to `adapter-kafka` and `adapter-http`. Any backend implementing `LoopStorageAdapter` can be used.
82+
The same contract pattern extends to `adapter-kafka` and `adapter-http`. Any backend implementing `LoopStore` can be used.
8383
</Callout>

content/docs/getting-started/installation.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ Use at least:
3838

3939
## Install packages individually
4040

41-
If you do not want the SDK aggregate package, install only what you need:
41+
If you do not want the SDK aggregate package, install only what you need.
42+
43+
Core primitives:
4244

4345
- `@loop-engine/core` - domain model types and branded IDs
4446
- `@loop-engine/dsl` - `LoopBuilder`, parser, schema validation
@@ -50,11 +52,29 @@ If you do not want the SDK aggregate package, install only what you need:
5052
- `@loop-engine/observability` - metrics, timelines, replay
5153
- `@loop-engine/registry-client` - remote/local **loop catalog** client (package name retains `registry-client`)
5254
- `@loop-engine/ui-devtools` - React devtools components
55+
56+
Stores:
57+
5358
- `@loop-engine/adapter-memory` - in-memory `LoopStore`
5459
- `@loop-engine/adapter-postgres` - PostgreSQL `LoopStore` adapter
5560
- `@loop-engine/adapter-kafka` - Kafka `EventBus` adapter
5661
- `@loop-engine/adapter-http` - HTTP webhook `EventBus` adapter
5762

63+
AI adapters:
64+
65+
- `@loop-engine/adapter-anthropic` - Claude actor adapter
66+
- `@loop-engine/adapter-openai` - GPT actor adapter
67+
- `@loop-engine/adapter-gemini` - Gemini actor adapter
68+
- `@loop-engine/adapter-grok` - Grok actor adapter
69+
- `@loop-engine/adapter-perplexity` - Sonar grounded-search adapter
70+
71+
Routing and framework adapters:
72+
73+
- `@loop-engine/adapter-pagerduty` - PagerDuty approval routing
74+
- `@loop-engine/adapter-openclaw` - OpenClaw skill / approval bridge
75+
- `@loop-engine/adapter-vercel-ai` - Vercel AI SDK tool-call governance
76+
- `@loop-engine/adapter-commerce-gateway` - Commerce Gateway tool routing
77+
5878
## Runtime requirements
5979

6080
- Node.js 18+ is required.

content/docs/getting-started/quick-start.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,19 @@ eventBus.subscribe(async (event) => console.log(event.type))
6565
await engine.start({
6666
loopId: 'expense.approval',
6767
aggregateId: aggregateId('EXP-2026-001'),
68-
orgId: 'acme',
69-
actor: { type: 'system', id: 'system:intake' }
68+
actor: { type: 'automation', id: 'system:intake', serviceId: 'intake' }
7069
})
7170

7271
await engine.transition({
7372
aggregateId: aggregateId('EXP-2026-001'),
7473
transitionId: transitionId('start_review'),
75-
actor: { type: 'automation', id: 'system:router' }
74+
actor: { type: 'automation', id: 'system:router', serviceId: 'router' }
7675
})
7776

7877
await engine.transition({
7978
aggregateId: aggregateId('EXP-2026-001'),
8079
transitionId: transitionId('approve'),
81-
actor: { type: 'human', id: 'manager@acme.com' },
80+
actor: { type: 'human', id: 'manager@acme.com', userId: 'manager-1', displayName: 'Manager' },
8281
evidence: { comment: 'Approved for Q1 budget' }
8382
})
8483

@@ -91,7 +90,7 @@ console.log(state?.status) // CLOSED
9190

9291
<Callout variant="info" title="Execution summary">
9392
- The loop moved through 3 states (`SUBMITTED -> UNDER_REVIEW -> APPROVED`)
94-
- 3 actor types were used (`system`, `automation`, `human`)
93+
- 2 actor types were used (`automation`, `human`)
9594
- Each successful transition emitted `loop.transition.executed`
9695
- Reaching a terminal state sets loop status to `CLOSED`
9796
</Callout>

content/docs/integrations/http.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ section: Integrations
1111

1212
## What it does
1313

14-
Implements `LoopStorageAdapter` over HTTP. Any REST service that speaks the adapter protocol can back loop state storage. This is useful for integrating with existing services or remote storage planes.
14+
Implements `LoopStore` over HTTP. Any REST service that speaks the adapter protocol can back loop state storage. This is useful for integrating with existing services or remote storage planes.
1515

1616
## Adapter protocol
1717

@@ -51,7 +51,7 @@ Expected backend endpoints:
5151

5252
## Note
5353

54-
If your backend is in the same process, implementing `LoopStorageAdapter` directly is usually simpler than standing up the HTTP protocol.
54+
If your backend is in the same process, implementing `LoopStore` directly is usually simpler than standing up the HTTP protocol.
5555

5656
## Configuration reference
5757

content/docs/integrations/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Connect Loop Engine to any AI provider, agentic platform, storage backend, or ob
88

99
## ⟩ AI Providers
1010

11-
Use any major LLM as a governed actor. Provider actor adapters produce the same `AIAgentActor` shape — switching providers requires changing one import. Perplexity Sonar covers **grounded retrieval with citations** as an `LLMAdapter` for research steps (see the package reference).
11+
Use any major LLM as a governed actor. Provider actor adapters produce the same `AIAgentActor` shape — switching providers requires changing one import. Perplexity Sonar covers **grounded retrieval with citations** as a `ToolAdapter` for research steps (see the package reference).
1212

1313
<div className="grid gap-4 md:grid-cols-2">
1414
<IntegrationCard
@@ -136,7 +136,7 @@ Connect Loop Engine to commerce platforms and LLM commerce data layers.
136136

137137
## Building an integration?
138138

139-
The Loop Engine adapter interface is open and documented. Any backend that implements `LoopStorageAdapter` is valid.
139+
The Loop Engine adapter interface is open and documented. Any backend that implements `LoopStore` is valid.
140140

141141
- [Adapter interface docs →](/docs/running-loops/adapters)
142142
- [Apply for certification →](mailto:oss@betterdata.co)

content/docs/integrations/openclaw.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This is the Sense → Decide → Govern pattern in practice:
7676

7777
| Option | Type | Default | Description |
7878
|---|---|---|---|
79-
| `loopSystem` | `LoopSystem` | required | Runtime instance used for governed transitions |
79+
| `loopSystem` | `LoopEngine` | required | Runtime instance used for governed transitions |
8080
| `signalMap` | `Record<string, string>` | `{}` | Optional action-to-signal mapping override |
8181
| `defaultActor` | `Actor` | `ai-agent/openclaw` | Fallback actor attribution metadata |
8282
| `onProposal` | `(proposal) => Promise<void>` || Optional hook before transition submission |

content/docs/integrations/perplexity.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ section: Integrations
1818

1919
## What it does
2020

21-
`@loop-engine/adapter-perplexity` implements `LLMAdapter.invoke()` against the Sonar chat API. You get answer text plus structured citations for audit and evidence attachment. Use it where provenance matters more than open-ended generation.
21+
`@loop-engine/adapter-perplexity` implements `ToolAdapter.invoke()` against the Sonar chat API. You get answer text plus structured citations for audit and evidence attachment. Use it where provenance matters more than open-ended generation.
2222

2323
## When to use it
2424

0 commit comments

Comments
 (0)