Skip to content

Fix documentation inaccuracies, add unit tests, and clean up docs#580

Merged
hardbyte merged 3 commits intomainfrom
docs/fix-chatbot-cms-documentation
Feb 7, 2026
Merged

Fix documentation inaccuracies, add unit tests, and clean up docs#580
hardbyte merged 3 commits intomainfrom
docs/fix-chatbot-cms-documentation

Conversation

@hardbyte
Copy link
Owner

@hardbyte hardbyte commented Feb 7, 2026

Summary

Comprehensive documentation review and cleanup of the Huey Books Backend, driven by a three-agent team (dev, QA, tech writer) that audited all documentation against the actual codebase.

Documentation fixes:

  • chatbot-system.md: Fixed 8 inaccuracies — state namespaces (system.* not session.*), CEL syntax (was JSON Logic), synchronous execution model (was incorrectly described as async/Cloud Tasks), processor hierarchy, /v1 endpoint prefix, ConversationSession schema, overstated maturity markers
  • cms.md: Removed fictional webhook registration endpoints, added missing schema fields (school_id, visibility, search_document), annotated analytics endpoints as real SQL vs placeholder data (-313 lines)
  • architecture-service-layer.md: Refactored from 2,294 to 287 lines — separated current implementation from aspirational design, verified all service/repository inventories against code
  • design-session-replay.md: Refactored from 886 to 104 lines — removed pseudo-code for implemented features, verified components against code
  • CLAUDE.md / README.md: Deduplicated (CLAUDE.md 216 → 108 lines), CLAUDE.md now references README for shared content
  • testing-credentials.md: Consolidated on seed script as primary approach, fixed wrong OpenAPI URLs (/docs/v1/docs), fixed hardcoded absolute paths

New documentation:

  • architecture-roadmap.md: Preserves design thinking cut from architecture refactor (UoW rationale, CQRS evolution, User domain migration strategy, event system vision)
  • analytics-design-note.md: Categorizes 21 analytics endpoints — 8 real SQL, 5 hardcoded fake, 4 deferred, 5 no backend implementation

New unit tests (115 total):

  • test_cms_workflow.py: 66 tests covering publish, bulk ops, validation, variants, content lifecycle
  • test_chatbot_integrations.py: 49 tests covering helper functions and Pydantic models

Dependency cleanup:

  • Added psutil to dev dependencies (was imported in test conftest but missing)
  • Removed unused playwright and pytest-playwright dev dependencies

Test plan

  • All 413 unit tests pass (source scripts/setup-test-env.sh && poetry run pytest app/tests/unit/ -v)
  • Pre-commit hooks pass (ruff-format, isort)
  • Integration tests via bash scripts/integration-tests.sh
  • Review architecture-roadmap.md captures key design thinking
  • Verify CLAUDE.md still works well as AI assistant context

- chatbot-system.md: correct state namespaces (system/user/context/temp),
  replace JSON Logic with CEL syntax, fix sync execution model description,
  fix processor hierarchy, add /v1 prefix to endpoints, update schema
- cms.md: remove fictional webhook registration endpoints, add missing
  schema fields (school_id, visibility, search_document), condense stale
  Landbot migration references
- architecture-service-layer.md: refactor from 2294 to 287 lines,
  separate current implementation from aspirational design, verify all
  service and repository inventories against code
- pyproject.toml: add psutil to dev deps, remove unused playwright/
  pytest-playwright
Documentation:
- CLAUDE.md: deduplicate with README (216 to 108 lines), keep AI-specific
  instructions, reference README for shared content
- README.md: absorb unique content from CLAUDE.md, add LOCAL_BUILD_ONLY
  flag, document @pytest.mark.isolated, reference setup-test-env.sh
- docs/cms.md: annotate analytics endpoints as real SQL vs placeholder,
  trim verbose response examples (-313 lines)
- docs/design-session-replay.md: refactor from 886 to 104 lines, verify
  all components against code, remove pseudo-code for implemented features
- docs/testing-credentials.md: consolidate on seed script as primary
  approach, fix OpenAPI URLs (/docs to /v1/docs), fix absolute paths
- docs/architecture-roadmap.md: new file preserving design thinking cut
  from architecture refactor (UoW, CQRS, migration strategy, events)
- docs/analytics-design-note.md: new design note categorizing 21 analytics
  endpoints (8 real SQL, 5 hardcoded fake, 4 deferred, 5 no backend)

Tests:
- app/tests/unit/test_cms_workflow.py: 66 new unit tests covering publish,
  bulk ops, validation, variants, content lifecycle
- app/tests/unit/test_chatbot_integrations.py: 49 new unit tests covering
  helper functions and Pydantic models
The seed script (scripts/seed_admin_ui_data.py) is the canonical test
data setup. The legacy Playwright-focused script created a different
school with fewer roles and is no longer needed.
@hardbyte hardbyte merged commit f861fce into main Feb 7, 2026
11 checks passed
@hardbyte hardbyte deleted the docs/fix-chatbot-cms-documentation branch February 7, 2026 08:03
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