Q205: sprint records never tied to task progress are removed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8861aa4c30
commit
10283f87e5
14 files changed
+16
-82
No files matched your search
@@ -26,8 +26,6 @@ export const collaborationContracts = {
|
||||
}) satisfies z.ZodType<C.UpdateKnowledgeEntryInput>,
|
||||
deleteKnowledgeEntry: z.strictObject({ orgId: id, entryId: id, deletedByEmployeeId: id }) satisfies z.ZodType<C.DeleteKnowledgeEntryInput>,
|
||||
listKnowledgeRevisions: z.strictObject({ orgId: id, entryId: id }) satisfies z.ZodType<C.ListKnowledgeRevisionsInput>,
|
||||
createSprint: z.strictObject({ orgId: id, name: z.string(), goal: z.string(), startDate: z.string(), endDate: z.string() }) satisfies z.ZodType<C.CreateSprintInput>,
|
||||
deleteSprint: z.strictObject({ orgId: id, sprintId: id }) satisfies z.ZodType<C.DeleteSprintInput>,
|
||||
createChatSpace: z.strictObject({
|
||||
orgId: id, spaceType: z.enum(["company", "division", "department", "project", "pod", "ad_hoc", "direct"]), name: z.string(), topic: z.string(),
|
||||
visibility: z.enum(["workspace", "restricted"]), retentionPolicy: z.enum(["standard_365d", "restricted_365d"]).optional(),
|
||||
|
||||
@@ -23,7 +23,6 @@ import { OperationsService } from "../services/operations-service";
|
||||
import { TaskExecutionService } from "../services/task-execution-service";
|
||||
import { DocumentService } from "../services/document-service";
|
||||
import { KnowledgeService } from "../services/knowledge-service";
|
||||
import { SprintService } from "../services/sprint-service";
|
||||
import { ComposioConnectionService } from "../services/composio/composio-connection-service";
|
||||
import { ConnectorGrantsService } from "../services/composio/connector-grants";
|
||||
import { approvalDrifts } from "../services/approval-drift";
|
||||
@@ -90,7 +89,6 @@ export function registerIpcHandlers(deps: IpcDeps): void {
|
||||
const operations = new OperationsService(deps.connection.db);
|
||||
const documents = new DocumentService(deps.connection.db);
|
||||
const knowledge = new KnowledgeService(deps.connection.db);
|
||||
const sprintService = new SprintService(deps.connection.db);
|
||||
const onboarding = new OnboardingService({
|
||||
db: deps.connection.db,
|
||||
saveProviderCredential: (input) => providers.saveCredential(input),
|
||||
@@ -238,8 +236,6 @@ export function registerIpcHandlers(deps: IpcDeps): void {
|
||||
revision: r.revision, topic: r.topic, category: r.category, content: r.content, importance: r.importance,
|
||||
changedByType: r.changed_by_type, changedById: r.changed_by_id, reason: r.reason, createdAt: r.created_at,
|
||||
}))));
|
||||
handle("createSprint", (input) => mutate(() => sprintService.create(input)));
|
||||
handle("deleteSprint", (input) => mutate(() => sprintService.delete(input)));
|
||||
handle("createApproval", (input) => mutate(() => approvals.create(input)));
|
||||
handle("decideApproval", (input) => mutate(() => approvals.decide(input)));
|
||||
handle("syncEmployeeIdentity", (input) => mutate(() => identityAccess.syncEmployeeIdentity(input)));
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// Sprints were saved but never tracked against tasks; the records are removed rather than kept as a promise.
|
||||
export const dropSprintsSchema = `
|
||||
drop index if exists idx_sprints_org;
|
||||
drop table if exists sprints;
|
||||
`;
|
||||
@@ -108,6 +108,7 @@ import { viewStateSchema } from "./migrations/106-view-state";
|
||||
import { searchPendingSchema } from "./migrations/107-search-pending";
|
||||
import { dropAutomationRulesSchema } from "./migrations/108-drop-automation-rules";
|
||||
import { dropMeetingsSchema } from "./migrations/109-drop-meetings";
|
||||
import { dropSprintsSchema } from "./migrations/110-drop-sprints";
|
||||
|
||||
interface Migration {
|
||||
version: number;
|
||||
@@ -225,6 +226,7 @@ const MIGRATIONS: Migration[] = [
|
||||
{ version: 107, name: "search_pending", sql: searchPendingSchema },
|
||||
{ version: 108, name: "drop_automation_rules", sql: dropAutomationRulesSchema },
|
||||
{ version: 109, name: "drop_meetings", sql: dropMeetingsSchema },
|
||||
{ version: 110, name: "drop_sprints", sql: dropSprintsSchema },
|
||||
];
|
||||
|
||||
const SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1].version;
|
||||
|
||||
@@ -151,7 +151,6 @@ export class SnapshotService {
|
||||
auditEvents: recentInOrg<AppSnapshot["auditEvents"][number]>(this.db, "audit_events", "created_at desc", 200, activeOrgId),
|
||||
documents: list(this.db, "documents", "updated_at desc"),
|
||||
knowledgeEntries: list(this.db, "knowledge_entries", "updated_at desc"),
|
||||
sprints: list(this.db, "sprints", "start_date desc"),
|
||||
connectorAccounts: list(this.db, "connector_accounts", "toolkit_slug asc"),
|
||||
connectorGrants: list(this.db, "agent_connector_grants", "toolkit_slug asc, created_at asc"),
|
||||
};
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import type { CreateSprintInput, DeleteSprintInput } from "../../shared/commands";
|
||||
import { createId } from "../../shared/ids";
|
||||
import { AuditService } from "./audit-service";
|
||||
|
||||
export class SprintService {
|
||||
private readonly audit: AuditService;
|
||||
|
||||
constructor(private readonly db: DatabaseSync) {
|
||||
this.audit = new AuditService(db);
|
||||
}
|
||||
|
||||
create(input: CreateSprintInput): string {
|
||||
const id = createId("spr");
|
||||
const now = new Date().toISOString();
|
||||
this.db.prepare(`
|
||||
insert into sprints(id, org_id, name, goal, status, start_date, end_date, velocity_points, completed_points, retrospective, created_at, updated_at)
|
||||
values (?, ?, ?, ?, ?, ?, ?, 0, 0, ?, ?, ?)
|
||||
`).run(id, input.orgId, input.name.trim(), input.goal.trim(), "planned", input.startDate, input.endDate, "", now, now);
|
||||
this.audit.record({
|
||||
orgId: input.orgId,
|
||||
entityType: "sprint",
|
||||
entityId: id,
|
||||
actorType: "system",
|
||||
actorId: null,
|
||||
action: "created",
|
||||
payload: { name: input.name.trim() },
|
||||
});
|
||||
return id;
|
||||
}
|
||||
|
||||
delete(input: DeleteSprintInput): void {
|
||||
const result = this.db.prepare("delete from sprints where id = ? and org_id = ?").run(input.sprintId, input.orgId);
|
||||
if (result.changes === 0) throw new Error("Sprint was not found.");
|
||||
}
|
||||
}
|
||||
@@ -44,8 +44,6 @@ const api: DesktopApi = {
|
||||
updateKnowledgeEntry: (input) => invoke(IPC_CHANNELS.updateKnowledgeEntry, input),
|
||||
listDocumentVersions: (input) => invoke(IPC_CHANNELS.listDocumentVersions, input),
|
||||
listKnowledgeRevisions: (input) => invoke(IPC_CHANNELS.listKnowledgeRevisions, input),
|
||||
createSprint: (input) => invoke(IPC_CHANNELS.createSprint, input),
|
||||
deleteSprint: (input) => invoke(IPC_CHANNELS.deleteSprint, input),
|
||||
createApproval: (input) => invoke(IPC_CHANNELS.createApproval, input),
|
||||
decideApproval: (input) => invoke(IPC_CHANNELS.decideApproval, input),
|
||||
syncEmployeeIdentity: (input) => invoke(IPC_CHANNELS.syncEmployeeIdentity, input),
|
||||
|
||||
@@ -103,16 +103,3 @@ export interface DeleteKnowledgeEntryInput {
|
||||
entryId: string;
|
||||
deletedByEmployeeId: string;
|
||||
}
|
||||
|
||||
export interface CreateSprintInput {
|
||||
orgId: string;
|
||||
name: string;
|
||||
goal: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}
|
||||
|
||||
export interface DeleteSprintInput {
|
||||
orgId: string;
|
||||
sprintId: string;
|
||||
}
|
||||
@@ -19,8 +19,6 @@ import type {
|
||||
CreateApprovalInput,
|
||||
CreateDocumentInput,
|
||||
CreateGoalInput,
|
||||
CreateSprintInput,
|
||||
DeleteSprintInput,
|
||||
CreateKnowledgeEntryInput,
|
||||
UpdateKnowledgeEntryInput,
|
||||
DocumentVersionRecord,
|
||||
@@ -159,8 +157,6 @@ export interface DesktopApi {
|
||||
updateKnowledgeEntry(input: UpdateKnowledgeEntryInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
listDocumentVersions(input: ListDocumentVersionsInput): Promise<DesktopResult<DocumentVersionRecord[]>>;
|
||||
listKnowledgeRevisions(input: ListKnowledgeRevisionsInput): Promise<DesktopResult<KnowledgeRevisionRecord[]>>;
|
||||
createSprint(input: CreateSprintInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
deleteSprint(input: DeleteSprintInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
createApproval(input: CreateApprovalInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
decideApproval(input: DecideApprovalInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
syncEmployeeIdentity(input: SyncEmployeeIdentityInput): Promise<DesktopResult<AppSnapshot>>;
|
||||
|
||||
@@ -244,21 +244,6 @@ export interface ApprovalRecord {
|
||||
decidedAt: string | null;
|
||||
}
|
||||
|
||||
export interface SprintRecord {
|
||||
id: string;
|
||||
orgId: string;
|
||||
name: string;
|
||||
goal: string;
|
||||
status: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
velocityPoints: number;
|
||||
completedPoints: number;
|
||||
retrospective: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface FileObjectRecord {
|
||||
id: string;
|
||||
orgId: string;
|
||||
|
||||
@@ -77,8 +77,6 @@ export const IPC_CHANNELS = {
|
||||
updateKnowledgeEntry: "agentcompany:update-knowledge-entry",
|
||||
listDocumentVersions: "agentcompany:list-document-versions",
|
||||
listKnowledgeRevisions: "agentcompany:list-knowledge-revisions",
|
||||
createSprint: "agentcompany:create-sprint",
|
||||
deleteSprint: "agentcompany:delete-sprint",
|
||||
listConnectorCatalog: "agentcompany:list-connector-catalog",
|
||||
connectComposioToolkit: "agentcompany:connect-composio-toolkit",
|
||||
disconnectComposioToolkit: "agentcompany:disconnect-composio-toolkit",
|
||||
|
||||
@@ -36,7 +36,6 @@ import type {
|
||||
ProviderRecord,
|
||||
ScheduledPostRecord,
|
||||
SkillDefinitionRecord,
|
||||
SprintRecord,
|
||||
TaskRecord,
|
||||
TaskRunRecord,
|
||||
WorkspaceRecord,
|
||||
@@ -125,7 +124,6 @@ export interface AppSnapshot {
|
||||
auditEvents: AuditEventRecord[];
|
||||
documents: DocumentRecord[];
|
||||
knowledgeEntries: KnowledgeEntryRecord[];
|
||||
sprints: SprintRecord[];
|
||||
connectorAccounts: ConnectorAccountRecord[];
|
||||
connectorGrants: ConnectorGrantRecord[];
|
||||
}
|
||||
@@ -36,7 +36,7 @@ describe("domain services", () => {
|
||||
const connection = createConnection();
|
||||
|
||||
const rows = connection.db.prepare("select version from schema_migrations order by version asc").all() as Array<{ version: number }>;
|
||||
expect(rows.map((row) => row.version)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]);
|
||||
expect(rows.map((row) => row.version)).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110]);
|
||||
connection.close();
|
||||
});
|
||||
|
||||
|
||||
@@ -21,3 +21,11 @@ test("meeting records are gone: no table, no channels", () => {
|
||||
expect(tables.map((row) => row.name)).not.toContain("meetings");
|
||||
expect(Object.keys(IPC_CHANNELS).filter((key) => /meeting/i.test(key))).toEqual([]);
|
||||
});
|
||||
|
||||
test("sprint records are gone: no table, no channels", () => {
|
||||
const connection = new DatabaseConnection(join(tmpdir(), `agentcompany-new-${randomUUID()}.db`));
|
||||
const tables = connection.db.prepare("select name from sqlite_master where type = 'table'").all() as Array<{ name: string }>;
|
||||
connection.close();
|
||||
expect(tables.map((row) => row.name)).not.toContain("sprints");
|
||||
expect(Object.keys(IPC_CHANNELS).filter((key) => /sprint/i.test(key))).toEqual([]);
|
||||
});
|
||||
Reference in new issue
Block a user