fix(FN-5089): add trailer settings typing defaults

Fusion-Task-Id: FN-5089
Fusion-Task-Lineage: ad7ea32a-c024-45bb-b68e-b65665b9b7c6
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 02:33:44 -07:00
committed by gsxdsm
parent 6c40b0685d
commit e53cf7e0b1
3 changed files with 6 additions and 4 deletions

View File

@@ -215,6 +215,7 @@ export const DEFAULT_PROJECT_SETTINGS = {
},
worktreesDir: undefined,
taskPrefix: "FN",
taskAttributionTrailerNames: ["Fusion-Task-Id"],
commitMsgHookEnabled: true,
includeTaskIdInCommit: true,
commitAuthorEnabled: true,

View File

@@ -2724,6 +2724,10 @@ export interface ProjectSettings {
* Defaults to `"KB"`. Only affects new tasks — existing tasks retain
* their original IDs. */
taskPrefix?: string;
/** Preferred commit trailer keys for task attribution in priority order.
* The first value is used by commit-msg hook installation when enabled.
* Defaults to `["Fusion-Task-Id"]`. */
taskAttributionTrailerNames?: string[];
/** When true, Fusion installs a commit-msg hook in managed task worktrees
* that appends the configured task attribution trailer (e.g. `Fusion-Task-Id: FN-123`).
* Set to false for projects with custom hook infrastructure. Default: true. */

View File

@@ -172,7 +172,7 @@ export class NativeWorktreeBackend implements WorktreeBackend {
constructor(
private readonly deps: {
logger?: { log: (m: string) => void; warn: (m: string) => void };
settings?: Pick<Settings, "worktreesDir" | "commitMsgHookEnabled" | "taskPrefix" | "taskAttributionTrailerNames">;
settings?: Partial<Pick<Settings, "worktreesDir" | "commitMsgHookEnabled" | "taskPrefix" | "taskAttributionTrailerNames">>;
audit?: Pick<RunAuditor, "git">;
} = {},
) {}
@@ -552,9 +552,6 @@ export class WorktrunkWorktreeBackend implements WorktreeBackend {
await installTaskWorktreeIdentityGuard({
worktreePath: resolvedPath,
taskId: input.taskId,
commitMsgHookEnabled: this.deps.settings?.commitMsgHookEnabled,
taskPrefix: this.deps.settings?.taskPrefix,
taskAttributionTrailerName: this.deps.settings?.taskAttributionTrailerNames?.[0],
});
} catch (error) {
await execAsync(`rm -rf ${quoteShellArg(resolvedPath)}`, {