feat(ai-psychosis): add pushback_count + domain_context state fields
This commit is contained in:
parent
1a45caf18b
commit
080f2414ad
4 changed files with 14 additions and 0 deletions
|
|
@ -128,6 +128,8 @@ export const THRESHOLD_SOFT_DEP_FLAGS = 2;
|
||||||
export const THRESHOLD_HARD_DEP_FLAGS = 5;
|
export const THRESHOLD_HARD_DEP_FLAGS = 5;
|
||||||
export const COOLDOWN_SOFT = 1800;
|
export const COOLDOWN_SOFT = 1800;
|
||||||
export const COOLDOWN_HARD = 3600;
|
export const COOLDOWN_HARD = 3600;
|
||||||
|
// v1.1.0 — counting threshold; tier-reduction logic is v1.2 scope
|
||||||
|
export const THRESHOLD_PUSHBACK_FLAGS = 2;
|
||||||
|
|
||||||
// --- Session counting ---
|
// --- Session counting ---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ const state = {
|
||||||
esc_flags: 0,
|
esc_flags: 0,
|
||||||
fatigue_flags: 0,
|
fatigue_flags: 0,
|
||||||
val_flags: 0,
|
val_flags: 0,
|
||||||
|
pushback_count: 0,
|
||||||
|
domain_context: null,
|
||||||
last_warning_epoch: 0
|
last_warning_epoch: 0
|
||||||
};
|
};
|
||||||
writeState(state);
|
writeState(state);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ function freshState() {
|
||||||
tool_count: 0, edit_count: 0,
|
tool_count: 0, edit_count: 0,
|
||||||
last_event_epoch: 0, burst_count: 0,
|
last_event_epoch: 0, burst_count: 0,
|
||||||
dep_flags: 0, esc_flags: 0, fatigue_flags: 0, val_flags: 0,
|
dep_flags: 0, esc_flags: 0, fatigue_flags: 0, val_flags: 0,
|
||||||
|
pushback_count: 0, domain_context: null,
|
||||||
last_warning_epoch: 0,
|
last_warning_epoch: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,13 @@ describe('session-start', () => {
|
||||||
assert.equal(out.continue, true);
|
assert.equal(out.continue, true);
|
||||||
assert.ok(!out.hookSpecificOutput);
|
assert.ok(!out.hookSpecificOutput);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('initializes pushback_count and domain_context fields (v1.1.0)', () => {
|
||||||
|
dir = setupTestDir();
|
||||||
|
runHook('session-start.mjs', { session_id: 's4', cwd: '/tmp' }, dir);
|
||||||
|
const state = readState(dir, 's4');
|
||||||
|
assert.ok(state);
|
||||||
|
assert.equal(state.pushback_count, 0);
|
||||||
|
assert.equal(state.domain_context, null);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue