feat(FN-4468): add workflow step gateMode advisory gating
Adds an "advisory" `gateMode` option for workflow steps: steps in advisory mode log findings but no longer block merge completion, while steps that must block can still be configured as blocking. The change covers the workflow step types and schema, executor gating logic, dashboard UI in WorkflowSte Fusion-Task-Id: FN-4468
This commit is contained in:
@@ -119,7 +119,7 @@ export function probeFts5(db: DatabaseSync): boolean {
|
||||
|
||||
// ── Schema Definition ────────────────────────────────────────────────
|
||||
|
||||
const SCHEMA_VERSION = 75;
|
||||
const SCHEMA_VERSION = 76;
|
||||
|
||||
function normalizeTaskComments(
|
||||
steeringComments: SteeringComment[] | undefined,
|
||||
@@ -324,6 +324,7 @@ CREATE TABLE IF NOT EXISTS workflow_steps (
|
||||
mode TEXT NOT NULL DEFAULT 'prompt',
|
||||
phase TEXT NOT NULL DEFAULT 'pre-merge',
|
||||
prompt TEXT NOT NULL DEFAULT '',
|
||||
gateMode TEXT NOT NULL DEFAULT 'advisory',
|
||||
toolMode TEXT,
|
||||
scriptName TEXT,
|
||||
enabled INTEGER NOT NULL DEFAULT 1,
|
||||
@@ -1769,6 +1770,7 @@ export class Database {
|
||||
mode TEXT NOT NULL DEFAULT 'prompt',
|
||||
phase TEXT NOT NULL DEFAULT 'pre-merge',
|
||||
prompt TEXT NOT NULL DEFAULT '',
|
||||
gateMode TEXT NOT NULL DEFAULT 'advisory',
|
||||
toolMode TEXT,
|
||||
scriptName TEXT,
|
||||
enabled INTEGER NOT NULL DEFAULT 1,
|
||||
@@ -1798,6 +1800,7 @@ export class Database {
|
||||
mode,
|
||||
phase,
|
||||
prompt,
|
||||
gateMode,
|
||||
toolMode,
|
||||
scriptName,
|
||||
enabled,
|
||||
@@ -1806,7 +1809,7 @@ export class Database {
|
||||
modelId,
|
||||
createdAt,
|
||||
updatedAt
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`);
|
||||
|
||||
for (const step of workflowSteps) {
|
||||
@@ -1837,6 +1840,9 @@ export class Database {
|
||||
mode,
|
||||
phase,
|
||||
typeof step.prompt === "string" ? step.prompt : "",
|
||||
step.gateMode === "gate" || step.gateMode === "advisory"
|
||||
? step.gateMode
|
||||
: (mode === "script" ? "gate" : "advisory"),
|
||||
step.toolMode === "coding" || step.toolMode === "readonly" ? step.toolMode : null,
|
||||
typeof step.scriptName === "string" ? step.scriptName : null,
|
||||
step.enabled === false ? 0 : 1,
|
||||
@@ -3244,6 +3250,13 @@ export class Database {
|
||||
});
|
||||
}
|
||||
|
||||
if (version < 76) {
|
||||
this.applyMigration(76, () => {
|
||||
this.addColumnIfMissing("workflow_steps", "gateMode", "TEXT NOT NULL DEFAULT 'advisory'");
|
||||
this.db.exec("UPDATE workflow_steps SET gateMode = CASE WHEN mode = 'script' THEN 'gate' ELSE 'advisory' END WHERE gateMode IS NULL OR gateMode = ''");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user