Accept nested Scattermind concept maps
This commit is contained in:
@@ -139,7 +139,37 @@ try {
|
||||
assert.equal(actions.ranked.find(item => item.id === 'saved-workspace').lane.id, 'park');
|
||||
assert.deepEqual(actions.handoff.warnings, []);
|
||||
|
||||
console.log(JSON.stringify({ ok: true, top: data.ranked[0].id, hintedTop: hinted.ranked[0].id, actionTop: actions.ranked[0].id, provenance: data.input.provenance, buildOrder: data.buildOrder }, null, 2));
|
||||
const nestedConceptResponse = await fetch(`${base}/api/rank-feedback`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
sourceName: 'Scattermind',
|
||||
idea: 'Scattermind produced a Concept Map artifact with nested next actions.',
|
||||
context: 'Ranker should consume the artifact directly and preserve provenance without asking Scattermind to rename actions as features.',
|
||||
mode: 'mvp',
|
||||
conceptMap: {
|
||||
id: 'concept_map_nested_42',
|
||||
snapshotTitle: 'Course idea continuation',
|
||||
originalPrompt: 'I have a course idea and need the first build step.',
|
||||
nextActions: [
|
||||
{ id: 'landing-proof', action: 'One-page promise test', why: 'A tired creator can see whether the promise lands before building lessons.', evidence: 'Can 5 target users describe the promised outcome?', validationSteps: ['Write the promise', 'Ask 5 target users'], rankerHints: { value: 9, effort: 2, confidence: 8, urgency: 8, risk: 2 }, suggestedLane: 'do-first' },
|
||||
{ id: 'lesson-library', action: 'Full lesson library', why: 'Build every module, account dashboard, saved progress, and team workspace.', dependencies: ['auth', 'content system', 'progress tracking', 'workspace'], risk: 'Large platform before promise proof.', suggestedLane: 'park' },
|
||||
{ id: 'copyable-plan', action: 'Copyable build order brief', why: 'Gives the creator a concrete next step to paste into notes.', evidence: 'Does the brief trigger one real follow-up action?', suggestedLane: 'validate-next' },
|
||||
],
|
||||
},
|
||||
}),
|
||||
});
|
||||
assert.equal(nestedConceptResponse.status, 200);
|
||||
const nestedConcept = await nestedConceptResponse.json();
|
||||
assert.equal(nestedConcept.input.provenance.artifactId, 'concept_map_nested_42');
|
||||
assert.equal(nestedConcept.input.provenance.conceptMapId, 'concept_map_nested_42');
|
||||
assert.equal(nestedConcept.handoff.source.hasOriginalPrompt, true);
|
||||
assert.equal(nestedConcept.ranked[0].id, 'landing-proof');
|
||||
assert.equal(nestedConcept.ranked.find(item => item.id === 'landing-proof').provenance.sourceSection, 'concept-map.nextActions');
|
||||
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));
|
||||
} finally {
|
||||
server.kill('SIGTERM');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user