@allpepper/task-orchestrator 1.1.1 → 1.1.2
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/package.json +1 -1
- package/src/repos/tasks.ts +14 -2
- package/src/tools/manage-container.ts +0 -1
package/package.json
CHANGED
package/src/repos/tasks.ts
CHANGED
|
@@ -73,7 +73,6 @@ function validateComplexity(complexity: number): boolean {
|
|
|
73
73
|
// ============================================================================
|
|
74
74
|
|
|
75
75
|
export function createTask(params: {
|
|
76
|
-
projectId?: string;
|
|
77
76
|
featureId?: string;
|
|
78
77
|
title: string;
|
|
79
78
|
summary: string;
|
|
@@ -97,6 +96,19 @@ export function createTask(params: {
|
|
|
97
96
|
return err('Summary is required', 'VALIDATION_ERROR');
|
|
98
97
|
}
|
|
99
98
|
|
|
99
|
+
// Derive projectId from feature - feature is the source of truth for project membership
|
|
100
|
+
let projectId: string | undefined;
|
|
101
|
+
if (params.featureId) {
|
|
102
|
+
const feature = queryOne<{ project_id: string | null }>(
|
|
103
|
+
'SELECT project_id FROM features WHERE id = ?',
|
|
104
|
+
[params.featureId]
|
|
105
|
+
);
|
|
106
|
+
if (!feature) {
|
|
107
|
+
return err(`Feature not found: ${params.featureId}`, 'NOT_FOUND');
|
|
108
|
+
}
|
|
109
|
+
projectId = feature.project_id ?? undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
const id = generateId();
|
|
101
113
|
const timestamp = now();
|
|
102
114
|
const status = params.status ?? TaskStatus.PENDING;
|
|
@@ -113,7 +125,7 @@ export function createTask(params: {
|
|
|
113
125
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
|
114
126
|
[
|
|
115
127
|
id,
|
|
116
|
-
|
|
128
|
+
projectId ?? null,
|
|
117
129
|
params.featureId ?? null,
|
|
118
130
|
params.title.trim(),
|
|
119
131
|
params.summary.trim(),
|