Skip to content

docs: modular backend and serializer documentation#72

Merged
27Bslash6 merged 14 commits intomainfrom
docs/modular-doc-structure
Mar 28, 2026
Merged

docs: modular backend and serializer documentation#72
27Bslash6 merged 14 commits intomainfrom
docs/modular-doc-structure

Conversation

@27Bslash6
Copy link
Copy Markdown
Contributor

@27Bslash6 27Bslash6 commented Mar 27, 2026

Summary

Comprehensive documentation restructure and accuracy audit. Splits monolithic guide files into modular per-topic pages, fixes 54 accuracy findings, adds competitive test suite.

Structure

  • docs/backends/ — 7 pages: README, redis, file, memcached, cachekitio, none (L1-only), custom
  • docs/serializers/ — 8 pages: README, default, auto, orjson, arrow, encryption, pydantic, custom
  • Old docs/guides/ files replaced with redirect stubs (backward-compatible)
  • QUICK_START.md removed (redundant with getting-started.md)
  • docs/README.md slimmed to navigation hub
  • index.md renamed to README.md for GitHub folder auto-rendering

Accuracy (54 findings fixed)

  • Ghost parameters removed from api-reference.md (pipelined, fast_mode, etc.)
  • DefaultSerializer renamed to StandardSerializer everywhere (wrong class name)
  • PickleSerializer references removed (doesn't exist)
  • Feature docs rewritten: adaptive-timeouts, distributed-locking, prometheus-metrics had fictional APIs
  • rust-serialization.md converted to redirect stub (was stale)
  • health_check() added to BaseBackend protocol docs (was showing 4/5 methods)
  • Corporate language removed ("enterprise-grade", "Executive Summary", etc.)
  • Footers standardized across all docs, stale dates removed
  • comparison.md updated with honest competitive findings + serializer='auto' fix

New content

  • docs/backends/none.md — L1-only mode documentation
  • docs/serializers/auto.md — AutoSerializer type preservation documentation
  • llms.txt comprehensive rewrite with API examples and full doc map
  • tests/competitive/test_head_to_head.py — 50-test suite vs lru_cache, cachetools, aiocache

Doc contract validation

  • 126 testable markdown doc blocks passing
  • Caught real bug: EncryptionWrapper(master_key=...) needs bytes.fromhex(), not hex string

Test plan

  • pytest --markdown-docs docs/ — 126 passed
  • pytest tests/competitive/test_head_to_head.py — 50 passed
  • No stale references
  • Lint clean

Related issues

#73 #74 #75 #76 #77 #78

…docs

Accuracy (13 critical fixes):
- Remove ghost parameters from api-reference.md (pipelined, fast_mode,
  circuit_breaker as bool, etc.) — replaced with actual DecoratorConfig fields
- Rename DefaultSerializer → StandardSerializer everywhere (class name mismatch)
- Remove PickleSerializer references (does not exist) from 4 files
- Fix type support table conflating StandardSerializer with AutoSerializer
- Rewrite adaptive-timeouts.md (documented P99×3x, actual is P95×1.5x)
- Rewrite distributed-locking.md (ghost params replaced with LockableBackend protocol)
- Fix prometheus-metrics.md ghost params (metrics_enabled etc.)
- Fix CachekitConfig fields (remove redis_url, socket_timeout etc.)
- Add health_check() to BaseBackend protocol docs (was showing 4/5 methods)
- Fix ttl default (3600 → None)
- Fix Redis URL default (remove /0 suffix)
- Remove get_cache_metrics reference (function doesn't exist)
- Fix version annotations (v1.0+ → current version)

Style fixes:
- Kill corporate language: "enterprise-grade", "Executive Summary",
  "Why cachekit Wins Everywhere", "Conservative Marketing Claims"
- Standardize footers across all 29 doc files (remove stale Last Updated dates)
- Add GFM callouts to feature docs
- Fix "we" pronoun usage in getting-started.md
- Convert rust-serialization.md to redirect stub (was stale)

Structural fixes:
- Flesh out redis.md (was significantly shorter than other backend docs)
- Add footers to all 7 serializer docs (were missing entirely)
- Standardize breadcrumbs for ssrf-protection.md and l1-invalidation.md
- Normalize cross-reference style (remove ./ prefix)
- Fix 3 broken notest markers causing doc test failures
- Make configuration.md canonical source for env vars
- Consolidate duplicate serializer section in api-reference.md
- Standardize Prometheus metric prefix to cachekit_

124 doc tests pass.
Methodical testing of cachekit vs lru_cache vs cachetools vs aiocache
across 10 data type categories and 7 behavioral dimensions.

Key findings (engineering, not vibes):
- cachekit serializes even in L1-only mode — tuples become lists
  via MessagePack (consistent behavior regardless of backend)
- cachekit handles unhashable args (lists, dicts) via content-based
  hashing — lru_cache and cachetools raise TypeError
- lru_cache on async functions caches the coroutine, not the result
  (RuntimeError on second call) — cachekit handles async natively
- All libraries handle primitives, special floats, bytes, datetime,
  Decimal, UUID, Enum identically in in-memory mode
- cachekit async uses ainvalidate_cache(), not cache_clear()
Fix inaccurate claims based on 50-test head-to-head suite:
- Disclose tuple→list serialization in ALL modes (not just Redis)
- Add unhashable args and async support to feature matrix
- Document lru_cache async footgun (caches coroutine, not result)
- Note async cache management uses ainvalidate_cache()
- Replace stale "pluggable serializers v1.0+" with honest tradeoff note
- Reference test suite and GitHub issues as evidence
- Remove "Rust Performance" row (vague, not a user-facing feature)

Verified: lru_cache async bug confirmed on Python 3.12, no stdlib fix.
References: #73, #74, #75, #76, #77
…o' fix

- New docs/serializers/auto.md documenting type preservation capabilities
- Update comparison.md: disclose serializer='auto' as the fix for tuple→list,
  rather than framing it as an unsolvable tradeoff
- Add AutoSerializer to serializer index and docs README
- Note: tuples not yet preserved by AutoSerializer (tracked in #78)
@27Bslash6 27Bslash6 force-pushed the docs/modular-doc-structure branch from 8aab901 to 4fbff7d Compare March 28, 2026 04:58
@27Bslash6 27Bslash6 changed the base branch from docs/memcached-backend-docs to main March 28, 2026 04:58
@27Bslash6 27Bslash6 merged commit 813f3d9 into main Mar 28, 2026
31 checks passed
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