# Changelog

All notable changes to this project will be documented in this file.

## [1.0.0] — 2026-04-05

### Added

- **Layer 4: Contemplative references** — conditional section in
  `/interaction-report` when flags are elevated (total >= 5 or fatigue >= 2)
  and `layer4: true`. Points to Miracle of Mind by Sadhguru.
- **Automated test suite** — 73 cases using `node:test` (zero npm deps):
  session-start (4), prompt-analyzer (56), tool-tracker (8),
  session-end (4), privacy canary (1)

### Fixed

- Dependency regex `you understand me` no longer matches "merging" (added `\b`)

### Changed

- CLAUDE.md testing section updated for automated tests
- Deprecated bash scripts removed (available in git history)
- All "Known gaps" from v0.4.0 resolved

## [0.4.0] — 2026-04-05

### Changed

- **All hooks migrated from bash+jq to Node.js** — full cross-platform
  support (macOS, Linux, Windows)
  - `lib.sh` → `lib.mjs` (shared library, 22 functions)
  - `session-start.sh` → `session-start.mjs`
  - `prompt-analyzer.sh` → `prompt-analyzer.mjs` (23 regex patterns)
  - `tool-tracker.sh` → `tool-tracker.mjs`
  - `session-end.sh` → `session-end.mjs`
- hooks.json now invokes `node ...mjs` instead of `bash ...sh`
- Zero npm dependencies — Node.js stdlib only (`fs`, `path`, `os`)
- Bash scripts deprecated (kept for reference, marked with DEPRECATED)
- Dependencies reduced: bash and jq no longer required
- All documentation updated for Node.js migration

### Fixed

- Data path fallback now matches documented path
  (`~/.claude/plugins/data/ai-psychosis`)
- `.claude/` directory added to `.gitignore`
- Private repo path removed from design brief
- CONTRIBUTING.md line reference corrected
- README now links to CONTRIBUTING.md
- plugin.json includes author, license, repository fields

## [0.3.0] — 2026-04-05

### Added

- **Layer 3: Interaction reports** — `/interaction-report` slash command
  for aggregated session statistics
  - Time periods: `weekly` (default), `monthly`, `all`
  - Overview: session count, avg duration, tool calls, edit ratio
  - Pattern flags: dependency, escalation, fatigue, validation frequency
  - Tool usage distribution (top 10)
  - Daily activity breakdown
  - Trend comparison vs previous period
- `commands/interaction-report.md` — pure markdown command, no script
  dependencies (cross-platform: macOS, Linux, Windows)
- Layer 3 respects `layer3: true/false` in
  `.claude/ai-psychosis.local.md` (opt-in, off by default)

### Changed

- README updated with Layer 3 usage instructions
- Platform compatibility expanded: Layer 3 works on Windows
- Version bumped to 0.3.0

## [0.2.0] — 2026-04-05

### Added

- **Layer 2: Programmatic pattern detection** — four hooks measuring session
  time, tool usage, burst patterns, and language flags
  - `session-start.sh` — daily session count, late-night detection
  - `prompt-analyzer.sh` — dependency, escalation, fatigue, and
    validation-seeking pattern flags (prompt text never stored)
  - `tool-tracker.sh` — event logging, edit ratio, burst detection,
    progressive alerts with cooldown
  - `session-end.sh` — session finalization, JSONL record, state cleanup
- `lib.sh` — shared library with thresholds, state management, cooldown
  logic, and layer configuration
- Per-project layer configuration via
  `.claude/ai-psychosis.local.md`
- `require_layer()` guard in all hook scripts — layers are opt-in/out
- MIT LICENSE file
- `matcher` field in hooks.json for schema compliance

### Changed

- hooks.json now registers 4 events (was 2)
- `DATA_DIR` fallback hardened to `~/.claude/data/ai-psychosis`
- README rewritten with architecture diagram, research background,
  privacy section, threshold reference tables
- Version bumped to 0.2.0

### Removed

- `periodic-reminder.sh` — replaced by `tool-tracker.sh`
- `session-awareness.sh` — replaced by `session-start.sh`

## [0.1.0] — 2026-04-04

### Added

- **Layer 1: Behavioral instructions** — `SKILL.md` with 5 rules and 5
  named patterns (reinforcement loop, scope escalation, narrative
  crystallization, emotional dependency, session overuse)
- `periodic-reminder.sh` — re-injects awareness every 25 tool calls
- `session-awareness.sh` — SessionStart context injection
- Plugin manifest (`plugin.json`)
- Design document (`docs/ai-ai-psychosis-brief_1.md`)

## Known gaps

- No CI pipeline
- Single-user plugin — no multi-user patterns considered

[1.0.0]: https://git.fromaitochitta.com/open/ai-psychosis/compare/v0.4.0...v1.0.0
[0.4.0]: https://git.fromaitochitta.com/open/ai-psychosis/compare/v0.3.0...v0.4.0
[0.3.0]: https://git.fromaitochitta.com/open/ai-psychosis/compare/v0.2.0...v0.3.0
[0.2.0]: https://git.fromaitochitta.com/open/ai-psychosis/compare/v0.1.0...v0.2.0
[0.1.0]: https://git.fromaitochitta.com/open/ai-psychosis/releases/tag/v0.1.0
