@hivehub/rulebook 5.0.0 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rulebook",
3
3
  "description": "Standardize AI-generated projects with Ralph autonomous loop, persistent memory, and quality gates. Supports 28 languages, 17 frameworks, 13 MCP modules, and 20 services.",
4
- "version": "5.0.0",
4
+ "version": "5.1.2",
5
5
  "author": {
6
6
  "name": "HiveLLM"
7
7
  }
package/README.md CHANGED
@@ -23,7 +23,7 @@ Large Language Models (LLMs) for software development need **clear directives**
23
23
 
24
24
  - 📋 **Comprehensive Rule Sets**: Language-specific guidelines (TypeScript, Rust, Python, etc.), framework conventions (NestJS, Django, React), testing standards, linting rules, spell-checking, CI/CD pipelines, Git hooks, and version control best practices
25
25
  - 🤖 **Ralph Autonomous Loop**: Multi-iteration AI agent task solving with quality gates (type-check, lint, tests, coverage), iteration tracking, learnings extraction, and graceful pause/resume
26
- - 🧠 **Persistent Memory**: Context that survives across AI sessions with hybrid BM25+HNSW search, zero native dependencies
26
+ - 🧠 **Persistent Memory**: Context that survives across AI sessions with hybrid BM25+HNSW search, native SQLite with WASM fallback
27
27
  - 🎯 **Normalized Deliverables**: Ensures consistent code quality across all AI-generated outputs
28
28
  - 🛡️ **Error Reduction**: Catches issues early through automated quality gates and pre-commit/pre-push hooks
29
29
  - ⚙️ **Process Automation**: Automates repetitive tasks like formatting, testing, and deployment
@@ -63,6 +63,29 @@ npx @hivehub/rulebook@latest rules project # Project to all tools
63
63
 
64
64
  See the full [CHANGELOG](CHANGELOG.md) for details.
65
65
 
66
+ ### v5.1.2 — MCP Per-Session PID Lock
67
+
68
+ Fixed a critical issue where only one VSCode/Claude Code window could use the MCP server at a time. The PID lock now uses **session-scoped files** (`mcp-server.<pid>.pid`) instead of a single global lock, allowing multiple concurrent MCP instances. Stale PID files from dead processes are automatically cleaned on startup, with backward-compatible cleanup of the legacy format.
69
+
70
+ ### v5.1.0 — Incremental Implementation & Knowledge Base Integration
71
+
72
+ Born from real-world experience: AI agents that implement everything at once produce cascading errors. This release makes **step-by-step implementation** and **knowledge base usage** mandatory for all agents.
73
+
74
+ **New Tier 1 Rule: `incremental-implementation`**
75
+ - Decompose, implement ONE step, test/verify, repeat
76
+ - **3-attempt restart rule**: if stuck 3 times on the same error, STOP, record anti-pattern, restart from scratch
77
+ - "The line between persistence and stubbornness is thin"
78
+
79
+ **Knowledge Base as Mandatory Workflow**
80
+ - All agents now check `.rulebook/knowledge/` BEFORE implementing
81
+ - All agents record patterns/anti-patterns AFTER completing
82
+ - Code reviewers validate against known patterns and anti-patterns
83
+ - Project managers track KB health and remind agents to record learnings
84
+
85
+ **41 New Memory Store Tests**
86
+ - Comprehensive CRUD, FTS5 search, sessions, persistence, code nodes
87
+ - sql.js fallback validation (for environments without native build tools)
88
+
66
89
  ### v5.0.0 — Multi-Tool AI Framework
67
90
 
68
91
  The biggest release yet. Rulebook becomes a **tool-agnostic AI development framework** — same quality directives for every AI tool, with graceful degradation.
@@ -78,8 +101,8 @@ The biggest release yet. Rulebook becomes a **tool-agnostic AI development frame
78
101
  - Cursor: contextual `.mdc` rules activated by file glob patterns
79
102
  - Gemini/Codex: inline conditional sections
80
103
 
81
- **7 Tier 1 Prohibitions** (auto-installed, universal)
82
- - No shortcuts/stubs/TODOs, git safety allow-list, no delete without authorization, research-first, sequential editing, no deferred tasks, **follow task sequence** (no cherry-picking)
104
+ **8 Tier 1 Prohibitions** (auto-installed, universal)
105
+ - No shortcuts/stubs/TODOs, git safety allow-list, no delete without authorization, research-first, sequential editing, no deferred tasks, follow task sequence, **incremental implementation** (step by step, restart if stuck)
83
106
 
84
107
  **Project Complexity Detection**
85
108
  - `rulebook assess` — auto-detects LOC, languages, structure
@@ -183,8 +206,8 @@ Session 2 (new tab, days later):
183
206
 
184
207
  | Component | Technology | Purpose |
185
208
  |-----------|-----------|---------|
186
- | **Storage** | SQLite via sql.js WASM | Zero native compilation, works everywhere |
187
- | **Keyword Search** | BM25 | Fast exact-match scoring |
209
+ | **Storage** | better-sqlite3 (native) with sql.js fallback | Fast native SQLite with WAL journal; falls back to WASM if no build tools |
210
+ | **Keyword Search** | BM25 via FTS5 | Fast exact-match scoring |
188
211
  | **Vector Search** | HNSW index | Semantic similarity matching |
189
212
  | **Embeddings** | TF-IDF + FNV1a hashing | 256-dim vectors, pure TypeScript, no API calls |
190
213
  | **Ranking** | Reciprocal Rank Fusion | Combines BM25 + vector scores |
@@ -377,7 +400,7 @@ Cross-project operations (search, task listing) are explicit and deliberate.
377
400
  - Graceful pause/resume capabilities
378
401
  - Complete iteration history and metrics
379
402
  - 6 CLI commands + 4 MCP tools
380
- - 🧠 **Persistent Memory**: Context that survives across AI sessions — hybrid BM25+HNSW search, auto-capture, zero native dependencies
403
+ - 🧠 **Persistent Memory**: Context that survives across AI sessions — hybrid BM25+HNSW search, auto-capture, native SQLite with WASM fallback
381
404
  - 🔍 **Auto-Detection**: Detects languages, frameworks, MCP modules, and services from your project files
382
405
  - 📁 **Modular Architecture**: Templates in `/.rulebook/` directory — smaller AGENTS.md, on-demand loading
383
406
  - 🔗 **Git Hook Automation**: Pre-commit/pre-push hooks with language-aware quality checks
@@ -275,7 +275,7 @@ export async function initCommand(options) {
275
275
  const { getTemplatesDir } = await import('../core/generator.js');
276
276
  const templatesDir = getTemplatesDir();
277
277
  // Tier 1 rules — always installed
278
- const tier1Rules = ['no-shortcuts', 'git-safety', 'sequential-editing', 'research-first', 'follow-task-sequence'];
278
+ const tier1Rules = ['no-shortcuts', 'git-safety', 'sequential-editing', 'research-first', 'follow-task-sequence', 'incremental-implementation'];
279
279
  // Tier 2 rules — installed for medium+ complexity
280
280
  const tier2Rules = ['task-decomposition', 'incremental-tests', 'no-deferred', 'session-workflow'];
281
281
  const rulesToInstall = [...tier1Rules];
@@ -1640,7 +1640,7 @@ async function updateSingleProject(cwd, options) {
1640
1640
  const { getTemplatesDir } = await import('../core/generator.js');
1641
1641
  const complexity = assessComplexity(cwd);
1642
1642
  const templatesDir = getTemplatesDir();
1643
- const tier1 = ['no-shortcuts', 'git-safety', 'sequential-editing', 'research-first', 'follow-task-sequence'];
1643
+ const tier1 = ['no-shortcuts', 'git-safety', 'sequential-editing', 'research-first', 'follow-task-sequence', 'incremental-implementation'];
1644
1644
  const tier2 = ['task-decomposition', 'incremental-tests', 'no-deferred', 'session-workflow'];
1645
1645
  const toInstall = [...tier1];
1646
1646
  if (complexity.recommendations.tier2Rules) {