Skip to content

fix: respect local cache deletion patterns - #146

Draft
Kayvan-Zahiri wants to merge 1 commit into
SchematicHQ:mainfrom
Kayvan-Zahiri:codex/respect-local-cache-scan-pattern
Draft

Kayvan-Zahiri wants to merge 1 commit into
SchematicHQ:mainfrom
Kayvan-Zahiri:codex/respect-local-cache-scan-pattern

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

AsyncLocalCache.delete_missing accepts scan_pattern but ignores it. A scoped cleanup such as delete_missing([], scan_pattern="flags:*") therefore also deletes company entries and other namespaces. The datastream flags handler already uses this scoped call; the Redis provider filters deletion by the supplied pattern.

Restrict deletion candidates using case-sensitive pattern matching, then preserve keys in the keep list. Unscoped and wildcard cleanup retain their previous behavior. Six deterministic public-cache cases cover scoped deletion with and without a retained flag, company-only cleanup, an unmatched prefix, case sensitivity, and the unscoped controls. One unchanged cache-comprehension expression is reformatted by the pinned formatter. Only handwritten .fernignore-protected code and custom tests change.

Validation with Python 3.10.20, Poetry 2.1.4, unchanged poetry.lock and CI's datastream/aiohttp extras:

  • Before: four new cases fail; two controls pass in a separate baseline checkout.
  • After: all 44 focused cache tests pass. The broader SDK run has 748 passing tests and 12 passing subtests. Its nine failures and 19 setup errors reproduce exactly on the untouched baseline without the pinned WASM artifact.
  • Full Mypy passes across 1,153 source files. Changed-file Ruff 0.11.5 lint and formatting pass. Repository-wide Ruff reports 24 diagnostics identical to the baseline. git diff --check passes.
  • Source distribution and wheel build successfully. The wheel lacks rulesengine.wasm, so the CI package-content check is not satisfied: the documented SchematicHQ/schematic-api release repository is unavailable to the current GitHub connection. No substitute binary was used, and no complete WASM integration/package claim is made.

Open reconnect-cache PR #128 changes reconnect invalidation and does not modify this local cache implementation. The scoped deletion bug is separate. No generated bindings, dependencies, versions or release configuration are changed.

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.

1 participant