@mastra/factory 0.8.0-alpha.9 → 0.8.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/CHANGELOG.md +630 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +41 -3
- package/dist/factory.js.map +1 -1
- package/dist/integrations/base.d.ts +8 -0
- package/dist/integrations/base.d.ts.map +1 -1
- package/dist/integrations/github/app-identity.d.ts +43 -0
- package/dist/integrations/github/app-identity.d.ts.map +1 -0
- package/dist/integrations/github/app-identity.js +62 -0
- package/dist/integrations/github/app-identity.js.map +1 -0
- package/dist/integrations/github/integration.d.ts.map +1 -1
- package/dist/integrations/github/integration.js +3 -1
- package/dist/integrations/github/integration.js.map +1 -1
- package/dist/integrations/github/reconcile-worker.d.ts +5 -0
- package/dist/integrations/github/reconcile-worker.d.ts.map +1 -1
- package/dist/integrations/github/reconcile-worker.js +7 -0
- package/dist/integrations/github/reconcile-worker.js.map +1 -1
- package/dist/integrations/github/routes.d.ts.map +1 -1
- package/dist/integrations/github/routes.js +11 -6
- package/dist/integrations/github/routes.js.map +1 -1
- package/dist/integrations/github/rules.d.ts +8 -0
- package/dist/integrations/github/rules.d.ts.map +1 -1
- package/dist/integrations/github/rules.js +30 -8
- package/dist/integrations/github/rules.js.map +1 -1
- package/dist/integrations/github/sandbox.d.ts +39 -6
- package/dist/integrations/github/sandbox.d.ts.map +1 -1
- package/dist/integrations/github/sandbox.js +48 -14
- package/dist/integrations/github/sandbox.js.map +1 -1
- package/dist/integrations/github/webhook.d.ts +20 -0
- package/dist/integrations/github/webhook.d.ts.map +1 -1
- package/dist/integrations/github/webhook.js +32 -5
- package/dist/integrations/github/webhook.js.map +1 -1
- package/dist/integrations/linear/rules.d.ts.map +1 -1
- package/dist/integrations/linear/rules.js +2 -1
- package/dist/integrations/linear/rules.js.map +1 -1
- package/dist/integrations/platform/github/event-worker.d.ts +11 -0
- package/dist/integrations/platform/github/event-worker.d.ts.map +1 -1
- package/dist/integrations/platform/github/event-worker.js +53 -14
- package/dist/integrations/platform/github/event-worker.js.map +1 -1
- package/dist/integrations/platform/github/integration.d.ts +7 -0
- package/dist/integrations/platform/github/integration.d.ts.map +1 -1
- package/dist/integrations/platform/github/integration.js +40 -4
- package/dist/integrations/platform/github/integration.js.map +1 -1
- package/dist/integrations/slack/slack.d.ts.map +1 -1
- package/dist/integrations/slack/slack.js +2 -1
- package/dist/integrations/slack/slack.js.map +1 -1
- package/dist/routes/config.d.ts +12 -6
- package/dist/routes/config.d.ts.map +1 -1
- package/dist/routes/config.js +97 -56
- package/dist/routes/config.js.map +1 -1
- package/dist/routes/knowledge.d.ts +152 -0
- package/dist/routes/knowledge.d.ts.map +1 -0
- package/dist/routes/knowledge.js +442 -0
- package/dist/routes/knowledge.js.map +1 -0
- package/dist/routes/projects.d.ts +9 -1
- package/dist/routes/projects.d.ts.map +1 -1
- package/dist/routes/projects.js +8 -0
- package/dist/routes/projects.js.map +1 -1
- package/dist/routes/surface.d.ts +6 -0
- package/dist/routes/surface.d.ts.map +1 -1
- package/dist/routes/surface.js +9 -0
- package/dist/routes/surface.js.map +1 -1
- package/dist/routes/work-items.d.ts.map +1 -1
- package/dist/routes/work-items.js +3 -1
- package/dist/routes/work-items.js.map +1 -1
- package/dist/rules/binding-context.d.ts.map +1 -1
- package/dist/rules/binding-context.js +4 -1
- package/dist/rules/binding-context.js.map +1 -1
- package/dist/rules/defaults.d.ts.map +1 -1
- package/dist/rules/defaults.js +87 -4
- package/dist/rules/defaults.js.map +1 -1
- package/dist/rules/dispatcher.d.ts +6 -0
- package/dist/rules/dispatcher.d.ts.map +1 -1
- package/dist/rules/dispatcher.js +118 -16
- package/dist/rules/dispatcher.js.map +1 -1
- package/dist/rules/processor.d.ts.map +1 -1
- package/dist/rules/processor.js +20 -7
- package/dist/rules/processor.js.map +1 -1
- package/dist/rules/resolve.d.ts +1 -0
- package/dist/rules/resolve.d.ts.map +1 -1
- package/dist/rules/resolve.js +3 -2
- package/dist/rules/resolve.js.map +1 -1
- package/dist/rules/start-coordinator.d.ts +2 -0
- package/dist/rules/start-coordinator.d.ts.map +1 -1
- package/dist/rules/start-coordinator.js +3 -1
- package/dist/rules/start-coordinator.js.map +1 -1
- package/dist/rules/terminal-cleanup.d.ts +23 -0
- package/dist/rules/terminal-cleanup.d.ts.map +1 -0
- package/dist/rules/terminal-cleanup.js +43 -0
- package/dist/rules/terminal-cleanup.js.map +1 -0
- package/dist/rules/tools.d.ts.map +1 -1
- package/dist/rules/tools.js +24 -2
- package/dist/rules/tools.js.map +1 -1
- package/dist/rules/transition-service.d.ts +3 -0
- package/dist/rules/transition-service.d.ts.map +1 -1
- package/dist/rules/transition-service.js +10 -6
- package/dist/rules/transition-service.js.map +1 -1
- package/dist/rules/types.d.ts +32 -3
- package/dist/rules/types.d.ts.map +1 -1
- package/dist/rules/types.js +2 -0
- package/dist/rules/types.js.map +1 -1
- package/dist/rules/validation.d.ts.map +1 -1
- package/dist/rules/validation.js +8 -3
- package/dist/rules/validation.js.map +1 -1
- package/dist/sandbox/base-checkpoint-triggers.d.ts +77 -0
- package/dist/sandbox/base-checkpoint-triggers.d.ts.map +1 -0
- package/dist/sandbox/base-checkpoint-triggers.js +137 -0
- package/dist/sandbox/base-checkpoint-triggers.js.map +1 -0
- package/dist/sandbox/base-checkpoint.d.ts +59 -0
- package/dist/sandbox/base-checkpoint.d.ts.map +1 -0
- package/dist/sandbox/base-checkpoint.js +145 -0
- package/dist/sandbox/base-checkpoint.js.map +1 -0
- package/dist/sandbox/fleet.d.ts +32 -0
- package/dist/sandbox/fleet.d.ts.map +1 -1
- package/dist/sandbox/fleet.js +39 -10
- package/dist/sandbox/fleet.js.map +1 -1
- package/dist/session/checkpoint-capture.d.ts +3 -2
- package/dist/session/checkpoint-capture.d.ts.map +1 -1
- package/dist/session/checkpoint-capture.js +3 -3
- package/dist/session/checkpoint-capture.js.map +1 -1
- package/dist/session/factory-session.d.ts.map +1 -1
- package/dist/session/factory-session.js +2 -1
- package/dist/session/factory-session.js.map +1 -1
- package/dist/session/model-pack-hydration.d.ts +55 -0
- package/dist/session/model-pack-hydration.d.ts.map +1 -0
- package/dist/session/model-pack-hydration.js +56 -0
- package/dist/session/model-pack-hydration.js.map +1 -0
- package/dist/skills/service.d.ts +9 -0
- package/dist/skills/service.d.ts.map +1 -1
- package/dist/skills/service.js +10 -1
- package/dist/skills/service.js.map +1 -1
- package/dist/storage/domains/model-packs/base.d.ts +26 -0
- package/dist/storage/domains/model-packs/base.d.ts.map +1 -1
- package/dist/storage/domains/model-packs/base.js +102 -13
- package/dist/storage/domains/model-packs/base.js.map +1 -1
- package/dist/storage/domains/source-control/base.d.ts +47 -1
- package/dist/storage/domains/source-control/base.d.ts.map +1 -1
- package/dist/storage/domains/source-control/base.js +78 -19
- package/dist/storage/domains/source-control/base.js.map +1 -1
- package/dist/storage/domains/source-control/inmemory.d.ts +11 -3
- package/dist/storage/domains/source-control/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/source-control/inmemory.js +10 -1
- package/dist/storage/domains/source-control/inmemory.js.map +1 -1
- package/dist/storage/domains/work-items/base.d.ts +67 -1
- package/dist/storage/domains/work-items/base.d.ts.map +1 -1
- package/dist/storage/domains/work-items/base.js +140 -12
- package/dist/storage/domains/work-items/base.js.map +1 -1
- package/dist/workspace.d.ts +31 -2
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +225 -54
- package/dist/workspace.js.map +1 -1
- package/factory-skills/factory-plan/SKILL.md +1 -1
- package/factory-skills/factory-rereview/SKILL.md +3 -3
- package/factory-skills/factory-review/SKILL.md +3 -3
- package/factory-skills/factory-triage/SKILL.md +2 -0
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inmemory.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/source-control/inmemory.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,+BAA+B,EAC/B,yCAAyC,EACzC,+BAA+B,E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EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE;2DAMhD;YAAE,mBAAmB,EAAE,MAAM,CAAA;SAAE;oCAEtD,MAAM,KAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;iEAM5E;YACD,mBAAmB,EAAE,MAAM,CAAC;YAC5B,MAAM,EAAE,MAAM,CAAC;YACf,MAAM,EAAE,MAAM,CAAC;SAChB,KAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;wBAIlB,+BAA+B,KAAG,OAAO,CAAC,oBAAoB,CAAC;yDA2BlF;YACD,EAAE,EAAE,MAAM,CAAC;YACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;YACzB,cAAc,EAAE,MAAM,CAAC;SACxB;mCAIgC;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;0CAIP;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;iDAId;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE;qBAMjD,MAAM;MAGzB;CACH"}
|
|
@@ -230,6 +230,7 @@ var SourceControlStorageInMemory = class {
|
|
|
230
230
|
sandboxProvider: input.sandboxProvider,
|
|
231
231
|
sandboxWorkdir: input.sandboxWorkdir,
|
|
232
232
|
setupCommand: input.setupCommand ?? null,
|
|
233
|
+
baseCheckpoint: null,
|
|
233
234
|
teardownCommand: input.teardownCommand ?? null,
|
|
234
235
|
createdAt: now,
|
|
235
236
|
updatedAt: now
|
|
@@ -243,9 +244,16 @@ var SourceControlStorageInMemory = class {
|
|
|
243
244
|
id
|
|
244
245
|
});
|
|
245
246
|
if (!row) return null;
|
|
247
|
+
if (input.setupCommand !== void 0 && input.setupCommand !== row.setupCommand) row.baseCheckpoint = null;
|
|
246
248
|
Object.assign(row, input, { updatedAt: /* @__PURE__ */ new Date() });
|
|
247
249
|
return row;
|
|
248
250
|
},
|
|
251
|
+
setBaseCheckpoint: async (args) => {
|
|
252
|
+
const row = this.projectRepositoriesRows.find((candidate) => candidate.id === args.id);
|
|
253
|
+
if (!row) throw new Error("Project repository not found");
|
|
254
|
+
if (args.checkpoint && row.setupCommand !== args.expectedSetupCommand) return;
|
|
255
|
+
row.baseCheckpoint = args.checkpoint;
|
|
256
|
+
},
|
|
249
257
|
unlink: async ({ orgId, id }) => {
|
|
250
258
|
if (!await this.projectRepositories.get({
|
|
251
259
|
orgId,
|
|
@@ -334,7 +342,7 @@ var SourceControlStorageInMemory = class {
|
|
|
334
342
|
}
|
|
335
343
|
};
|
|
336
344
|
sessions = {
|
|
337
|
-
list: async ({ projectRepositoryId,
|
|
345
|
+
list: async ({ projectRepositoryId, viewerUserId }) => this.sessionsRows.filter((row) => row.projectRepositoryId === projectRepositoryId && (row.visibility !== "private" || row.userId === viewerUserId)),
|
|
338
346
|
listByProjectRepository: async ({ projectRepositoryId }) => this.sessionsRows.filter((row) => row.projectRepositoryId === projectRepositoryId),
|
|
339
347
|
getBySessionId: async (sessionId) => this.sessionsRows.find((row) => row.sessionId === sessionId) ?? null,
|
|
340
348
|
getForBranch: async ({ projectRepositoryId, userId, branch }) => this.sessionsRows.find((row) => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch) ?? null,
|
|
@@ -347,6 +355,7 @@ var SourceControlStorageInMemory = class {
|
|
|
347
355
|
id: randomUUID(),
|
|
348
356
|
...input,
|
|
349
357
|
title: input.title ?? null,
|
|
358
|
+
visibility: input.visibility ?? "org",
|
|
350
359
|
sandboxId: null,
|
|
351
360
|
sandboxWorkdir: null,
|
|
352
361
|
materializedAt: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inmemory.js","names":[],"sources":["../../../../src/storage/domains/source-control/inmemory.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { UniqueViolationError } from '@mastra/core/storage';\n\nimport type {\n ConfiguredExternalRepositoryKey,\n CreateProjectSourceControlConnectionInput,\n CreateSourceControlSessionInput,\n ExternalRepositoryProjectTarget,\n LinkProjectRepositoryInput,\n PooledSandbox,\n ProjectRepository,\n ProjectRepositorySandbox,\n ProjectSourceControlConnection,\n ReleasePooledSandboxInput,\n SourceControlInstallation,\n SourceControlRepository,\n SourceControlSession,\n SourceControlStorageHandle,\n SourceControlWorktree,\n UpdateProjectRepositoryInput,\n UpsertSourceControlInstallationInput,\n UpsertSourceControlRepositoryInput,\n UpsertSourceControlWorktreeInput,\n} from './base.js';\n\n/** In-memory provider-scoped source-control handle for route tests. */\nexport class SourceControlStorageInMemory implements SourceControlStorageHandle {\n readonly integrationId: string;\n installationsRows: SourceControlInstallation[] = [];\n repositoriesRows: SourceControlRepository[] = [];\n connectionsRows: ProjectSourceControlConnection[] = [];\n projectRepositoriesRows: ProjectRepository[] = [];\n sandboxesRows: ProjectRepositorySandbox[] = [];\n sandboxPoolRows: PooledSandbox[] = [];\n worktreesRows: SourceControlWorktree[] = [];\n sessionsRows: SourceControlSession[] = [];\n\n constructor(integrationId = 'github') {\n this.integrationId = integrationId;\n }\n\n readonly installations = {\n list: async ({ orgId }: { orgId: string }): Promise<SourceControlInstallation[]> =>\n this.installationsRows.filter(row => row.orgId === orgId),\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<SourceControlInstallation | null> =>\n this.installationsRows.find(row => row.orgId === orgId && row.id === id) ?? null,\n findByExternalId: async ({\n orgId,\n externalId,\n }: {\n orgId: string;\n externalId: string;\n }): Promise<SourceControlInstallation | null> =>\n this.installationsRows.find(row => row.orgId === orgId && row.externalId === externalId) ?? null,\n upsert: async (input: UpsertSourceControlInstallationInput): Promise<SourceControlInstallation> => {\n const existing = this.installationsRows.find(\n row => row.orgId === input.orgId && row.externalId === input.externalId,\n );\n if (existing) {\n Object.assign(existing, {\n connectedByUserId: input.connectedByUserId,\n accountName: input.accountName ?? null,\n accountType: input.accountType ?? null,\n providerMetadata: input.providerMetadata ?? {},\n });\n return existing;\n }\n const created: SourceControlInstallation = {\n id: randomUUID(),\n integrationId: this.integrationId,\n orgId: input.orgId,\n connectedByUserId: input.connectedByUserId,\n externalId: input.externalId,\n accountName: input.accountName ?? null,\n accountType: input.accountType ?? null,\n providerMetadata: input.providerMetadata ?? {},\n createdAt: new Date(),\n };\n this.installationsRows.push(created);\n return created;\n },\n delete: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n const index = this.installationsRows.findIndex(row => row.orgId === orgId && row.id === id);\n if (index < 0) return false;\n this.installationsRows.splice(index, 1);\n return true;\n },\n };\n\n readonly repositories = {\n list: async ({ orgId, installationId }: { orgId: string; installationId: string }) => {\n const installation = await this.installations.get({ orgId, id: installationId });\n return installation ? this.repositoriesRows.filter(row => row.installationId === installationId) : [];\n },\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<SourceControlRepository | null> => {\n const row = this.repositoriesRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.installations.get({ orgId, id: row.installationId })) ? row : null;\n },\n findByExternalId: async ({\n orgId,\n installationId,\n externalId,\n }: {\n orgId: string;\n installationId: string;\n externalId: string;\n }) => {\n const rows = await this.repositories.list({ orgId, installationId });\n return rows.find(row => row.externalId === externalId) ?? null;\n },\n findBySlug: async ({ orgId, installationId, slug }: { orgId: string; installationId: string; slug: string }) => {\n const rows = await this.repositories.list({ orgId, installationId });\n return rows.find(row => row.slug === slug) ?? null;\n },\n upsert: async ({\n orgId,\n input,\n }: {\n orgId: string;\n input: UpsertSourceControlRepositoryInput;\n }): Promise<SourceControlRepository> => {\n if (!(await this.installations.get({ orgId, id: input.installationId }))) {\n throw new Error('Source-control installation not found');\n }\n const existing = this.repositoriesRows.find(\n row => row.installationId === input.installationId && row.externalId === input.externalId,\n );\n const now = new Date();\n if (existing) {\n Object.assign(existing, {\n slug: input.slug,\n defaultBranch: input.defaultBranch,\n providerMetadata: input.providerMetadata ?? {},\n updatedAt: now,\n });\n return existing;\n }\n const created: SourceControlRepository = {\n id: randomUUID(),\n installationId: input.installationId,\n externalId: input.externalId,\n slug: input.slug,\n defaultBranch: input.defaultBranch,\n providerMetadata: input.providerMetadata ?? {},\n createdAt: now,\n updatedAt: now,\n };\n this.repositoriesRows.push(created);\n return created;\n },\n migrateInstallation: async ({\n orgId,\n id,\n newInstallationId,\n }: {\n orgId: string;\n id: string;\n newInstallationId: string;\n }) => {\n const existing = await this.repositories.get({ orgId, id });\n if (!existing) {\n throw new Error(`Repository ${id} not found in organization ${orgId}`);\n }\n if (!(await this.installations.get({ orgId, id: newInstallationId }))) {\n throw new Error('Source-control installation not found');\n }\n // Check if a repository with the same external_id exists under the new installation\n const conflict = this.repositoriesRows.find(\n row => row.installationId === newInstallationId && row.externalId === existing.externalId,\n );\n if (conflict) {\n // Return the existing repository under the new installation\n return conflict;\n }\n // Update the repository's installation\n existing.installationId = newInstallationId;\n existing.updatedAt = new Date();\n // Migrate dependent connections to the new installation\n for (const conn of this.connectionsRows) {\n if (conn.installationId === existing.installationId) {\n conn.installationId = newInstallationId;\n }\n }\n return existing;\n },\n };\n\n readonly connections = {\n list: async ({ factoryProjectId }: { orgId: string; factoryProjectId: string }) =>\n this.connectionsRows.filter(row => row.factoryProjectId === factoryProjectId),\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<ProjectSourceControlConnection | null> => {\n const row = this.connectionsRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.installations.get({ orgId, id: row.installationId })) ? row : null;\n },\n create: async (input: CreateProjectSourceControlConnectionInput): Promise<ProjectSourceControlConnection> => {\n if (!(await this.installations.get({ orgId: input.orgId, id: input.installationId }))) {\n throw new Error('Source-control installation not found');\n }\n const existing = this.connectionsRows.find(\n row =>\n row.factoryProjectId === input.factoryProjectId &&\n row.integrationId === this.integrationId &&\n row.installationId === input.installationId,\n );\n if (existing) return existing;\n const created: ProjectSourceControlConnection = {\n id: randomUUID(),\n factoryProjectId: input.factoryProjectId,\n integrationId: this.integrationId,\n installationId: input.installationId,\n createdByUserId: input.createdByUserId,\n createdAt: new Date(),\n };\n this.connectionsRows.push(created);\n return created;\n },\n delete: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n if (!(await this.connections.get({ orgId, id }))) return false;\n this.connectionsRows.splice(0, this.connectionsRows.length, ...this.connectionsRows.filter(row => row.id !== id));\n return true;\n },\n };\n\n readonly projectRepositories = {\n list: async ({ orgId, connectionId }: { orgId: string; connectionId: string }) =>\n (await this.connections.get({ orgId, id: connectionId }))\n ? this.projectRepositoriesRows.filter(row => row.connectionId === connectionId)\n : [],\n listConfiguredExternalKeys: async (): Promise<ConfiguredExternalRepositoryKey[]> => {\n const keys = new Map<string, ConfiguredExternalRepositoryKey>();\n for (const connection of this.connectionsRows.filter(row => row.integrationId === this.integrationId)) {\n const installation = this.installationsRows.find(row => row.id === connection.installationId);\n if (!installation) continue;\n for (const link of this.projectRepositoriesRows.filter(row => row.connectionId === connection.id)) {\n const repository = this.repositoriesRows.find(row => row.id === link.repositoryId);\n if (!repository) continue;\n keys.set(`${installation.externalId}\\u0000${repository.externalId}`, {\n installationExternalId: installation.externalId,\n repositoryExternalId: repository.externalId,\n });\n }\n }\n return [...keys.values()];\n },\n listByExternalRepository: async ({\n installationExternalId,\n repositoryExternalId,\n }: {\n installationExternalId: string;\n repositoryExternalId: string;\n }): Promise<ExternalRepositoryProjectTarget[]> => {\n const targets: ExternalRepositoryProjectTarget[] = [];\n for (const installation of this.installationsRows.filter(row => row.externalId === installationExternalId)) {\n const repository = this.repositoriesRows.find(\n row => row.installationId === installation.id && row.externalId === repositoryExternalId,\n );\n if (!repository) continue;\n for (const projectRepository of this.projectRepositoriesRows.filter(\n row => row.repositoryId === repository.id,\n )) {\n const connection = this.connectionsRows.find(\n row =>\n row.id === projectRepository.connectionId &&\n row.installationId === installation.id &&\n row.integrationId === this.integrationId,\n );\n if (!connection) continue;\n targets.push({\n orgId: installation.orgId,\n factoryProjectId: connection.factoryProjectId,\n projectRepository,\n });\n }\n }\n return targets;\n },\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<ProjectRepository | null> => {\n const row = this.projectRepositoriesRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.connections.get({ orgId, id: row.connectionId })) ? row : null;\n },\n link: async (input: LinkProjectRepositoryInput): Promise<ProjectRepository> => {\n const connection = await this.connections.get({ orgId: input.orgId, id: input.connectionId });\n const repository = await this.repositories.get({ orgId: input.orgId, id: input.repositoryId });\n if (!connection || !repository || repository.installationId !== connection.installationId) {\n throw new Error('Source-control connection or repository not found');\n }\n const existing = this.projectRepositoriesRows.find(\n row => row.connectionId === input.connectionId && row.repositoryId === input.repositoryId,\n );\n if (existing) return existing;\n const now = new Date();\n const created: ProjectRepository = {\n id: randomUUID(),\n connectionId: input.connectionId,\n repositoryId: input.repositoryId,\n createdByUserId: input.createdByUserId,\n branch: input.branch ?? null,\n sandboxProvider: input.sandboxProvider,\n sandboxWorkdir: input.sandboxWorkdir,\n setupCommand: input.setupCommand ?? null,\n teardownCommand: input.teardownCommand ?? null,\n createdAt: now,\n updatedAt: now,\n };\n this.projectRepositoriesRows.push(created);\n return created;\n },\n update: async ({\n orgId,\n id,\n input,\n }: {\n orgId: string;\n id: string;\n input: UpdateProjectRepositoryInput;\n }): Promise<ProjectRepository | null> => {\n const row = await this.projectRepositories.get({ orgId, id });\n if (!row) return null;\n Object.assign(row, input, { updatedAt: new Date() });\n return row;\n },\n unlink: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n if (!(await this.projectRepositories.get({ orgId, id }))) return false;\n this.projectRepositoriesRows.splice(\n 0,\n this.projectRepositoriesRows.length,\n ...this.projectRepositoriesRows.filter(row => row.id !== id),\n );\n return true;\n },\n };\n\n readonly sandboxes = {\n getOrCreate: async ({\n projectRepository,\n userId,\n }: {\n projectRepository: ProjectRepository;\n userId: string;\n }): Promise<ProjectRepositorySandbox> => {\n const existing = this.sandboxesRows.find(\n row => row.projectRepositoryId === projectRepository.id && row.userId === userId,\n );\n if (existing) return existing;\n const created: ProjectRepositorySandbox = {\n id: randomUUID(),\n projectRepositoryId: projectRepository.id,\n userId,\n sandboxId: null,\n sandboxWorkdir: projectRepository.sandboxWorkdir,\n materializedAt: null,\n createdAt: new Date(),\n };\n this.sandboxesRows.push(created);\n return created;\n },\n getById: async ({ id }: { id: string }): Promise<ProjectRepositorySandbox | null> =>\n this.sandboxesRows.find(row => row.id === id) ?? null,\n setWorkdir: async ({ id, sandboxWorkdir }: { id: string; sandboxWorkdir: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxWorkdir, materializedAt: null });\n },\n setSandboxId: async ({ id, sandboxId }: { id: string; sandboxId: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) row.sandboxId = sandboxId;\n },\n clearBinding: async ({ id }: { id: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxId: null, materializedAt: null });\n },\n markMaterialized: async ({ id }: { id: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) row.materializedAt = new Date();\n },\n };\n\n readonly sandboxPool = {\n release: async (input: ReleasePooledSandboxInput): Promise<void> => {\n // Mirror the SQL implementation: a missing project-repository link\n // makes the release a silent no-op.\n if (!this.projectRepositoriesRows.some(row => row.id === input.projectRepositoryId)) return;\n if (this.sandboxPoolRows.some(row => row.sandboxId === input.sandboxId)) return;\n this.sandboxPoolRows.push({ id: randomUUID(), releasedAt: new Date(), ...input });\n },\n claim: async ({ projectRepositoryId }: { projectRepositoryId: string }): Promise<PooledSandbox | null> => {\n const candidates = this.sandboxPoolRows\n .filter(row => row.projectRepositoryId === projectRepositoryId)\n .sort((left, right) => right.releasedAt.getTime() - left.releasedAt.getTime());\n const claimed = candidates[0];\n if (!claimed) return null;\n this.sandboxPoolRows.splice(this.sandboxPoolRows.indexOf(claimed), 1);\n return claimed;\n },\n };\n\n readonly worktrees = {\n upsert: async (input: UpsertSourceControlWorktreeInput): Promise<void> => {\n const existing = this.worktreesRows.find(\n row =>\n row.projectRepositoryId === input.projectRepositoryId &&\n row.userId === input.userId &&\n row.branch === input.branch,\n );\n if (existing) {\n existing.baseBranch = input.baseBranch;\n existing.worktreePath = input.worktreePath;\n return;\n }\n this.worktreesRows.push({ id: randomUUID(), createdAt: new Date(), ...input });\n },\n list: async ({\n projectRepositoryId,\n userId,\n }: {\n projectRepositoryId: string;\n userId: string;\n }): Promise<SourceControlWorktree[]> =>\n this.worktreesRows.filter(row => row.projectRepositoryId === projectRepositoryId && row.userId === userId),\n get: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<SourceControlWorktree | null> =>\n this.worktreesRows.find(\n row => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch,\n ) ?? null,\n findByPath: async ({\n projectRepositoryId,\n userId,\n worktreePath,\n }: {\n projectRepositoryId: string;\n userId: string;\n worktreePath: string;\n }): Promise<SourceControlWorktree | null> =>\n this.worktreesRows.find(\n row =>\n row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.worktreePath === worktreePath,\n ) ?? null,\n delete: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<void> => {\n this.worktreesRows.splice(\n 0,\n this.worktreesRows.length,\n ...this.worktreesRows.filter(\n row => !(row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch),\n ),\n );\n },\n };\n\n readonly sessions = {\n list: async ({ projectRepositoryId, userId }: { projectRepositoryId: string; userId: string }) =>\n this.sessionsRows.filter(row => row.projectRepositoryId === projectRepositoryId && row.userId === userId),\n listByProjectRepository: async ({ projectRepositoryId }: { projectRepositoryId: string }) =>\n this.sessionsRows.filter(row => row.projectRepositoryId === projectRepositoryId),\n getBySessionId: async (sessionId: string): Promise<SourceControlSession | null> =>\n this.sessionsRows.find(row => row.sessionId === sessionId) ?? null,\n getForBranch: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<SourceControlSession | null> =>\n this.sessionsRows.find(\n row => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch,\n ) ?? null,\n create: async (input: CreateSourceControlSessionInput): Promise<SourceControlSession> => {\n const existing = await this.sessions.getForBranch(input);\n if (existing) return existing;\n if (this.sessionsRows.some(row => row.sessionId === input.sessionId)) {\n throw new UniqueViolationError('Source-control session ID already exists');\n }\n const now = new Date();\n const session: SourceControlSession = {\n id: randomUUID(),\n ...input,\n title: input.title ?? null,\n sandboxId: null,\n sandboxWorkdir: null,\n materializedAt: null,\n firstMessageAt: null,\n firstMeaningfulExecAt: null,\n createdAt: now,\n updatedAt: now,\n };\n this.sessionsRows.push(session);\n return session;\n },\n setSandbox: async ({\n id,\n sandboxId,\n sandboxWorkdir,\n }: {\n id: string;\n sandboxId: string | null;\n sandboxWorkdir: string;\n }) => {\n const row = this.sessionsRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxId, sandboxWorkdir, updatedAt: new Date() });\n },\n markMaterialized: async ({ id }: { id: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.id === id);\n if (row && row.materializedAt === null) Object.assign(row, { materializedAt: new Date(), updatedAt: new Date() });\n },\n markFirstMessage: async ({ sessionId }: { sessionId: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.sessionId === sessionId);\n if (row && row.firstMessageAt === null) Object.assign(row, { firstMessageAt: new Date(), updatedAt: new Date() });\n },\n markFirstMeaningfulExec: async ({ sessionId }: { sessionId: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.sessionId === sessionId);\n if (row && row.firstMeaningfulExecAt === null) {\n Object.assign(row, { firstMeaningfulExecAt: new Date(), updatedAt: new Date() });\n }\n },\n delete: async (id: string) => {\n this.sessionsRows.splice(0, this.sessionsRows.length, ...this.sessionsRows.filter(row => row.id !== id));\n },\n };\n}\n"],"mappings":";;;;AA0BA,IAAa,+BAAb,MAAgF;CAC9E;CACA,oBAAiD,CAAC;CAClD,mBA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B,OAAO,EAAE,gBAAuC;GACvE,MAAM,MAAM,KAAK,aAAa,MAAK,cAAa,UAAU,cAAc,SAAS;GACjF,IAAI,OAAO,IAAI,0BAA0B,MACvC,OAAO,OAAO,KAAK;IAAE,uCAAuB,IAAI,KAAK;IAAG,2BAAW,IAAI,KAAK;GAAE,CAAC;EAEnF;EACA,QAAQ,OAAO,OAAe;GAC5B,KAAK,aAAa,OAAO,GAAG,KAAK,aAAa,QAAQ,GAAG,KAAK,aAAa,QAAO,QAAO,IAAI,OAAO,EAAE,CAAC;EACzG;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"inmemory.js","names":[],"sources":["../../../../src/storage/domains/source-control/inmemory.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { UniqueViolationError } from '@mastra/core/storage';\n\nimport type {\n ConfiguredExternalRepositoryKey,\n CreateProjectSourceControlConnectionInput,\n CreateSourceControlSessionInput,\n ExternalRepositoryProjectTarget,\n LinkProjectRepositoryInput,\n PooledSandbox,\n ProjectRepository,\n ProjectRepositoryBaseCheckpoint,\n ProjectRepositorySandbox,\n ProjectSourceControlConnection,\n ReleasePooledSandboxInput,\n SourceControlInstallation,\n SourceControlRepository,\n SourceControlSession,\n SourceControlStorageHandle,\n SourceControlWorktree,\n UpdateProjectRepositoryInput,\n UpsertSourceControlInstallationInput,\n UpsertSourceControlRepositoryInput,\n UpsertSourceControlWorktreeInput,\n} from './base.js';\n\n/** In-memory provider-scoped source-control handle for route tests. */\nexport class SourceControlStorageInMemory implements SourceControlStorageHandle {\n readonly integrationId: string;\n installationsRows: SourceControlInstallation[] = [];\n repositoriesRows: SourceControlRepository[] = [];\n connectionsRows: ProjectSourceControlConnection[] = [];\n projectRepositoriesRows: ProjectRepository[] = [];\n sandboxesRows: ProjectRepositorySandbox[] = [];\n sandboxPoolRows: PooledSandbox[] = [];\n worktreesRows: SourceControlWorktree[] = [];\n sessionsRows: SourceControlSession[] = [];\n\n constructor(integrationId = 'github') {\n this.integrationId = integrationId;\n }\n\n readonly installations = {\n list: async ({ orgId }: { orgId: string }): Promise<SourceControlInstallation[]> =>\n this.installationsRows.filter(row => row.orgId === orgId),\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<SourceControlInstallation | null> =>\n this.installationsRows.find(row => row.orgId === orgId && row.id === id) ?? null,\n findByExternalId: async ({\n orgId,\n externalId,\n }: {\n orgId: string;\n externalId: string;\n }): Promise<SourceControlInstallation | null> =>\n this.installationsRows.find(row => row.orgId === orgId && row.externalId === externalId) ?? null,\n upsert: async (input: UpsertSourceControlInstallationInput): Promise<SourceControlInstallation> => {\n const existing = this.installationsRows.find(\n row => row.orgId === input.orgId && row.externalId === input.externalId,\n );\n if (existing) {\n Object.assign(existing, {\n connectedByUserId: input.connectedByUserId,\n accountName: input.accountName ?? null,\n accountType: input.accountType ?? null,\n providerMetadata: input.providerMetadata ?? {},\n });\n return existing;\n }\n const created: SourceControlInstallation = {\n id: randomUUID(),\n integrationId: this.integrationId,\n orgId: input.orgId,\n connectedByUserId: input.connectedByUserId,\n externalId: input.externalId,\n accountName: input.accountName ?? null,\n accountType: input.accountType ?? null,\n providerMetadata: input.providerMetadata ?? {},\n createdAt: new Date(),\n };\n this.installationsRows.push(created);\n return created;\n },\n delete: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n const index = this.installationsRows.findIndex(row => row.orgId === orgId && row.id === id);\n if (index < 0) return false;\n this.installationsRows.splice(index, 1);\n return true;\n },\n };\n\n readonly repositories = {\n list: async ({ orgId, installationId }: { orgId: string; installationId: string }) => {\n const installation = await this.installations.get({ orgId, id: installationId });\n return installation ? this.repositoriesRows.filter(row => row.installationId === installationId) : [];\n },\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<SourceControlRepository | null> => {\n const row = this.repositoriesRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.installations.get({ orgId, id: row.installationId })) ? row : null;\n },\n findByExternalId: async ({\n orgId,\n installationId,\n externalId,\n }: {\n orgId: string;\n installationId: string;\n externalId: string;\n }) => {\n const rows = await this.repositories.list({ orgId, installationId });\n return rows.find(row => row.externalId === externalId) ?? null;\n },\n findBySlug: async ({ orgId, installationId, slug }: { orgId: string; installationId: string; slug: string }) => {\n const rows = await this.repositories.list({ orgId, installationId });\n return rows.find(row => row.slug === slug) ?? null;\n },\n upsert: async ({\n orgId,\n input,\n }: {\n orgId: string;\n input: UpsertSourceControlRepositoryInput;\n }): Promise<SourceControlRepository> => {\n if (!(await this.installations.get({ orgId, id: input.installationId }))) {\n throw new Error('Source-control installation not found');\n }\n const existing = this.repositoriesRows.find(\n row => row.installationId === input.installationId && row.externalId === input.externalId,\n );\n const now = new Date();\n if (existing) {\n Object.assign(existing, {\n slug: input.slug,\n defaultBranch: input.defaultBranch,\n providerMetadata: input.providerMetadata ?? {},\n updatedAt: now,\n });\n return existing;\n }\n const created: SourceControlRepository = {\n id: randomUUID(),\n installationId: input.installationId,\n externalId: input.externalId,\n slug: input.slug,\n defaultBranch: input.defaultBranch,\n providerMetadata: input.providerMetadata ?? {},\n createdAt: now,\n updatedAt: now,\n };\n this.repositoriesRows.push(created);\n return created;\n },\n migrateInstallation: async ({\n orgId,\n id,\n newInstallationId,\n }: {\n orgId: string;\n id: string;\n newInstallationId: string;\n }) => {\n const existing = await this.repositories.get({ orgId, id });\n if (!existing) {\n throw new Error(`Repository ${id} not found in organization ${orgId}`);\n }\n if (!(await this.installations.get({ orgId, id: newInstallationId }))) {\n throw new Error('Source-control installation not found');\n }\n // Check if a repository with the same external_id exists under the new installation\n const conflict = this.repositoriesRows.find(\n row => row.installationId === newInstallationId && row.externalId === existing.externalId,\n );\n if (conflict) {\n // Return the existing repository under the new installation\n return conflict;\n }\n // Update the repository's installation\n existing.installationId = newInstallationId;\n existing.updatedAt = new Date();\n // Migrate dependent connections to the new installation\n for (const conn of this.connectionsRows) {\n if (conn.installationId === existing.installationId) {\n conn.installationId = newInstallationId;\n }\n }\n return existing;\n },\n };\n\n readonly connections = {\n list: async ({ factoryProjectId }: { orgId: string; factoryProjectId: string }) =>\n this.connectionsRows.filter(row => row.factoryProjectId === factoryProjectId),\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<ProjectSourceControlConnection | null> => {\n const row = this.connectionsRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.installations.get({ orgId, id: row.installationId })) ? row : null;\n },\n create: async (input: CreateProjectSourceControlConnectionInput): Promise<ProjectSourceControlConnection> => {\n if (!(await this.installations.get({ orgId: input.orgId, id: input.installationId }))) {\n throw new Error('Source-control installation not found');\n }\n const existing = this.connectionsRows.find(\n row =>\n row.factoryProjectId === input.factoryProjectId &&\n row.integrationId === this.integrationId &&\n row.installationId === input.installationId,\n );\n if (existing) return existing;\n const created: ProjectSourceControlConnection = {\n id: randomUUID(),\n factoryProjectId: input.factoryProjectId,\n integrationId: this.integrationId,\n installationId: input.installationId,\n createdByUserId: input.createdByUserId,\n createdAt: new Date(),\n };\n this.connectionsRows.push(created);\n return created;\n },\n delete: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n if (!(await this.connections.get({ orgId, id }))) return false;\n this.connectionsRows.splice(0, this.connectionsRows.length, ...this.connectionsRows.filter(row => row.id !== id));\n return true;\n },\n };\n\n readonly projectRepositories = {\n list: async ({ orgId, connectionId }: { orgId: string; connectionId: string }) =>\n (await this.connections.get({ orgId, id: connectionId }))\n ? this.projectRepositoriesRows.filter(row => row.connectionId === connectionId)\n : [],\n listConfiguredExternalKeys: async (): Promise<ConfiguredExternalRepositoryKey[]> => {\n const keys = new Map<string, ConfiguredExternalRepositoryKey>();\n for (const connection of this.connectionsRows.filter(row => row.integrationId === this.integrationId)) {\n const installation = this.installationsRows.find(row => row.id === connection.installationId);\n if (!installation) continue;\n for (const link of this.projectRepositoriesRows.filter(row => row.connectionId === connection.id)) {\n const repository = this.repositoriesRows.find(row => row.id === link.repositoryId);\n if (!repository) continue;\n keys.set(`${installation.externalId}\\u0000${repository.externalId}`, {\n installationExternalId: installation.externalId,\n repositoryExternalId: repository.externalId,\n });\n }\n }\n return [...keys.values()];\n },\n listByExternalRepository: async ({\n installationExternalId,\n repositoryExternalId,\n }: {\n installationExternalId: string;\n repositoryExternalId: string;\n }): Promise<ExternalRepositoryProjectTarget[]> => {\n const targets: ExternalRepositoryProjectTarget[] = [];\n for (const installation of this.installationsRows.filter(row => row.externalId === installationExternalId)) {\n const repository = this.repositoriesRows.find(\n row => row.installationId === installation.id && row.externalId === repositoryExternalId,\n );\n if (!repository) continue;\n for (const projectRepository of this.projectRepositoriesRows.filter(\n row => row.repositoryId === repository.id,\n )) {\n const connection = this.connectionsRows.find(\n row =>\n row.id === projectRepository.connectionId &&\n row.installationId === installation.id &&\n row.integrationId === this.integrationId,\n );\n if (!connection) continue;\n targets.push({\n orgId: installation.orgId,\n factoryProjectId: connection.factoryProjectId,\n projectRepository,\n });\n }\n }\n return targets;\n },\n get: async ({ orgId, id }: { orgId: string; id: string }): Promise<ProjectRepository | null> => {\n const row = this.projectRepositoriesRows.find(candidate => candidate.id === id);\n if (!row) return null;\n return (await this.connections.get({ orgId, id: row.connectionId })) ? row : null;\n },\n link: async (input: LinkProjectRepositoryInput): Promise<ProjectRepository> => {\n const connection = await this.connections.get({ orgId: input.orgId, id: input.connectionId });\n const repository = await this.repositories.get({ orgId: input.orgId, id: input.repositoryId });\n if (!connection || !repository || repository.installationId !== connection.installationId) {\n throw new Error('Source-control connection or repository not found');\n }\n const existing = this.projectRepositoriesRows.find(\n row => row.connectionId === input.connectionId && row.repositoryId === input.repositoryId,\n );\n if (existing) return existing;\n const now = new Date();\n const created: ProjectRepository = {\n id: randomUUID(),\n connectionId: input.connectionId,\n repositoryId: input.repositoryId,\n createdByUserId: input.createdByUserId,\n branch: input.branch ?? null,\n sandboxProvider: input.sandboxProvider,\n sandboxWorkdir: input.sandboxWorkdir,\n setupCommand: input.setupCommand ?? null,\n baseCheckpoint: null,\n teardownCommand: input.teardownCommand ?? null,\n createdAt: now,\n updatedAt: now,\n };\n this.projectRepositoriesRows.push(created);\n return created;\n },\n update: async ({\n orgId,\n id,\n input,\n }: {\n orgId: string;\n id: string;\n input: UpdateProjectRepositoryInput;\n }): Promise<ProjectRepository | null> => {\n const row = await this.projectRepositories.get({ orgId, id });\n if (!row) return null;\n if (input.setupCommand !== undefined && input.setupCommand !== row.setupCommand) {\n row.baseCheckpoint = null;\n }\n Object.assign(row, input, { updatedAt: new Date() });\n return row;\n },\n setBaseCheckpoint: async (\n args:\n | { id: string; checkpoint: null }\n | { id: string; checkpoint: ProjectRepositoryBaseCheckpoint; expectedSetupCommand: string | null },\n ): Promise<void> => {\n const row = this.projectRepositoriesRows.find(candidate => candidate.id === args.id);\n if (!row) throw new Error('Project repository not found');\n if (args.checkpoint && row.setupCommand !== args.expectedSetupCommand) return;\n row.baseCheckpoint = args.checkpoint;\n },\n unlink: async ({ orgId, id }: { orgId: string; id: string }): Promise<boolean> => {\n if (!(await this.projectRepositories.get({ orgId, id }))) return false;\n this.projectRepositoriesRows.splice(\n 0,\n this.projectRepositoriesRows.length,\n ...this.projectRepositoriesRows.filter(row => row.id !== id),\n );\n return true;\n },\n };\n\n readonly sandboxes = {\n getOrCreate: async ({\n projectRepository,\n userId,\n }: {\n projectRepository: ProjectRepository;\n userId: string;\n }): Promise<ProjectRepositorySandbox> => {\n const existing = this.sandboxesRows.find(\n row => row.projectRepositoryId === projectRepository.id && row.userId === userId,\n );\n if (existing) return existing;\n const created: ProjectRepositorySandbox = {\n id: randomUUID(),\n projectRepositoryId: projectRepository.id,\n userId,\n sandboxId: null,\n sandboxWorkdir: projectRepository.sandboxWorkdir,\n materializedAt: null,\n createdAt: new Date(),\n };\n this.sandboxesRows.push(created);\n return created;\n },\n getById: async ({ id }: { id: string }): Promise<ProjectRepositorySandbox | null> =>\n this.sandboxesRows.find(row => row.id === id) ?? null,\n setWorkdir: async ({ id, sandboxWorkdir }: { id: string; sandboxWorkdir: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxWorkdir, materializedAt: null });\n },\n setSandboxId: async ({ id, sandboxId }: { id: string; sandboxId: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) row.sandboxId = sandboxId;\n },\n clearBinding: async ({ id }: { id: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxId: null, materializedAt: null });\n },\n markMaterialized: async ({ id }: { id: string }): Promise<void> => {\n const row = this.sandboxesRows.find(candidate => candidate.id === id);\n if (row) row.materializedAt = new Date();\n },\n };\n\n readonly sandboxPool = {\n release: async (input: ReleasePooledSandboxInput): Promise<void> => {\n // Mirror the SQL implementation: a missing project-repository link\n // makes the release a silent no-op.\n if (!this.projectRepositoriesRows.some(row => row.id === input.projectRepositoryId)) return;\n if (this.sandboxPoolRows.some(row => row.sandboxId === input.sandboxId)) return;\n this.sandboxPoolRows.push({ id: randomUUID(), releasedAt: new Date(), ...input });\n },\n claim: async ({ projectRepositoryId }: { projectRepositoryId: string }): Promise<PooledSandbox | null> => {\n const candidates = this.sandboxPoolRows\n .filter(row => row.projectRepositoryId === projectRepositoryId)\n .sort((left, right) => right.releasedAt.getTime() - left.releasedAt.getTime());\n const claimed = candidates[0];\n if (!claimed) return null;\n this.sandboxPoolRows.splice(this.sandboxPoolRows.indexOf(claimed), 1);\n return claimed;\n },\n };\n\n readonly worktrees = {\n upsert: async (input: UpsertSourceControlWorktreeInput): Promise<void> => {\n const existing = this.worktreesRows.find(\n row =>\n row.projectRepositoryId === input.projectRepositoryId &&\n row.userId === input.userId &&\n row.branch === input.branch,\n );\n if (existing) {\n existing.baseBranch = input.baseBranch;\n existing.worktreePath = input.worktreePath;\n return;\n }\n this.worktreesRows.push({ id: randomUUID(), createdAt: new Date(), ...input });\n },\n list: async ({\n projectRepositoryId,\n userId,\n }: {\n projectRepositoryId: string;\n userId: string;\n }): Promise<SourceControlWorktree[]> =>\n this.worktreesRows.filter(row => row.projectRepositoryId === projectRepositoryId && row.userId === userId),\n get: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<SourceControlWorktree | null> =>\n this.worktreesRows.find(\n row => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch,\n ) ?? null,\n findByPath: async ({\n projectRepositoryId,\n userId,\n worktreePath,\n }: {\n projectRepositoryId: string;\n userId: string;\n worktreePath: string;\n }): Promise<SourceControlWorktree | null> =>\n this.worktreesRows.find(\n row =>\n row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.worktreePath === worktreePath,\n ) ?? null,\n delete: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<void> => {\n this.worktreesRows.splice(\n 0,\n this.worktreesRows.length,\n ...this.worktreesRows.filter(\n row => !(row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch),\n ),\n );\n },\n };\n\n readonly sessions = {\n list: async ({ projectRepositoryId, viewerUserId }: { projectRepositoryId: string; viewerUserId: string }) =>\n this.sessionsRows.filter(\n row =>\n row.projectRepositoryId === projectRepositoryId &&\n (row.visibility !== 'private' || row.userId === viewerUserId),\n ),\n listByProjectRepository: async ({ projectRepositoryId }: { projectRepositoryId: string }) =>\n this.sessionsRows.filter(row => row.projectRepositoryId === projectRepositoryId),\n getBySessionId: async (sessionId: string): Promise<SourceControlSession | null> =>\n this.sessionsRows.find(row => row.sessionId === sessionId) ?? null,\n getForBranch: async ({\n projectRepositoryId,\n userId,\n branch,\n }: {\n projectRepositoryId: string;\n userId: string;\n branch: string;\n }): Promise<SourceControlSession | null> =>\n this.sessionsRows.find(\n row => row.projectRepositoryId === projectRepositoryId && row.userId === userId && row.branch === branch,\n ) ?? null,\n create: async (input: CreateSourceControlSessionInput): Promise<SourceControlSession> => {\n const existing = await this.sessions.getForBranch(input);\n if (existing) return existing;\n if (this.sessionsRows.some(row => row.sessionId === input.sessionId)) {\n throw new UniqueViolationError('Source-control session ID already exists');\n }\n const now = new Date();\n const session: SourceControlSession = {\n id: randomUUID(),\n ...input,\n title: input.title ?? null,\n visibility: input.visibility ?? 'org',\n sandboxId: null,\n sandboxWorkdir: null,\n materializedAt: null,\n firstMessageAt: null,\n firstMeaningfulExecAt: null,\n createdAt: now,\n updatedAt: now,\n };\n this.sessionsRows.push(session);\n return session;\n },\n setSandbox: async ({\n id,\n sandboxId,\n sandboxWorkdir,\n }: {\n id: string;\n sandboxId: string | null;\n sandboxWorkdir: string;\n }) => {\n const row = this.sessionsRows.find(candidate => candidate.id === id);\n if (row) Object.assign(row, { sandboxId, sandboxWorkdir, updatedAt: new Date() });\n },\n markMaterialized: async ({ id }: { id: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.id === id);\n if (row && row.materializedAt === null) Object.assign(row, { materializedAt: new Date(), updatedAt: new Date() });\n },\n markFirstMessage: async ({ sessionId }: { sessionId: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.sessionId === sessionId);\n if (row && row.firstMessageAt === null) Object.assign(row, { firstMessageAt: new Date(), updatedAt: new Date() });\n },\n markFirstMeaningfulExec: async ({ sessionId }: { sessionId: string }) => {\n const row = this.sessionsRows.find(candidate => candidate.sessionId === sessionId);\n if (row && row.firstMeaningfulExecAt === null) {\n Object.assign(row, { firstMeaningfulExecAt: new Date(), updatedAt: new Date() });\n }\n },\n delete: async (id: string) => {\n this.sessionsRows.splice(0, this.sessionsRows.length, ...this.sessionsRows.filter(row => row.id !== id));\n },\n };\n}\n"],"mappings":";;;;AA2BA,IAAa,+BAAb,MAAgF;CAC9E;CACA,oBAAiD,CAAC;CAClD,mBAA8C,CAAC;CAC/C,kBAAoD,CAAC;CACrD,0BAA+C,CAAC;CAChD,gBAA4C,CAAC;CAC7C,kBAAmC,CAAC;CACpC,gBAAyC,CAAC;CAC1C,eAAuC,CAAC;CAExC,YAAY,gBAAgB,UAAU;EACpC,KAAK,gBAAgB;CACvB;CAE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,aAAa,MAAK,cAAa,UAAU,cAAc,SAAS;GACjF,IAAI,OAAO,IAAI,mBAAmB,MAAM,OAAO,OAAO,KAAK;IAAE,gCAAgB,IAAI,KAAK;IAAG,2BAAW,IAAI,KAAK;GAAE,CAAC;EAClH;EACA,yBAAyB,OAAO,EAAE,gBAAuC;GACvE,MAAM,MAAM,KAAK,aAAa,MAAK,cAAa,UAAU,cAAc,SAAS;GACjF,IAAI,OAAO,IAAI,0BAA0B,MACvC,OAAO,OAAO,KAAK;IAAE,uCAAuB,IAAI,KAAK;IAAG,2BAAW,IAAI,KAAK;GAAE,CAAC;EAEnF;EACA,QAAQ,OAAO,OAAe;GAC5B,KAAK,aAAa,OAAO,GAAG,KAAK,aAAa,QAAQ,GAAG,KAAK,aAAa,QAAO,QAAO,IAAI,OAAO,EAAE,CAAC;EACzG;CACF;AACF"}
|
|
@@ -168,6 +168,17 @@ export interface RevokeFactoryRunBindingInput {
|
|
|
168
168
|
bindingId: string;
|
|
169
169
|
revokedAt: Date;
|
|
170
170
|
}
|
|
171
|
+
export interface RevokeStaleFactoryRunBindingsInput {
|
|
172
|
+
/** Active bindings created before this instant are revoked regardless of item state. */
|
|
173
|
+
olderThan: Date;
|
|
174
|
+
now: Date;
|
|
175
|
+
}
|
|
176
|
+
export interface RevokeFactoryRunBindingsForWorkItemInput {
|
|
177
|
+
orgId: string;
|
|
178
|
+
factoryProjectId: string;
|
|
179
|
+
workItemId: string;
|
|
180
|
+
revokedAt: Date;
|
|
181
|
+
}
|
|
171
182
|
export interface FactoryRunBindingRecord {
|
|
172
183
|
id: string;
|
|
173
184
|
orgId: string;
|
|
@@ -242,6 +253,8 @@ export interface CommitFactoryTransitionInput {
|
|
|
242
253
|
code: string;
|
|
243
254
|
reason: string;
|
|
244
255
|
};
|
|
256
|
+
/** Arm autonomy in the same revision-checked update that commits the transition. */
|
|
257
|
+
armAutonomy?: boolean;
|
|
245
258
|
}
|
|
246
259
|
export type CommitFactoryTransitionResult = {
|
|
247
260
|
status: 'committed';
|
|
@@ -267,6 +280,8 @@ export interface PrepareFactoryRunStartInput {
|
|
|
267
280
|
resourceId: string;
|
|
268
281
|
kickoffKey: string;
|
|
269
282
|
kickoffMessage: string | null;
|
|
283
|
+
/** Arm the item's autonomy in the same transaction that prepares the run. */
|
|
284
|
+
armAutonomy?: boolean;
|
|
270
285
|
}
|
|
271
286
|
export interface PrepareFactoryRunStartResult {
|
|
272
287
|
item: WorkItemRow;
|
|
@@ -292,6 +307,13 @@ export interface WorkItemRow {
|
|
|
292
307
|
stageHistory: WorkItemStageEntry[];
|
|
293
308
|
sessions: WorkItemSessions;
|
|
294
309
|
metadata: Record<string, unknown> | null;
|
|
310
|
+
/**
|
|
311
|
+
* When a person first committed this item to the Factory, by starting a run
|
|
312
|
+
* on it or releasing one that was proposed. Projects that withhold auto-run
|
|
313
|
+
* are asking to decide what the Factory picks up, not to approve each step of
|
|
314
|
+
* work they already asked for, so runs on an armed item skip the gate.
|
|
315
|
+
*/
|
|
316
|
+
autonomyArmedAt: Date | null;
|
|
295
317
|
revision: number;
|
|
296
318
|
createdBy: string;
|
|
297
319
|
createdAt: Date;
|
|
@@ -362,10 +384,30 @@ export declare class WorkItemsStorage extends FactoryStorageDomain {
|
|
|
362
384
|
failDeferredDecision(input: FactoryDispatchFailureInput): Promise<FactoryDeferredDecisionRecord | null>;
|
|
363
385
|
/** Park a claimed effect for human approval; the dispatcher never claims `proposed` rows. */
|
|
364
386
|
proposeDeferredDecision(identity: FactoryLeaseIdentity, now: Date): Promise<FactoryDeferredDecisionRecord | null>;
|
|
365
|
-
/**
|
|
387
|
+
/**
|
|
388
|
+
* Release an approved effect back to the dispatcher; only `proposed` rows are
|
|
389
|
+
* approvable. Approval is a person taking the item on, so the item's autonomy
|
|
390
|
+
* is armed in the same transaction — a crash cannot release the run while
|
|
391
|
+
* leaving its follow-up work parked for re-approval.
|
|
392
|
+
*/
|
|
366
393
|
approveDeferredDecision(orgId: string, factoryProjectId: string, decisionId: string, now: Date): Promise<FactoryDeferredDecisionRecord | null>;
|
|
367
394
|
/** Retire a proposal nobody wants: `dismissed` is terminal, so the run never happens. */
|
|
368
395
|
dismissDeferredDecision(orgId: string, factoryProjectId: string, decisionId: string, now: Date): Promise<FactoryDeferredDecisionRecord | null>;
|
|
396
|
+
/**
|
|
397
|
+
* Retire proposals parked on a work item. A merged pull request (or an item
|
|
398
|
+
* closed out any other way) leaves its queued runs with nothing left to do,
|
|
399
|
+
* and they would otherwise sit on the card forever asking to be answered.
|
|
400
|
+
*
|
|
401
|
+
* Pass `role` to retire only the proposals a run now starting has overtaken:
|
|
402
|
+
* a parked "start triage" is moot the moment triage is actually running.
|
|
403
|
+
*/
|
|
404
|
+
dismissProposalsForWorkItem(input: {
|
|
405
|
+
orgId: string;
|
|
406
|
+
factoryProjectId: string;
|
|
407
|
+
workItemId: string;
|
|
408
|
+
role?: string;
|
|
409
|
+
dismissedAt: Date;
|
|
410
|
+
}): Promise<FactoryDeferredDecisionRecord[]>;
|
|
369
411
|
/** Requeue the same idempotent terminal effect; non-failed decisions are never rerun. */
|
|
370
412
|
retryDeferredDecision(orgId: string, factoryProjectId: string, decisionId: string, now: Date): Promise<FactoryDeferredDecisionRecord | null>;
|
|
371
413
|
/** Resolve exact active agent authority; partial session matches never authorize. */
|
|
@@ -385,6 +427,19 @@ export declare class WorkItemsStorage extends FactoryStorageDomain {
|
|
|
385
427
|
findRunBindingBySession(address: FactoryRunBindingSessionAddress): Promise<FactoryRunBindingRecord | null>;
|
|
386
428
|
/** Revoke one exact tenant-scoped binding. */
|
|
387
429
|
revokeRunBinding(input: RevokeFactoryRunBindingInput): Promise<FactoryRunBindingRecord | null>;
|
|
430
|
+
/**
|
|
431
|
+
* Revoke every active binding for one work item (all roles). Called from
|
|
432
|
+
* terminal-stage cleanup so completed items stop paying the reconcile walk.
|
|
433
|
+
* Returns the number of bindings revoked.
|
|
434
|
+
*/
|
|
435
|
+
revokeRunBindingsForWorkItem(input: RevokeFactoryRunBindingsForWorkItemInput): Promise<number>;
|
|
436
|
+
/**
|
|
437
|
+
* Revoke leaked/legacy active bindings: older than `olderThan`, or whose
|
|
438
|
+
* work item is gone, malformed, or already terminal. Terminal-stage cleanup
|
|
439
|
+
* handles bindings go-forward; this sweep drains anything that slipped past
|
|
440
|
+
* it. Returns the number of bindings revoked.
|
|
441
|
+
*/
|
|
442
|
+
revokeStaleRunBindings(input: RevokeStaleFactoryRunBindingsInput): Promise<number>;
|
|
388
443
|
/** Enumerate active bindings for the server-owned restart reconciler. */
|
|
389
444
|
listActiveRunBindings(): Promise<FactoryRunBindingRecord[]>;
|
|
390
445
|
/** List binding history, optionally narrowed to one work item. */
|
|
@@ -420,6 +475,17 @@ export declare class WorkItemsStorage extends FactoryStorageDomain {
|
|
|
420
475
|
item: WorkItemRow;
|
|
421
476
|
previous: WorkItemPriorState;
|
|
422
477
|
} | null>;
|
|
478
|
+
/**
|
|
479
|
+
* Record that a person committed this item to the Factory. Only the first
|
|
480
|
+
* time counts: the timestamp marks when the item stopped needing permission,
|
|
481
|
+
* so later runs must not push it forward. Bumps no revision, because arming
|
|
482
|
+
* is not a change anyone is editing against.
|
|
483
|
+
*/
|
|
484
|
+
armAutonomy({ orgId, id, now }: {
|
|
485
|
+
orgId: string;
|
|
486
|
+
id: string;
|
|
487
|
+
now: Date;
|
|
488
|
+
}): Promise<void>;
|
|
423
489
|
delete({ orgId, id }: {
|
|
424
490
|
orgId: string;
|
|
425
491
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/work-items/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,oBAAoB,EAAwB,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAEhF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAanC,wBAAgB,mBAAmB,CAAC,QAAQ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QACf,KAAK,EAAE,mBAAmB,CAAC;KAC5B,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,QAAQ,EAAE,kBAAkB,CAAA;KAAE,GAAG,IAAI,CAAC;IAuBvE;;;;;OAKG;IACG,WAAW,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CxF,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CAwBxF"}
|
|
@@ -32,6 +32,18 @@ function isAgentActor(by) {
|
|
|
32
32
|
if (by === void 0) return false;
|
|
33
33
|
return by.startsWith("agent:") || by === "factory-tool-result-rule";
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Stages in which a bound run can still act on its work item. Mirrors the
|
|
37
|
+
* non-terminal subset of `FACTORY_RULE_STAGES` (rules/types.ts); bindings for
|
|
38
|
+
* items outside these stages are dead weight in the reconcile walk.
|
|
39
|
+
*/
|
|
40
|
+
const ACTIVE_RUN_BINDING_STAGES = /* @__PURE__ */ new Set([
|
|
41
|
+
"intake",
|
|
42
|
+
"triage",
|
|
43
|
+
"planning",
|
|
44
|
+
"execute",
|
|
45
|
+
"review"
|
|
46
|
+
]);
|
|
35
47
|
const WORK_ITEMS_SCHEMA = {
|
|
36
48
|
name: "work_items",
|
|
37
49
|
columns: {
|
|
@@ -58,6 +70,10 @@ const WORK_ITEMS_SCHEMA = {
|
|
|
58
70
|
type: "json",
|
|
59
71
|
nullable: true
|
|
60
72
|
},
|
|
73
|
+
autonomy_armed_at: {
|
|
74
|
+
type: "timestamp",
|
|
75
|
+
nullable: true
|
|
76
|
+
},
|
|
61
77
|
revision: {
|
|
62
78
|
type: "integer",
|
|
63
79
|
default: 1
|
|
@@ -101,6 +117,7 @@ function toWorkItem(row) {
|
|
|
101
117
|
stageHistory: row.stage_history,
|
|
102
118
|
sessions: row.sessions,
|
|
103
119
|
metadata: row.metadata,
|
|
120
|
+
autonomyArmedAt: row.autonomy_armed_at ?? null,
|
|
104
121
|
revision: row.revision,
|
|
105
122
|
createdBy: row.created_by,
|
|
106
123
|
createdAt: row.created_at,
|
|
@@ -116,6 +133,7 @@ function patchColumns(changes) {
|
|
|
116
133
|
...changes.stageHistory !== void 0 ? { stage_history: changes.stageHistory } : {},
|
|
117
134
|
...changes.sessions !== void 0 ? { sessions: changes.sessions } : {},
|
|
118
135
|
...changes.metadata !== void 0 ? { metadata: changes.metadata } : {},
|
|
136
|
+
...changes.autonomyArmedAt !== void 0 && changes.autonomyArmedAt !== null ? { autonomy_armed_at: changes.autonomyArmedAt } : {},
|
|
119
137
|
...changes.revision !== void 0 ? { revision: changes.revision } : {},
|
|
120
138
|
...changes.updatedAt !== void 0 ? { updated_at: changes.updatedAt } : {}
|
|
121
139
|
};
|
|
@@ -664,8 +682,10 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
664
682
|
reason = input.evaluation.reason;
|
|
665
683
|
return null;
|
|
666
684
|
}
|
|
667
|
-
|
|
685
|
+
const arm = input.armAutonomy === true && !existing.autonomyArmedAt;
|
|
686
|
+
if (existing.stages.length === 1 && existing.stages[0] === input.destinationStage) return arm ? patchColumns({ autonomyArmedAt: now }) : null;
|
|
668
687
|
return patchColumns({
|
|
688
|
+
...arm ? { autonomyArmedAt: now } : {},
|
|
669
689
|
stages: [input.destinationStage],
|
|
670
690
|
stageHistory: applyStageTransition(existing.stageHistory, existing.stages, [input.destinationStage], input.actorId, now),
|
|
671
691
|
revision: existing.revision + 1,
|
|
@@ -946,18 +966,37 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
946
966
|
});
|
|
947
967
|
return proposed && row ? toDeferredDecision(row) : null;
|
|
948
968
|
}
|
|
949
|
-
/**
|
|
969
|
+
/**
|
|
970
|
+
* Release an approved effect back to the dispatcher; only `proposed` rows are
|
|
971
|
+
* approvable. Approval is a person taking the item on, so the item's autonomy
|
|
972
|
+
* is armed in the same transaction — a crash cannot release the run while
|
|
973
|
+
* leaving its follow-up work parked for re-approval.
|
|
974
|
+
*/
|
|
950
975
|
async approveDeferredDecision(orgId, factoryProjectId, decisionId, now) {
|
|
951
|
-
return this
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
976
|
+
return this.storage.withTransaction(async (ops) => {
|
|
977
|
+
let settled = false;
|
|
978
|
+
const row = await ops.updateAtomic("factory_deferred_decisions", {
|
|
979
|
+
id: decisionId,
|
|
980
|
+
org_id: orgId,
|
|
981
|
+
factory_project_id: factoryProjectId
|
|
982
|
+
}, (current) => {
|
|
983
|
+
if (current.status !== "proposed") return null;
|
|
984
|
+
settled = true;
|
|
985
|
+
return {
|
|
986
|
+
status: "pending",
|
|
987
|
+
attempts: 0,
|
|
988
|
+
available_at: now,
|
|
989
|
+
approved_at: now,
|
|
990
|
+
updated_at: now
|
|
991
|
+
};
|
|
992
|
+
});
|
|
993
|
+
if (!settled || !row) return null;
|
|
994
|
+
const record = toDeferredDecision(row);
|
|
995
|
+
if (record.workItemId) await ops.updateAtomic("work_items", {
|
|
996
|
+
org_id: orgId,
|
|
997
|
+
id: record.workItemId
|
|
998
|
+
}, (current) => current.autonomy_armed_at ? null : { autonomy_armed_at: now });
|
|
999
|
+
return record;
|
|
961
1000
|
});
|
|
962
1001
|
}
|
|
963
1002
|
/** Retire a proposal nobody wants: `dismissed` is terminal, so the run never happens. */
|
|
@@ -972,6 +1011,29 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
972
1011
|
completed_at: now
|
|
973
1012
|
});
|
|
974
1013
|
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Retire proposals parked on a work item. A merged pull request (or an item
|
|
1016
|
+
* closed out any other way) leaves its queued runs with nothing left to do,
|
|
1017
|
+
* and they would otherwise sit on the card forever asking to be answered.
|
|
1018
|
+
*
|
|
1019
|
+
* Pass `role` to retire only the proposals a run now starting has overtaken:
|
|
1020
|
+
* a parked "start triage" is moot the moment triage is actually running.
|
|
1021
|
+
*/
|
|
1022
|
+
async dismissProposalsForWorkItem(input) {
|
|
1023
|
+
const rows = await this.#db.findMany("factory_deferred_decisions", {
|
|
1024
|
+
org_id: input.orgId,
|
|
1025
|
+
factory_project_id: input.factoryProjectId,
|
|
1026
|
+
work_item_id: input.workItemId,
|
|
1027
|
+
status: "proposed"
|
|
1028
|
+
});
|
|
1029
|
+
const dismissed = [];
|
|
1030
|
+
for (const row of rows) {
|
|
1031
|
+
if (input.role !== void 0 && toDeferredDecision(row).decision.role !== input.role) continue;
|
|
1032
|
+
const record = await this.dismissDeferredDecision(input.orgId, input.factoryProjectId, row.id, input.dismissedAt);
|
|
1033
|
+
if (record) dismissed.push(record);
|
|
1034
|
+
}
|
|
1035
|
+
return dismissed;
|
|
1036
|
+
}
|
|
975
1037
|
async #settleProposedDecision({ orgId, factoryProjectId, decisionId }, patch) {
|
|
976
1038
|
let settled = false;
|
|
977
1039
|
const row = await this.#db.updateAtomic("factory_deferred_decisions", {
|
|
@@ -1070,6 +1132,56 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1070
1132
|
});
|
|
1071
1133
|
return revoked && row ? toBinding(row) : null;
|
|
1072
1134
|
}
|
|
1135
|
+
/**
|
|
1136
|
+
* Revoke every active binding for one work item (all roles). Called from
|
|
1137
|
+
* terminal-stage cleanup so completed items stop paying the reconcile walk.
|
|
1138
|
+
* Returns the number of bindings revoked.
|
|
1139
|
+
*/
|
|
1140
|
+
async revokeRunBindingsForWorkItem(input) {
|
|
1141
|
+
return this.#db.updateMany("factory_run_bindings", {
|
|
1142
|
+
org_id: input.orgId,
|
|
1143
|
+
factory_project_id: input.factoryProjectId,
|
|
1144
|
+
work_item_id: input.workItemId,
|
|
1145
|
+
status: "active"
|
|
1146
|
+
}, {
|
|
1147
|
+
status: "revoked",
|
|
1148
|
+
revoked_at: input.revokedAt
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Revoke leaked/legacy active bindings: older than `olderThan`, or whose
|
|
1153
|
+
* work item is gone, malformed, or already terminal. Terminal-stage cleanup
|
|
1154
|
+
* handles bindings go-forward; this sweep drains anything that slipped past
|
|
1155
|
+
* it. Returns the number of bindings revoked.
|
|
1156
|
+
*/
|
|
1157
|
+
async revokeStaleRunBindings(input) {
|
|
1158
|
+
const bindings = await this.listActiveRunBindings();
|
|
1159
|
+
const itemCache = /* @__PURE__ */ new Map();
|
|
1160
|
+
let revoked = 0;
|
|
1161
|
+
for (const binding of bindings) {
|
|
1162
|
+
let stale = binding.createdAt.getTime() < input.olderThan.getTime();
|
|
1163
|
+
if (!stale) {
|
|
1164
|
+
const key = `${binding.orgId}:${binding.workItemId}`;
|
|
1165
|
+
let item = itemCache.get(key);
|
|
1166
|
+
if (item === void 0) {
|
|
1167
|
+
item = await this.get({
|
|
1168
|
+
orgId: binding.orgId,
|
|
1169
|
+
id: binding.workItemId
|
|
1170
|
+
});
|
|
1171
|
+
itemCache.set(key, item);
|
|
1172
|
+
}
|
|
1173
|
+
stale = !item || item.stages.length !== 1 || !ACTIVE_RUN_BINDING_STAGES.has(item.stages[0]) || item.factoryProjectId !== binding.factoryProjectId;
|
|
1174
|
+
}
|
|
1175
|
+
if (!stale) continue;
|
|
1176
|
+
if (await this.revokeRunBinding({
|
|
1177
|
+
orgId: binding.orgId,
|
|
1178
|
+
factoryProjectId: binding.factoryProjectId,
|
|
1179
|
+
bindingId: binding.id,
|
|
1180
|
+
revokedAt: input.now
|
|
1181
|
+
})) revoked += 1;
|
|
1182
|
+
}
|
|
1183
|
+
return revoked;
|
|
1184
|
+
}
|
|
1073
1185
|
/** Enumerate active bindings for the server-owned restart reconciler. */
|
|
1074
1186
|
async listActiveRunBindings() {
|
|
1075
1187
|
return (await this.#db.findMany("factory_run_bindings", { status: "active" })).map(toBinding);
|
|
@@ -1174,6 +1286,10 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1174
1286
|
});
|
|
1175
1287
|
item = toRow(row);
|
|
1176
1288
|
}
|
|
1289
|
+
if (input.armAutonomy && !item.autonomyArmedAt) {
|
|
1290
|
+
const armedRow = await ops.updateAtomic("work_items", { id: item.id }, (current) => current.autonomy_armed_at ? null : { autonomy_armed_at: now });
|
|
1291
|
+
if (armedRow) item = toRow(armedRow);
|
|
1292
|
+
}
|
|
1177
1293
|
await ops.updateMany("factory_run_bindings", {
|
|
1178
1294
|
org_id: input.orgId,
|
|
1179
1295
|
factory_project_id: input.factoryProjectId,
|
|
@@ -1372,6 +1488,18 @@ var WorkItemsStorage = class extends FactoryStorageDomain {
|
|
|
1372
1488
|
return this.#withProjectRelationTransaction(orgId, candidate.factory_project_id, run);
|
|
1373
1489
|
}
|
|
1374
1490
|
/**
|
|
1491
|
+
* Record that a person committed this item to the Factory. Only the first
|
|
1492
|
+
* time counts: the timestamp marks when the item stopped needing permission,
|
|
1493
|
+
* so later runs must not push it forward. Bumps no revision, because arming
|
|
1494
|
+
* is not a change anyone is editing against.
|
|
1495
|
+
*/
|
|
1496
|
+
async armAutonomy({ orgId, id, now }) {
|
|
1497
|
+
await this.#db.updateAtomic("work_items", {
|
|
1498
|
+
org_id: orgId,
|
|
1499
|
+
id
|
|
1500
|
+
}, (current) => current.autonomy_armed_at ? null : { autonomy_armed_at: now });
|
|
1501
|
+
}
|
|
1502
|
+
/**
|
|
1375
1503
|
* Drop the governance rows that materialized a source key so a deleted work item
|
|
1376
1504
|
* is not resurrected by the prior-ingress replay path on the next intake poll.
|
|
1377
1505
|
*/
|