Architecture decision
ADR-018: Keep lexical search a first-class feature
Make published evidence discoverable without an AI provider, with its own bounded API and operational checks.
Context
Ask Habib should help a visitor find original evidence before it attempts to generate an answer. Tool names such as sqlc and pgx, architecture decisions, and experience pages should remain discoverable when an AI provider is unavailable or its budget is exhausted.
Decision
Provide a lexical search page and a separate Go API backed by PostgreSQL full-text search. Return one result per page, with its evidence type, a plain-text snippet, and a canonical link. Use English stemming alongside a simple dictionary and deterministic technical aliases. No model calls or embeddings participate.
Treat the index as derived data from the same immutable content used to build the frontend. Validate the whole corpus, publish the frontend, verify its release manifest, then atomically update the index. The API filters results against the content fingerprints bundled in its release. Draft or stale changed documents cannot become citations through an older index.
Search has an independent query cap and a loose, bounded in-memory quota. An unavailable database produces a clear retry message while static navigation and the original portfolio pages remain available.
Alternatives considered
An AI-only interface could paraphrase natural-language questions, but it would make basic navigation depend on provider latency, availability, and spend. Static navigation remains useful, but cannot efficiently locate mentions inside longer pages. A separate search service would add another component before this small corpus demonstrates a need for it.
Consequences and verification
The design adds an indexing job, two GIN indexes, and a deployment verification step. Index maintenance increases write cost and storage. Lexical matching does not understand every paraphrase, and its score describes text matching rather than professional expertise or the truth of a claim.
Local Podman tests with PostgreSQL cover repeat execution, atomic write failure, renames, stale-result filtering, lock ownership, publication checks, and database outages. Production acceptance on 21 November 2026 verified 17 indexed documents, repeat execution without changes, public technical queries and throttling, an off-VPS encrypted restore with matching hashes and privileges, and application rollback/restore with the index retained. Chrome keyboard search opened the canonical evidence page. The approved deployment timer is active again.
Revisit retrieval techniques after collecting explicit examples where lexical matching fails. Future semantic retrieval and generated answers should preserve this independent route to the source pages.