Skip to content

Docs & cleanup: undocumented env vars/features, stale docstrings, assorted low-severity polish #26

Description

@codenamekt

Summary

Documentation gaps and a batch of low-severity polish items collected during the review.

Documentation gaps

  • Webhooks feature is undocumentedHEXUS_WEBHOOK_URL/HEXUS_WEBHOOK_SECRET, payload schema, and a signature-verification recipe appear nowhere but a one-line ROADMAP mention. (Cross-ref the webhooks issue.)
  • ~12 real env vars are undocumented (in code, absent from README/docs): HEXUS_EMBED_LONG_TEXT_MODE, HEXUS_RERANK_LONG_DOC_MODE, HEXUS_EMBED_DEVICE, HEXUS_ENTITY_EXTRACTOR_ENABLED/_PATTERNS, HEXUS_DB_NAME/USER/PASS, MEMORY_PGVECTOR_DB_*, HEXUS_TRANSPORT, HEXUS_DEBUG, HEXUS_LOG_LEVEL, PG_TEST_*. The recently-added long-text chunking + long-doc rerank features have no user docs.
  • Stale docs/comments: compose.yml comments reference a non-existent /app/pgvector/migrations/ path; get_config_schema says embed_url required + "768-dim" (stale); bulk_upsert_md docstring says 768-dim.

Low-severity cleanup

  • mcp_server/cli.py:141_redact_dsn only redacts password= keyword DSNs; a URI-form DSN (postgres://user:pass@host) logs the password in cleartext (cli.py:75-80).
  • hexus/ccr/cache.py:26-29CCRCache.set() raises StopIteration when maxsize<=0 (uncaught, under a lock on the write path).
  • mcp_server/server.py:431-453 — cleanup daemon sleeps before its first run and has no jitter/backoff on repeated failure.
  • mcp_server/server.py:225-229, 941-945 — writer-queue stats only read the first active writer (for … : break), under-counting queue depth when multiple writers are active.
  • hexus/pipeline/router.py:88-90 — log-compression header claims "showing {N} errors" while displaying at most 20.
  • hexus/__init__.py:786prefetch()'s session_id param is accepted and never used; :410 vs 861-871turn_min_chars comment promises exceptions _is_noise doesn't implement.
  • store.py:2305-2319consolidate_low_confidence_memories has LIMIT 20 with no ORDER BY (nondeterministic selection); store.py:1092-1099DEBUG_SEARCH_RAW builds a full-content list unconditionally (PII into logs when DEBUG on).
  • store.py:492-517adapt_vector_precision runs DDL (ACCESS EXCLUSIVE, HNSW rebuild) on startup with no advisory lock; two processes starting together race it.

Suggested direction

Add an env-var reference table to the README/docs, document the webhook + long-text/rerank features, refresh stale docstrings/comments, and knock out the small cleanups (several are one-liners).

Filed from the 2026-07 codebase review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: docsArea: docscode-reviewFiled from the 2026-07 codebase reviewdocumentationImprovements or additions to documentationpriority: lowNice to have; polish/docs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions