Repository navigation
Description
Background
src/config.ts exists and is 333 lines, reading process.env 34 times. It does
no validation — no schema, no zod, despite zod already being a dependency used
for route validation. And 14 other files under src/ read process.env
directly, bypassing it entirely, among them src/db.ts, src/app.ts,
src/index.ts, src/api/admin.ts and src/bazaar/rateLimit.ts.
The failure mode is a misspelled or missing variable becoming undefined, then
a default, then a service that starts cleanly and behaves wrongly. A numeric
limit read as undefined silently becomes NaN in arithmetic. Nothing fails
until a price is wrong.
What to build
- One validated config module as the single source: parse and validate the whole
environment once at startup with zod, and fail to start on anything invalid. - Types derived from the schema, so a typo in a config key is a compile error.
- Replace the 14 direct reads with imports from it.
- Every variable documented in
.env.example. The repo has a drift guard that
checks this — run it. - Required-in-production variables must be required, not silently defaulted.
Acceptance criteria
-
process.envis read in exactly one module - Invalid or missing required configuration fails at startup with a message naming the variable
- Config values are typed from the schema
-
.env.exampledocuments every variable and the drift guard passes - A numeric variable that is not a number is rejected rather than becoming
NaN
Drips Wave · Complexity: Intermediate · 150 points
Repo: Divinity-Labs/Lens. Node + TypeScript, Fastify, Prisma on Postgres,
Redis for queues, Prometheus via prom-client.
Run the tests: npm test. The tests are vitest, not jest. Running jest
against this repo reports "66 suites, 0 tests" and means nothing. A single file
is npx vitest run src/__tests__/yourfile.test.ts.
Load test (prices) is already failing on main and has been for some
time. It is not your PR that broke it. Every other check should be green.
This service prices real assets on Stellar mainnet. A number that is wrong
is worse than a number that is missing, because a caller cannot tell the
difference. Prefer failing loudly over returning a plausible value.
Never elide an address, a contract id or a key in code, a comment or a test
fixture. A previous batch wrote a shortened contract id in an issue text and
five contributors invented plausible-looking ids to fill the gap. Write the
whole thing or do not write it at all.
The house pattern for an outbound deadline already exists — see
src/alerts/delivery.ts, which passes signal: AbortSignal.timeout(10_000) to
fetch. Where an issue below asks for a timeout, copy that, do not invent a
second convention.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
Activity
Miracle656 commentedon Oct 16, 2026
Coordination note: #113 "Restructure
config.tsinto a per-network config map" (assigned to @Belzabeem) also rewritessrc/config.ts.They are different changes — #113 is about the shape of the per-network configuration, this one is about validating the environment once at startup and removing the 14 direct
process.envreads elsewhere insrc/— but they land in the same file and will conflict if written blind.Check #113's state before starting, and coordinate on who goes first. If #113 has already landed, rebase onto it and keep its structure.
Jossy-ossy commentedon Oct 16, 2026
@Jossy-ossy has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Jossy-ossy to this issue.
Ranjeet2063 commentedon Oct 16, 2026
@Ranjeet2063 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ranjeet2063 to this issue.
Stanley471 commentedon Oct 16, 2026
@Stanley471 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Stanley471 to this issue.
drips-wave commentedon Oct 16, 2026
Congratulations, @Jossy-ossy! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.
🧑💻 @Jossy-ossy: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊