diff --git a/scripts/psychographic-signals.ts b/scripts/psychographic-signals.ts index 43d4a89ab4..d6a479497c 100644 --- a/scripts/psychographic-signals.ts +++ b/scripts/psychographic-signals.ts @@ -306,29 +306,6 @@ export function resolveOptionKey(question_id: string, choice: string): string | return tie ? undefined : best; } -/** - * Apply a user choice for a question to the running dimension totals. - * - * @param dims - running total of dimension nudges (mutated) - * @param signal_key - from the question registry entry - * @param user_choice - the option key the user selected - * @returns list of dimension deltas applied (empty if no mapping) - */ -export function applySignal( - dims: Record, - signal_key: string, - user_choice: string, -): DimensionDelta[] { - const subMap = SIGNAL_MAP[signal_key]; - if (!subMap) return []; - const deltas = subMap[user_choice]; - if (!deltas) return []; - for (const { dim, delta } of deltas) { - dims[dim] = (dims[dim] ?? 0) + delta; - } - return deltas; -} - /** * Validate that every signal_key referenced in the registry has a matching * entry in SIGNAL_MAP. Called by tests to catch drift. @@ -353,17 +330,6 @@ export function validateRegistrySignalKeys(): { return { missing, extra }; } -/** Empty dimension totals — starting point for derivation. */ -export function newDimensionTotals(): Record { - return { - scope_appetite: 0, - risk_tolerance: 0, - detail_preference: 0, - autonomy: 0, - architecture_care: 0, - }; -} - /** Sigmoid clamp: map accumulated delta total to [0, 1]. */ export function normalizeToDimensionValue(total: number): number { // Simple sigmoid: each 1.0 of accumulated delta approaches saturation. diff --git a/test/plan-tune.test.ts b/test/plan-tune.test.ts index 413ed07f96..467ec8b913 100644 --- a/test/plan-tune.test.ts +++ b/test/plan-tune.test.ts @@ -29,9 +29,7 @@ import { } from '../scripts/one-way-doors'; import { SIGNAL_MAP, - applySignal, validateRegistrySignalKeys, - newDimensionTotals, normalizeToDimensionValue, resolveOptionKey, ALL_DIMENSIONS, @@ -246,26 +244,6 @@ describe('psychographic signal map', () => { expect(missing).toEqual([]); }); - test('applySignal mutates dimension totals per mapping', () => { - const dims = newDimensionTotals(); - const applied = applySignal(dims, 'scope-appetite', 'expand'); - expect(applied.length).toBeGreaterThan(0); - expect(dims.scope_appetite).toBeCloseTo(0.06, 5); - }); - - test('applySignal returns [] for unknown signal_key', () => { - const dims = newDimensionTotals(); - const applied = applySignal(dims, 'no-such-signal', 'anything'); - expect(applied).toEqual([]); - expect(dims.scope_appetite).toBe(0); - }); - - test('applySignal returns [] for unknown user_choice', () => { - const dims = newDimensionTotals(); - const applied = applySignal(dims, 'scope-appetite', 'definitely-not-a-real-choice'); - expect(applied).toEqual([]); - }); - test('normalizeToDimensionValue maps 0 → 0.5 (neutral)', () => { expect(normalizeToDimensionValue(0)).toBeCloseTo(0.5, 5); });