Repository navigation
feat: batch architecture and durable event contracts #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| []() | ||
| []() | ||
| []() | ||
| []() | ||
| []() | ||
|
|
||
| **A rules-enforced RPG backend that turns any LLM into a game master who can't cheat.** | ||
|
|
||
|
|
@@ -46,9 +46,9 @@ You talk to an AI (Claude, GPT, etc.) in natural language. You say things like " | |
|
|
||
| ## v1.0 Release (January 2026) | ||
|
|
||
| ### 83% Tool Reduction: 195 → 33 Tools (29 Consolidated + 4 Meta/Event) | ||
| ### 81% Tool Reduction: 195 → 36 Tools (31 Consolidated + 5 Meta/Event) | ||
|
|
||
| This release consolidates 195 individual tools into **29 action-based tools** plus 4 standalone meta/event tools using: | ||
| This release consolidates 195 individual tools into **31 action-based tools** plus 5 standalone meta/event tools using: | ||
|
Comment on lines
+49
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win List every tool included in the published count. Lines 49-51 and 121 claim 31 consolidated tools and 5 meta/event tools. The consolidated reference lists only 29 tools. Also applies to: 121-121 🤖 Prompt for AI Agents |
||
|
|
||
| - **Action enums** - Each tool handles multiple operations via an `action` parameter | ||
| - **Fuzzy matching** - Typo-tolerant action matching with suggestions | ||
|
|
@@ -61,7 +61,7 @@ This release consolidates 195 individual tools into **29 action-based tools** pl | |
|
|
||
| | Metric | Before | After | Change | | ||
| |--------|--------|-------|--------| | ||
| | MCP Tools | 195 | 33 | **83.1% reduction** | | ||
| | MCP Tools | 195 | 36 | **81.5% reduction** | | ||
| | Tests | 1,242 | 2,214 | +78% coverage | | ||
| | Token overhead | ~50K | ~6-8K | **85% reduction** | | ||
|
|
||
|
|
@@ -118,7 +118,7 @@ This engine implements the **Event-Driven Agentic AI Architecture**: | |
|
|
||
| --- | ||
|
|
||
| ## Consolidated Tools Reference (29 Tools) | ||
| ## Consolidated Tools Reference (31 Tools) | ||
|
|
||
| ### Character & Party | ||
|
|
||
|
|
@@ -318,7 +318,7 @@ src/ | |
| │ ├── migrations.ts # SQLite schema definitions | ||
| │ └── repos/ # Repository pattern for persistence | ||
| ├── server/ | ||
| │ ├── consolidated/ # 29 action-based tools | ||
| │ ├── consolidated/ # 31 action-based tools | ||
| │ ├── handlers/ # Extracted handler implementations (combat, spatial) | ||
| │ ├── consolidated-registry.ts # Tool registration | ||
| │ ├── meta-tools.ts # search_tools, load_tool_schema | ||
|
|
@@ -354,20 +354,29 @@ docs/ # White paper and LLM spatial guide | |
| LLMs cannot cast spells they don't know or claim damage they didn't roll. | ||
|
|
||
| 7. **Token efficiency** | ||
| 29 consolidated tools with action routing reduce context overhead by 85%. | ||
| 31 consolidated tools with action routing reduce context overhead by 85%. | ||
|
|
||
| 8. **Guiding errors** | ||
| Invalid actions return suggestions, not just failures. | ||
|
|
||
| ## Tool-surface policy | ||
|
|
||
| The consolidated MCP contracts are the public tool surface. The older | ||
| world-map helpers in `src/server/tools.ts` are retained in compatibility mode | ||
| as an internal adapter because `world_map` still delegates to their validated | ||
| world persistence and patch implementation. New public tools must be added to | ||
| the consolidated contracts, and the adapter matrix is enforced by | ||
| `src/server/legacy-surface-policy.ts`. | ||
|
|
||
| --- | ||
|
|
||
| ## Test Coverage | ||
|
|
||
| ```bash | ||
| npm test | ||
| # 2214 tests passing, 7 skipped | ||
| # 136 test files | ||
| # Coverage across all 33 tools (29 consolidated + 4 meta/event) | ||
| # 2252 tests passing, 7 skipped | ||
| # 148 test files | ||
| # Coverage across all 36 tools (31 consolidated + 5 meta/event) | ||
|
Comment on lines
373
to
+379
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use one command-specific test count throughout README. Lines 375-379 report 2,252 tests. Other README sections still report 2,214 or 2,252-related older values. Update all test-count statements together, or identify different commands when their totals differ. 🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| --- | ||
|
|
@@ -391,7 +400,7 @@ Contributions welcome! Please: | |
| - [x] Corpse and loot mechanics | ||
| - [x] NPC memory and relationships | ||
| - [x] Improvisation engine | ||
| - [x] Tool consolidation (195 → 33) | ||
| - [x] Tool consolidation (195 → 36) | ||
| - [x] Fuzzy action matching | ||
| - [x] Preset systems (creatures, encounters, locations) | ||
| - [ ] WebSocket real-time subscriptions | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,25 @@ | ||
| ## ADR-004: Legacy Tool Surface Strategy (Deprecate vs Compatibility Mode) | ||
|
|
||
| ### Status | ||
| Proposed | ||
| Accepted | ||
|
|
||
| ### Context | ||
| The consolidated runtime path is active, while `src/server/tools.ts` remains as a legacy-style tool surface. | ||
|
|
||
| ### Problem | ||
| Without explicit policy, dual surfaces increase maintenance cost and risk behavior divergence. | ||
|
|
||
| ### Decision (to be made) | ||
| Choose one explicit strategy and document it: | ||
| 1. **Deprecate/remove legacy surface** with migration notes, or | ||
| 2. **Retain compatibility mode** with explicit support guarantees and parity tests | ||
| ### Decision | ||
| Retain **compatibility mode**. The consolidated MCP tools are the only public | ||
| registration surface. `src/server/tools.ts` remains an internal adapter for | ||
| the world-map implementation until that implementation is migrated behind the | ||
| same contract, and no new public legacy tools may be added. | ||
|
|
||
| The supported adapter matrix is the seven world-map operations listed in | ||
| `src/server/legacy-surface-policy.ts`. Each entry maps to one | ||
| `world_map` action and is covered by a parity test. The adapter may be removed | ||
| only after the consolidated implementation no longer imports it and a staged | ||
| migration note is published. | ||
|
|
||
| ### Consequences | ||
| **If deprecate** | ||
|
|
@@ -24,10 +31,10 @@ Choose one explicit strategy and document it: | |
| - Ongoing parity testing/maintenance overhead | ||
|
|
||
| ### Acceptance Criteria | ||
| - [ ] ADR finalized with selected option | ||
| - [ ] README/docs updated with the decision | ||
| - [ ] If retained: parity test matrix for critical workflows | ||
| - [ ] If deprecated: staged removal plan and timeline | ||
| - [x] ADR finalized with selected option | ||
| - [x] README/docs updated with the decision | ||
| - [x] If retained: parity test matrix for critical workflows | ||
| - [x] If deprecated: staged removal plan and timeline | ||
|
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Mark the inactive deprecation criterion as not applicable. The decision retains compatibility mode. Line 37 marks 🤖 Prompt for AI Agents |
||
|
|
||
| ### Source | ||
| Architecture analysis: `docs/ARCHITECTURE-CODEBASE-ANALYSIS.md` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove the empty badge link.
Line 8 has an empty link destination. Markdownlint reports MD042. Remove the link wrapper, or add a valid destination.
Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 8-8: No empty links
(MD042, no-empty-links)
🤖 Prompt for AI Agents
Source: Linters/SAST tools