craftercms / craftercms/ai-assistant-plugin
Follow-up polish: parseCatalogDocument side effects, StudioAiToolContext builder, read-only tools SPI
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
## Follow-up polish items (low priority)
These items were identified during the design review of #8 and remain as non-blocking polish after the refactor in #9.
### 1. `parseCatalogDocument()` side effects
Ensure the catalog parse method follows a pure parse→return pattern with no mutation of shared/static state during parsing. Any initialization of shared state should be deferred to an explicit `initialize()` or `load()` step.
### 2. `StudioAiToolContext` multi-argument constructor
Replace or supplement the raw multi-arg constructor with a proper Builder to eliminate parameter-order risks at call sites and improve readability.
### 3. Read-only tools allowlist drift
Derive read-only / pipeline-stage classification from the tool SPI itself (e.g., an `isReadOnly()` flag or `pipelineStage` field on each tool class) so that the manual allowlist in `AuthoringIntentRecipeEngine` cannot drift from the actual tool set.
---
Raised during review of #9 by @coderabbitai.
Requested by @russdanner.
Contributor guide
Assessment
This issue has not been assessed yet.