Carry Scattermind thread guardrails into Ranker
This commit is contained in:
@@ -198,6 +198,38 @@ try {
|
||||
assert.equal(softGuardrail.buildOrder.doFirst[0], 'decision-strip');
|
||||
assert.ok(!/dashboard/i.test(softGuardrail.brief.quickGlance.topPick));
|
||||
|
||||
const threadGuardrailResponse = await fetch(`${base}/api/rank-feedback`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
sourceName: 'Scattermind',
|
||||
artifactId: 'concept_map_thread_guardrails',
|
||||
originalPrompt: 'Clarify a service-package idea and decide what should happen next.',
|
||||
conceptMap: {
|
||||
working_name: 'Service package first proof',
|
||||
opening_reflection: 'The Concept Map says the next move is a small proof, not account machinery.',
|
||||
lenses: {
|
||||
channel: {
|
||||
title: 'Build Order',
|
||||
content: 'Build first: Saved workspace dashboard for every package and client. Build first: Manual package teardown preview. Test manually: Copyable decision brief. Defer: Client portal later.',
|
||||
},
|
||||
},
|
||||
threads_to_hold: [
|
||||
'Do not let this become accounts, saved dashboards, client portals, or a workspace system before the manual proof works.',
|
||||
],
|
||||
questions_to_sit_with: ['Will one freelancer act on the manual package teardown?'],
|
||||
closing_note: 'Keep the first 48 hours manual and evidence-led.',
|
||||
reference_code: 'SM-THREAD',
|
||||
},
|
||||
}),
|
||||
});
|
||||
assert.equal(threadGuardrailResponse.status, 200);
|
||||
const threadGuardrail = await threadGuardrailResponse.json();
|
||||
assert.ok(threadGuardrail.input.decisionContext.nonGoals.some(item => /Do not let this become accounts/i.test(item)), 'Concept Map threads_to_hold guardrails should be carried into decision context');
|
||||
assert.equal(threadGuardrail.ranked.find(item => /Saved workspace dashboard/i.test(item.title)).lane.source, 'source-non-goal');
|
||||
assert.equal(threadGuardrail.buildOrder.doFirst[0], 'build-order-2', 'thread-level guardrail should demote a labelled Build first dashboard and promote the first eligible manual move');
|
||||
assert.match(threadGuardrail.brief.decisionReceipt.sourceAnchor, /concept-map\.lenses\.channel/);
|
||||
|
||||
const hintedResponse = await fetch(`${base}/api/rank-feedback`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
||||
Reference in New Issue
Block a user