@opensoftware/contracts 1.0.0 → 1.5.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
@@ -25,6 +25,9 @@ import { type FactoryDefinition, validate } from "@opensoftware/contracts";
25
25
  const problems = validate("factory-definition", document); // [] when valid, else { path, message } per problem
26
26
  ```
27
27
 
28
+ `runSpans(record)` reads a run record as runlog writes it: each span with its decoded resource and attributes, or
29
+ `undefined` when the value is no OTLP/JSON trace export request ([ADR 0041](../docs/decisions/0041-run-record-reader.md)).
30
+
28
31
  The schema files are exported at the paths in the table below, for example
29
32
  `@opensoftware/contracts/work-item/work-item.schema.json`, along with `events/asyncapi.yaml`, `openapi/*` and `typespec/*`.
30
33
 
@@ -39,7 +42,16 @@ Each format has one schema, generated from `typespec/`, and fixtures that CONTRA
39
42
  | run record | `run-record/run-record.schema.json` | `RunRecord` | OTel resource and root-span attributes; pins in `typespec/run-record.tsp`. |
40
43
  | evidence bundle | `evidence-bundle/evidence-bundle.schema.json` | `EvidenceManifest` | `evidence.json` at the bundle root. |
41
44
  | score | `score/score.schema.json` | `Score` | Subset of Langfuse's create-score request; factory fields in `metadata`. |
42
- | events | `events/<event>/<event>.schema.json`, `events/asyncapi.yaml` | `WorkReceived` … `PrOpened` | CloudEvents 1.0, structured JSON. |
45
+ | gate record | `gate-record/gate-record.schema.json` | `GateRecord` | gatekeeper's signed approval record (ADR 0047). |
46
+ | events | `events/<event>/<event>.schema.json`, `events/asyncapi.yaml` | `WorkReceived` … `PrClosed` | CloudEvents 1.0, structured JSON. |
47
+
48
+ ## HTTP APIs
49
+
50
+ `openapi/openapi.json` also holds the paths of the module APIs, from the operations in `typespec/` (ADR 0048). The
51
+ first is gatekeeper's: `POST /v1/gates` and `GET /v1/gates/{gateId}` with the models `GateRequest`, `GateView` and
52
+ `ApiProblem` (RFC 9457). `pnpm build` compiles the operations with the TypeSpec OpenAPI 3 emitter and copies their
53
+ paths next to the named models; an operation that uses a type that is no model fails the build. The package exports
54
+ the type `paths`, which types a client such as openapi-fetch.
43
55
 
44
56
  Wire formats (everything but the factory definition) are open: readers ignore fields they do not know, so a minor
45
57
  version may add optional fields. Read `factory.yaml` with a YAML 1.2 parser: YAML 1.1 parsers turn the key `on`
@@ -65,9 +77,12 @@ into `true`.
65
77
  ## Releases
66
78
 
67
79
  release-please opens a release pull request from the Conventional Commits under `contracts/`. Merging it creates
68
- the tag `contracts-v<version>`. The workflow `.github/workflows/publish-contracts.yml` then builds the package and
69
- publishes it to npm as `@opensoftware/contracts`, with provenance. To publish a tag again, run the workflow by
70
- hand with the tag. The CONTRACT check and `osf-contracts breaking` compare with the newest `contracts-v*` tag.
80
+ the tag `contracts-v<version>`. The release pull request also sets the version in `openapi/openapi.json`, which
81
+ `pnpm build` copies from `package.json`, so the generated file stays current. The workflow `.github/workflows/publish-contracts.yml` then builds the package and
82
+ publishes it to npm as `@opensoftware/contracts`. npm accepts a provenance statement only from a public
83
+ repository, so the workflow adds one only when this repository is public. When the newest tag is missing on npm,
84
+ for example after a failed upload, the next run of the workflow on `main` publishes it. To publish a tag again, run
85
+ the workflow by hand with the tag. The CONTRACT check and `osf-contracts breaking` compare with the newest `contracts-v*` tag.
71
86
 
72
87
  Only the TypeScript package exists (ADR 0012). A client for another language can be generated from
73
88
  `openapi/openapi.json` with any OpenAPI generator when someone needs one.
@@ -104,3 +119,5 @@ None. The CLI reads no environment variables.
104
119
  | SCN-CTR-007 | deprecated | The generated Python client round-trips every valid fixture |
105
120
  | SCN-CTR-008 | deprecated | The generated Java client round-trips every valid fixture |
106
121
  | SCN-CTR-009 | implemented | A tighter form of a "exactly one of" rule fails the compatibility check |
122
+ | SCN-CTR-010 | implemented | runSpans gives each span of a run record with its resource and decoded attributes |
123
+ | SCN-CTR-011 | implemented | runSpans gives no spans for a value that is not a trace export request |
package/dist/breaking.js CHANGED
@@ -154,3 +154,4 @@ function fail(message) {
154
154
  process.stderr.write(`${message}\n`);
155
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,SAAS,IAAI,CAAC,OAAe;IAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACrC,OAAO,CAAC,CAAC;AACX,CAAC"}
package/dist/cli.js CHANGED
@@ -66,3 +66,4 @@ function usage(message) {
66
66
  return 2;
67
67
  }
68
68
  process.exitCode = main(process.argv.slice(2));
69
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,kHAAkH;AAClH,6DAA6D;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,KAAK,GAAG;;2EAE6D,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;yEAIjD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;CAC1F,CAAC;AAEF,SAAS,IAAI,CAAC,IAAc;IAC1B,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAChC,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/B,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAClC,OAAO,QAAQ,CAAC,EAAE,KAAK,CAAC,CAA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8
  format("score", "Score"),
9
+ format("gate-record", "GateRecord"),
9
10
  format("events/work-received", "WorkReceived"),
10
11
  format("events/run-completed", "RunCompleted"),
11
12
  format("events/gate-requested", "GateRequested"),
12
13
  format("events/gate-decided", "GateDecided"),
13
14
  format("events/score-recorded", "ScoreRecorded"),
14
15
  format("events/pr-opened", "PrOpened"),
16
+ format("events/pr-reviewed", "PrReviewed"),
17
+ format("events/pr-closed", "PrClosed"),
15
18
  ];
16
19
  export function formatNamed(name) {
17
20
  return FORMATS.find((candidate) => candidate.name === name);
18
21
  }
22
+ //# sourceMappingURL=formats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.js","sourceRoot":"","sources":["../src/formats.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAW3G,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAEjH,MAAM,CAAC,MAAM,OAAO,GAAsB;IACxC,MAAM,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC;IAC/B,MAAM,CAAC,YAAY,EAAE,WAAW,CAAC;IACjC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,aAAa,EAAE,YAAY,CAAC;IACnC,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAC9C,MAAM,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAC9C,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAChD,MAAM,CAAC,qBAAqB,EAAE,aAAa,CAAC;IAC5C,MAAM,CAAC,uBAAuB,EAAE,eAAe,CAAC;IAChD,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACtC,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAC1C,MAAM,CAAC,kBAAkB,EAAE,UAAU,CAAC;CACvC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AAC9D,CAAC"}
@@ -1,4 +1,39 @@
1
- export type paths = Record<string, never>;
1
+ export type paths = {
2
+ "/v1/gates": {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ get?: never;
10
+ put?: never;
11
+ /** @description Ask the policy's approver groups for a decision. The same request again answers the gate it made before. */
12
+ post: operations["GatekeeperApi_requestGate"];
13
+ delete?: never;
14
+ options?: never;
15
+ head?: never;
16
+ patch?: never;
17
+ trace?: never;
18
+ };
19
+ "/v1/gates/{gateId}": {
20
+ parameters: {
21
+ query?: never;
22
+ header?: never;
23
+ path?: never;
24
+ cookie?: never;
25
+ };
26
+ /** @description A gate: its state, and its record once it is decided. */
27
+ get: operations["GatekeeperApi_getGate"];
28
+ put?: never;
29
+ post?: never;
30
+ delete?: never;
31
+ options?: never;
32
+ head?: never;
33
+ patch?: never;
34
+ trace?: never;
35
+ };
36
+ };
2
37
  export type webhooks = Record<string, never>;
3
38
  export type components = {
4
39
  schemas: {
@@ -33,6 +68,15 @@ export type components = {
33
68
  /** @description Runtime of the agent. */
34
69
  sandbox?: components["schemas"]["Sandbox"];
35
70
  };
71
+ /** @description An error of an HTTP API (RFC 9457). */
72
+ ApiProblem: {
73
+ /** @description A short summary, the same for every occurrence of the problem. */
74
+ title: string;
75
+ /** @description The HTTP status code. */
76
+ status: number;
77
+ /** @description What went wrong this time, for example the field that is missing. */
78
+ detail?: string;
79
+ };
36
80
  Artifact: {
37
81
  path: components["schemas"]["BundlePath"];
38
82
  kind: components["schemas"]["ArtifactKind"];
@@ -111,15 +155,21 @@ export type components = {
111
155
  /** @description Adapters per port with a version range, pinned in `factory.lock` by `factory plan`. */
112
156
  providers?: components["schemas"]["Providers"];
113
157
  /** @description Agents by name. */
114
- agents: Record<string, never>;
158
+ agents: {
159
+ [key: string]: components["schemas"]["Agent"];
160
+ };
115
161
  /** @description Stages in order. Each stage runs one agent; the agent defaults to the stage name. */
116
162
  workflow?: components["schemas"]["Stage"][];
117
163
  /** @description What starts work without a person asking. */
118
164
  automations?: components["schemas"]["Automation"][];
119
165
  /** @description Scorers by name. */
120
- scorers?: Record<string, never>;
166
+ scorers?: {
167
+ [key: string]: components["schemas"]["Scorer"];
168
+ };
121
169
  /** @description Benchmark suites by name. */
122
- benchmarks?: Record<string, never>;
170
+ benchmarks?: {
171
+ [key: string]: components["schemas"]["Benchmark"];
172
+ };
123
173
  };
124
174
  /**
125
175
  * @description The version of a format inside its documents. Only 1 exists; a new major version of a format adds the next.
@@ -166,6 +216,47 @@ export type components = {
166
216
  };
167
217
  /** @enum {string} */
168
218
  GateDecision: "approved" | "rejected" | "expired";
219
+ /** @description gatekeeper: who decided what and when, signed with Ed25519 (ADR 0047). */
220
+ GateRecord: {
221
+ gate: string;
222
+ workItem: string;
223
+ stage: components["schemas"]["Name"];
224
+ summary: string;
225
+ /** @description SHA-256 of the canonical request: what was approved. */
226
+ request: string;
227
+ /** @description The policy file. */
228
+ policy: string;
229
+ /** @description SHA-256 of the policy's text: the rules that picked the approvers. */
230
+ policyDigest: string;
231
+ risk?: string;
232
+ approvers: components["schemas"]["Name"][];
233
+ channel: string;
234
+ /** Format: date-time */
235
+ requestedAt: string;
236
+ decision: components["schemas"]["GateDecision"];
237
+ /** @description Who decided. Absent only when the gate expired. A policy that names no group decides as a trigger. */
238
+ decidedBy?: components["schemas"]["Actor"];
239
+ /** Format: date-time */
240
+ decidedAt: string;
241
+ /** @description The reason of a rejection. */
242
+ reason?: string;
243
+ /** @description Ed25519 over the canonical JSON of the rest of the record. Absent when the record is unsigned. */
244
+ signature?: components["schemas"]["RecordSignature"];
245
+ };
246
+ /** @description gatekeeper: what a person is asked to approve, and the facts the policy decides on (ADR 0047). */
247
+ GateRequest: {
248
+ /** @description What waits: a work item ID or a URL. */
249
+ workItem: string;
250
+ /** @description The stage that waits, for example "merge". */
251
+ stage: components["schemas"]["Name"];
252
+ /** @description What the approvers decide, shown in the channel. */
253
+ summary: string;
254
+ links?: components["schemas"]["Link"][];
255
+ /** @description Any facts the policy needs, such as changed paths, labels or the author. */
256
+ change?: {
257
+ [key: string]: unknown;
258
+ };
259
+ };
169
260
  /** @description gatekeeper: a decision is needed before a stage starts. */
170
261
  GateRequested: {
171
262
  /** @constant */
@@ -204,6 +295,39 @@ export type components = {
204
295
  /** Format: date-time */
205
296
  expiresAt?: string;
206
297
  };
298
+ /**
299
+ * @description A gate's state: waiting, or how it was decided.
300
+ * @enum {string}
301
+ */
302
+ GateState: "pending" | "approved" | "rejected" | "expired";
303
+ /** @description gatekeeper: a gate as the HTTP API shows it (ADR 0048). */
304
+ GateView: {
305
+ /** @description "g" and 16 hex digits of the SHA-256 of the work item, the stage and the change. */
306
+ id: string;
307
+ workItem: string;
308
+ stage: components["schemas"]["Name"];
309
+ summary: string;
310
+ /** @description The risk the policy named, for example "high". */
311
+ risk?: string;
312
+ /** @description The groups whose members may decide. Empty when the policy approved without a person. */
313
+ approvers: components["schemas"]["Name"][];
314
+ /** @description The groups asked after the escalation time. */
315
+ escalateTo?: components["schemas"]["Name"][];
316
+ /** @description Where people decide, for example "slack:C0GATES". */
317
+ channel: string;
318
+ state: components["schemas"]["GateState"];
319
+ /** @description The groups that may decide now. Only while the gate is pending. */
320
+ waitingFor?: components["schemas"]["Name"][];
321
+ /** Format: date-time */
322
+ requestedAt: string;
323
+ /**
324
+ * Format: date-time
325
+ * @description When the gate expires without a decision.
326
+ */
327
+ expiresAt?: string;
328
+ /** @description The record, once the gate is decided. */
329
+ record?: components["schemas"]["GateRecord"];
330
+ };
207
331
  /** @description An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque. */
208
332
  Identifier: string;
209
333
  Link: {
@@ -224,6 +348,38 @@ export type components = {
224
348
  /** @description ID in the source system. */
225
349
  externalId?: string;
226
350
  };
351
+ /** @description forge adapters: a pull request was merged or closed without a merge. */
352
+ PrClosed: {
353
+ /** @constant */
354
+ specversion: "1.0";
355
+ /** @description Unique per source. A consumer that sees the same source and id twice handles the event once. */
356
+ id: components["schemas"]["Identifier"];
357
+ /** @description The producing module, for example "/osf/intake". */
358
+ source: string;
359
+ /** @constant */
360
+ type: "pr.closed@v1";
361
+ /** Format: date-time */
362
+ time: string;
363
+ /** @description The ID of the thing the event is about: work item, gate, run, score or pull request. */
364
+ subject?: string;
365
+ /** @constant */
366
+ datacontenttype?: "application/json";
367
+ /** Format: uri */
368
+ dataschema?: string;
369
+ /** @description W3C trace context (CloudEvents distributed tracing extension). */
370
+ traceparent?: string;
371
+ data: components["schemas"]["PrClosedData"];
372
+ };
373
+ PrClosedData: {
374
+ /**
375
+ * Format: uri
376
+ * @description The pull request.
377
+ */
378
+ url: string;
379
+ /** @description True when the pull request was merged, false when it was closed without a merge. */
380
+ merged: boolean;
381
+ mergeCommit?: components["schemas"]["CommitHash"];
382
+ };
227
383
  /** @description forge adapters: the factory opened a pull request. */
228
384
  PrOpened: {
229
385
  /** @constant */
@@ -260,6 +416,39 @@ export type components = {
260
416
  workItemId?: components["schemas"]["Identifier"];
261
417
  runId?: components["schemas"]["Identifier"];
262
418
  };
419
+ /** @description forge adapters: a person, an agent or a bot reviewed or commented on a pull request. */
420
+ PrReviewed: {
421
+ /** @constant */
422
+ specversion: "1.0";
423
+ /** @description Unique per source. A consumer that sees the same source and id twice handles the event once. */
424
+ id: components["schemas"]["Identifier"];
425
+ /** @description The producing module, for example "/osf/intake". */
426
+ source: string;
427
+ /** @constant */
428
+ type: "pr.reviewed@v1";
429
+ /** Format: date-time */
430
+ time: string;
431
+ /** @description The ID of the thing the event is about: work item, gate, run, score or pull request. */
432
+ subject?: string;
433
+ /** @constant */
434
+ datacontenttype?: "application/json";
435
+ /** Format: uri */
436
+ dataschema?: string;
437
+ /** @description W3C trace context (CloudEvents distributed tracing extension). */
438
+ traceparent?: string;
439
+ data: components["schemas"]["PrReviewedData"];
440
+ };
441
+ PrReviewedData: {
442
+ /**
443
+ * Format: uri
444
+ * @description The pull request.
445
+ */
446
+ url: string;
447
+ reviewer: components["schemas"]["Actor"];
448
+ /** @description True when an agent or a bot wrote the review, not a person. */
449
+ automated?: boolean;
450
+ state: components["schemas"]["ReviewState"];
451
+ };
263
452
  /** @enum {string} */
264
453
  Priority: "urgent" | "high" | "normal" | "low";
265
454
  Producer: {
@@ -268,16 +457,44 @@ export type components = {
268
457
  };
269
458
  /** @description The adapters a factory uses, per port (docs/architecture/internals.md). Keys are adapter names. */
270
459
  Providers: {
271
- harness?: Record<string, never>;
272
- sandbox?: Record<string, never>;
273
- channel?: Record<string, never>;
274
- tracker?: Record<string, never>;
275
- forge?: Record<string, never>;
276
- inference?: Record<string, never>;
277
- secrets?: Record<string, never>;
278
- telemetry?: Record<string, never>;
279
- policy?: Record<string, never>;
460
+ harness?: {
461
+ [key: string]: components["schemas"]["VersionRange"];
462
+ };
463
+ sandbox?: {
464
+ [key: string]: components["schemas"]["VersionRange"];
465
+ };
466
+ channel?: {
467
+ [key: string]: components["schemas"]["VersionRange"];
468
+ };
469
+ tracker?: {
470
+ [key: string]: components["schemas"]["VersionRange"];
471
+ };
472
+ forge?: {
473
+ [key: string]: components["schemas"]["VersionRange"];
474
+ };
475
+ inference?: {
476
+ [key: string]: components["schemas"]["VersionRange"];
477
+ };
478
+ secrets?: {
479
+ [key: string]: components["schemas"]["VersionRange"];
480
+ };
481
+ telemetry?: {
482
+ [key: string]: components["schemas"]["VersionRange"];
483
+ };
484
+ policy?: {
485
+ [key: string]: components["schemas"]["VersionRange"];
486
+ };
487
+ };
488
+ RecordSignature: {
489
+ /** @constant */
490
+ algorithm: "Ed25519";
491
+ /** @description SHA-256 of the public key in DER, like "sha256:…". */
492
+ key: string;
493
+ /** @description The signature in base64. */
494
+ value: string;
280
495
  };
496
+ /** @enum {string} */
497
+ ReviewState: "approved" | "changes_requested" | "commented";
281
498
  /** @description foreman: a run ended. */
282
499
  RunCompleted: {
283
500
  /** @constant */
@@ -440,6 +657,8 @@ export type components = {
440
657
  "osf.judge.model"?: string;
441
658
  /** @description Cost of the judge call. */
442
659
  "osf.judge.cost.usd"?: number;
660
+ } & {
661
+ [key: string]: unknown;
443
662
  };
444
663
  /** @description scorekit: a scorer scored a run. */
445
664
  ScoreRecorded: {
@@ -540,4 +759,96 @@ export type components = {
540
759
  pathItems: never;
541
760
  };
542
761
  export type $defs = Record<string, never>;
543
- export type operations = Record<string, never>;
762
+ export interface operations {
763
+ GatekeeperApi_requestGate: {
764
+ parameters: {
765
+ query?: never;
766
+ header?: never;
767
+ path?: never;
768
+ cookie?: never;
769
+ };
770
+ requestBody: {
771
+ content: {
772
+ "application/json": components["schemas"]["GateRequest"];
773
+ };
774
+ };
775
+ responses: {
776
+ /** @description The request has succeeded. */
777
+ 200: {
778
+ headers: {
779
+ [name: string]: unknown;
780
+ };
781
+ content: {
782
+ "application/json": components["schemas"]["GateView"];
783
+ };
784
+ };
785
+ /** @description The request has succeeded and a new resource has been created as a result. */
786
+ 201: {
787
+ headers: {
788
+ [name: string]: unknown;
789
+ };
790
+ content: {
791
+ "application/json": components["schemas"]["GateView"];
792
+ };
793
+ };
794
+ /** @description The server could not understand the request due to invalid syntax. */
795
+ 400: {
796
+ headers: {
797
+ [name: string]: unknown;
798
+ };
799
+ content: {
800
+ "application/problem+json": components["schemas"]["ApiProblem"];
801
+ };
802
+ };
803
+ /** @description Access is unauthorized. */
804
+ 401: {
805
+ headers: {
806
+ [name: string]: unknown;
807
+ };
808
+ content: {
809
+ "application/problem+json": components["schemas"]["ApiProblem"];
810
+ };
811
+ };
812
+ };
813
+ };
814
+ GatekeeperApi_getGate: {
815
+ parameters: {
816
+ query?: never;
817
+ header?: never;
818
+ path: {
819
+ gateId: string;
820
+ };
821
+ cookie?: never;
822
+ };
823
+ requestBody?: never;
824
+ responses: {
825
+ /** @description The request has succeeded. */
826
+ 200: {
827
+ headers: {
828
+ [name: string]: unknown;
829
+ };
830
+ content: {
831
+ "application/json": components["schemas"]["GateView"];
832
+ };
833
+ };
834
+ /** @description Access is unauthorized. */
835
+ 401: {
836
+ headers: {
837
+ [name: string]: unknown;
838
+ };
839
+ content: {
840
+ "application/problem+json": components["schemas"]["ApiProblem"];
841
+ };
842
+ };
843
+ /** @description The server cannot find the requested resource. */
844
+ 404: {
845
+ headers: {
846
+ [name: string]: unknown;
847
+ };
848
+ content: {
849
+ "application/problem+json": components["schemas"]["ApiProblem"];
850
+ };
851
+ };
852
+ };
853
+ };
854
+ }
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/generated/types.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,8 @@ import { type Format } from "./formats.ts";
2
2
  import type { components } from "./generated/types.ts";
3
3
  export { diff as breakingChanges, type Schema } from "./breaking.ts";
4
4
  export { FORMATS, type Format, formatNamed } from "./formats.ts";
5
- export type { components } from "./generated/types.ts";
5
+ export type { components, paths } from "./generated/types.ts";
6
+ export { type AttributeValue, type RunSpan, runSpans, type SpanAttributes } from "./run-record.ts";
6
7
  type Schemas = components["schemas"];
7
8
  export type FactoryDefinition = Schemas["FactoryDefinition"];
8
9
  export type WorkItem = Schemas["WorkItem"];
@@ -15,6 +16,12 @@ export type GateRequested = Schemas["GateRequested"];
15
16
  export type GateDecided = Schemas["GateDecided"];
16
17
  export type ScoreRecorded = Schemas["ScoreRecorded"];
17
18
  export type PrOpened = Schemas["PrOpened"];
19
+ export type PrReviewed = Schemas["PrReviewed"];
20
+ export type PrClosed = Schemas["PrClosed"];
21
+ export type GateRecord = Schemas["GateRecord"];
22
+ export type GateRequest = Schemas["GateRequest"];
23
+ export type GateView = Schemas["GateView"];
24
+ export type ApiProblem = Schemas["ApiProblem"];
18
25
  /** One reason a document does not match its format. `path` is a JSON Pointer into the document. */
19
26
  export interface Problem {
20
27
  path: string;
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import addFormats from "ajv-formats";
7
7
  import { formatNamed } from "./formats.js";
8
8
  export { diff as breakingChanges } from "./breaking.js";
9
9
  export { FORMATS, formatNamed } from "./formats.js";
10
+ export { runSpans } from "./run-record.js";
10
11
  /** The package root: dist/ and src/ both sit one level below it, next to the schema folders. */
11
12
  const ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
12
13
  const validators = new Map();
@@ -71,3 +72,4 @@ function describe(error) {
71
72
  return { path: error.instancePath || "/", message: error.message ?? error.keyword };
72
73
  }
73
74
  }
75
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,OAAO,EAAE,EAA2C,MAAM,kBAAkB,CAAC;AACpF,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAe,WAAW,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,IAAI,IAAI,eAAe,EAAe,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,OAAO,EAAe,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAqC,QAAQ,EAAuB,MAAM,iBAAiB,CAAC;AA2BnG,gGAAgG;AAChG,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IA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,CAAC"}
package/dist/roundtrip.js CHANGED
@@ -87,3 +87,4 @@ function firstDifference(a, b, path) {
87
87
  ? undefined
88
88
  : `${path || "/"}: ${JSON.stringify(a)} → ${JSON.stringify(b)}`;
89
89
  }
90
+ //# sourceMappingURL=roundtrip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roundtrip.js","sourceRoot":"","sources":["../src/roundtrip.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,iHAAiH;AACjH,wBAAwB;AACxB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAe,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,YAAY,CAAU,CAAC;AAQ/C,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,GAAW;IACpD,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,GAAG,6BAA6B,CAAC,CAAC;QAClF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,OAA6B,CAAC;IAClC,IAAI,CAAC;QACH,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAI,KAAe,CAAC,OAAO,IAAI,CAAC,CAAC;QACtD,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,QAAQ,EAAE,CAAC;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;QAC5C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;AACpE,CAAC"}
@@ -0,0 +1,18 @@
1
+ /** An OTLP/JSON attribute value as runlog writes it: a string, an integer, a double or an array of them. */
2
+ export type AttributeValue = string | number | AttributeValue[] | undefined;
3
+ export type SpanAttributes = Record<string, AttributeValue>;
4
+ /** One span of a run record, with its resource. */
5
+ export interface RunSpan {
6
+ traceId: string;
7
+ spanId: string;
8
+ parentSpanId: string | undefined;
9
+ name: string;
10
+ /** Unix time in nanoseconds; 0 when the span has none. */
11
+ start: bigint;
12
+ end: bigint;
13
+ /** The attributes of the span's resource, like `osf.run.id`. */
14
+ resource: SpanAttributes;
15
+ attributes: SpanAttributes;
16
+ }
17
+ /** The spans of a run record in the order they appear; undefined when the value is no OTLP/JSON trace export request. */
18
+ export declare function runSpans(record: unknown): RunSpan[] | undefined;
@@ -0,0 +1,27 @@
1
+ // Reading run records: OTLP/JSON trace export requests with the run-record attributes, as runlog writes them.
2
+ /** The spans of a run record in the order they appear; undefined when the value is no OTLP/JSON trace export request. */
3
+ export function runSpans(record) {
4
+ const { resourceSpans } = (record ?? {});
5
+ if (!Array.isArray(resourceSpans))
6
+ return undefined;
7
+ return resourceSpans.flatMap((entry) => {
8
+ const resource = decode(entry.resource?.attributes);
9
+ return (entry.scopeSpans ?? []).flatMap((scope) => (scope.spans ?? []).map((span) => ({
10
+ traceId: span.traceId,
11
+ spanId: span.spanId,
12
+ parentSpanId: span.parentSpanId || undefined,
13
+ name: span.name ?? "",
14
+ start: BigInt(span.startTimeUnixNano ?? 0),
15
+ end: BigInt(span.endTimeUnixNano ?? 0),
16
+ resource,
17
+ attributes: decode(span.attributes),
18
+ })));
19
+ });
20
+ }
21
+ const value = (otlp) => {
22
+ if (otlp.arrayValue)
23
+ return (otlp.arrayValue.values ?? []).map(value);
24
+ return otlp.intValue === undefined ? (otlp.stringValue ?? otlp.doubleValue) : Number(otlp.intValue);
25
+ };
26
+ const decode = (list) => Object.fromEntries((list ?? []).map(({ key, value: entry }) => [key, value(entry)]));
27
+ //# sourceMappingURL=run-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-record.js","sourceRoot":"","sources":["../src/run-record.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAyC9G,yHAAyH;AACzH,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAgC,CAAC;IACxE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC;QAAE,OAAO,SAAS,CAAC;IACpD,OAAQ,aAAqC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QACpD,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAChD,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACjC,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;YAC5C,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;YACrB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;YAC1C,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC;YACtC,QAAQ;YACR,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SACpC,CAAC,CAAC,CACJ,CAAC;IACJ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