feat(FN-5321): add evidence gap detector for external integration manifests

Implements external integration validation (FN-5321) with a manifest validator scaffold, worktrunk manifest wiring, and an evidence gap detector that runs during spec validation and triage; the reviewer also gates on external integration readiness. Includes tests for manifest, evidence gap, and tria

Fusion-Task-Id: FN-5321
This commit is contained in:
Fusion (runfusion.ai)
2026-05-20 15:53:54 -07:00
committed by gsxdsm
parent cce877b5f6
commit b06cf64cd4
15 changed files with 708 additions and 30 deletions

View File

@@ -36,6 +36,10 @@ import {
} from "./agent-session-helpers.js";
import { reviewStep, type ReviewVerdict } from "./reviewer.js";
import { detectDanglingTaskDocReferences, formatDanglingDiagnostic } from "./spec-validation/task-document-references.js";
import {
detectExternalIntegrationEvidenceGaps,
formatExternalIntegrationEvidenceDiagnostic,
} from "./spec-validation/external-integration-evidence.js";
import { buildSessionSkillContext } from "./session-skill-context.js";
import { PRIORITY_SPECIFY, type AgentSemaphore } from "./concurrency.js";
import { AgentLogger } from "./agent-logger.js";
@@ -2101,6 +2105,20 @@ export class TriageProcessor {
};
}
const evidenceGaps = detectExternalIntegrationEvidenceGaps({
promptContent,
});
if (evidenceGaps.length > 0) {
const diagnostic = formatExternalIntegrationEvidenceDiagnostic(evidenceGaps);
specReviewVerdictRef.current = "REVISE";
planLog.warn(`${taskId}: ${diagnostic}`);
await store.logEntry(taskId, "Spec review: REVISE (external-integration evidence gaps)");
return {
content: [{ type: "text" as const, text: diagnostic }],
details: {},
};
}
// Re-read task detail to get latest user comments
const currentDetail = await store.getTask(taskId);
const currentUserComments = (currentDetail.comments || []).filter(