BalitaanNotes
Back to site
00 Notes

The reasoning, written down once

Each of the libraries started as a decision I kept having to explain. These are those explanations, short enough to read with a coffee. The longer versions live in each project’s documentation.

01 December 2026 · lexmatch

When I wrote the answers myself

For a few dozen to a few thousand short questions and answers, all written by hand, a vector database felt like more machinery than the problem deserved: a model to build the embeddings, a store to query them, and a deployment that depends on both.

Plain BM25 needs none of that and runs in microseconds. It also has a property that matters more here than a few points of recall: you can predict what it will match, because the math is legible. For an FAQ or a help desk, being able to explain why a question matched is worth a lot.

It needed two additions. BM25 cannot rank a query made entirely of common words, like what do you do?, because those words appear everywhere and carry no weight. So phrasing is scored separately, but only counts when the meaningful words also overlap; otherwise what is 2+2 matches what is your job on “what is” alone.

The second is a threshold below which it refuses to answer. An off-topic question still scores something from shared filler words, and a confident wrong answer is worse than no answer.

Embeddings are still the better tool for paraphrases across a large corpus nobody wrote by hand. This is for the other case.

02 December 2026 · maskvault

Some values come back, and some never should

Most anonymization tools do one thing: they remove. Text that has to pass through a third party carries two kinds of value that need opposite handling.

The first is identifying but legitimate: an employer, a phone number, a salary. These are swapped for tokens before the text leaves, and restored in the reply. The third party never sees them, and the person still gets a correct answer.

The second should never have been there at all: an API key, a private key, a card number. These are replaced with a notice and deliberately not restored. If one turned up, something went wrong upstream, and quietly putting it back would hide that.

So an exact round trip only holds when nothing was destroyed. That is the intended behavior, not a gap to close.

03 December 2026 · secretref

An audit that runs nothing

.env files work until the config needs structure: a list, a nested section, a number that is really a number. JSON and YAML handle structure, but then the secrets sit in a file beside the code, which is how they reach a repository. Config that names its secrets instead of holding them keeps both.

The naming is the easy half. The half that makes it a library rather than a helper function is the audit, a single line in a pipeline that fails the build when a literal credential is about to be committed, and says where.

One decision in it is easy to miss. A secret can be fetched by a command, such as a password-manager lookup, and the audit never runs it. The main place an audit runs is on a pull request, and resolving that config would execute whatever the pull request contained. Running it is a separate opt-in, for a config you wrote yourself.

The exit codes are split for a similar reason: one means “your config has a problem”, another means “the tool was used wrongly”. A pipeline needs to know which of the two it is looking at.