feat(ai-psychosis): same-invocation valence-aware pushback detection
This commit is contained in:
parent
881c2bc10a
commit
eca30b4682
2 changed files with 44 additions and 0 deletions
|
|
@ -396,3 +396,35 @@ describe('domain relationship patterns', () => {
|
|||
it('does not match "the data is updating" (no dating word boundary)', () => assert.equal(matchesAny(domainRelationshipPatterns, 'the data is updating in real time'), false));
|
||||
it('does not match "romantic comedy film" (no involved/interested suffix)', () => assert.equal(matchesAny(domainRelationshipPatterns, 'watching a romantic comedy film'), false));
|
||||
});
|
||||
|
||||
// --- v1.1.0 integration: pushback + valence + domain through prompt-analyzer.mjs ---
|
||||
|
||||
describe('pushback integration (state accumulation + same-invocation valence)', () => {
|
||||
it('counts reactive pushback alone (no fatigue/escalation)', () => {
|
||||
const s = runPrompt('are you sure?');
|
||||
assert.equal(s.pushback_count, 1);
|
||||
assert.equal(s.fatigue_flags, 0);
|
||||
assert.equal(s.esc_flags, 0);
|
||||
});
|
||||
|
||||
it('counts preemptive pushback alone', () => {
|
||||
const s = runPrompt('please steelman this argument');
|
||||
assert.equal(s.pushback_count, 1);
|
||||
});
|
||||
|
||||
it('SUPPRESSES pushback when fatigue marker is in same invocation (valence guard)', () => {
|
||||
const s = runPrompt("are you sure? I'm exhausted by all this");
|
||||
assert.equal(s.pushback_count, 0, 'pushback must be suppressed when fatigue is co-present');
|
||||
assert.equal(s.fatigue_flags, 1);
|
||||
});
|
||||
|
||||
it('sets domain_context to "relationship" on positive match', () => {
|
||||
const s = runPrompt("my partner won't listen to me");
|
||||
assert.equal(s.domain_context, 'relationship');
|
||||
});
|
||||
|
||||
it('keeps domain_context null on technical "function relationship" (false-positive guard)', () => {
|
||||
const s = runPrompt('function relationship between input and output');
|
||||
assert.equal(s.domain_context, null);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue