Accept free Scattermind snapshot handoffs

This commit is contained in:
OpenClaw Bot
2026-05-27 16:33:49 +02:00
parent a225586296
commit 6a34916697
3 changed files with 79 additions and 2 deletions
+46
View File
@@ -1050,6 +1050,47 @@ function optionsFromQuestionsToSitWith(items = [], sourceSection = 'concept-map.
}).filter(item => item.action && item.evidence);
}
function optionsFromSnapshotReading(source = {}, sourceSection = 'snapshot') {
const reading = objectFrom(source);
const lenses = objectFrom(reading.lenses);
const rawShapeLens = lenses.shape || reading.lens || reading.shape;
const shapeLens = objectFrom(rawShapeLens);
const shapeText = cleanMultiline(lensContent(rawShapeLens), 700);
const workingName = cleanText(reading.working_name || reading.workingName || reading.snapshotTitle || reading.snapshot_title || reading.title || reading.name || '', 90);
const restatedIdea = cleanText(reading.restated_idea || reading.restatedIdea || reading.ideaText || reading.idea_text || reading.idea || '', 260);
const questions = cleanFlexibleTextList(reading.questions_to_sit_with || reading.questionsToSitWith || reading.openQuestions || reading.open_questions, 4, 240);
const hasSnapshotShape = Boolean(workingName || restatedIdea || shapeText || questions.length);
if (!hasSnapshotShape || (!shapeText && !restatedIdea && questions.length < 1)) return [];
const firstQuestion = questions[0] || 'What smallest manual proof would show this is worth building first?';
const proofTitle = workingName
? `Manual proof for ${workingName}`
: restatedIdea
? `Manual proof: ${restatedIdea}`
: questionActionTitle(firstQuestion);
const proofExcerpt = shapeText || restatedIdea || firstQuestion;
const proofOption = {
id: 'snapshot-manual-proof',
action: proofTitle,
why: restatedIdea || shapeText || 'The Snapshot clarified a possible direction, but it still needs a small real-world proof before product machinery.',
evidence: firstQuestion,
validationSteps: ['Run one manual version before building supporting UI', 'Ask 3 target users what they would do next'],
suggestedLane: 'do-first',
rankerHints: { value: 8, effort: 2, confidence: 6, urgency: 7, risk: 3 },
sourceSection: `${sourceSection}.lenses.shape`,
sourceItemId: `${sourceSection}.lenses.shape#1`,
sourceTitle: cleanText(shapeLens.title || 'Snapshot shape', 140),
sourceExcerpt: proofExcerpt,
};
const questionOptions = optionsFromQuestionsToSitWith(
questions.slice(0, 3),
`${sourceSection}.questionsToSitWith`,
'Snapshot decision question'
);
const options = [proofOption, ...questionOptions].slice(0, 4);
return options.length >= 2 ? options : [];
}
function optionsFromBody(body = {}) {
const envelope = bridgeEnvelopeFrom(body);
const featureSet = featureSetFrom(body);
@@ -1162,6 +1203,11 @@ function optionsFromBody(body = {}) {
'Question to sit with'
);
if (questionOptions.length >= 2) return normalizeCandidateGroup([{ items: questionOptions, sourceSection: 'concept-map.questionsToSitWith', defaultLane: 'validate-next' }]);
const nestedSnapshotReadingOptions = optionsFromSnapshotReading(snapshot, 'snapshot');
const snapshotReadingOptions = nestedSnapshotReadingOptions.length
? nestedSnapshotReadingOptions
: optionsFromSnapshotReading(body, 'snapshot');
if (snapshotReadingOptions.length >= 2) return normalizeCandidateGroup([{ items: snapshotReadingOptions, sourceSection: 'snapshot', defaultLane: 'validate-next' }]);
if (Array.isArray(body.options)) {
return normalizeOptionIds(body.options.slice(0, 24).map((item, index) => normalizeFeatureOption(item, index, 'option', 'options')).filter(item => item.title));
}