Treat candidate lane as rank hint

This commit is contained in:
OpenClaw Bot
2026-05-27 00:35:36 +02:00
parent fd0bb3857e
commit 29c0b1c244
3 changed files with 34 additions and 3 deletions
+29
View File
@@ -341,6 +341,35 @@ try {
assert.equal(mixedWrapper.handoff.itemTrace.find(item => item.id === 'account-dashboard').sourceSection, 'concept-map.parkingLot');
assert.deepEqual(mixedWrapper.handoff.warnings, []);
const laneAliasResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
sourceName: 'Scattermind',
artifactId: 'concept_map_lane_aliases',
originalPrompt: 'Scattermind exported normalized candidates with lane fields instead of recommendedLane.',
idea: 'Ranker should treat lane as a lane hint when it is do-first/validate-next/defer/park, while preserving the actual source section.',
mode: 'mvp',
featureSet: {
features: [
{ id: 'manual-bridge-proof', title: 'Manual bridge proof', description: 'Defended build order from one Concept Map.', evidenceNeeded: 'Can one tired user act on the first move?', lane: 'do-first', sourceSection: 'concept-map.nextActions', rankerHints: { value: 9, effort: 2, confidence: 8, urgency: 8, risk: 2 } },
{ id: 'copyable-decision-brief', title: 'Copyable decision brief', description: 'Export the defended order as plain text.', evidenceNeeded: 'Does the copied brief preserve the next action?', lane: 'validate-next', sourceSection: 'concept-map.nextActions' },
{ id: 'auth-workspace', title: 'Auth workspace', description: 'Accounts, dashboard, saved projects, and collaboration.', evidenceNeeded: 'No bridge proof yet.', lane: 'park', sourceSection: 'concept-map.parkingLot' },
],
},
}),
});
assert.equal(laneAliasResponse.status, 200);
const laneAlias = await laneAliasResponse.json();
assert.equal(laneAlias.ranked[0].id, 'manual-bridge-proof');
assert.equal(laneAlias.ranked.find(item => item.id === 'manual-bridge-proof').provenance.sourceSection, 'concept-map.nextActions');
assert.equal(laneAlias.ranked.find(item => item.id === 'copyable-decision-brief').lane.id, 'test');
assert.equal(laneAlias.ranked.find(item => item.id === 'copyable-decision-brief').lane.source, 'hint');
assert.equal(laneAlias.ranked.find(item => item.id === 'auth-workspace').lane.id, 'park');
assert.equal(laneAlias.ranked.find(item => item.id === 'auth-workspace').lane.source, 'hint');
assert.equal(laneAlias.handoff.itemTrace.find(item => item.id === 'auth-workspace').sourceSection, 'concept-map.parkingLot');
assert.deepEqual(laneAlias.handoff.warnings, []);
const duplicateIdResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },