fix: clean workflow helper extraction lint
This commit is contained in:
parent
426fea7334
commit
e154dad930
3 changed files with 27 additions and 32 deletions
|
|
@ -9,23 +9,6 @@ import { existsSync } from "node:fs";
|
||||||
import { basename, join } from "node:path";
|
import { basename, join } from "node:path";
|
||||||
import { getLoadedSkills } from "@singularity-forge/pi-coding-agent";
|
import { getLoadedSkills } from "@singularity-forge/pi-coding-agent";
|
||||||
import { buildExtractionStepsBlock } from "./commands-extract-learnings.js";
|
import { buildExtractionStepsBlock } from "./commands-extract-learnings.js";
|
||||||
import {
|
|
||||||
inlineFile,
|
|
||||||
inlineFileOptional,
|
|
||||||
inlineFileSmart,
|
|
||||||
} from "./io-helpers.js";
|
|
||||||
import {
|
|
||||||
buildSliceSummaryExcerpt,
|
|
||||||
getDependencyTaskSummaryPaths,
|
|
||||||
getPriorTaskSummaryPaths,
|
|
||||||
isSummaryCleanForSkip,
|
|
||||||
} from "./summary-helpers.js";
|
|
||||||
import {
|
|
||||||
buildCarryForwardSection,
|
|
||||||
buildResumeSection,
|
|
||||||
checkNeedsReassessment,
|
|
||||||
checkNeedsRunUat,
|
|
||||||
} from "./workflow-helpers.js";
|
|
||||||
import {
|
import {
|
||||||
computeBudgets,
|
computeBudgets,
|
||||||
resolveExecutorContextWindow,
|
resolveExecutorContextWindow,
|
||||||
|
|
@ -35,12 +18,16 @@ import {
|
||||||
formatOverridesSection,
|
formatOverridesSection,
|
||||||
loadActiveOverrides,
|
loadActiveOverrides,
|
||||||
loadFile,
|
loadFile,
|
||||||
parseContinue,
|
|
||||||
parseSummary,
|
parseSummary,
|
||||||
parseTaskPlanFile,
|
parseTaskPlanFile,
|
||||||
} from "./files.js";
|
} from "./files.js";
|
||||||
import { assertGateCoverage, getGatesForTurn } from "./gate-registry.js";
|
import { assertGateCoverage, getGatesForTurn } from "./gate-registry.js";
|
||||||
import { inlineGraphSubgraph } from "./graph-context.js";
|
import { inlineGraphSubgraph } from "./graph-context.js";
|
||||||
|
import {
|
||||||
|
inlineFile,
|
||||||
|
inlineFileOptional,
|
||||||
|
inlineFileSmart,
|
||||||
|
} from "./io-helpers.js";
|
||||||
import { injectKnowledgeIntPrompt } from "./knowledge-injector.js";
|
import { injectKnowledgeIntPrompt } from "./knowledge-injector.js";
|
||||||
import {
|
import {
|
||||||
formatMemoriesForPrompt,
|
formatMemoriesForPrompt,
|
||||||
|
|
@ -81,8 +68,17 @@ import {
|
||||||
formatDecisionsCompact,
|
formatDecisionsCompact,
|
||||||
formatRequirementsCompact,
|
formatRequirementsCompact,
|
||||||
} from "./structured-data-formatter.js";
|
} from "./structured-data-formatter.js";
|
||||||
|
import {
|
||||||
|
buildSliceSummaryExcerpt,
|
||||||
|
getDependencyTaskSummaryPaths,
|
||||||
|
getPriorTaskSummaryPaths,
|
||||||
|
} from "./summary-helpers.js";
|
||||||
import { composeInlinedContext } from "./unit-context-composer.js";
|
import { composeInlinedContext } from "./unit-context-composer.js";
|
||||||
import { getUatType, hasVerdict } from "./verdict-parser.js";
|
import { getUatType } from "./verdict-parser.js";
|
||||||
|
import {
|
||||||
|
buildCarryForwardSection,
|
||||||
|
buildResumeSection,
|
||||||
|
} from "./workflow-helpers.js";
|
||||||
import { logWarning } from "./workflow-logger.js";
|
import { logWarning } from "./workflow-logger.js";
|
||||||
|
|
||||||
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
// ─── Preamble Cap ─────────────────────────────────────────────────────────────
|
||||||
|
|
@ -925,9 +921,6 @@ export function extractMarkdownSection(content, heading) {
|
||||||
export function escapeRegExp(value) {
|
export function escapeRegExp(value) {
|
||||||
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||||
}
|
}
|
||||||
function oneLine(text) {
|
|
||||||
return text.replace(/\s+/g, " ").trim();
|
|
||||||
}
|
|
||||||
// Re-exported from workflow-helpers.js:
|
// Re-exported from workflow-helpers.js:
|
||||||
// - buildResumeSection, buildCarryForwardSection
|
// - buildResumeSection, buildCarryForwardSection
|
||||||
// - checkNeedsReassessment, checkNeedsRunUat
|
// - checkNeedsReassessment, checkNeedsRunUat
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { loadFile, parseSummary } from "./files.js";
|
import { loadFile, parseSummary } from "./files.js";
|
||||||
import {
|
import { relSlicePath, resolveTaskFiles, resolveTasksDir } from "./paths.js";
|
||||||
relSlicePath,
|
|
||||||
resolveSliceFile,
|
|
||||||
resolveTasksDir,
|
|
||||||
resolveTaskFiles,
|
|
||||||
} from "./paths.js";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extract and format a slice summary as a compact excerpt.
|
* Extract and format a slice summary as a compact excerpt.
|
||||||
|
|
@ -183,8 +178,15 @@ export function isSummaryCleanForSkip(content) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Check for critical keywords in narrative
|
// Check for critical keywords in narrative
|
||||||
const narrative = `${s.deviations} ${s.knownLimitations} ${s.followUps}`.toLowerCase();
|
const narrative =
|
||||||
const criticalKeywords = ["critical", "blocker", "blocked", "fail", "error"];
|
`${s.deviations} ${s.knownLimitations} ${s.followUps}`.toLowerCase();
|
||||||
|
const criticalKeywords = [
|
||||||
|
"critical",
|
||||||
|
"blocker",
|
||||||
|
"blocked",
|
||||||
|
"fail",
|
||||||
|
"error",
|
||||||
|
];
|
||||||
if (criticalKeywords.some((kw) => narrative.includes(kw))) {
|
if (criticalKeywords.some((kw) => narrative.includes(kw))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
import { existsSync } from "node:fs";
|
import { existsSync } from "node:fs";
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
|
import { loadFile, parseContinue, parseSummary } from "./files.js";
|
||||||
import { resolveSliceFile } from "./paths.js";
|
import { resolveSliceFile } from "./paths.js";
|
||||||
import { loadFile, parseSummary, parseContinue } from "./files.js";
|
|
||||||
import { isDbAvailable } from "./sf-db.js";
|
import { isDbAvailable } from "./sf-db.js";
|
||||||
import { hasVerdict } from "./verdict-parser.js";
|
import { hasVerdict } from "./verdict-parser.js";
|
||||||
|
|
||||||
|
|
@ -57,7 +57,7 @@ function extractMarkdownSection(content, heading) {
|
||||||
* - The last completed slice already has an assessment file
|
* - The last completed slice already has an assessment file
|
||||||
* - All slices are complete (milestone done — no point reassessing)
|
* - All slices are complete (milestone done — no point reassessing)
|
||||||
*/
|
*/
|
||||||
export async function checkNeedsReassessment(base, mid, _state, prefs) {
|
export async function checkNeedsReassessment(base, mid, _state, _prefs) {
|
||||||
// DB primary path
|
// DB primary path
|
||||||
try {
|
try {
|
||||||
const { getMilestoneSlices } = await import("./sf-db.js");
|
const { getMilestoneSlices } = await import("./sf-db.js");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue