Skip to content

Commit caace27

Browse files
dougborgclaude
andcommitted
docs(mcp): address Copilot review comments on cookbook recipe (#665)
Three nits flagged by Copilot review on PR #665: - Line 185: typo "external- content" → "external-content". - Line 212: the _variant_postprocess snippet referenced `parent_name` and `sku` locals that weren't bound in the shown excerpt. Restored the local declarations (`parent_name: str | None = None` and `sku = unwrap_unset(attrs_obj.sku, None)`) so the snippet is internally consistent. - Line 306: dropped the team-specific "cowork retro" phrasing. Reframed as "originally a real supplier-item-code lookup that returned zero results from the legacy cache" — public, accurate, doesn't require context the reader can't reach. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d51da13 commit caace27

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

katana_mcp_server/docs/cookbook/catalog-search.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ END;
182182

183183
Triggers fire for every write mode SQLite supports — ORM `session.add()`, Core
184184
`INSERT ... ON CONFLICT`, raw `exec_driver_sql`, even a future migration helper issuing
185-
`text(...)` SQL. That's the SQLite-recommended pattern for external- content FTS5 and is
185+
`text(...)` SQL. That's the SQLite-recommended pattern for external-content FTS5 and is
186186
what the typed cache uses now.
187187

188188
The regression test that would have caught the original bug is
@@ -203,11 +203,15 @@ The relevant hook is `_variant_postprocess` in `typed_cache/sync.py`:
203203
```python
204204
def _variant_postprocess(attrs_obj: Any, cache_row: CachedVariant) -> None:
205205
parent = unwrap_unset(attrs_obj.product_or_material, None)
206+
parent_name: str | None = None
207+
sku = unwrap_unset(attrs_obj.sku, None)
208+
206209
if parent is not None:
207210
cache_row.parent_archived_at = unwrap_unset(
208211
getattr(parent, "archived_at", None), None
209212
)
210-
cache_row.parent_name = unwrap_unset(getattr(parent, "name", None), None)
213+
parent_name = unwrap_unset(getattr(parent, "name", None), None)
214+
cache_row.parent_name = parent_name
211215

212216
display_parts = [parent_name] if parent_name else [sku] if sku else []
213217
# ...append variant config_attributes...
@@ -302,8 +306,9 @@ Tokenize: `["00", "7018", "581", "003"]`. Match:
302306
column carries the space-joined supplier codes; all four tokens hit prefixes there.
303307

304308
This is the [#473](https://github.com/dougborg/katana-openapi-client/issues/473) repro
305-
that lived in the cowork retro. It only works because the tokenizer splits on `\W+`;
306-
with the legacy `query.split()` the whole string was one unmatchable token.
309+
case (originally a real supplier-item-code lookup that returned zero results from the
310+
legacy cache). It only works because the tokenizer splits on `\W+`; with the legacy
311+
`query.split()` the whole string was one unmatchable token.
307312

308313
### Multi-token natural-language
309314

0 commit comments

Comments
 (0)