@opensoftware/contracts 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,18 +44,21 @@ Each format has one schema, generated from `typespec/`, and fixtures that CONTRA
44
44
  | score | `score/score.schema.json` | `Score` | Subset of Langfuse's create-score request; factory fields in `metadata`. |
45
45
  | gate record | `gate-record/gate-record.schema.json` | `GateRecord` | gatekeeper's signed approval record (ADR 0047). |
46
46
  | sandbox spec | `sandbox-spec/sandbox-spec.schema.json` | `SandboxSpec` | The input of a sandbox adapter's `create` (ADR 0054). Closed objects: an unknown field is an error. |
47
- | events | `events/<event>/<event>.schema.json`, `events/asyncapi.yaml` | `WorkReceived`, `RunStarted` … `IssueLabeled` | CloudEvents 1.0, structured JSON. |
47
+ | factory lock | `factory-lock/factory-lock.schema.json` | `FactoryLock` | `factory.lock` next to `factory.yaml`: the registry MCP servers and the adapters that `factory plan` pinned (ADR 0020, ADR 0125). factory-spec writes it, the foreman reads the adapter pins. |
48
+ | events | `events/<event>/<event>.schema.json`, `events/asyncapi.yaml` | `WorkReceived`, `WorkRetryRequested`, `RunStarted`, `RunCompleted`, `RunBlocked`, `DoctorPing` … `IssueLabeled` | CloudEvents 1.0, structured JSON. |
48
49
 
49
50
  ## HTTP APIs
50
51
 
51
52
  `openapi/openapi.json` also holds the paths of the module APIs, from the operations in `typespec/` (ADR 0048). The
52
- first is gatekeeper's: `POST /v1/gates` and `GET /v1/gates/{gateId}` with the models `GateRequest`, `GateView` and
53
+ first is gatekeeper's: `POST /v1/gates`, `GET /v1/gates/{gateId}` and `POST /v1/gates/{gateId}/decisions` (ADR 0118) with the models `GateRequest`, `GateView`, `GateDecisionRequest` and
53
54
  `ApiProblem` (RFC 9457). The second is intake's (ADR 0063): `POST /v1/work-items` and
54
55
  `GET /v1/work-items/{workItemId}` with the models `WorkSubmission`, `WorkItemView` and `WorkRequest`, and
55
56
  `GET /v1/inbox` with `WorkItemList`. The third is the
56
- foreman's (ADR 0067): `POST /v1/runs`, `GET /v1/runs/{runId}` and `POST /v1/runs/{runId}/signals` with the models
57
- `RunView`, `StageView`, `CheckView` (ADR 0069) and `RunSignal`. All three answer `GET /v1/health` with the models
58
- `Health` and `HealthCheck` (`HealthApi`, ADR 0086). `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
57
+ foreman's (ADR 0067): `POST /v1/runs`, `GET /v1/runs` with `RunList`, `GET /v1/runs/{runId}`, `POST /v1/runs/{runId}/signals` and
58
+ `POST /v1/runs/{runId}/retry` (ADR 0105), and `GET /v1/doctor/pings/{id}` with `DoctorPingSeen` (ADR 0120), with the models `RunView` (its `adapters`, ADR 0110), `StageView` (its `waitingSince`, ADR 0106, and its `note`, ADR 0109), `CheckView` (ADR 0069), `RunSignal` (its `by`, ADR 0118), `RunAction`
59
+ and `RunRetry`. All three answer `GET /v1/health` with the models
60
+ `Health` and `HealthCheck` (`HealthApi`, ADR 0086). Both lists take `limit` and `cursor` and answer the cursor of the next
61
+ page in `next` (ADR 0115). `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
59
62
  paths next to the named models; an operation that uses a type that is no model fails the build. The package exports
60
63
  the type `paths`, which types a client such as openapi-fetch.
61
64
 
package/dist/formats.js CHANGED
@@ -8,9 +8,13 @@ export const FORMATS = [
8
8
  format("score", "Score"),
9
9
  format("gate-record", "GateRecord"),
10
10
  format("sandbox-spec", "SandboxSpec"),
11
+ format("factory-lock", "FactoryLock"),
11
12
  format("events/work-received", "WorkReceived"),
13
+ format("events/work-retry-requested", "WorkRetryRequested"),
12
14
  format("events/run-started", "RunStarted"),
13
15
  format("events/run-completed", "RunCompleted"),
16
+ format("events/run-blocked", "RunBlocked"),
17
+ format("events/doctor-ping", "DoctorPing"),
14
18
  format("events/gate-requested", "GateRequested"),
15
19
  format("events/gate-decided", "GateDecided"),
16
20
  format("events/score-recorded", "ScoreRecorded"),
@@ -1 +1 @@
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