Harden Scattermind rank feedback candidate fallback

This commit is contained in:
OpenClaw Bot
2026-05-26 23:18:03 +02:00
parent 2f49155ed8
commit 10f6efcbd3
3 changed files with 29 additions and 2 deletions
+27
View File
@@ -171,6 +171,33 @@ try {
assert.equal(nestedConcept.ranked.find(item => item.id === 'lesson-library').lane.id, 'park');
assert.deepEqual(nestedConcept.handoff.warnings, []);
const emptyWrapperResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
sourceName: 'Scattermind',
artifactId: 'concept_map_empty_wrappers',
originalPrompt: 'The export includes empty feature arrays plus real Concept Map next actions.',
idea: 'Ranker should ignore empty wrapper arrays and rank the real nested action set.',
mode: 'mvp',
features: [],
featureSet: { features: [], actions: [] },
conceptMap: {
nextActions: [
{ id: 'source-action-proof', action: 'Source action proof', why: 'Use the Concept Map next action directly to defend the first move.', evidence: 'Can this action become a build-order preview?', suggestedLane: 'do-first' },
{ id: 'source-action-export', action: 'Copyable action brief', why: 'Keep the handoff artifact-shaped for a tired user.', evidence: 'Can the brief be pasted into notes?', suggestedLane: 'validate-next' },
{ id: 'empty-shadow-dashboard', action: 'Saved dashboard after empty import', why: 'Auth workspace dashboard that should not win.', suggestedLane: 'park' },
],
},
}),
});
assert.equal(emptyWrapperResponse.status, 200);
const emptyWrapper = await emptyWrapperResponse.json();
assert.equal(emptyWrapper.input.optionCount, 3);
assert.equal(emptyWrapper.ranked[0].id, 'source-action-proof', 'empty top-level arrays must not shadow nested Concept Map actions');
assert.equal(emptyWrapper.ranked.find(item => item.id === 'source-action-proof').provenance.sourceSection, 'concept-map.nextActions');
assert.deepEqual(emptyWrapper.handoff.warnings, []);
const nonGoalResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },