Skip to content

fix: use 'patterns' namespace consistently in hooks-tools (fixes #1136)#1183

Open
ripgtxgt wants to merge 1 commit intoruvnet:mainfrom
ripgtxgt:fix/hooks-tools-pattern-namespace
Open

fix: use 'patterns' namespace consistently in hooks-tools (fixes #1136)#1183
ripgtxgt wants to merge 1 commit intoruvnet:mainfrom
ripgtxgt:fix/hooks-tools-pattern-namespace

Conversation

@ripgtxgt
Copy link

Fixes #1136

Problem

hooks-tools.ts used singular 'pattern' as the memory namespace in 4 locations, while the rest of the codebase (workers/index.ts, reasoningbank/index.ts, README examples) consistently uses 'patterns' (plural).

This caused a silent data loss bug: intelligence hooks stored patterns in namespace 'pattern', but memory_search and memory_list searched in 'patterns' — stored entries were invisible to normal memory operations.

Fix

Changed all 4 occurrences in hooks-tools.ts:

  • namespace: 'pattern'namespace: 'patterns'
  • || 'pattern' default → || 'patterns'
  • Description string updated to reflect correct default
- namespace: 'pattern',
+ namespace: 'patterns',

- const namespace = (params.namespace as string) || 'pattern';
+ const namespace = (params.namespace as string) || 'patterns';

…et#1136)

hooks-tools.ts used singular 'pattern' as the memory namespace in 4
locations while the rest of the codebase (workers/index.ts, reasoningbank,
README examples) uses 'patterns' (plural).

This caused a silent data loss bug: intelligence hooks stored patterns in
namespace 'pattern', but memory_search and memory_list looked in 'patterns',
making all stored pattern entries invisible to normal memory operations.

Changed:
- namespace: 'pattern'  →  namespace: 'patterns'
- default || 'pattern'  →  default || 'patterns'
- description string updated to reflect correct default
@ripgtxgt
Copy link
Author

Hi team 👋 Just checking in — any updates on this one? Happy to make adjustments if needed. Thanks!

Copy link

@mixingchex mixingchex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — Reviewed via hive-mind swarm analysis.

All 4 changes are correct and necessary. The singular 'pattern' namespace caused silent data loss: patterns stored via intelligence hooks were invisible to memory search/list which uses 'patterns' (plural).

Grep confirms no remaining instances of the incorrect singular namespace.

Suggestions (non-blocking):

  • Extract 'patterns' to a shared constant to prevent future drift
  • Add regression test for namespace consistency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'pattern' vs 'patterns' namespace typo in hooks-tools.js

2 participants