Accept nested proof gate bridge fields

This commit is contained in:
OpenClaw Bot
2026-05-28 00:17:48 +02:00
parent f424b61730
commit 896198fe07
3 changed files with 57 additions and 7 deletions
+7 -6
View File
@@ -1111,14 +1111,15 @@ function normalizeFeatureOption(item, index, fallbackId = 'feature', defaultSour
const rawValue = typeof item === 'string' || typeof item === 'number' ? String(item) : '';
const raw = rawValue ? { action: rawValue } : objectFrom(item);
const title = cleanText(raw.title || raw.name || raw.action || raw.move || raw.step || raw.task || raw.instruction || raw.nextMove || raw.next_move || raw.nextStep || raw.next_step || raw.recommendedNextStep || raw.recommended_next_step || raw.experiment || raw.testName || raw.test_name || raw.hypothesis || raw.label || raw.text || raw.content || raw.summary || '', 140);
const proofSteps = cleanTextList(raw.proofSteps || raw.proof_steps || raw.proof || raw.firstProof || raw.first_proof || raw.validationSteps || raw.validation_steps || raw.steps || raw.method, 5, 180);
const proofGate = objectFrom(raw.proofGate || raw.proof_gate || raw.validationGate || raw.validation_gate || raw.evidenceGate || raw.evidence_gate || raw.decisionGate || raw.decision_gate || raw.gate);
const proofSteps = cleanTextList(raw.proofSteps || raw.proof_steps || raw.proof || raw.firstProof || raw.first_proof || raw.validationSteps || raw.validation_steps || raw.steps || raw.method || proofGate.steps || proofGate.proofSteps || proofGate.proof_steps || proofGate.method, 5, 180);
const dependencies = cleanTextList(raw.dependencies || raw.blockedBy || raw.blocked_by, 5, 120);
const evidenceNeeded = cleanText(raw.evidenceNeeded || raw.evidence_needed || raw.evidenceToCollect || raw.evidence_to_collect || raw.evidence || raw.test || raw.proofQuestion || raw.proof_question || raw.evidenceQuestion || raw.evidence_question || raw.questionToAnswer || raw.question_to_answer || raw.question || raw.learningGoal || raw.learning_goal || '', 260);
const evidenceNeeded = cleanText(raw.evidenceNeeded || raw.evidence_needed || raw.evidenceToCollect || raw.evidence_to_collect || raw.evidence || raw.test || raw.proofQuestion || raw.proof_question || raw.evidenceQuestion || raw.evidence_question || raw.questionToAnswer || raw.question_to_answer || raw.question || raw.learningGoal || raw.learning_goal || proofGate.evidenceNeeded || proofGate.evidence_needed || proofGate.evidence || proofGate.question || proofGate.evidenceQuestion || proofGate.evidence_question || proofGate.learningGoal || proofGate.learning_goal || '', 260);
const userValue = cleanText(raw.userValue || raw.user_value || raw.value || raw.outcome || raw.why || raw.whyItMatters || raw.why_it_matters || raw.whyNow || raw.why_now, 260);
const risk = cleanText(raw.risk || raw.assumption || raw.unknown || raw.watchOut || raw.watch_out || '', 220);
const nextStep = cleanText(raw.nextStep || raw.next_step || raw.nextAction || raw.next_action || raw.firstStep || raw.first_step || raw.manualStep || raw.manual_step || raw.actionToTake || raw.action_to_take || raw.firstProofStep || raw.first_proof_step || raw.step || raw.task || raw.instruction || '', 260);
const successSignal = cleanText(raw.successSignal || raw.success_signal || raw.successCriteria || raw.success_criteria || raw.successMetric || raw.success_metric || raw.greenLight || raw.green_light || raw.greenFlag || raw.green_flag || raw.signalToSee || raw.signal_to_see || '', 260);
const killSignal = cleanText(raw.killSignal || raw.kill_signal || raw.stopSignal || raw.stop_signal || raw.redFlag || raw.red_flag || raw.failureSignal || raw.failure_signal || raw.cutIf || raw.cut_if || raw.stopIf || raw.stop_if || '', 260);
const risk = cleanText(raw.risk || raw.assumption || raw.unknown || raw.watchOut || raw.watch_out || proofGate.risk || proofGate.assumption || '', 220);
const nextStep = cleanText(raw.nextStep || raw.next_step || raw.nextAction || raw.next_action || raw.firstStep || raw.first_step || raw.manualStep || raw.manual_step || raw.actionToTake || raw.action_to_take || raw.firstProofStep || raw.first_proof_step || proofGate.nextStep || proofGate.next_step || proofGate.nextAction || proofGate.next_action || proofGate.firstStep || proofGate.first_step || proofGate.firstProofStep || proofGate.first_proof_step || raw.step || raw.task || raw.instruction || '', 260);
const successSignal = cleanText(raw.successSignal || raw.success_signal || raw.successCriteria || raw.success_criteria || raw.successMetric || raw.success_metric || raw.greenLight || raw.green_light || raw.greenFlag || raw.green_flag || raw.signalToSee || raw.signal_to_see || proofGate.successSignal || proofGate.success_signal || proofGate.successCriteria || proofGate.success_criteria || proofGate.greenLight || proofGate.green_light || proofGate.passSignal || proofGate.pass_signal || '', 260);
const killSignal = cleanText(raw.killSignal || raw.kill_signal || raw.stopSignal || raw.stop_signal || raw.redFlag || raw.red_flag || raw.failureSignal || raw.failure_signal || raw.cutIf || raw.cut_if || raw.stopIf || raw.stop_if || proofGate.killSignal || proofGate.kill_signal || proofGate.stopSignal || proofGate.stop_signal || proofGate.failureSignal || proofGate.failure_signal || proofGate.redFlag || proofGate.red_flag || proofGate.failSignal || proofGate.fail_signal || '', 260);
const rawLane = cleanText(raw.lane || '', 40);
const laneLooksLikeHint = Boolean(normalizeLaneHint(rawLane));
const sourceSection = cleanText(raw.sourceSection || raw.source_section || raw.section || raw.origin || (!laneLooksLikeHint ? rawLane : '') || defaultSourceSection, 80);