@hivehub/rulebook 5.0.0 → 5.1.1

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.1",
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,25 @@ 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.0 — Incremental Implementation & Knowledge Base Integration
67
+
68
+ 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.
69
+
70
+ **New Tier 1 Rule: `incremental-implementation`**
71
+ - Decompose, implement ONE step, test/verify, repeat
72
+ - **3-attempt restart rule**: if stuck 3 times on the same error, STOP, record anti-pattern, restart from scratch
73
+ - "The line between persistence and stubbornness is thin"
74
+
75
+ **Knowledge Base as Mandatory Workflow**
76
+ - All agents now check `.rulebook/knowledge/` BEFORE implementing
77
+ - All agents record patterns/anti-patterns AFTER completing
78
+ - Code reviewers validate against known patterns and anti-patterns
79
+ - Project managers track KB health and remind agents to record learnings
80
+
81
+ **41 New Memory Store Tests**
82
+ - Comprehensive CRUD, FTS5 search, sessions, persistence, code nodes
83
+ - sql.js fallback validation (for environments without native build tools)
84
+
66
85
  ### v5.0.0 — Multi-Tool AI Framework
67
86
 
68
87
  The biggest release yet. Rulebook becomes a **tool-agnostic AI development framework** — same quality directives for every AI tool, with graceful degradation.
@@ -78,8 +97,8 @@ The biggest release yet. Rulebook becomes a **tool-agnostic AI development frame
78
97
  - Cursor: contextual `.mdc` rules activated by file glob patterns
79
98
  - Gemini/Codex: inline conditional sections
80
99
 
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)
100
+ **8 Tier 1 Prohibitions** (auto-installed, universal)
101
+ - 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
102
 
84
103
  **Project Complexity Detection**
85
104
  - `rulebook assess` — auto-detects LOC, languages, structure
@@ -183,8 +202,8 @@ Session 2 (new tab, days later):
183
202
 
184
203
  | Component | Technology | Purpose |
185
204
  |-----------|-----------|---------|
186
- | **Storage** | SQLite via sql.js WASM | Zero native compilation, works everywhere |
187
- | **Keyword Search** | BM25 | Fast exact-match scoring |
205
+ | **Storage** | better-sqlite3 (native) with sql.js fallback | Fast native SQLite with WAL journal; falls back to WASM if no build tools |
206
+ | **Keyword Search** | BM25 via FTS5 | Fast exact-match scoring |
188
207
  | **Vector Search** | HNSW index | Semantic similarity matching |
189
208
  | **Embeddings** | TF-IDF + FNV1a hashing | 256-dim vectors, pure TypeScript, no API calls |
190
209
  | **Ranking** | Reciprocal Rank Fusion | Combines BM25 + vector scores |
@@ -377,7 +396,7 @@ Cross-project operations (search, task listing) are explicit and deliberate.
377
396
  - Graceful pause/resume capabilities
378
397
  - Complete iteration history and metrics
379
398
  - 6 CLI commands + 4 MCP tools
380
- - 🧠 **Persistent Memory**: Context that survives across AI sessions — hybrid BM25+HNSW search, auto-capture, zero native dependencies
399
+ - 🧠 **Persistent Memory**: Context that survives across AI sessions — hybrid BM25+HNSW search, auto-capture, native SQLite with WASM fallback
381
400
  - 🔍 **Auto-Detection**: Detects languages, frameworks, MCP modules, and services from your project files
382
401
  - 📁 **Modular Architecture**: Templates in `/.rulebook/` directory — smaller AGENTS.md, on-demand loading
383
402
  - 🔗 **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) {