Support Scattermind question-only rank handoffs

This commit is contained in:
OpenClaw Bot
2026-05-27 16:27:12 +02:00
parent ca186f2a01
commit a225586296
3 changed files with 77 additions and 5 deletions
+32 -1
View File
@@ -1254,6 +1254,37 @@ try {
assert.equal(threadsFallback.handoff.readiness.status, 'ready');
assert.deepEqual(threadsFallback.handoff.warnings, []);
const questionsFallbackResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
reference_code: 'SM-QUESTIONS-1',
working_name: 'Question-only Concept Map',
ideaText: 'Scattermind produced questions rather than a labelled build order; Ranker should turn those into evidence actions, not fake features.',
context: 'Tired solo operator. Avoid dashboards and saved workspaces before evidence.',
conceptMap: {
questions_to_sit_with: [
'Can one tired user act on the first continuation move without opening a workspace?',
{ question: 'Would a copyable handoff preserve enough source context to trust the order?', validationSteps: ['Paste the handoff into notes and ask one user what they would do next.'] },
'Should billing wait until one defended build-order handoff creates real follow-up?'
],
},
mode: 'validation',
}),
});
assert.equal(questionsFallbackResponse.status, 200);
const questionsFallback = await questionsFallbackResponse.json();
assert.equal(questionsFallback.input.provenance.artifactId, 'SM-QUESTIONS-1');
assert.equal(questionsFallback.input.optionCount, 3);
assert.equal(questionsFallback.ranked[0].id, 'question-2');
assert.equal(questionsFallback.ranked[0].lane.id, 'do');
assert.equal(questionsFallback.ranked[0].provenance.sourceSection, 'concept-map.questionsToSitWith');
assert.match(questionsFallback.ranked[0].title, /^Answer:/);
assert.match(questionsFallback.ranked.find(item => item.id === 'question-1').factors.evidenceNeeded, /without opening a workspace/);
assert.equal(questionsFallback.ranked.find(item => item.id === 'question-1').provenance.sourceSection, 'concept-map.questionsToSitWith');
assert.equal(questionsFallback.handoff.readiness.status, 'ready');
assert.deepEqual(questionsFallback.handoff.warnings, []);
const storedScattermindRowResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -1290,7 +1321,7 @@ try {
assert.equal(storedScattermindRow.handoff.readiness.status, 'ready');
assert.deepEqual(storedScattermindRow.handoff.warnings, []);
console.log(JSON.stringify({ ok: true, top: data.ranked[0].id, hintedTop: hinted.ranked[0].id, actionTop: actions.ranked[0].id, nestedConceptTop: nestedConcept.ranked[0].id, nonGoalTop: nonGoal.ranked[0].id, structuredContextTop: structuredContext.ranked[0].id, lensOnlyTop: lensOnly.ranked[0].id, scattermindPaidShapeTop: scattermindPaidShape.ranked[0].id, mergedContextTop: mergedContext.ranked[0].id, embeddedJsonTop: embeddedJson.ranked[0].id, fencedJsonTop: fencedJson.ranked[0].id, embeddedSnapshotTop: embeddedSnapshot.ranked[0].id, sourceExcerptTop: sourceExcerpt.ranked[0].id, snakeCaseBridgeTop: snakeCaseBridge.ranked[0].id, nextStepsAliasTop: nextStepsAlias.ranked[0].id, summaryGuardrailTop: summaryGuardrail.ranked[0].id, bridgeEnvelopeTop: bridgeEnvelope.ranked[0].id, directEnvelopeSectionsTop: directEnvelopeSections.ranked[0].id, softDirectLaneAliasesTop: softDirectLaneAliases.ranked[0].id, threadsFallbackTop: threadsFallback.ranked[0].id, storedScattermindRowTop: storedScattermindRow.ranked[0].id, duplicateIds: duplicateIds.ranked.map(item => item.id), readiness: data.handoff.readiness.status, provenance: data.input.provenance, buildOrder: data.buildOrder }, null, 2));
console.log(JSON.stringify({ ok: true, top: data.ranked[0].id, hintedTop: hinted.ranked[0].id, actionTop: actions.ranked[0].id, nestedConceptTop: nestedConcept.ranked[0].id, nonGoalTop: nonGoal.ranked[0].id, structuredContextTop: structuredContext.ranked[0].id, lensOnlyTop: lensOnly.ranked[0].id, scattermindPaidShapeTop: scattermindPaidShape.ranked[0].id, mergedContextTop: mergedContext.ranked[0].id, embeddedJsonTop: embeddedJson.ranked[0].id, fencedJsonTop: fencedJson.ranked[0].id, embeddedSnapshotTop: embeddedSnapshot.ranked[0].id, sourceExcerptTop: sourceExcerpt.ranked[0].id, snakeCaseBridgeTop: snakeCaseBridge.ranked[0].id, nextStepsAliasTop: nextStepsAlias.ranked[0].id, summaryGuardrailTop: summaryGuardrail.ranked[0].id, bridgeEnvelopeTop: bridgeEnvelope.ranked[0].id, directEnvelopeSectionsTop: directEnvelopeSections.ranked[0].id, softDirectLaneAliasesTop: softDirectLaneAliases.ranked[0].id, threadsFallbackTop: threadsFallback.ranked[0].id, questionsFallbackTop: questionsFallback.ranked[0].id, storedScattermindRowTop: storedScattermindRow.ranked[0].id, duplicateIds: duplicateIds.ranked.map(item => item.id), readiness: data.handoff.readiness.status, provenance: data.input.provenance, buildOrder: data.buildOrder }, null, 2));
} finally {
server.kill('SIGTERM');
}