chore(ai-psychosis): release v1.2.0

This commit is contained in:
Kjell Tore Guttormsen 2026-05-01 21:59:40 +02:00
commit 339abc521e
4 changed files with 176 additions and 12 deletions

View file

@ -16,7 +16,7 @@ Four layers, each building on the previous:
| File | Purpose |
|------|---------|
| `hooks/scripts/lib.mjs` | Shared library: stdin, paths, thresholds, state, cooldowns, layer guards |
| `hooks/scripts/lib.mjs` | Shared library: stdin, paths, thresholds, state, cooldowns, layer guards, DOMAIN_STAKES, readRecentEndRecords |
| `hooks/scripts/session-start.mjs` | SessionStart: register session, count daily, night check |
| `hooks/scripts/prompt-analyzer.mjs` | UserPromptSubmit: pattern flags (NEVER logs prompt text) |
| `hooks/scripts/tool-tracker.mjs` | PostToolUse: events, edit ratio, burst, alerts |
@ -65,7 +65,7 @@ layer4: false # default off
## Testing
Automated test suite using `node:test` (126 cases, zero npm dependencies):
Automated test suite using `node:test` (258 cases, zero npm dependencies):
```bash
node --test tests/*.test.mjs
@ -73,14 +73,19 @@ node --test tests/*.test.mjs
| File | Cases | Coverage |
|------|-------|----------|
| `tests/session-start.test.mjs` | 5 | State init, JSONL, missing sid |
| `tests/prompt-analyzer.test.mjs` | 93 | 41 (25 negative + 12 pushback + 4 domain) patterns × 2 + thresholds + valence |
| `tests/session-start.test.mjs` | 11 | State init, JSONL, tier-2 cross-session alert |
| `tests/prompt-analyzer.test.mjs` | 100 | All v1.x patterns × 2 + thresholds + valence + v1.2 pushback contract |
| `tests/tool-tracker.test.mjs` | 8 | Counting, burst, reminders |
| `tests/session-end.test.mjs` | 6 | Finalize, duration, flags, v1.0.0 backward compat |
| `tests/privacy.test.mjs` | 2 | Canary string + matched-phrase leak guard |
| `tests/skill-md.test.mjs` | 1 | SKILL.md cites Constitution + 5-publication framework |
| `tests/perf.test.mjs` | 8 | 4 hooks × 2 modes — enforces <50ms logic / <200ms total |
| `tests/interaction-report.test.mjs` | 3 | report-reader.mjs reads JSONL with v1.0.0 backward compat |
| `tests/session-end.test.mjs` | 7 | Finalize, duration, flags, v1.1.0 string + v1.2 array shapes |
| `tests/privacy.test.mjs` | 7 | Canary + matched-phrase × original + 5 v1.2 detector variants |
| `tests/skill-md.test.mjs` | 3 | Constitution citation + Score 5 + 11 guidance criteria |
| `tests/perf.test.mjs` | 9 | 4 hooks × 2 modes + 1000-record sessions.jsonl wall-clock |
| `tests/interaction-report.test.mjs` | 6 | report-reader.mjs v1.0/v1.1/v1.2 + SC-12 stdout assertions |
| `tests/lib.test.mjs` | 17 | Threshold constants + DOMAIN_STAKES + readRecentEndRecords |
| `tests/domain-detection.test.mjs` | 39 | 8 new domains × positive + adjacent-domain negatives + multi-domain |
| `tests/user-info.test.mjs` | 24 | yes_people/yes_digital/no priority + sticky + tier-1 alert |
| `tests/validation-seeking.test.mjs` | 20 | valseek detection + accumulation + domain-gated alert |
| `tests/stakes-matrix.test.mjs` | 7 | Stakes weighting on v1.2 alerts; v1.1.0 sensitivity preserved |
## Conventions