Guard rank feedback with Scattermind non-goals

This commit is contained in:
OpenClaw Bot
2026-05-26 22:53:43 +02:00
parent 9315130c1f
commit d01cc6ede7
3 changed files with 98 additions and 12 deletions
+36 -1
View File
@@ -169,7 +169,42 @@ try {
assert.equal(nestedConcept.ranked.find(item => item.id === 'lesson-library').lane.id, 'park');
assert.deepEqual(nestedConcept.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, provenance: data.input.provenance, buildOrder: data.buildOrder }, null, 2));
const nonGoalResponse = await fetch(`${base}/api/rank-feedback`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
sourceName: 'Scattermind',
artifactId: 'concept_map_non_goals',
originalPrompt: 'I clarified a tiny service idea and need the first build order.',
idea: 'Ranker should respect Concept Map non-goals when defending the build order.',
mode: 'mvp',
conceptMap: {
snapshotTitle: 'Non-goal guarded continuation',
context: {
targetAudience: 'Tired non-AI-native solo operator',
constraints: ['No account before first value', 'Manual proof is acceptable'],
nonGoals: ['Avoid saved workspaces', 'No auth dashboard', 'No billing layer before proof'],
},
nextActions: [
{ id: 'workspace-autopilot', action: 'Saved workspace autopilot', why: 'Build accounts, auth dashboard, saved workspaces, and team sync.', evidence: 'None yet', suggestedLane: 'do-first', rankerHints: { value: 10, effort: 2, confidence: 9, urgency: 9, risk: 2 } },
{ id: 'manual-next-move', action: 'Manual next-move build order preview', why: 'Turn one source artifact into a defended first action and rank-ready build order without accounts.', evidence: 'Can 3 users act on the first move?', validationSteps: ['Create one static brief'], suggestedLane: 'do-first', rankerHints: { value: 9, effort: 1, confidence: 9, urgency: 9, risk: 1 } },
{ id: 'copy-brief', action: 'Copyable build-order brief', why: 'Give the user a plain artifact they can paste into notes.', evidence: 'Does copy/paste preserve the next step?', suggestedLane: 'validate-next' },
],
},
}),
});
assert.equal(nonGoalResponse.status, 200);
const nonGoal = await nonGoalResponse.json();
assert.equal(nonGoal.input.decisionContext.targetAudience, 'Tired non-AI-native solo operator');
assert.deepEqual(nonGoal.input.decisionContext.nonGoals, ['Avoid saved workspaces', 'No auth dashboard', 'No billing layer before proof']);
assert.equal(nonGoal.ranked[0].id, 'manual-next-move', 'non-goal conflicts should beat flashy positive hints');
const workspace = nonGoal.ranked.find(item => item.id === 'workspace-autopilot');
assert.ok(workspace.metrics.nonGoalConflicts.length >= 2);
assert.match(workspace.concern, /Source context says not to do this yet/);
assert.deepEqual(nonGoal.handoff.itemTrace.find(item => item.id === 'workspace-autopilot').nonGoalConflicts, workspace.metrics.nonGoalConflicts);
assert.ok(!nonGoal.buildOrder.doFirst.includes('workspace-autopilot'));
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, provenance: data.input.provenance, buildOrder: data.buildOrder }, null, 2));
} finally {
server.kill('SIGTERM');
}