@ashulab/carrier 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +265 -2
- package/dist/chat/claude.js +367 -0
- package/dist/chat/codex.js +375 -0
- package/dist/chat/config.js +61 -0
- package/dist/chat/db.js +9 -0
- package/dist/chat/fake.js +203 -0
- package/dist/chat/folder.js +56 -0
- package/dist/chat/git.js +27 -0
- package/dist/chat/group.js +28 -0
- package/dist/chat/health.js +49 -0
- package/dist/chat/host.js +123 -0
- package/dist/chat/idle.js +20 -0
- package/dist/chat/migrations/0000_lame_quasar.sql +15 -0
- package/dist/chat/migrations/0001_quiet_penance.sql +23 -0
- package/dist/chat/migrations/0002_slim_ezekiel_stane.sql +1 -0
- package/dist/chat/migrations/0003_naive_iron_lad.sql +5 -0
- package/dist/chat/migrations/0004_skinny_dakota_north.sql +1 -0
- package/dist/chat/migrations/0005_tidy_strong_guy.sql +1 -0
- package/dist/chat/migrations/meta/0000_snapshot.json +121 -0
- package/dist/chat/migrations/meta/0001_snapshot.json +277 -0
- package/dist/chat/migrations/meta/0002_snapshot.json +284 -0
- package/dist/chat/migrations/meta/0003_snapshot.json +320 -0
- package/dist/chat/migrations/meta/0004_snapshot.json +327 -0
- package/dist/chat/migrations/meta/0005_snapshot.json +334 -0
- package/dist/chat/migrations/meta/_journal.json +48 -0
- package/dist/chat/names.js +97 -0
- package/dist/chat/plan.js +21 -0
- package/dist/chat/projects.js +242 -0
- package/dist/chat/runner.js +6 -0
- package/dist/chat/schema.js +48 -0
- package/dist/chat/server.js +202 -0
- package/dist/chat/sessions.js +766 -0
- package/dist/chat/sweep.js +64 -0
- package/dist/chat/transcript.js +31 -0
- package/dist/chat/words.js +20 -0
- package/dist/chat/workspace.js +134 -0
- package/dist/chat/worktree.js +142 -0
- package/dist/config/default-path.js +7 -0
- package/dist/config/engine-places.js +9 -0
- package/dist/config/json-schema.js +15 -0
- package/dist/config/load.js +48 -0
- package/dist/config/resolve.js +41 -0
- package/dist/config/schema.js +225 -0
- package/dist/control/epic.js +219 -0
- package/dist/control/events.js +48 -0
- package/dist/control/files.js +262 -0
- package/dist/control/replies.js +1 -0
- package/dist/control/server.js +237 -0
- package/dist/control/sessions.js +68 -0
- package/dist/doctor/doctor.js +255 -0
- package/dist/doctor/fixes.js +35 -0
- package/dist/execution/agent-runner.js +1 -0
- package/dist/execution/caller-result.js +61 -0
- package/dist/execution/events.js +19 -0
- package/dist/execution/failure.js +3 -0
- package/dist/execution/fake.js +82 -0
- package/dist/execution/git-workspaces.js +136 -0
- package/dist/execution/import-result.js +23 -0
- package/dist/execution/workspaces.js +1 -0
- package/dist/format/duration.js +12 -0
- package/dist/harnesses/agy.js +131 -0
- package/dist/harnesses/claude.js +246 -0
- package/dist/harnesses/codex.js +118 -0
- package/dist/harnesses/common.js +59 -0
- package/dist/harnesses/credentials.js +38 -0
- package/dist/harnesses/host-runner.js +225 -0
- package/dist/harnesses/local.js +25 -0
- package/dist/harnesses/names.js +9 -0
- package/dist/harnesses/replay-events.js +57 -0
- package/dist/integrations/available-repos.js +29 -0
- package/dist/integrations/forge-cwd.js +27 -0
- package/dist/integrations/github-graphql.js +216 -0
- package/dist/integrations/github.js +231 -0
- package/dist/logging/logger.js +53 -0
- package/dist/logging/redact.js +21 -0
- package/dist/orchestration/blockers.js +25 -0
- package/dist/orchestration/changes-slices.js +5 -0
- package/dist/orchestration/clock.js +7 -0
- package/dist/orchestration/engine.js +1068 -0
- package/dist/orchestration/fake.js +152 -0
- package/dist/orchestration/final-pr.js +15 -0
- package/dist/orchestration/github.js +31 -0
- package/dist/orchestration/reserve.js +32 -0
- package/dist/orchestration/resume-refused.js +7 -0
- package/dist/orchestration/retention.js +145 -0
- package/dist/orchestration/retry.js +16 -0
- package/dist/prompts/build-prompt.js +13 -0
- package/dist/prompts/fix.js +21 -0
- package/dist/prompts/intro.js +21 -0
- package/dist/prompts/invoke.js +2 -0
- package/dist/prompts/persona.js +12 -0
- package/dist/prompts/result.js +32 -0
- package/dist/prompts/review.js +15 -0
- package/dist/prompts/ship.js +8 -0
- package/dist/status/snapshot.js +92 -0
- package/dist/status/types.js +1 -0
- package/dist/storage/caller-results.js +7 -0
- package/dist/storage/db.js +8 -0
- package/dist/storage/epic-review-threads.js +19 -0
- package/dist/storage/epic-slices.js +17 -0
- package/dist/storage/events.js +52 -0
- package/dist/storage/executions.js +31 -0
- package/dist/storage/lock.js +21 -0
- package/dist/storage/migrations/0000_nosy_demogoblin.sql +5 -0
- package/dist/storage/migrations/0001_worried_grey_gargoyle.sql +3 -0
- package/dist/storage/migrations/0002_tough_squirrel_girl.sql +5 -0
- package/dist/storage/migrations/0003_loose_maria_hill.sql +4 -0
- package/dist/storage/migrations/0004_long_cerise.sql +18 -0
- package/dist/storage/migrations/0005_review_result.sql +2 -0
- package/dist/storage/migrations/0006_melted_menace.sql +10 -0
- package/dist/storage/migrations/0007_powerful_bloodscream.sql +2 -0
- package/dist/storage/migrations/0008_panel_state.sql +4 -0
- package/dist/storage/migrations/0009_workable_tiger_shark.sql +5 -0
- package/dist/storage/migrations/0010_nasty_blue_marvel.sql +4 -0
- package/dist/storage/migrations/0011_steep_lila_cheney.sql +13 -0
- package/dist/storage/migrations/0012_talented_big_bertha.sql +1 -0
- package/dist/storage/migrations/0013_third_mulholland_black.sql +17 -0
- package/dist/storage/migrations/0014_perfect_marten_broadcloak.sql +20 -0
- package/dist/storage/migrations/0015_long_bloodaxe.sql +1 -0
- package/dist/storage/migrations/0016_neat_true_believers.sql +5 -0
- package/dist/storage/migrations/0017_previous_swarm.sql +6 -0
- package/dist/storage/migrations/0018_opposite_plazm.sql +2 -0
- package/dist/storage/migrations/0019_hesitant_triton.sql +3 -0
- package/dist/storage/migrations/meta/0000_snapshot.json +49 -0
- package/dist/storage/migrations/meta/0001_snapshot.json +74 -0
- package/dist/storage/migrations/meta/0002_snapshot.json +105 -0
- package/dist/storage/migrations/meta/0003_snapshot.json +134 -0
- package/dist/storage/migrations/meta/0004_snapshot.json +257 -0
- package/dist/storage/migrations/meta/0005_snapshot.json +271 -0
- package/dist/storage/migrations/meta/0006_snapshot.json +337 -0
- package/dist/storage/migrations/meta/0007_snapshot.json +351 -0
- package/dist/storage/migrations/meta/0008_snapshot.json +379 -0
- package/dist/storage/migrations/meta/0009_snapshot.json +414 -0
- package/dist/storage/migrations/meta/0010_snapshot.json +442 -0
- package/dist/storage/migrations/meta/0011_snapshot.json +531 -0
- package/dist/storage/migrations/meta/0012_snapshot.json +538 -0
- package/dist/storage/migrations/meta/0013_snapshot.json +655 -0
- package/dist/storage/migrations/meta/0014_snapshot.json +772 -0
- package/dist/storage/migrations/meta/0015_snapshot.json +779 -0
- package/dist/storage/migrations/meta/0016_snapshot.json +793 -0
- package/dist/storage/migrations/meta/0017_snapshot.json +835 -0
- package/dist/storage/migrations/meta/0018_snapshot.json +849 -0
- package/dist/storage/migrations/meta/0019_snapshot.json +870 -0
- package/dist/storage/migrations/meta/_journal.json +146 -0
- package/dist/storage/schema.js +43 -0
- package/dist/terminal/cli/args.js +91 -0
- package/dist/terminal/cli/cli-error.js +11 -0
- package/dist/terminal/cli/commands/chat-host.js +18 -0
- package/dist/terminal/cli/commands/chat.js +321 -0
- package/dist/terminal/cli/commands/control.js +46 -0
- package/dist/terminal/cli/commands/doctor.js +15 -0
- package/dist/terminal/cli/commands/init.js +43 -0
- package/dist/terminal/cli/commands/restart.js +92 -0
- package/dist/terminal/cli/commands/run.js +20 -0
- package/dist/terminal/cli/commands/schema.js +4 -0
- package/dist/terminal/cli/commands/start.js +21 -0
- package/dist/terminal/cli/commands/status.js +61 -0
- package/dist/terminal/cli/commands/watch.js +112 -0
- package/dist/terminal/cli/compose.js +163 -0
- package/dist/terminal/cli/config-file.js +24 -0
- package/dist/terminal/cli/control-client.js +94 -0
- package/dist/terminal/cli/detached.js +41 -0
- package/dist/terminal/cli/interrupt.js +39 -0
- package/dist/terminal/cli/main.js +85 -0
- package/dist/terminal/cli/open-url.js +9 -0
- package/dist/terminal/dashboard/dashboard.js +204 -0
- package/dist/terminal/dashboard/history.js +38 -0
- package/dist/terminal/dashboard/interactive.js +60 -0
- package/dist/terminal/dashboard/keys.js +22 -0
- package/dist/terminal/dashboard/logs.js +85 -0
- package/dist/terminal/dashboard/panel.js +62 -0
- package/dist/terminal/dashboard/plain.js +32 -0
- package/dist/terminal/dashboard/printable.js +2 -0
- package/dist/terminal/dashboard/ui-state.js +110 -0
- package/dist/terminal/prompts/clack.js +121 -0
- package/dist/terminal/prompts/types.js +3 -0
- package/dist/terminal/wizard/build-config.js +66 -0
- package/dist/terminal/wizard/deps.js +94 -0
- package/dist/terminal/wizard/flags.js +1 -0
- package/dist/terminal/wizard/forge-registry.js +23 -0
- package/dist/terminal/wizard/prior.js +20 -0
- package/dist/terminal/wizard/questions/agent.js +61 -0
- package/dist/terminal/wizard/questions/identities.js +28 -0
- package/dist/terminal/wizard/questions/identity.js +30 -0
- package/dist/terminal/wizard/questions/options.js +93 -0
- package/dist/terminal/wizard/questions/out.js +16 -0
- package/dist/terminal/wizard/questions/persona.js +47 -0
- package/dist/terminal/wizard/questions/repos.js +61 -0
- package/dist/terminal/wizard/summary.js +31 -0
- package/dist/terminal/wizard/testing.js +106 -0
- package/dist/terminal/wizard/wizard.js +172 -0
- package/package.json +46 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Database from 'better-sqlite3';
|
|
2
|
+
import { drizzle } from 'drizzle-orm/better-sqlite3';
|
|
3
|
+
import { migrate } from 'drizzle-orm/better-sqlite3/migrator';
|
|
4
|
+
export function openDatabase(file) {
|
|
5
|
+
const db = drizzle(new Database(file));
|
|
6
|
+
migrate(db, { migrationsFolder: `${import.meta.dirname}/migrations` });
|
|
7
|
+
return db;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { integer, primaryKey, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
// A cache of what GitHub said about the final pull request's review threads the last time the poll asked (ADR 0008). Never read to decide anything.
|
|
3
|
+
export const epicReviewThreads = sqliteTable('epic_review_threads', {
|
|
4
|
+
epicId: integer().notNull(),
|
|
5
|
+
id: text().notNull(), // GraphQL node id
|
|
6
|
+
position: integer().notNull(), // GitHub's order
|
|
7
|
+
path: text().notNull(),
|
|
8
|
+
line: integer(),
|
|
9
|
+
resolved: integer({ mode: 'boolean' }).notNull(),
|
|
10
|
+
outdated: integer({ mode: 'boolean' }).notNull(),
|
|
11
|
+
author: text(),
|
|
12
|
+
bot: integer({ mode: 'boolean' }).notNull(),
|
|
13
|
+
firstLine: text().notNull(),
|
|
14
|
+
commentCount: integer().notNull(),
|
|
15
|
+
url: text().notNull(),
|
|
16
|
+
readAt: integer().notNull(), // ms since epoch
|
|
17
|
+
// Only the first hundred threads are read; the same on every row of an epic, like epic_slices.
|
|
18
|
+
truncated: integer({ mode: 'boolean' }).notNull().default(false),
|
|
19
|
+
}, (table) => [primaryKey({ columns: [table.epicId, table.id] })]);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { integer, primaryKey, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
// A cache of what GitHub said about an epic's slices the last time the poll asked (ADR 0008). Never read to decide anything.
|
|
3
|
+
export const epicSlices = sqliteTable('epic_slices', {
|
|
4
|
+
epicId: integer().notNull(),
|
|
5
|
+
number: integer().notNull(),
|
|
6
|
+
title: text().notNull(),
|
|
7
|
+
state: text({ enum: ['closed', 'skipped', 'in_progress', 'waiting', 'ready'] }).notNull(),
|
|
8
|
+
blockedBy: text({ mode: 'json' }).$type().notNull(), // the numbers of the blockers still open
|
|
9
|
+
assignee: text(),
|
|
10
|
+
prNumber: integer(),
|
|
11
|
+
prState: text({ enum: ['open', 'draft', 'merged', 'closed'] }),
|
|
12
|
+
prMergedAt: integer(), // ms since epoch
|
|
13
|
+
closedAt: integer(), // ms since epoch
|
|
14
|
+
readAt: integer().notNull(), // ms since epoch
|
|
15
|
+
// Only the first hundred slices are read; the same on every row of an epic. ponytail: per row, a column of its own if more flags ever join it.
|
|
16
|
+
truncated: integer({ mode: 'boolean' }).notNull().default(false),
|
|
17
|
+
}, (table) => [primaryKey({ columns: [table.epicId, table.number] })]);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { index, integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import { executions } from './executions.js';
|
|
3
|
+
import { epics } from './schema.js';
|
|
4
|
+
// Append-only history of what the engine did to an epic; the autoincrement id keeps the order.
|
|
5
|
+
export const epicEvents = sqliteTable('epic_events', {
|
|
6
|
+
id: integer().primaryKey({ autoIncrement: true }),
|
|
7
|
+
epicId: integer().notNull().references(() => epics.id),
|
|
8
|
+
at: integer().notNull(), // ms since epoch
|
|
9
|
+
type: text().notNull(),
|
|
10
|
+
data: text({ mode: 'json' }).$type().notNull(),
|
|
11
|
+
});
|
|
12
|
+
// What an agent did during an execution (ADR 0006), already bounded and redacted. The id is the cursor of the `events` request.
|
|
13
|
+
// A tool call is two rows with the same callId. Deleted with the logs, 30 days after the epic ends.
|
|
14
|
+
export const executionEvents = sqliteTable('execution_events', {
|
|
15
|
+
id: integer().primaryKey({ autoIncrement: true }),
|
|
16
|
+
executionId: text().notNull().references(() => executions.executionId),
|
|
17
|
+
at: integer().notNull(), // ms since epoch: the line's own time, else when it arrived
|
|
18
|
+
kind: text({ enum: ['say', 'tool_start', 'tool_end', 'note', 'error', 'task'] }).notNull(),
|
|
19
|
+
callId: text(),
|
|
20
|
+
agentId: text(), // the Claude subagent that did it
|
|
21
|
+
tool: text(),
|
|
22
|
+
arg: text(),
|
|
23
|
+
summary: text(),
|
|
24
|
+
status: text({ enum: ['ok', 'err'] }),
|
|
25
|
+
durationMs: integer(),
|
|
26
|
+
payload: text({ mode: 'json' }).$type(), // the text of a message, a command's output, a diff, the slice and lane hints
|
|
27
|
+
}, (table) => [index('execution_events_execution').on(table.executionId, table.id)]);
|
|
28
|
+
/** Stores the events of one output chunk in a single transaction; `arrival` is the time of those without their own. */
|
|
29
|
+
export function recordEvents(db, executionId, events, arrival) {
|
|
30
|
+
if (events.length === 0)
|
|
31
|
+
return;
|
|
32
|
+
db.transaction((tx) => {
|
|
33
|
+
for (const { at, kind, callId, agentId, tool, arg, summary, status, durationMs, ...rest } of events) {
|
|
34
|
+
const payload = Object.fromEntries(Object.entries(rest).filter(([, value]) => value !== undefined));
|
|
35
|
+
tx.insert(executionEvents)
|
|
36
|
+
.values({
|
|
37
|
+
executionId,
|
|
38
|
+
at: at ?? arrival,
|
|
39
|
+
kind,
|
|
40
|
+
callId: callId ?? null,
|
|
41
|
+
agentId: agentId ?? null,
|
|
42
|
+
tool: tool ?? null,
|
|
43
|
+
arg: arg ?? null,
|
|
44
|
+
summary: summary ?? null,
|
|
45
|
+
status: status ?? null,
|
|
46
|
+
durationMs: durationMs ?? null,
|
|
47
|
+
payload: Object.keys(payload).length > 0 ? payload : null,
|
|
48
|
+
})
|
|
49
|
+
.run();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { integer, real, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import { epics } from './schema.js';
|
|
3
|
+
export const executionStates = ['running', 'finished', 'failed', 'timed_out', 'interrupted', 'invalid_result'];
|
|
4
|
+
export const failureKinds = ['usage_limit', 'api_error', 'killed', 'crashed', 'spawn_error', 'auth', 'session_lost', 'timeout', 'invalid_result', 'unknown'];
|
|
5
|
+
export const executions = sqliteTable('executions', {
|
|
6
|
+
executionId: text().primaryKey(),
|
|
7
|
+
epicId: integer().notNull().references(() => epics.id),
|
|
8
|
+
stage: text({ enum: ['ship', 'review', 'fix'] }).notNull(),
|
|
9
|
+
status: text({ enum: executionStates }).notNull().default('running'),
|
|
10
|
+
sessionId: text(), // saved as soon as the runner reports it, not when it ends
|
|
11
|
+
// Why a technical failure ended it; set only for the ones the engine retries or stops for a person (auth_failed).
|
|
12
|
+
error: text(),
|
|
13
|
+
// Why it ended badly (glossary: Failure kind); all null on an execution that ended ok, that Carrier stopped, or that predates them.
|
|
14
|
+
failureKind: text({ enum: failureKinds }),
|
|
15
|
+
failureDetail: text(),
|
|
16
|
+
exitCode: integer(),
|
|
17
|
+
signal: text(),
|
|
18
|
+
hostFreeMemMb: integer(), // only for killed, crashed and unknown
|
|
19
|
+
hostLoad: real(), // one-minute load average, same cases
|
|
20
|
+
// The agent and the folder this execution ran with, written when the row is inserted; null on rows from before they were recorded.
|
|
21
|
+
harness: text(),
|
|
22
|
+
model: text(),
|
|
23
|
+
provider: text(),
|
|
24
|
+
option: text(), // the agent option the role ran on
|
|
25
|
+
configDir: text(), // that option's config folder, absolute; null when it had none
|
|
26
|
+
workspace: text(), // the cwd of the session: what resuming it needs
|
|
27
|
+
round: integer(), // the review round, null for ship
|
|
28
|
+
resultPath: text().notNull(),
|
|
29
|
+
startedAt: integer().notNull(),
|
|
30
|
+
finishedAt: integer(),
|
|
31
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { chmodSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import Database from 'better-sqlite3';
|
|
4
|
+
// The lock is an exclusive SQLite transaction on a file in the engine's state folder, held for the life of
|
|
5
|
+
// the process. The OS drops it when the process dies, so a crash never leaves it stuck.
|
|
6
|
+
export function acquireLock(stateDir) {
|
|
7
|
+
mkdirSync(stateDir, { recursive: true });
|
|
8
|
+
chmodSync(stateDir, 0o700); // the database, the control socket and the lock in here are for the user only, also when the folder already existed with a looser mode
|
|
9
|
+
// timeout 0: no waiting, a held lock fails immediately with SQLITE_BUSY.
|
|
10
|
+
const db = new Database(join(stateDir, 'carrier.lock'), { timeout: 0 });
|
|
11
|
+
try {
|
|
12
|
+
db.exec('BEGIN EXCLUSIVE');
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
db.close();
|
|
16
|
+
if (error instanceof Error && 'code' in error && error.code === 'SQLITE_BUSY')
|
|
17
|
+
return { ok: false };
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
return { ok: true, release: () => db.close() };
|
|
21
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
ALTER TABLE `epics` ADD `startedAt` integer;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE `epics` ADD `config` text;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE `epics` ADD `cancelReason` text;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE `epics` ADD `labelPending` integer DEFAULT false NOT NULL;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
CREATE TABLE `executions` (
|
|
2
|
+
`executionId` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`epicId` integer NOT NULL,
|
|
4
|
+
`stage` text NOT NULL,
|
|
5
|
+
`status` text DEFAULT 'running' NOT NULL,
|
|
6
|
+
`sessionId` text,
|
|
7
|
+
`resultPath` text NOT NULL,
|
|
8
|
+
`startedAt` integer NOT NULL,
|
|
9
|
+
`finishedAt` integer,
|
|
10
|
+
FOREIGN KEY (`epicId`) REFERENCES `epics`(`id`) ON UPDATE no action ON DELETE no action
|
|
11
|
+
);
|
|
12
|
+
--> statement-breakpoint
|
|
13
|
+
ALTER TABLE `epics` ADD `stage` text;--> statement-breakpoint
|
|
14
|
+
ALTER TABLE `epics` ADD `round` integer;--> statement-breakpoint
|
|
15
|
+
ALTER TABLE `epics` ADD `prNumber` integer;--> statement-breakpoint
|
|
16
|
+
ALTER TABLE `epics` ADD `prHeadSha` text;--> statement-breakpoint
|
|
17
|
+
ALTER TABLE `epics` ADD `needsHumanReason` text;--> statement-breakpoint
|
|
18
|
+
ALTER TABLE `epics` ADD `finishedAt` integer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
CREATE TABLE `epic_events` (
|
|
2
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
3
|
+
`epicId` integer NOT NULL,
|
|
4
|
+
`at` integer NOT NULL,
|
|
5
|
+
`type` text NOT NULL,
|
|
6
|
+
`data` text NOT NULL,
|
|
7
|
+
FOREIGN KEY (`epicId`) REFERENCES `epics`(`id`) ON UPDATE no action ON DELETE no action
|
|
8
|
+
);
|
|
9
|
+
--> statement-breakpoint
|
|
10
|
+
ALTER TABLE `executions` ADD `error` text;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE `executions` ADD `harness` text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE `executions` ADD `model` text;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE `executions` ADD `provider` text;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE `executions` ADD `workspace` text;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE `executions` ADD `round` integer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
CREATE TABLE `epic_slices` (
|
|
2
|
+
`epicId` integer NOT NULL,
|
|
3
|
+
`number` integer NOT NULL,
|
|
4
|
+
`title` text NOT NULL,
|
|
5
|
+
`state` text NOT NULL,
|
|
6
|
+
`blockedBy` text NOT NULL,
|
|
7
|
+
`assignee` text,
|
|
8
|
+
`prNumber` integer,
|
|
9
|
+
`closedAt` integer,
|
|
10
|
+
`readAt` integer NOT NULL,
|
|
11
|
+
`truncated` integer DEFAULT false NOT NULL,
|
|
12
|
+
PRIMARY KEY(`epicId`, `number`)
|
|
13
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `epics` ADD `pr` text;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
CREATE TABLE `execution_events` (
|
|
2
|
+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
3
|
+
`executionId` text NOT NULL,
|
|
4
|
+
`at` integer NOT NULL,
|
|
5
|
+
`kind` text NOT NULL,
|
|
6
|
+
`callId` text,
|
|
7
|
+
`agentId` text,
|
|
8
|
+
`tool` text,
|
|
9
|
+
`arg` text,
|
|
10
|
+
`summary` text,
|
|
11
|
+
`status` text,
|
|
12
|
+
`durationMs` integer,
|
|
13
|
+
`payload` text,
|
|
14
|
+
FOREIGN KEY (`executionId`) REFERENCES `executions`(`executionId`) ON UPDATE no action ON DELETE no action
|
|
15
|
+
);
|
|
16
|
+
--> statement-breakpoint
|
|
17
|
+
CREATE INDEX `execution_events_execution` ON `execution_events` (`executionId`,`id`);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
CREATE TABLE `epic_review_threads` (
|
|
2
|
+
`epicId` integer NOT NULL,
|
|
3
|
+
`id` text NOT NULL,
|
|
4
|
+
`position` integer NOT NULL,
|
|
5
|
+
`path` text NOT NULL,
|
|
6
|
+
`line` integer,
|
|
7
|
+
`resolved` integer NOT NULL,
|
|
8
|
+
`outdated` integer NOT NULL,
|
|
9
|
+
`author` text,
|
|
10
|
+
`bot` integer NOT NULL,
|
|
11
|
+
`firstLine` text NOT NULL,
|
|
12
|
+
`commentCount` integer NOT NULL,
|
|
13
|
+
`url` text NOT NULL,
|
|
14
|
+
`readAt` integer NOT NULL,
|
|
15
|
+
`truncated` integer DEFAULT false NOT NULL,
|
|
16
|
+
PRIMARY KEY(`epicId`, `id`)
|
|
17
|
+
);
|
|
18
|
+
--> statement-breakpoint
|
|
19
|
+
-- The cached pull request blocks of finished epics predate the threads: clear them so the next poll reads block and threads once (a cache of GitHub, nothing decides from it).
|
|
20
|
+
UPDATE `epics` SET `pr` = NULL WHERE `status` IN ('merged', 'cancelled');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `epics` ADD `observationsPassAt` integer;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
ALTER TABLE `epic_slices` ADD `prState` text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE `epic_slices` ADD `prMergedAt` integer;
|
|
3
|
+
--> statement-breakpoint
|
|
4
|
+
-- The cached slices predate the own-pull-request rule (some linked a sibling's or the final PR): clear them so the next poll reads them again (a cache of GitHub, nothing decides from it).
|
|
5
|
+
DELETE FROM `epic_slices`;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ALTER TABLE `executions` ADD `failureKind` text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE `executions` ADD `failureDetail` text;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE `executions` ADD `exitCode` integer;--> statement-breakpoint
|
|
4
|
+
ALTER TABLE `executions` ADD `signal` text;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE `executions` ADD `hostFreeMemMb` integer;--> statement-breakpoint
|
|
6
|
+
ALTER TABLE `executions` ADD `hostLoad` real;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "19a61b42-1053-4c64-9523-b6e8e8f69dd3",
|
|
5
|
+
"prevId": "00000000-0000-0000-0000-000000000000",
|
|
6
|
+
"tables": {
|
|
7
|
+
"epics": {
|
|
8
|
+
"name": "epics",
|
|
9
|
+
"columns": {
|
|
10
|
+
"id": {
|
|
11
|
+
"name": "id",
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": true
|
|
16
|
+
},
|
|
17
|
+
"repo": {
|
|
18
|
+
"name": "repo",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"issue": {
|
|
25
|
+
"name": "issue",
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"indexes": {},
|
|
33
|
+
"foreignKeys": {},
|
|
34
|
+
"compositePrimaryKeys": {},
|
|
35
|
+
"uniqueConstraints": {},
|
|
36
|
+
"checkConstraints": {}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"views": {},
|
|
40
|
+
"enums": {},
|
|
41
|
+
"_meta": {
|
|
42
|
+
"schemas": {},
|
|
43
|
+
"tables": {},
|
|
44
|
+
"columns": {}
|
|
45
|
+
},
|
|
46
|
+
"internal": {
|
|
47
|
+
"indexes": {}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "e7f9ace3-49db-4427-8845-2ac122e12331",
|
|
5
|
+
"prevId": "19a61b42-1053-4c64-9523-b6e8e8f69dd3",
|
|
6
|
+
"tables": {
|
|
7
|
+
"epics": {
|
|
8
|
+
"name": "epics",
|
|
9
|
+
"columns": {
|
|
10
|
+
"id": {
|
|
11
|
+
"name": "id",
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": true
|
|
16
|
+
},
|
|
17
|
+
"repo": {
|
|
18
|
+
"name": "repo",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"issue": {
|
|
25
|
+
"name": "issue",
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
},
|
|
31
|
+
"status": {
|
|
32
|
+
"name": "status",
|
|
33
|
+
"type": "text",
|
|
34
|
+
"primaryKey": false,
|
|
35
|
+
"notNull": true,
|
|
36
|
+
"autoincrement": false,
|
|
37
|
+
"default": "'queued'"
|
|
38
|
+
},
|
|
39
|
+
"queuedAt": {
|
|
40
|
+
"name": "queuedAt",
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"primaryKey": false,
|
|
43
|
+
"notNull": true,
|
|
44
|
+
"autoincrement": false,
|
|
45
|
+
"default": 0
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"indexes": {
|
|
49
|
+
"epics_repo_issue": {
|
|
50
|
+
"name": "epics_repo_issue",
|
|
51
|
+
"columns": [
|
|
52
|
+
"repo",
|
|
53
|
+
"issue"
|
|
54
|
+
],
|
|
55
|
+
"isUnique": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"foreignKeys": {},
|
|
59
|
+
"compositePrimaryKeys": {},
|
|
60
|
+
"uniqueConstraints": {},
|
|
61
|
+
"checkConstraints": {}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"views": {},
|
|
65
|
+
"enums": {},
|
|
66
|
+
"_meta": {
|
|
67
|
+
"schemas": {},
|
|
68
|
+
"tables": {},
|
|
69
|
+
"columns": {}
|
|
70
|
+
},
|
|
71
|
+
"internal": {
|
|
72
|
+
"indexes": {}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "29475005-f7df-4081-90f2-9bc2ed9c809e",
|
|
5
|
+
"prevId": "e7f9ace3-49db-4427-8845-2ac122e12331",
|
|
6
|
+
"tables": {
|
|
7
|
+
"epics": {
|
|
8
|
+
"name": "epics",
|
|
9
|
+
"columns": {
|
|
10
|
+
"id": {
|
|
11
|
+
"name": "id",
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": true
|
|
16
|
+
},
|
|
17
|
+
"repo": {
|
|
18
|
+
"name": "repo",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"issue": {
|
|
25
|
+
"name": "issue",
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
},
|
|
31
|
+
"status": {
|
|
32
|
+
"name": "status",
|
|
33
|
+
"type": "text",
|
|
34
|
+
"primaryKey": false,
|
|
35
|
+
"notNull": true,
|
|
36
|
+
"autoincrement": false,
|
|
37
|
+
"default": "'queued'"
|
|
38
|
+
},
|
|
39
|
+
"queuedAt": {
|
|
40
|
+
"name": "queuedAt",
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"primaryKey": false,
|
|
43
|
+
"notNull": true,
|
|
44
|
+
"autoincrement": false,
|
|
45
|
+
"default": 0
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"indexes": {
|
|
49
|
+
"epics_repo_issue": {
|
|
50
|
+
"name": "epics_repo_issue",
|
|
51
|
+
"columns": [
|
|
52
|
+
"repo",
|
|
53
|
+
"issue"
|
|
54
|
+
],
|
|
55
|
+
"isUnique": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"foreignKeys": {},
|
|
59
|
+
"compositePrimaryKeys": {},
|
|
60
|
+
"uniqueConstraints": {},
|
|
61
|
+
"checkConstraints": {}
|
|
62
|
+
},
|
|
63
|
+
"caller_results": {
|
|
64
|
+
"name": "caller_results",
|
|
65
|
+
"columns": {
|
|
66
|
+
"executionId": {
|
|
67
|
+
"name": "executionId",
|
|
68
|
+
"type": "text",
|
|
69
|
+
"primaryKey": true,
|
|
70
|
+
"notNull": true,
|
|
71
|
+
"autoincrement": false
|
|
72
|
+
},
|
|
73
|
+
"outcome": {
|
|
74
|
+
"name": "outcome",
|
|
75
|
+
"type": "text",
|
|
76
|
+
"primaryKey": false,
|
|
77
|
+
"notNull": true,
|
|
78
|
+
"autoincrement": false
|
|
79
|
+
},
|
|
80
|
+
"result": {
|
|
81
|
+
"name": "result",
|
|
82
|
+
"type": "text",
|
|
83
|
+
"primaryKey": false,
|
|
84
|
+
"notNull": true,
|
|
85
|
+
"autoincrement": false
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"indexes": {},
|
|
89
|
+
"foreignKeys": {},
|
|
90
|
+
"compositePrimaryKeys": {},
|
|
91
|
+
"uniqueConstraints": {},
|
|
92
|
+
"checkConstraints": {}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"views": {},
|
|
96
|
+
"enums": {},
|
|
97
|
+
"_meta": {
|
|
98
|
+
"schemas": {},
|
|
99
|
+
"tables": {},
|
|
100
|
+
"columns": {}
|
|
101
|
+
},
|
|
102
|
+
"internal": {
|
|
103
|
+
"indexes": {}
|
|
104
|
+
}
|
|
105
|
+
}
|