feat(ai-psychosis): tier-1 user-info isolation alert (per-session)
This commit is contained in:
parent
b88cd8a978
commit
4fd5e7b24a
2 changed files with 101 additions and 0 deletions
|
|
@ -8,6 +8,9 @@ import {
|
|||
nowEpoch,
|
||||
STATE_DIR, THRESHOLD_SOFT_DEP_FLAGS, THRESHOLD_HARD_DEP_FLAGS,
|
||||
COOLDOWN_SOFT,
|
||||
TIER1_TURN_THRESHOLD, THRESHOLD_VALSEEK_FLAGS, THRESHOLD_PUSHBACK_FLAGS,
|
||||
HIGH_SYCOPHANCY_DOMAINS, HIGH_STAKES_DOMAINS, INFO_DOMAINS,
|
||||
DOMAIN_STAKES,
|
||||
readState, sessionStateFile, writeState, checkCooldown,
|
||||
outputContinue, outputWithContext
|
||||
} from './lib.mjs';
|
||||
|
|
@ -395,6 +398,26 @@ if (newVal >= 3) {
|
|||
warnings.push(`Validation-seeking pattern detected (${newVal} flags). Evaluate independently rather than confirming.`);
|
||||
}
|
||||
|
||||
// v1.2: Tier-1 user-info isolation alert.
|
||||
// Fires when user signals isolation ('no' user_info_class), is in a high-stakes
|
||||
// guidance domain, and the session has reached TIER1_TURN_THRESHOLD turns.
|
||||
function domainsIntersect(domains, set) {
|
||||
if (!Array.isArray(domains)) return false;
|
||||
for (const d of domains) {
|
||||
if (set.includes(d)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const stateDomains = Array.isArray(state.domain_context) ? state.domain_context : [];
|
||||
if (
|
||||
state.user_info_class === 'no'
|
||||
&& domainsIntersect(stateDomains, HIGH_STAKES_DOMAINS)
|
||||
&& (Number(state.turn_count) || 0) >= TIER1_TURN_THRESHOLD
|
||||
) {
|
||||
warnings.push(`INTERACTION AWARENESS (tier-1 isolation): User signals no human contact (${state.turn_count} turns) in a high-stakes domain (${stateDomains.filter(d => HIGH_STAKES_DOMAINS.includes(d)).join(', ')}). Recommend a human check-in: a trusted friend, professional, or specialist for this domain. Stay supportive but do not be a substitute for that contact.`);
|
||||
}
|
||||
|
||||
if (warnings.length > 0) {
|
||||
// Fatigue bypasses cooldown
|
||||
if (fatHit === 1 || checkCooldown(COOLDOWN_SOFT)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue