feat(ai-psychosis): promote domain_context to array for multi-domain support
This commit is contained in:
parent
011634583b
commit
a5bc53cb42
6 changed files with 72 additions and 11 deletions
|
|
@ -137,7 +137,19 @@ state.esc_flags = newEsc;
|
|||
state.fatigue_flags = newFat;
|
||||
state.val_flags = newVal;
|
||||
state.pushback_count = (Number(state.pushback_count) || 0) + pbReactiveHit + pbPreemptiveHit;
|
||||
if (domainHit === 1 && !state.domain_context) state.domain_context = 'relationship';
|
||||
|
||||
// v1.2: domain_context is always an array. Coerce v1.1.0 string shape on read.
|
||||
if (domainHit === 1) {
|
||||
if (typeof state.domain_context === 'string') {
|
||||
state.domain_context = state.domain_context ? [state.domain_context] : [];
|
||||
}
|
||||
if (!Array.isArray(state.domain_context)) {
|
||||
state.domain_context = [];
|
||||
}
|
||||
if (!state.domain_context.includes('relationship')) {
|
||||
state.domain_context.push('relationship');
|
||||
}
|
||||
}
|
||||
writeState(state);
|
||||
|
||||
// Check if any thresholds crossed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue