Skip to content

Commit 79d3e20

Browse files
committed
chore: initial scaffold — core and dsl packages
Signed-off-by: Todd Palmer <todd@betterdata.co>
0 parents  commit 79d3e20

65 files changed

Lines changed: 3450 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.base.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es2022: true,
5+
node: true
6+
},
7+
extends: []
8+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: OSS Boundary Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "packages/**"
7+
8+
jobs:
9+
placeholder:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- run: echo "Workflow scaffolded. Full implementation in Prompt 9."

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, "rc/*"]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
placeholder:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- run: echo "Workflow scaffolded. Full implementation in Prompt 9."

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
placeholder:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: echo "Workflow scaffolded. Full implementation in Prompt 9."

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/
2+
dist/
3+
.turbo/
4+
*.tsbuildinfo
5+
coverage/
6+
.env
7+
.env.local
8+
sbom.json

CONTRIBUTING.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Contributing to Loop Engine
2+
3+
## Governance
4+
5+
Loop Engine follows a BDFL (Benevolent Dictator for Life) model.
6+
Better Data, Inc. controls the final roadmap and release decisions.
7+
Community contributions are welcome and encouraged.
8+
9+
## How to contribute
10+
11+
1. Open an issue before building anything significant
12+
2. Sign every commit with DCO: `Signed-off-by: Your Name <email>`
13+
(required - add `git config commit.verbose true` and use `-s` flag)
14+
3. PRs must pass all CI checks before review
15+
4. Breaking changes to core types require RFC (open an issue with [RFC] prefix)
16+
17+
## What belongs in this repo
18+
19+
✅ Domain-neutral primitives (packages/core)
20+
✅ Loop definitions that work in any runtime (loops/)
21+
✅ Examples showing cross-domain applicability
22+
✅ Adapters for persistence and event buses
23+
24+
❌ SCM-specific business logic (belongs in domain packs)
25+
❌ AI optimization algorithms (proprietary - not accepted)
26+
❌ Better Data-specific tenant or billing logic (proprietary)
27+
❌ Any import from packages outside this repository
28+
29+
## Versioning
30+
31+
All packages follow semver strictly.
32+
Breaking changes to event schemas require 6-month deprecation notice.
33+
Use changesets for all version bumps: `pnpm changeset`

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Loop Engine Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Loop Engine
2+
3+
Loop Engine is an open-source runtime for constrained, observable, and improvable
4+
operational loops.
5+
6+
It helps teams model enterprise processes as finite-state control systems that can
7+
be operated by humans, automation, and AI.
8+
9+
Created by [Better Data](https://betterdata.co).
10+
11+
## What it is
12+
13+
The Loop Engine gives AI and automation structure, boundaries, and feedback - not
14+
improvisation. Every process is a bounded state machine. Every action has an
15+
attributed actor. Every completed loop emits structured training data.
16+
17+
- **Portable loop definitions** - define any process as a bounded state machine
18+
- **Deterministic guards** - enforce policy before AI or automation can act
19+
- **First-class actor model** - human, automation, and AI actions are all attributed
20+
- **Structured events** - every transition emits training-quality data
21+
- **Self-learning loops** - closed loops generate improvement signals automatically
22+
23+
## Quick start
24+
25+
```bash
26+
npm install @loopengine/sdk
27+
```
28+
29+
```typescript
30+
import { createLoopEngine } from "@loopengine/sdk";
31+
32+
const engine = createLoopEngine({ store: memoryStore() });
33+
34+
await engine.start({
35+
loopId: "scm.procurement",
36+
aggregateId: "PO-2026-0012"
37+
});
38+
39+
await engine.transition({
40+
aggregateId: "PO-2026-0012",
41+
transitionId: "confirm_po",
42+
actor: { type: "human", id: "drew.kim@example.com" },
43+
evidence: { approved: true, method: "3-way-match" }
44+
});
45+
```
46+
47+
## Packages
48+
49+
| Package | Purpose |
50+
|---------|---------|
51+
| @loopengine/core | Domain model types - zero dependencies |
52+
| @loopengine/dsl | YAML/JSON loop authoring, parsing, validation |
53+
| @loopengine/runtime | State machine executor |
54+
| @loopengine/guards | Deterministic policy checks |
55+
| @loopengine/signals | Event-to-signal detection |
56+
| @loopengine/events | Canonical event schema |
57+
| @loopengine/actors | Actor model + AI actor constraints |
58+
| @loopengine/observability | Loop history, timelines, metrics |
59+
| @loopengine/sdk | Friendly developer interface (start here) |
60+
| @loopengine/registry-client | Fetch loop definitions from a registry |
61+
| @loopengine/ui-devtools | React devtools panel |
62+
| @loopengine/adapter-memory | In-memory store (testing/dev) |
63+
| @loopengine/adapter-postgres | PostgreSQL persistence |
64+
| @loopengine/adapter-kafka | Kafka event bus |
65+
66+
## Examples
67+
68+
See [examples/mini](./examples/mini) for lightweight runnable examples.
69+
For complete reference implementations, see [loop-examples](https://github.com/loopengine/loop-examples).
70+
71+
## Documentation
72+
73+
[loopengine.dev](https://loopengine.dev)
74+
75+
## License
76+
77+
MIT

ROADMAP.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Roadmap
2+
3+
## v0.1 - Foundation (current)
4+
5+
- [x] Core domain model (@loopengine/core)
6+
- [x] DSL - YAML and TypeScript builder (@loopengine/dsl)
7+
- [x] Runtime - state machine executor (@loopengine/runtime)
8+
- [x] Guards - deterministic policy checks (@loopengine/guards)
9+
- [x] Actors - human, automation, AI agent model (@loopengine/actors)
10+
- [x] Events - canonical structured event schema (@loopengine/events)
11+
- [x] SDK - developer entry point (@loopengine/sdk)
12+
- [x] Adapters - memory, Postgres, Kafka, HTTP
13+
- [x] Canonical loops - SCM, CRM, finance, support
14+
15+
## v0.2 - Observability + Devtools
16+
17+
- [ ] Observability package - metrics, timeline, replay (@loopengine/observability)
18+
- [ ] UI Devtools - React panel for loop inspection (@loopengine/ui-devtools)
19+
- [ ] Loop Inspector app
20+
- [ ] Signal rules - state dwell, threshold breach, guard pattern
21+
22+
## v0.3 - Registry
23+
24+
- [ ] Registry client (@loopengine/registry-client)
25+
- [ ] Local registry support
26+
- [ ] loop-registry repo (hosted discovery)
27+
28+
## v1.0 - Stable
29+
30+
- [ ] Stable API across all core packages
31+
- [ ] 6-month deprecation window enforced on breaking changes
32+
- [ ] Community governance model documented
33+
34+
This roadmap reflects current thinking. It will change based on contributor
35+
input and real-world usage. Open an RFC issue to propose additions.

apps/inspector/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)