@operad-io/dev 0.1.1 → 0.3.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 +1 -1
- package/dev.schema.json +53 -31
- package/package.json +9 -6
- package/skills/git/SKILL.md +70 -0
- package/skills/setup/SKILL.md +74 -0
- package/src/access-grants.ts +59 -0
- package/src/actions.ts +81 -17
- package/src/announce.ts +134 -17
- package/src/chat.ts +586 -36
- package/src/check-host.ts +111 -0
- package/src/check-load.ts +67 -0
- package/src/check.ts +45 -22
- package/src/clock.ts +29 -0
- package/src/clone-chat.ts +32 -0
- package/src/commands.ts +103 -34
- package/src/create-actions.ts +210 -0
- package/src/flaky.ts +45 -29
- package/src/flow-compiler.ts +156 -69
- package/src/followups.ts +20 -22
- package/src/gate.ts +254 -88
- package/src/git-state.ts +155 -0
- package/src/git.ts +92 -4
- package/src/index.ts +52 -6
- package/src/integrate.ts +162 -62
- package/src/integration-queue.ts +23 -10
- package/src/lock.ts +101 -5
- package/src/mainclone.ts +61 -5
- package/src/model-error.ts +70 -0
- package/src/model.ts +61 -35
- package/src/notcode.ts +51 -15
- package/src/places.ts +2 -2
- package/src/prepare.ts +7 -2
- package/src/project-flows.ts +135 -4
- package/src/project-settings.ts +110 -3
- package/src/register-requests.ts +121 -0
- package/src/repository-key.ts +4 -0
- package/src/rerun.ts +23 -7
- package/src/retry.ts +2 -12
- package/src/rework.ts +8 -0
- package/src/schedule.ts +342 -93
- package/src/service.ts +241 -185
- package/src/settings.ts +409 -65
- package/src/setup-git.ts +366 -0
- package/src/standing.ts +23 -6
- package/src/step-edge.ts +22 -0
- package/src/steps.ts +945 -179
- package/src/throughput.ts +4 -21
- package/src/timeouts.ts +10 -2
- package/src/views.ts +325 -86
- package/src/waits.ts +59 -0
package/src/throughput.ts
CHANGED
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
foldObjectFacts,
|
|
11
|
-
|
|
11
|
+
formatElapsed,
|
|
12
12
|
type StoredObject,
|
|
13
13
|
type ViewContext,
|
|
14
14
|
} from "@operad-io/engine";
|
|
15
15
|
import {
|
|
16
|
+
allFactsOf,
|
|
16
17
|
listAll,
|
|
17
18
|
repositoryData,
|
|
18
19
|
taskData,
|
|
@@ -60,14 +61,6 @@ export function percentile(values: readonly number[], p: number): number {
|
|
|
60
61
|
return sorted[Math.min(sorted.length, rank) - 1] ?? 0;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
function duration(ms: number): string {
|
|
64
|
-
const total = Math.max(0, Math.round(ms / 1000));
|
|
65
|
-
if (total < 60) return `${total}s`;
|
|
66
|
-
const minutes = Math.round(total / 60);
|
|
67
|
-
if (minutes < 60) return `${minutes}m`;
|
|
68
|
-
return `${Math.floor(minutes / 60)}h${String(minutes % 60).padStart(2, "0")}m`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
64
|
function pad(value: number): string {
|
|
72
65
|
return String(value).padStart(2, "0");
|
|
73
66
|
}
|
|
@@ -156,17 +149,7 @@ async function readTask(
|
|
|
156
149
|
// Each attempt's cost, the latest recorded for it: a rework is paid for too.
|
|
157
150
|
const attemptCosts = new Map<number, number>();
|
|
158
151
|
const reasons = new Set<string>();
|
|
159
|
-
const facts
|
|
160
|
-
let cursor: string | undefined;
|
|
161
|
-
for (;;) {
|
|
162
|
-
const page = await ctx.store.facts(
|
|
163
|
-
{ type: object.type, id: object.id },
|
|
164
|
-
cursor === undefined ? {} : { cursor },
|
|
165
|
-
);
|
|
166
|
-
facts.push(...page.facts);
|
|
167
|
-
if (page.next === undefined) break;
|
|
168
|
-
cursor = page.next;
|
|
169
|
-
}
|
|
152
|
+
const facts = await allFactsOf(ctx.store, object);
|
|
170
153
|
for (const version of foldObjectFacts(facts)) {
|
|
171
154
|
const data = taskData(version.data);
|
|
172
155
|
const attempt = data.attempt;
|
|
@@ -309,7 +292,7 @@ export async function repositoryMetrics(
|
|
|
309
292
|
}
|
|
310
293
|
const stepRows = STEP_ROWS.map((step) => {
|
|
311
294
|
const values = timed.map((times) => times[step]);
|
|
312
|
-
return [step,
|
|
295
|
+
return [step, formatElapsed(percentile(values, 50)), formatElapsed(percentile(values, 90))];
|
|
313
296
|
});
|
|
314
297
|
const reworks = merged.map((task) => task.reworks);
|
|
315
298
|
const rounds = (value: number): string => String(value);
|
package/src/timeouts.ts
CHANGED
|
@@ -30,6 +30,14 @@ export function reviewWaitMs(retrySecs: number, n: number): number {
|
|
|
30
30
|
return Math.min(retrySecs * 2 ** doublings, cap) * 1000;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* The longest a model's `retry_after_secs` is waited out by dev. Past it, or
|
|
35
|
+
* on a usage limit, the task waits for a person: half an hour is as long as a
|
|
36
|
+
* review wait is allowed to last, and a longer wait is usually a quota period
|
|
37
|
+
* the owner must decide about (switch the worker or wait for the reset).
|
|
38
|
+
*/
|
|
39
|
+
export const MAX_MODEL_RETRY_SECS = 30 * 60;
|
|
40
|
+
|
|
33
41
|
/**
|
|
34
42
|
* How many times one review round may wait for an unavailable model before it
|
|
35
43
|
* waits for a person instead. It was 36 waits of a flat `retrySecs` (about 72
|
|
@@ -42,8 +50,8 @@ export const MAX_REVIEW_WAITS = 6;
|
|
|
42
50
|
|
|
43
51
|
/**
|
|
44
52
|
* How many times one attempt's work step may wait for an unavailable model
|
|
45
|
-
* before the failure goes to a person. The work wait
|
|
46
|
-
* `reviewer.retrySecs`.
|
|
53
|
+
* before the failure goes to a person. The work wait is the model's
|
|
54
|
+
* `retry_after_secs` when it gives one, else flat at `reviewer.retrySecs`.
|
|
47
55
|
*/
|
|
48
56
|
export const MAX_WORK_WAITS = 36;
|
|
49
57
|
|