-
Notifications
You must be signed in to change notification settings - Fork 2
feat: validate slug format in axme_save_decision and axme_save_memory #65
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
When saving decisions or memories, the slug parameter is used as part of the filename (e.g., D-042-my-decision-slug.md). Currently there is no validation that the slug conforms to a safe kebab-case format. Slugs with spaces, special characters, or uppercase letters could cause filesystem issues or dedup failures. Add a simple validation that rejects slugs not matching /^[a-z0-9][a-z0-9-]*$/ and returns a helpful error message.
Relevant files:
src/tools/decision-tools.ts— add slug validation inaxme_save_decisionhandlersrc/tools/memory-tools.ts— add slug validation inaxme_save_memoryhandlertest/decisions.test.tsandtest/memory.test.ts— add test cases for invalid slugs
Acceptance criteria:
- Slugs not matching
^[a-z0-9][a-z0-9-]*$are rejected with a clear error message - Error message suggests the correct format (lowercase, hyphens, no spaces)
- At least 4 test cases: valid slug, slug with spaces, slug with uppercase, slug with special chars
npm testpasses
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers