feat(confidence-engine): expose focused-investigation inputs in composed checkpoint

Add focusedInvestigationInput {targetDescription, question, answer} to
composeDeepInvestigationCheckpoint() return object. These are the actual
invocation values: targetDescription from situationGraph node, question
is previousQuestion (NOT node.openQuestion), answer is function param.

Deterministic verification: syntax check passed; source-inspection test
assertions E10/E11 added and pass (0 failures). Call-count ownership:
up to 3 live generateReconstruction calls (focusedDeconstruct +
reconsiderCompletedEpisode + synthesizeCurrentUnderstanding).

No provider, graph, or production behavior changed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
robbond
2026-10-09 13:47:54 +01:00
co-authored by Claude Code
parent d0f357877d
commit d12615075d
4 changed files with 26 additions and 4 deletions
@@ -324,6 +324,10 @@ assert(helperSrc.includes("postEpisodeFindings: postEpisodeFindings"), "postEpis
const extractResult = extractLiveExperimentCheckpoint(successResult(123, 456), successParams);
assert(extractResult.providerGenerateCalls === 1, "providerGenerateCalls preserved from extraction path");
// E10. Apparatus correction: focusedInvestigationInput field present in composed checkpoint (Iteration 2)
assert(helperSrc.includes("focusedInvestigationInput:"), "helper exposes focusedInvestigationInput in composed checkpoint output");
assert(helperSrc.includes("targetDescription:") && helperSrc.includes("question:") && helperSrc.includes("answer,"), "focusedInvestigationInput contains targetDescription, question, answer fields");
// ---- CONTRIBUTION SEAM VERIFICATION (Iteration 4 + Iteration 5 deconstruction) ──────────────────────
console.log("\n=== CONTRIBUTION SEAM VERIFICATION ===\n");
+11 -4
View File
@@ -314,10 +314,8 @@ async function composeDeepInvestigationCheckpoint({ situationGraph, previousQues
/* ── Production-equivalent focused-episode seam: targetNodeId triggers the same path as executeEpisodeDone → handleEpisodeMode ─── */
/* ── Canonical deconstruction: use focusedDeconstruct for Contribution derivation ─── */
const effectiveContributions = contributions.length > 0 ? [...contributions] : [];
/* ── Target-scoped filtering: only contributions belonging to the current target suppress fresh deconstruction ─── */
let targetDescription = "";
let effectiveContributionsForTarget = effectiveContributions;
if (targetNodeId && effectiveContributions.length > 0) {
effectiveContributionsForTarget = effectiveContributions.filter(
@@ -336,7 +334,7 @@ async function composeDeepInvestigationCheckpoint({ situationGraph, previousQues
// Extract node context for deconstruction prompt
const targetNode = situationGraph.nodes.find(n => n.id === targetNodeId);
const targetLabel = targetNode?.label ?? "";
const targetDescription = targetNode?.description ?? "";
targetDescription = targetNode?.description ?? "";
const centralStatement = situationGraph.centralStatement ?? "";
// Call production-focused deconstruct — exactly one provider generation
@@ -510,6 +508,15 @@ async function composeDeepInvestigationCheckpoint({ situationGraph, previousQues
/* ── Answer meaning (from production result) ─── */
userSupportedMeaning: episodeResult?.proposal?.answerMeaning?.userSupportedMeaning ?? null,
possibleInference: episodeResult?.proposal?.answerMeaning?.possibleInference ?? null,
/* ── Focused-investigation input values (apparatus correction) ─── */
focusedInvestigationInput: (previousQuestion != null || answer != null)
? {
targetDescription: targetDescription ?? "",
question: previousQuestion ?? "",
answer,
}
: null,
};
}