feat(FN-3056): merge fusion/fn-3056
This merge ships several feature and infrastructure improvements across the codebase. Task title validation is strengthened in triage with stricter rejection of malformed titles and preference for prompt-declared titles (FN-3056), while task creation now preserves priority settings (FN-3210). The Mi Fusion-Task-Id: FN-3056
This commit is contained in:
@@ -1967,6 +1967,11 @@ export class TriageProcessor {
|
||||
taskUpdates.reviewLevel = parseInt(reviewMatch[1], 10);
|
||||
}
|
||||
|
||||
const promptDeclaredTitle = extractPromptDeclaredTitle(written, task.id);
|
||||
if (promptDeclaredTitle) {
|
||||
taskUpdates.title = promptDeclaredTitle;
|
||||
}
|
||||
|
||||
await this.store.updateTask(task.id, taskUpdates);
|
||||
|
||||
if (settings.requirePlanApproval) {
|
||||
@@ -1996,6 +2001,23 @@ export class TriageProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
function extractPromptDeclaredTitle(prompt: string, taskId: string): string | null {
|
||||
const headingMatch = prompt.match(/^#\s+Task:\s+([A-Z]+-\d+)\s+-\s+(.+)$/m);
|
||||
if (!headingMatch) return null;
|
||||
const [, headingTaskId, rawTitle] = headingMatch;
|
||||
if (headingTaskId !== taskId) return null;
|
||||
|
||||
const title = rawTitle.trim().replace(/[\s.!?,;:]+$/g, "");
|
||||
if (!title) return null;
|
||||
|
||||
// Conservative guard: do not overwrite metadata with confirmation prose.
|
||||
if (/^created\s+(?:task\s+)?(?:fn-\d+\b|\*\*\s*fn-\d+\s*\*\*)/i.test(title)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
function hasLatestSpecReviewApproval(task: Task): boolean {
|
||||
for (let i = task.log.length - 1; i >= 0; i--) {
|
||||
const action = task.log[i]?.action ?? "";
|
||||
|
||||
Reference in New Issue
Block a user