Skip to content

Commit 0f9cab3

Browse files
committed
chore(ci): clear Boss Loops post-publish cleanup gates (LOOP-CLEANUP-01..03)
- runtime-core: fix seam-era test typings (RuntimeIdentity role/source, branded StateId fixtures) - registry-client: vendor registry-loop v0 spec into docs/specs; fix repo-root resolution (was monorepo depth) - runtime-db: vitest --passWithNoTests for the intentionally test-less package
1 parent bd6efd2 commit 0f9cab3

5 files changed

Lines changed: 74 additions & 6 deletions

File tree

docs/specs/loop-registry-api-v0.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Loop Registry API v0
2+
3+
Base URL: `https://registry.loopengine.dev`
4+
5+
Versioning strategy:
6+
7+
- API path versioning (`/v0`)
8+
- Additive changes allowed in v0
9+
- Breaking changes require `/v1`
10+
11+
Core resources:
12+
13+
- `LoopSummary`
14+
- `LoopVersionSummary`
15+
- `LoopArtifact`
16+
17+
Error envelope:
18+
19+
```json
20+
{
21+
"error": {
22+
"code": "INVALID_REQUEST",
23+
"message": "Human-readable message",
24+
"details": {}
25+
}
26+
}
27+
```
28+
29+
Valid error codes:
30+
31+
- `INVALID_REQUEST`
32+
- `LOOP_NOT_FOUND`
33+
- `VERSION_NOT_FOUND`
34+
- `VERSION_ALREADY_EXISTS`
35+
- `INVALID_LOOP_DEFINITION`
36+
- `INTEGRITY_MISMATCH`
37+
- `UNAUTHORIZED`
38+
- `FORBIDDEN`
39+
- `RATE_LIMITED`
40+
- `INTERNAL_ERROR`
41+
42+
Endpoints:
43+
44+
- `GET /v0/health`
45+
- `GET /v0/loops`
46+
- `GET /v0/loops/{loopId}`
47+
- `GET /v0/loops/{loopId}/versions`
48+
- `GET /v0/loops/{loopId}/versions/{version}`
49+
- `POST /v0/resolve`
50+
- `POST /v0/publisher/loops/{loopId}/versions`
51+
- `POST /v0/publisher/loops/{loopId}/versions/{version}/deprecate`
52+
- `POST /v0/publisher/loops/{loopId}/versions/{version}/withdraw`
53+
- `GET /v0/schemas/canonicalization`
54+
55+
Integrity:
56+
57+
- Canonicalize definition JSON by recursively sorting keys.
58+
- Serialize as compact UTF-8 JSON.
59+
- Compute SHA-256 over canonical JSON.
60+
61+
Rate limits:
62+
63+
- Public read: `100/min` per IP
64+
- Resolve: `60/min` per IP
65+
- Publisher writes: `20/min` per bearer token

packages/registry-client/src/__tests__/registry-loop-v0-contract.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { fileURLToPath } from "node:url";
99
import { describe, expect, it, vi } from "vitest";
1010
import { v0Registry } from "../adapters/v0";
1111

12-
const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../../..");
12+
const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../../..");
1313
const REGISTRY_SPEC = path.join(REPO_ROOT, "docs/specs/loop-registry-api-v0.md");
1414

1515
describe("registry-loop v0 contract (SDK client)", () => {

packages/runtime-core/src/__tests__/loop-execution.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ const identity = (tenantId = TENANT): RuntimeIdentity => ({
3232
tenantId,
3333
apiKeyId: "key-1",
3434
actorId: "user:demo",
35+
role: "API_KEY",
36+
source: "api",
3537
});
3638

3739
function buildInstance(overrides: Partial<PersistedLoopInstance> = {}): PersistedLoopInstance {

packages/runtime-core/src/__tests__/oss-traced-loop-system.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright (c) Better Data, Inc.
33

44
import { describe, expect, it, vi } from "vitest";
5+
import { stateId } from "@loop-engine/sdk";
56
import type { LoopEngine, TransitionParams, TransitionResult } from "@loop-engine/runtime";
67
import type { TraceRecord, TraceStore } from "@loop-engine/observability";
78

@@ -35,8 +36,8 @@ describe("createOssTracedLoopSystem — sequence allocation", () => {
3536

3637
const engine = makeEngine({
3738
status: "executed",
38-
toState: "APPROVED",
39-
fromState: "OPEN",
39+
toState: stateId("APPROVED"),
40+
fromState: stateId("OPEN"),
4041
});
4142
const traced = createOssTracedLoopSystem(engine, traceStore, {
4243
loopId: "loop.demo",
@@ -67,8 +68,8 @@ describe("createOssTracedLoopSystem — sequence allocation", () => {
6768

6869
const engine = makeEngine({
6970
status: "executed",
70-
toState: "APPROVED",
71-
fromState: "OPEN",
71+
toState: stateId("APPROVED"),
72+
fromState: stateId("OPEN"),
7273
});
7374
const traced = createOssTracedLoopSystem(engine, traceStore, {
7475
loopId: "loop.demo",

packages/runtime-db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"scripts": {
4646
"build": "pnpm db:generate && tsc",
4747
"typecheck": "pnpm db:generate && tsc --noEmit",
48-
"test": "vitest run",
48+
"test": "vitest run --passWithNoTests",
4949
"db:generate": "node ./scripts/run-prisma.mjs generate",
5050
"db:push": "node ./scripts/run-prisma.mjs db push",
5151
"db:migrate": "node ./scripts/run-prisma.mjs migrate deploy"

0 commit comments

Comments
 (0)