Repository navigation
stage 1.1: config, logging, database, and the HTTP skeleton #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
395c77b
feat(stage-1): foundation — config, logging, database, HTTP skeleton
Hendro8899 9942ff2
feat(stage-1): embedded migrations and a verifying migration manager
Hendro8899 5080bf9
fix(stage-1): CLI review — two leaks, a silent default, and a false s…
Hendro8899 fc29b8a
refactor(stage-1): SQLite for development, Postgres deferred
Hendro8899 425d491
fix(stage-1): CLI review — generalise redaction, guard the migrate en…
Hendro8899 9b81f93
fix(stage-1): two review passes — correlation id was two different ids
Hendro8899 825ca3b
fix(stage-1): protect the log line as a surface, not one field at a time
Hendro8899 fad9000
feat(stage-1): §1.3 tenancy — stores, API keys, and the tenant boundary
Hendro8899 14683da
feat(stage-1): §1.4 events and durable delivery
Hendro8899 96f0363
feat(stage-1): devices, consent, and the claim flow
Hendro8899 a9fe6c0
feat(stage-1): §1.2 engine contract, conformance suite, fake engine, …
Hendro8899 335764f
feat(stage-1): gowa adapter — polled reconciler, verified against liv…
Hendro8899 45e6e45
fix(stage-1): sixteen review findings, and finish §1.3
Hendro8899 ef8b44f
fix(stage-1): CLI review — 28 findings, three of them real holes
Hendro8899 228c66c
fix(stage-1): the transactions were not transactional, and three more
Hendro8899 1d3da38
feat(stage-1): §1.5 messaging — sending, idempotency, and the engine …
Hendro8899 4cd58fa
fix(stage-1): fifteen findings — two critical, both in code I wrote c…
Hendro8899 5bad426
fix(stage-1): the duplicate-OTP bug reappeared one line further down
Hendro8899 e9d68cb
feat(stage-1): §1.6 rule engine — matching, safety, and loop protection
Hendro8899 eb5154f
feat(stage-1): finish §1.6 — rule storage, HTTP surface, and the dry run
Hendro8899 e7093f0
fix(stage-1): twenty-five CLI findings — a QR leak among them
Hendro8899 5f5d424
fix(stage-1): the bot batch I had missed — an empty match list matche…
Hendro8899 829f257
test(stage-1): execute the exit criteria, and fix what they caught
Hendro8899 de627ec
test: align the older claim test with the documented 202
Hendro8899 6a67f3f
fix(stage-1): ten findings — reading rules needed no scope at all
Hendro8899 ecca1c2
fix(stage-1): audit every mutation for tenant scope, not one file at …
Hendro8899 0118662
fix(stage-1): the sweep missed reads, and a read was the critical one
Hendro8899 981d636
fix(stage-1): a safety check that refuses ordinary patterns gets swit…
Hendro8899 d477452
fix(stage-1): nesting was a one-character way past the pattern check
Hendro8899 eea3f96
docs: the design still described a Redis dependency we do not have
Hendro8899 4be1aa1
fix(stage-1): two scanners handled escapes, two did not
Hendro8899 2291b7e
docs: record the two deferred security gaps in todo.txt
Hendro8899 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # Copy to .env and adjust. Every value here is the documented default, so an | ||
| # empty .env behaves identically — but a variable that is present must be | ||
| # valid: blank and malformed values are rejected rather than defaulted. | ||
|
|
||
| # development | test | production | ||
| NODE_ENV=development | ||
|
|
||
| # Server | ||
| HOST=0.0.0.0 | ||
| PORT=3000 | ||
|
|
||
| # debug | info | warn | error (defaults to info in production, debug otherwise) | ||
| LOG_LEVEL=debug | ||
|
|
||
| # SQLite file. A bare path, a file: URL, or :memory:. Created on first run. | ||
| DATABASE_PATH=./data/db/bunwa.sqlite | ||
|
|
||
| # Refuse to start when migrations are pending, rather than applying them. | ||
| # Defaults to true in production, false otherwise. | ||
| MIGRATE_STRICT=false | ||
|
|
||
| # Writable directory for runtime state — chiefly the migrations materialised | ||
| # out of the binary. Ephemeral; nothing here is a source of truth. | ||
| RUNTIME_DIR=.runtime | ||
|
|
||
| # Mount the admin API. It can mint API keys and has no authentication yet, so | ||
| # enabling it is a deliberate act. Never true in a deployment until §1.3 grows | ||
| # operator sessions. | ||
| ADMIN_API_ENABLED=false | ||
|
|
||
| # Permit webhook targets that are plain http, or private/loopback addresses. | ||
| # Its own switch rather than derived from NODE_ENV: a security control must not | ||
| # be disabled by an unset environment name. Rejected outright in production. | ||
| ALLOW_INSECURE_WEBHOOK_TARGETS=false | ||
|
|
||
| # Where the colocated gowa engine listens. Empty disables the engine entirely, | ||
| # which is correct for a process that only runs migrations or the admin API. | ||
| GOWA_BASE_URL= | ||
|
|
||
| # Devices per engine pool. Bounds the blast radius of one pool failing. | ||
| ENGINE_POOL_CAPACITY=25 |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: deckyfx/bunwa
Length of output: 875
🏁 Script executed:
Repository: deckyfx/bunwa
Length of output: 10177
🏁 Script executed:
Repository: deckyfx/bunwa
Length of output: 417
Add schema-generation validation to CI
bun run db:embedreads only the migration journal and SQL files. It does not rundrizzle-kit generateor inspectsrc/db/schema.ts. A schema change without a generated migration can therefore pass this check. Runbun run db:generatein CI and fail if generated files change.🤖 Prompt for AI Agents