Repository navigation
docs: a configuration reference, because there wasn't one - #76
Open
ExposureGuard wants to merge 1 commit into
Open
ExposureGuard wants to merge 1 commit into
ExposureGuard wants to merge 1 commit into
Conversation
`.env.example` documented eight of the forty-eight `HALDIR_*` names the code reads. The other forty — the pool sizing, the signing keys, the transparency mirror, SMTP, the metrics token, x402, the log switches — were discoverable only by reading the modules that use them. `CONFIGURATION.md` lists every one with its default and what it does, grouped by what you are trying to do rather than alphabetically. It is packaged with the wheel and the sdist like the other operator docs, and linked from SELF_HOSTING.md's five-minute setup, which is where someone finishes the required settings and starts wondering what else there is. `tests/test_configuration_docs.py` scans the tree for names the code refers to by string literal and fails when one is missing from the document — the same shape as the version-literal and packaging guards, for the same reason: a fact that lives in one place and is checked in none. The scan paid for itself before it was committed. It found `HALDIR_SESSION_ID` advertised in `haldir_mcp_proxy.py`'s usage line — a variable nothing has ever read, so anyone setting it got a proxy that quietly minted its own session instead. The docstring says what actually happens now. It also produced two false positives on the first run (`HALDIR_KEY` in a shell example, `HALDIR_VERSION` as a Python identifier); the scan requires the name to stand alone as a string literal, which excludes both. Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Independent of #73/#74/#75 — branched from
main.The gap
.env.exampledocuments eight of the forty-eightHALDIR_*names the code reads. The rest — Postgres pool sizing, the Ed25519 signing keys, the transparency mirror, SMTP, the metrics token, the log switches, x402 — were discoverable only by reading the modules that use them. For a product you self-host, that's the difference between "configurable" and "configurable if you read the source".What this adds
CONFIGURATION.md— every variable, its default, and what it does, grouped by what you're trying to do (start here / storage / logging / tamper-evidence / HTTP / outbound / MCP / x402 / email / containers / build-only) rather than alphabetically. Packaged with the wheel and sdist alongsideSELF_HOSTING.md,CLI.mdandTHREAT_MODEL.md, and linked from the five-minute setup — the point where someone has finished the required settings and starts wondering what else there is.tests/test_configuration_docs.py— scans the tree for names the code refers to as string literals and fails when one is missing from the document. Same shape as the version-literal and packaging guards, for the same reason: a fact that lives in one place and is checked in none.It found a bug before it was committed
haldir_mcp_proxy.py's usage line advertisedHALDIR_SESSION_ID=ses_xxx— a variable nothing has ever read. The proxy creates its own session on first use (_ensure_session), so anyone who set it got a silent no-op. The docstring says what actually happens now.(The scan also produced two false positives on its first run —
HALDIR_KEYin a shell example,HALDIR_VERSIONas a Python identifier. It requires the name to stand alone as a string literal, which excludes both; both cases are commented in the test.)Verification
CONFIGURATION.mdshipsHALDIR_PORT(read bydocker-compose.yml, documented under Containers) andHALDIR_ORIGIN_SECRET(the variable release(0.4.3): the client address, the spec, and the OAuth metadata #73 adds — documented here ahead of it, so merging either order leaves the guard green)🤖 Generated with Claude Code