@ora-ai/cli 0.20.0 → 0.22.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.
Files changed (108) hide show
  1. package/README.md +93 -1
  2. package/dist/auth-commands.d.ts.map +1 -1
  3. package/dist/auth-commands.js +12 -1
  4. package/dist/auth-commands.js.map +1 -1
  5. package/dist/core/auth.d.ts +24 -13
  6. package/dist/core/auth.d.ts.map +1 -1
  7. package/dist/core/auth.js +26 -15
  8. package/dist/core/auth.js.map +1 -1
  9. package/dist/core/credential-sources.d.ts +45 -0
  10. package/dist/core/credential-sources.d.ts.map +1 -0
  11. package/dist/core/credential-sources.js +65 -0
  12. package/dist/core/credential-sources.js.map +1 -0
  13. package/dist/core/github-actions-sign-in.d.ts +33 -0
  14. package/dist/core/github-actions-sign-in.d.ts.map +1 -0
  15. package/dist/core/github-actions-sign-in.js +54 -0
  16. package/dist/core/github-actions-sign-in.js.map +1 -0
  17. package/dist/core/output.js +14 -1
  18. package/dist/core/output.js.map +1 -1
  19. package/dist/core/run-operation.d.ts +11 -4
  20. package/dist/core/run-operation.d.ts.map +1 -1
  21. package/dist/core/run-operation.js +14 -9
  22. package/dist/core/run-operation.js.map +1 -1
  23. package/dist/core/sign-in.d.ts +34 -0
  24. package/dist/core/sign-in.d.ts.map +1 -0
  25. package/dist/core/sign-in.js +21 -0
  26. package/dist/core/sign-in.js.map +1 -0
  27. package/dist/generated/operations.d.ts +1 -1
  28. package/dist/generated/operations.d.ts.map +1 -1
  29. package/dist/generated/operations.js +1236 -70
  30. package/dist/generated/operations.js.map +1 -1
  31. package/dist/generated/types.d.ts +1579 -112
  32. package/dist/generated/types.d.ts.map +1 -1
  33. package/dist/generated/types.js +1 -1
  34. package/dist/mcp/mcp-call.d.ts +25 -0
  35. package/dist/mcp/mcp-call.d.ts.map +1 -0
  36. package/dist/mcp/mcp-call.js +44 -0
  37. package/dist/mcp/mcp-call.js.map +1 -0
  38. package/dist/mcp/mcp-command.d.ts +26 -0
  39. package/dist/mcp/mcp-command.d.ts.map +1 -0
  40. package/dist/mcp/mcp-command.js +91 -0
  41. package/dist/mcp/mcp-command.js.map +1 -0
  42. package/dist/mcp/mcp-install.d.ts +50 -0
  43. package/dist/mcp/mcp-install.d.ts.map +1 -0
  44. package/dist/mcp/mcp-install.js +71 -0
  45. package/dist/mcp/mcp-install.js.map +1 -0
  46. package/dist/mcp/mcp-protocol.d.ts +69 -0
  47. package/dist/mcp/mcp-protocol.d.ts.map +1 -0
  48. package/dist/mcp/mcp-protocol.js +96 -0
  49. package/dist/mcp/mcp-protocol.js.map +1 -0
  50. package/dist/mcp/mcp-stdio.d.ts +17 -0
  51. package/dist/mcp/mcp-stdio.d.ts.map +1 -0
  52. package/dist/mcp/mcp-stdio.js +39 -0
  53. package/dist/mcp/mcp-stdio.js.map +1 -0
  54. package/dist/mcp/mcp-tools.d.ts +81 -0
  55. package/dist/mcp/mcp-tools.d.ts.map +1 -0
  56. package/dist/mcp/mcp-tools.js +134 -0
  57. package/dist/mcp/mcp-tools.js.map +1 -0
  58. package/dist/program.d.ts +4 -9
  59. package/dist/program.d.ts.map +1 -1
  60. package/dist/program.js +9 -3
  61. package/dist/program.js.map +1 -1
  62. package/dist/render/index.js +6 -0
  63. package/dist/render/index.js.map +1 -1
  64. package/dist/render/study/counting-views.d.ts +46 -0
  65. package/dist/render/study/counting-views.d.ts.map +1 -0
  66. package/dist/render/study/counting-views.js +49 -0
  67. package/dist/render/study/counting-views.js.map +1 -0
  68. package/dist/render/study/gate-views.d.ts +56 -0
  69. package/dist/render/study/gate-views.d.ts.map +1 -0
  70. package/dist/render/study/gate-views.js +64 -0
  71. package/dist/render/study/gate-views.js.map +1 -0
  72. package/dist/render/study/renderers.d.ts +8 -0
  73. package/dist/render/study/renderers.d.ts.map +1 -0
  74. package/dist/render/study/renderers.js +31 -0
  75. package/dist/render/study/renderers.js.map +1 -0
  76. package/dist/render/study/series-views.d.ts +65 -0
  77. package/dist/render/study/series-views.d.ts.map +1 -0
  78. package/dist/render/study/series-views.js +116 -0
  79. package/dist/render/study/series-views.js.map +1 -0
  80. package/dist/render/study/study-format.d.ts +24 -0
  81. package/dist/render/study/study-format.d.ts.map +1 -0
  82. package/dist/render/study/study-format.js +42 -0
  83. package/dist/render/study/study-format.js.map +1 -0
  84. package/dist/study-ci/ci-command.d.ts +31 -0
  85. package/dist/study-ci/ci-command.d.ts.map +1 -0
  86. package/dist/study-ci/ci-command.js +134 -0
  87. package/dist/study-ci/ci-command.js.map +1 -0
  88. package/dist/study-ci/ci-rehearse-command.d.ts +11 -0
  89. package/dist/study-ci/ci-rehearse-command.d.ts.map +1 -0
  90. package/dist/study-ci/ci-rehearse-command.js +83 -0
  91. package/dist/study-ci/ci-rehearse-command.js.map +1 -0
  92. package/dist/study-ci/ci-rehearse.d.ts +62 -0
  93. package/dist/study-ci/ci-rehearse.d.ts.map +1 -0
  94. package/dist/study-ci/ci-rehearse.js +49 -0
  95. package/dist/study-ci/ci-rehearse.js.map +1 -0
  96. package/dist/study-ci/ci-run.d.ts +87 -0
  97. package/dist/study-ci/ci-run.d.ts.map +1 -0
  98. package/dist/study-ci/ci-run.js +131 -0
  99. package/dist/study-ci/ci-run.js.map +1 -0
  100. package/dist/study-ci/gate-report.d.ts +64 -0
  101. package/dist/study-ci/gate-report.d.ts.map +1 -0
  102. package/dist/study-ci/gate-report.js +80 -0
  103. package/dist/study-ci/gate-report.js.map +1 -0
  104. package/dist/study-ci/params.d.ts +8 -0
  105. package/dist/study-ci/params.d.ts.map +1 -0
  106. package/dist/study-ci/params.js +72 -0
  107. package/dist/study-ci/params.js.map +1 -0
  108. package/package.json +1 -1
@@ -0,0 +1,62 @@
1
+ /**
2
+ * `ora study ci rehearse` — rehearse a design and wait for what it proved.
3
+ *
4
+ * Like `ci run`, it only SEQUENCES operations the API already has: start the
5
+ * rehearsal from the study's body file, then read its report until it is no
6
+ * longer pending. What "ready" means is the report's answer.
7
+ *
8
+ * EXIT CODES: 0 ready, 1 not ready (a check failed), 2 still pending when the
9
+ * time ran out, 3 the rehearsal could not be started or read.
10
+ */
11
+ export interface RehearsalReportView {
12
+ studyId: string;
13
+ name: string;
14
+ status: string;
15
+ /** How it ran: `live`, or a mode that starts no agent. Absent from a service that predates modes. */
16
+ mode?: string;
17
+ state: string;
18
+ groups: {
19
+ key: string;
20
+ label: string;
21
+ state: string;
22
+ checks: {
23
+ check: string;
24
+ answer: string;
25
+ detail: string;
26
+ }[];
27
+ }[];
28
+ }
29
+ export interface CiRehearsePaths {
30
+ rehearse: string;
31
+ /** Template with `{id}`. */
32
+ report: string;
33
+ }
34
+ export interface CiRehearseOptions {
35
+ body: Record<string, unknown>;
36
+ tasks?: number;
37
+ /** How the rehearsal runs. Absent = the service's default (the real agents). */
38
+ mode?: string;
39
+ timeoutMs: number;
40
+ pollMs: number;
41
+ }
42
+ /** The one client call a rehearsal makes (the CLI's own client satisfies it). */
43
+ export interface CiRehearseClient {
44
+ call(opts: {
45
+ method: string;
46
+ path: string;
47
+ query?: Record<string, string | number | undefined>;
48
+ body?: unknown;
49
+ }): Promise<unknown>;
50
+ }
51
+ export interface CiRehearseDeps {
52
+ client: CiRehearseClient;
53
+ paths: CiRehearsePaths;
54
+ now: () => number;
55
+ sleep: (ms: number) => Promise<void>;
56
+ log: (line: string) => void;
57
+ }
58
+ export declare function rehearsalExitCodeOf(state: string): number;
59
+ export declare function runStudyRehearsal(options: CiRehearseOptions, deps: CiRehearseDeps): Promise<RehearsalReportView>;
60
+ /** The report as plain lines for a job log: each group, each check, its sentence. */
61
+ export declare function rehearsalReportText(report: RehearsalReportView): string;
62
+ //# sourceMappingURL=ci-rehearse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-rehearse.d.ts","sourceRoot":"","sources":["../../src/study-ci/ci-rehearse.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI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C;IACrC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA0BtH;AAKD,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAOvE"}
@@ -0,0 +1,49 @@
1
+ import { CiRunError, EXIT } from "./ci-run.js";
2
+ export function rehearsalExitCodeOf(state) {
3
+ if (state === "ready")
4
+ return EXIT.pass;
5
+ if (state === "not_ready")
6
+ return EXIT.fail;
7
+ return EXIT.undecided;
8
+ }
9
+ export async function runStudyRehearsal(options, deps) {
10
+ const { client, paths, log } = deps;
11
+ const started = (await client.call({
12
+ method: "post",
13
+ path: paths.rehearse,
14
+ ...(options.tasks !== undefined || options.mode !== undefined
15
+ ? { query: { ...(options.tasks !== undefined ? { tasks: options.tasks } : {}), ...(options.mode !== undefined ? { mode: options.mode } : {}) } }
16
+ : {}),
17
+ body: options.body,
18
+ }));
19
+ const studyId = started?.rehearsal?.studyId;
20
+ if (!studyId)
21
+ throw new CiRunError("the rehearsal door answered no study id");
22
+ // The mode the SERVICE says it started, never the one asked for: they must agree, and only one of them ran.
23
+ const mode = started?.rehearsal?.mode;
24
+ log(`rehearsal ${studyId} started (${started?.rehearsal?.tasks ?? "?"} task(s) per group${mode ? `, mode ${mode}` : ""})`);
25
+ const deadline = deps.now() + options.timeoutMs;
26
+ for (;;) {
27
+ const report = (await client.call({
28
+ method: "get",
29
+ path: paths.report.replace("{id}", encodeURIComponent(studyId)),
30
+ }));
31
+ if (report.state !== "pending" || deps.now() >= deadline)
32
+ return report;
33
+ log(`pending (${report.groups.filter((group) => group.state === "pending").map((group) => group.label).join(", ") || "runs"})`);
34
+ await deps.sleep(Math.min(options.pollMs, Math.max(0, deadline - deps.now())));
35
+ }
36
+ }
37
+ const HEADLINE = { ready: "Ready", not_ready: "Not ready", pending: "Still pending" };
38
+ const MARK = { pass: "pass", fail: "FAIL", pending: "pending", unknown: "unknown" };
39
+ /** The report as plain lines for a job log: each group, each check, its sentence. */
40
+ export function rehearsalReportText(report) {
41
+ const lines = [`${HEADLINE[report.state] ?? report.state}: ${report.name} (study ${report.studyId}${report.mode ? `, mode ${report.mode}` : ""})`];
42
+ for (const group of report.groups) {
43
+ lines.push(` ${group.label}: ${HEADLINE[group.state] ?? group.state}`);
44
+ for (const check of group.checks)
45
+ lines.push(` [${MARK[check.answer] ?? check.answer}] ${check.check}: ${check.detail}`);
46
+ }
47
+ return lines.join("\n");
48
+ }
49
+ //# sourceMappingURL=ci-rehearse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-rehearse.js","sourceRoot":"","sources":["../../src/study-ci/ci-rehearse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAkD/C,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACxC,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAC5C,OAAO,IAAI,CAAC,SAAS,CAAC;AACxB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAA0B,EAAE,IAAoB;IACtF,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACpC,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC;QACjC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,KAAK,CAAC,QAAQ;QACpB,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAC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I,KAAK,CAAC,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9H,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,87 @@
1
+ import type { GateReportInput } from "./gate-report.js";
2
+ /**
3
+ * `ora study ci run` — ONE study, start to verdict, for a CI job.
4
+ *
5
+ * IT ONLY SEQUENCES. Every step is an operation the API already has
6
+ * (preflight, create, launch, stream, re-run infra failures, gate); this
7
+ * module adds the order, the waiting and the exit code, and no rule of its
8
+ * own. What "pass" means is the gate door's answer, and what a study is, is
9
+ * the body file's.
10
+ *
11
+ * preflight -> create -> launch -> wait until the runs end
12
+ * -> ask the gate
13
+ * - still grading? wait and ask again (bounded by --timeout)
14
+ * - infra ate the runs? re-run them in place (bounded by --infra-reruns), wait, ask again
15
+ * - anything else that is the answer
16
+ *
17
+ * EXIT CODES are the contract with the CI system:
18
+ * 0 pass, 1 fail, 2 undecided, 3 the run itself could not be completed.
19
+ * `undecided` is its own code on purpose: a pipeline decides whether "cannot
20
+ * tell yet" blocks a merge (`--undecided pass|fail` maps it), the tool does not.
21
+ */
22
+ export declare const EXIT: {
23
+ readonly pass: 0;
24
+ readonly fail: 1;
25
+ readonly undecided: 2;
26
+ readonly error: 3;
27
+ };
28
+ export type UndecidedPolicy = "undecided" | "pass" | "fail";
29
+ /** The slice of the HTTP client the run needs. */
30
+ export interface CiClient {
31
+ call(opts: {
32
+ method: string;
33
+ path: string;
34
+ body?: unknown;
35
+ }): Promise<unknown>;
36
+ open(opts: {
37
+ method: string;
38
+ path: string;
39
+ }): Promise<Response>;
40
+ }
41
+ /** Where each operation lives, read from the generated manifest by the command (never typed here). */
42
+ export interface CiPaths {
43
+ preflight: string;
44
+ create: string;
45
+ /** Templates with `{id}`. */
46
+ get: string;
47
+ launch: string;
48
+ stream: string;
49
+ rerunInfraFailures: string;
50
+ gate: string;
51
+ }
52
+ export interface CiRunOptions {
53
+ /** The create body, parameters already applied. */
54
+ body: Record<string, unknown>;
55
+ /** The gate spec (the gate door's request body). */
56
+ gate: unknown;
57
+ /** How long the whole run may take, from launch. */
58
+ timeoutMs: number;
59
+ /** How many times infra-failed runs are re-run in place before the gate's refusal stands. */
60
+ infraReruns: number;
61
+ /** How long to wait between two asks while grading settles. */
62
+ settlePollMs: number;
63
+ }
64
+ export interface CiRunDeps {
65
+ client: CiClient;
66
+ paths: CiPaths;
67
+ now: () => number;
68
+ sleep: (ms: number) => Promise<void>;
69
+ /** Progress lines, for a human reading the job log. */
70
+ log: (line: string) => void;
71
+ }
72
+ export interface CiRunResult {
73
+ studyId: string;
74
+ studyName: string;
75
+ plannedRunCount: number | null;
76
+ result: GateReportInput;
77
+ }
78
+ export declare class CiRunError extends Error {
79
+ readonly studyId?: string | undefined;
80
+ constructor(message: string, studyId?: string | undefined);
81
+ }
82
+ /** The pause before a dropped event stream is reopened. */
83
+ export declare const STREAM_RETRY_MS = 5000;
84
+ /** The process exit code for a decision, under the caller's policy for "cannot tell yet". */
85
+ export declare function exitCodeOf(decision: string, undecided?: UndecidedPolicy): number;
86
+ export declare function runStudyCi(options: CiRunOptions, deps: CiRunDeps): Promise<CiRunResult>;
87
+ //# sourceMappingURL=ci-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-run.d.ts","sourceRoot":"","sources":["../../src/study-ci/ci-run.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,IAAI;;;;;CAAwD,CAAC;AAE1E,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5D,kDAAkD;AAClD,MAA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AM,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,qBAAa,UAAW,SAAQ,KAAK;IAGjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM;gBADzB,OAAO,EAAE,MAAM,EACN,OAAO,CAAC,EAAE,MAAM,YAAA;CAK5B;AAGD,2DAA2D;AAC3D,eAAO,MAAM,eAAe,OAAQ,CAAC;AAIrC,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,eAA6B,GAAG,MAAM,CAI7F;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAiD7F"}
@@ -0,0 +1,131 @@
1
+ import { readSse } from "../core/sse.js";
2
+ /**
3
+ * `ora study ci run` — ONE study, start to verdict, for a CI job.
4
+ *
5
+ * IT ONLY SEQUENCES. Every step is an operation the API already has
6
+ * (preflight, create, launch, stream, re-run infra failures, gate); this
7
+ * module adds the order, the waiting and the exit code, and no rule of its
8
+ * own. What "pass" means is the gate door's answer, and what a study is, is
9
+ * the body file's.
10
+ *
11
+ * preflight -> create -> launch -> wait until the runs end
12
+ * -> ask the gate
13
+ * - still grading? wait and ask again (bounded by --timeout)
14
+ * - infra ate the runs? re-run them in place (bounded by --infra-reruns), wait, ask again
15
+ * - anything else that is the answer
16
+ *
17
+ * EXIT CODES are the contract with the CI system:
18
+ * 0 pass, 1 fail, 2 undecided, 3 the run itself could not be completed.
19
+ * `undecided` is its own code on purpose: a pipeline decides whether "cannot
20
+ * tell yet" blocks a merge (`--undecided pass|fail` maps it), the tool does not.
21
+ */
22
+ export const EXIT = { pass: 0, fail: 1, undecided: 2, error: 3 };
23
+ export class CiRunError extends Error {
24
+ studyId;
25
+ constructor(message, studyId) {
26
+ super(message);
27
+ this.studyId = studyId;
28
+ this.name = "CiRunError";
29
+ }
30
+ }
31
+ const TERMINAL_STUDY_STATUSES = new Set(["completed", "failed"]);
32
+ /** The pause before a dropped event stream is reopened. */
33
+ export const STREAM_RETRY_MS = 5_000;
34
+ const at = (template, id) => template.replace("{id}", encodeURIComponent(id));
35
+ /** The process exit code for a decision, under the caller's policy for "cannot tell yet". */
36
+ export function exitCodeOf(decision, undecided = "undecided") {
37
+ if (decision === "pass")
38
+ return EXIT.pass;
39
+ if (decision === "fail")
40
+ return EXIT.fail;
41
+ return undecided === "pass" ? EXIT.pass : undecided === "fail" ? EXIT.fail : EXIT.undecided;
42
+ }
43
+ export async function runStudyCi(options, deps) {
44
+ const { client, paths, log } = deps;
45
+ const plan = (await client.call({ method: "post", path: paths.preflight, body: options.body }));
46
+ const plannedRunCount = typeof plan?.plannedRunCount === "number" ? plan.plannedRunCount : null;
47
+ log(`preflight: ${plannedRunCount ?? "?"} runs planned`);
48
+ for (const issue of plan?.issues ?? [])
49
+ log(`preflight note (${issue.code}): ${issue.message}`);
50
+ const created = (await client.call({ method: "post", path: paths.create, body: options.body }));
51
+ const studyId = created?.study?.id;
52
+ if (!studyId)
53
+ throw new CiRunError("create answered no study id");
54
+ const studyName = created?.study?.name ?? studyId;
55
+ log(`created study ${studyId} (${created?.study?.status ?? "unknown status"})`);
56
+ if (created?.study?.status !== "ready") {
57
+ // A corpus that still has to be generated is a review step, not a CI step: its tasks would differ run to run.
58
+ throw new CiRunError(`the study is '${created?.study?.status}', not 'ready': a CI study needs its tasks in the body (\`tasks\`) or a pinned benchmark version`, studyId);
59
+ }
60
+ await client.call({ method: "post", path: at(paths.launch, studyId) });
61
+ const deadline = deps.now() + options.timeoutMs;
62
+ log("launched; waiting for the runs to end");
63
+ await waitForRuns(studyId, deadline, deps);
64
+ let rerunsLeft = options.infraReruns;
65
+ for (;;) {
66
+ const result = (await client.call({ method: "post", path: at(paths.gate, studyId), body: options.gate }));
67
+ const refusedBy = result.gate.refusedBy;
68
+ if (refusedBy === "infra_clean" && rerunsLeft > 0 && result.state === "settled") {
69
+ rerunsLeft -= 1;
70
+ log(`infra failures over the ceiling: re-running them in place (${rerunsLeft} re-run${rerunsLeft === 1 ? "" : "s"} left)`);
71
+ await client.call({ method: "post", path: at(paths.rerunInfraFailures, studyId) });
72
+ await waitForRuns(studyId, deadline, deps);
73
+ continue;
74
+ }
75
+ if (refusedBy === "settled" && deps.now() < deadline) {
76
+ log(`not settled yet (${result.owed.join(", ") || "work owed"}); asking again`);
77
+ await deps.sleep(options.settlePollMs);
78
+ continue;
79
+ }
80
+ return { studyId, studyName, plannedRunCount, result };
81
+ }
82
+ }
83
+ /**
84
+ * Wait until the study's runs have ended: read its status, and while it is not
85
+ * terminal follow its event stream (which the server closes at a terminal
86
+ * status). A stream that drops is not an error: the status is read again and
87
+ * the stream reopened, until the deadline.
88
+ */
89
+ async function waitForRuns(studyId, deadline, deps) {
90
+ const { client, paths } = deps;
91
+ for (;;) {
92
+ const detail = (await client.call({ method: "get", path: at(paths.get, studyId) }));
93
+ const status = detail?.study?.status ?? "";
94
+ if (TERMINAL_STUDY_STATUSES.has(status)) {
95
+ if (status === "failed")
96
+ throw new CiRunError("the study failed before its runs ended", studyId);
97
+ return;
98
+ }
99
+ if (deps.now() >= deadline)
100
+ throw new CiRunError(`timed out waiting for the runs to end (the study is '${status}')`, studyId);
101
+ let ended = false;
102
+ try {
103
+ const stream = await client.open({ method: "get", path: at(paths.stream, studyId) });
104
+ for await (const event of readSse(stream)) {
105
+ if (deps.now() >= deadline)
106
+ break;
107
+ if (isTerminalStatusEvent(event.data)) {
108
+ ended = true;
109
+ break;
110
+ }
111
+ }
112
+ }
113
+ catch {
114
+ // The stream could not be opened, or dropped: the status is read again below.
115
+ }
116
+ // A stream that closed WITHOUT saying the study ended (a dropped connection, a proxy's idle timeout) is
117
+ // followed by a pause, so a server that keeps closing it is asked a few times a minute, never in a loop.
118
+ if (!ended)
119
+ await deps.sleep(Math.min(STREAM_RETRY_MS, Math.max(0, deadline - deps.now())));
120
+ }
121
+ }
122
+ function isTerminalStatusEvent(data) {
123
+ try {
124
+ const frame = JSON.parse(data);
125
+ return frame.type === "status" && typeof frame.status === "string" && TERMINAL_STUDY_STATUSES.has(frame.status);
126
+ }
127
+ catch {
128
+ return false;
129
+ }
130
+ }
131
+ //# sourceMappingURL=ci-run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ci-run.js","sourceRoot":"","sources":["../../src/study-ci/ci-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAW,CAAC;AAmD1E,MAAM,OAAO,UAAW,SAAQ,KAAK;IAGxB;IAFX,YACE,OAAe,EACN,OAAgB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,YAAO,GAAP,OAAO,CAAS;QAGzB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF;AAED,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtF,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,MAAM,EAAE,GAAG,CAAC,QAAgB,EAAE,EAAU,EAAU,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC;AAEtG,6FAA6F;AAC7F,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,YAA6B,WAAW;IACnF,IAAI,QAAQ,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAC1C,IAAI,QAAQ,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAC1C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
+ * THE GATE'S REPORT, FOR PEOPLE — the markdown a CI job writes to its summary
3
+ * and to the pull request's one comment.
4
+ *
5
+ * IT PRINTS ONLY WHAT THE API ANSWERED. Every number and every sentence here
6
+ * comes from the gate door's response (`gate.reason` is composed by the
7
+ * service, from the figures it computed): this module chooses layout and
8
+ * never arithmetic, so a comment can never state a figure the study does not.
9
+ *
10
+ * The first line is a hidden marker. An automation that keeps ONE comment up
11
+ * to date finds its own comment by it, instead of adding a new one per push.
12
+ */
13
+ export declare const GATE_COMMENT_MARKER = "<!-- ora-study-gate -->";
14
+ /** The gate door's response, as far as the report reads it. */
15
+ export interface GateReportInput {
16
+ state: string;
17
+ owed: string[];
18
+ metric: {
19
+ key: string;
20
+ label: string;
21
+ family: string;
22
+ };
23
+ group: string;
24
+ /** `carriedRuns`: how many of the group's runs were carried from an earlier study of the series; absent = none. */
25
+ groups: {
26
+ key: string;
27
+ label: string;
28
+ value: number | null;
29
+ runs: number;
30
+ tasks: number;
31
+ interval: [number, number] | null;
32
+ carriedRuns?: number;
33
+ }[];
34
+ baseline: {
35
+ studyId: string;
36
+ name: string;
37
+ comparable: boolean;
38
+ differs: string[];
39
+ difference: {
40
+ effect: number;
41
+ unit: string;
42
+ interval: [number, number];
43
+ tasks: number;
44
+ } | null;
45
+ } | null;
46
+ gate: {
47
+ decision: string;
48
+ refusedBy: string | null;
49
+ reason: string;
50
+ rules: {
51
+ rule: string;
52
+ decision: string;
53
+ reason: string;
54
+ }[];
55
+ };
56
+ }
57
+ export interface GateReportContext {
58
+ /** The study's name, as its author wrote it. */
59
+ studyName: string;
60
+ /** A link to the study's page, when the caller knows the app's origin. */
61
+ studyUrl?: string;
62
+ }
63
+ export declare function gateReportMarkdown(result: GateReportInput, context: GateReportContext): string;
64
+ //# sourceMappingURL=gate-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-report.d.ts","sourceRoot":"","sources":["../../src/study-ci/gate-report.ts"],"names":[],"mappings":"AAAA;;;;;;;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CAAC;CACnI;AAED,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA8BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,GAAG,MAAM,CA6C9F"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * THE GATE'S REPORT, FOR PEOPLE — the markdown a CI job writes to its summary
3
+ * and to the pull request's one comment.
4
+ *
5
+ * IT PRINTS ONLY WHAT THE API ANSWERED. Every number and every sentence here
6
+ * comes from the gate door's response (`gate.reason` is composed by the
7
+ * service, from the figures it computed): this module chooses layout and
8
+ * never arithmetic, so a comment can never state a figure the study does not.
9
+ *
10
+ * The first line is a hidden marker. An automation that keeps ONE comment up
11
+ * to date finds its own comment by it, instead of adding a new one per push.
12
+ */
13
+ export const GATE_COMMENT_MARKER = "<!-- ora-study-gate -->";
14
+ /**
15
+ * The decision's word; a decision this version does not know is shown as the door wrote it. A function rather than
16
+ * an object keyed by decision: the release's credentials scan reads a `pass` key that holds a string as a hard-coded password (CWE-259), and a status word is not one.
17
+ */
18
+ function headlineOf(decision) {
19
+ switch (decision) {
20
+ case "pass":
21
+ return "Passed";
22
+ case "fail":
23
+ return "Failed";
24
+ case "undecided":
25
+ return "Undecided";
26
+ default:
27
+ return decision;
28
+ }
29
+ }
30
+ const value = (family, v) => v === null ? "not measured" : family === "rate" ? `${(v * 100).toFixed(1)}%` : `${v.toFixed(1)} of 100`;
31
+ const range = (family, interval) => interval === null ? "" : `${value(family, interval[0])} to ${value(family, interval[1])}`;
32
+ const signed = (effect, unit) => `${effect > 0 ? "+" : effect < 0 ? "-" : ""}${Math.abs(effect).toFixed(1)}${unit}`;
33
+ /** A markdown table cell: a pipe or a newline in a label must not break the row. */
34
+ const cell = (text) => text.replace(/\|/g, "\\|").replace(/\s*\n\s*/g, " ");
35
+ export function gateReportMarkdown(result, context) {
36
+ const { gate, metric } = result;
37
+ const title = context.studyUrl ? `[${cell(context.studyName)}](${context.studyUrl})` : cell(context.studyName);
38
+ const lines = [
39
+ GATE_COMMENT_MARKER,
40
+ `### ora study gate: ${headlineOf(gate.decision)}`,
41
+ "",
42
+ gate.reason,
43
+ "",
44
+ `Study: ${title}`,
45
+ "",
46
+ `| Group | ${cell(metric.label)} | 95% interval | Tasks | Runs |`,
47
+ "| --- | --- | --- | --- | --- |",
48
+ ...result.groups.map((g) => `| ${cell(g.label)}${g.key === result.group ? " (judged)" : ""} | ${value(metric.family, g.value)} | ${range(metric.family, g.interval)} | ${g.tasks} | ${g.runs} |`),
49
+ ];
50
+ // A group whose figures include runs of an earlier study says so: they were not run for this change.
51
+ const carried = result.groups.filter((g) => (g.carriedRuns ?? 0) > 0);
52
+ if (carried.length > 0) {
53
+ lines.push("", `Carried, not run again: ${carried.map((g) => `${g.carriedRuns} of ${cell(g.label)}'s runs`).join("; ")} (from an earlier study of this series).`);
54
+ }
55
+ if (result.baseline) {
56
+ const { baseline } = result;
57
+ lines.push("");
58
+ if (!baseline.comparable) {
59
+ lines.push(`Baseline: ${cell(baseline.name)}. Not comparable: it differs in ${baseline.differs.join(", ")}.`);
60
+ }
61
+ else if (baseline.difference) {
62
+ const d = baseline.difference;
63
+ lines.push(`Baseline: ${cell(baseline.name)}. Change: ${signed(d.effect, d.unit)} ` +
64
+ `(95% interval ${signed(d.interval[0], d.unit)} to ${signed(d.interval[1], d.unit)}, ${d.tasks} shared tasks).`);
65
+ }
66
+ else {
67
+ lines.push(`Baseline: ${cell(baseline.name)}. Too few shared tasks to compare.`);
68
+ }
69
+ }
70
+ if (result.state !== "settled")
71
+ lines.push("", `The study is not settled yet: it still owes ${result.owed.join(" and ")}.`);
72
+ if (gate.rules.length > 1) {
73
+ lines.push("", "<details><summary>Every rule that spoke</summary>", "");
74
+ for (const rule of gate.rules)
75
+ lines.push(`- \`${rule.rule}\`: ${rule.decision}. ${rule.reason}`);
76
+ lines.push("", "</details>");
77
+ }
78
+ return `${lines.join("\n")}\n`;
79
+ }
80
+ //# sourceMappingURL=gate-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate-report.js","sourceRoot":"","sources":["../../src/study-ci/gate-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AA2B7D;;;GAGG;AACH,SAAS,UAAU,CAAC,QAAgB;IAClC,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,QAAQ,CAAC;QAClB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC;AAED,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,CAAgB,EAAU,EAAE,CACzD,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AAE1G,MAAM,KAAK,GAAG,CAAC,MAAc,EAAE,QAAiC,EAAU,EAAE,CAC1E,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAE5F,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,IAAY,EAAU,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GA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CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,iBAAiB,CAClH,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,aAAa,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,+CAA+C,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5H,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,mDAAmD,EAAE,EAAE,CAAC,CAAC;QACxE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QAClG,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare class StudyParamError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ /** `["ref=abc", "build=https://…"]` as a map. The value may itself contain `=`. */
5
+ export declare function parseParams(pairs: readonly string[]): Map<string, string>;
6
+ /** The body with every `${name}` in every string filled in. Never mutates `body`. */
7
+ export declare function applyParams(body: unknown, params: ReadonlyMap<string, string>): unknown;
8
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/study-ci/params.ts"],"names":[],"mappings":"AAkBA,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzE;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CA8BvF"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * `--param name=value` — the values a study body file is filled with at run
3
+ * time: the commit under test, a build's URL, a branch name.
4
+ *
5
+ * A body file names a parameter as `${name}` inside any JSON STRING. The file
6
+ * stays valid JSON and reviewable in a pull request; the substitution is on
7
+ * parsed strings, never on the file's text, so a value can never change the
8
+ * body's structure (a quote or a brace in a branch name stays a character).
9
+ *
10
+ * STRICT BOTH WAYS, because a CI run that silently tested the wrong thing is
11
+ * worse than one that refused to start:
12
+ * - a placeholder with no `--param` is an error (the body would be sent with
13
+ * a literal `${ref}` in it);
14
+ * - a `--param` no placeholder uses is an error (a typo in either one would
15
+ * otherwise run the study without the value its author meant).
16
+ */
17
+ const PLACEHOLDER = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
18
+ export class StudyParamError extends Error {
19
+ constructor(message) {
20
+ super(message);
21
+ this.name = "StudyParamError";
22
+ }
23
+ }
24
+ /** `["ref=abc", "build=https://…"]` as a map. The value may itself contain `=`. */
25
+ export function parseParams(pairs) {
26
+ const params = new Map();
27
+ for (const pair of pairs) {
28
+ const at = pair.indexOf("=");
29
+ const name = at === -1 ? "" : pair.slice(0, at);
30
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
31
+ throw new StudyParamError(`--param takes name=value (got '${pair}'); a name is letters, digits and underscores`);
32
+ }
33
+ if (params.has(name))
34
+ throw new StudyParamError(`--param '${name}' is given twice`);
35
+ params.set(name, pair.slice(at + 1));
36
+ }
37
+ return params;
38
+ }
39
+ /** The body with every `${name}` in every string filled in. Never mutates `body`. */
40
+ export function applyParams(body, params) {
41
+ const used = new Set();
42
+ const missing = new Set();
43
+ const fill = (value) => {
44
+ if (typeof value === "string") {
45
+ return value.replace(PLACEHOLDER, (whole, name) => {
46
+ const replacement = params.get(name);
47
+ if (replacement === undefined) {
48
+ missing.add(name);
49
+ return whole;
50
+ }
51
+ used.add(name);
52
+ return replacement;
53
+ });
54
+ }
55
+ if (Array.isArray(value))
56
+ return value.map(fill);
57
+ if (value !== null && typeof value === "object") {
58
+ return Object.fromEntries(Object.entries(value).map(([key, inner]) => [key, fill(inner)]));
59
+ }
60
+ return value;
61
+ };
62
+ const filled = fill(body);
63
+ if (missing.size > 0) {
64
+ throw new StudyParamError(`the body names ${[...missing].sort().map((n) => `\${${n}}`).join(", ")} but no --param fills it`);
65
+ }
66
+ const unused = [...params.keys()].filter((name) => !used.has(name)).sort();
67
+ if (unused.length > 0) {
68
+ throw new StudyParamError(`--param ${unused.join(", ")} is not used by the body (it names no \${${unused[0]}})`);
69
+ }
70
+ return filled;
71
+ }
72
+ //# sourceMappingURL=params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.js","sourceRoot":"","sources":["../../src/study-ci/params.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,UAAU,WAAW,CAAC,KAAwB;IAClD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAA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- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "ora customer CLI — generated from the ora public API",
5
5
  "license": "MIT",
6
6
  "type": "module",