feat(FN-5253): merge fusion/fn-5253

This commit is contained in:
gsxdsm
2026-05-20 06:32:21 -07:00
parent 69c77fa3bf
commit e33f84fb0a
3 changed files with 48 additions and 10 deletions

View File

@@ -217,7 +217,7 @@ describe("buildExecutionPrompt", () => {
} as any);
const result = buildExecutionPrompt(task, "/home/user/project");
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — description" -m "Ref: runfusion/fusion#2915"');
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — <short summary>" -m "Ref: runfusion/fusion#2915"');
});
it("falls back to externalIssueId for commit source issue reference when issueNumber is missing", () => {
@@ -230,17 +230,36 @@ describe("buildExecutionPrompt", () => {
} as any);
const result = buildExecutionPrompt(task, "/home/user/project");
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — description" -m "Ref: runfusion/fusion#2915"');
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — <short summary>" -m "Ref: runfusion/fusion#2915"');
});
it("omits source issue reference from commit instruction when sourceIssue is missing", () => {
const task = createMockTaskDetail();
const result = buildExecutionPrompt(task, "/home/user/project");
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — description"');
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — <short summary>"');
expect(result).not.toContain(' -m "Ref:');
});
it("requires a short summary in the execution prompt begin block", () => {
const task = createMockTaskDetail();
const result = buildExecutionPrompt(task, "/home/user/project");
expect(result).toContain('git commit -m "feat(FN-001): complete Step N — <short summary>"');
expect(result).toContain("The `<short summary>` is required");
expect(result).toContain("concrete 510 word description of what the step changed");
});
it("keeps the executor source prompt wording and examples for commit summaries", async () => {
const { readFileSync } = await vi.importActual<typeof import("node:fs")>("node:fs");
const executorSource = readFileSync(new URL("../executor.ts", import.meta.url), "utf8");
expect(executorSource).toContain("Always include a short, specific summary after the em dash (510 words)");
expect(executorSource).toContain("Do NOT commit just \\`complete Step N\\`");
expect(executorSource).toContain("\\`feat(FN-1234): complete Step 4 — tighten prompt examples for commit summaries\\`");
expect(executorSource).toContain("\\`feat(FN-1234): complete Step 2\\`");
});
it("omits Project Commands section when neither command is set", () => {
const task = createMockTaskDetail();
const result = buildExecutionPrompt(task, "/home/user/project", {} as any);

View File

@@ -770,14 +770,18 @@ If the task's PROMPT.md includes a "Documentation Requirements" section listing
## Git discipline
- Commit after completing each step (not after every file change)
- Use conventional commit messages prefixed with the task ID
- Always include a short, specific summary after the em dash (510 words)
- Do NOT commit just \`complete Step N\` — the summary is what makes the commit useful in \`git log\`, merger subject derivation, and step reconciliation
- When the task has a GitHub issue reference, include \`Ref: owner/repo#N\` in the commit body
- Do NOT commit broken or half-implemented code
Good commit message examples:
- \`feat(FN-1234): complete Step 2 — add retry guard for workflow step timeouts\`
- \`feat(FN-1234): complete Step 4 — tighten prompt examples for commit summaries\`
- \`test(FN-1234): add regression tests for paused-session cleanup\`
Bad commit message examples:
- \`feat(FN-1234): complete Step 2\`
- \`misc updates\`
- \`fix stuff\`
- \`wip\`
@@ -10261,7 +10265,8 @@ ${hasProgress
Use \`fn_task_update\` to report progress on every step transition.
Use \`fn_task_log\` for important actions and decisions.
Use \`fn_task_create\` for truly separate follow-up work, not for fixes required to get tests, build, or typecheck back to green.
Commit at step boundaries: \`git commit -m "feat(${task.id}): complete Step N — description"${sourceIssueRef ? ` -m "Ref: ${sourceIssueRef}"` : ""}${authorArg}\`
Commit at step boundaries: \`git commit -m "feat(${task.id}): complete Step N — <short summary>"${sourceIssueRef ? ` -m "Ref: ${sourceIssueRef}"` : ""}${authorArg}\`
The \`<short summary>\` is required — replace it with a concrete 510 word description of what the step changed.
When all steps are complete: call \`fn_task_done()\`
If a build command is configured, run that exact command in this worktree before calling \`fn_task_done()\`.

View File

@@ -185,9 +185,16 @@ Follow this structure exactly:
Commits at step boundaries. All commits include the task ID:
- **Step completion:** \`feat({ID}): complete Step N — description\`
- **Bug fixes:** \`fix({ID}): description\`
- **Tests:** \`test({ID}): description\`
- **Step completion:** \`feat({ID}): complete Step N — <short summary>\` (the \`<short summary>\` is required — use a concrete 510 word description)
- **Bug fixes:** \`fix({ID}): description\` (short, concrete summary required)
- **Tests:** \`test({ID}): description\` (short, concrete summary required)
Good examples:
- \`feat(FN-1234): complete Step 2 — add retry guard for workflow step timeouts\`
- \`test(FN-1234): add regression tests for paused-session cleanup\`
Bad example:
- \`feat(FN-1234): complete Step 2\`
## Do NOT
@@ -455,9 +462,16 @@ Follow this structure exactly:
Commits at step boundaries. All commits include the task ID:
- **Step completion:** \`feat({ID}): complete Step N — description\`
- **Bug fixes:** \`fix({ID}): description\`
- **Tests:** \`test({ID}): description\`
- **Step completion:** \`feat({ID}): complete Step N — <short summary>\` (the \`<short summary>\` is required — use a concrete 510 word description)
- **Bug fixes:** \`fix({ID}): description\` (short, concrete summary required)
- **Tests:** \`test({ID}): description\` (short, concrete summary required)
Good examples:
- \`feat(FN-1234): complete Step 2 — add retry guard for workflow step timeouts\`
- \`test(FN-1234): add regression tests for paused-session cleanup\`
Bad example:
- \`feat(FN-1234): complete Step 2\`
## Do NOT