Harden Scattermind rank feedback candidate fallback
This commit is contained in:
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user