Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
c29966a
fix(console): reduce auth methods search limit from 200 to 100
jeroenrinzema Jun 24, 2026
91fc9cd
fix(scheduled): only report "Sending" for events that are due
jeroenrinzema Jun 25, 2026
dc1ce87
fix(scheduled): compute next occurrence without a 10000-interval cap
jeroenrinzema Jun 25, 2026
26ac675
test(scheduled): cover leap-day yearly occurrences; trim estimate com…
jeroenrinzema Jun 25, 2026
39a0d27
fix(console): re-enable campaign create after toggling transactional off
jeroenrinzema Jun 26, 2026
96e37b8
fix(journey): auto-assign entrance data_key so input event variables …
jeroenrinzema Jun 26, 2026
af486ff
fix(journey): default exit to the first entrance on placement
jeroenrinzema Jun 26, 2026
caa1173
fix(console): make email preview compact in Journey Send node
jeroenrinzema Jun 26, 2026
f46f9d3
fix(console): show the email itself in the small Journey preview
jeroenrinzema Jun 26, 2026
78c4513
fix(http): run rate limiter after authentication
jeroenrinzema Jun 26, 2026
ca8282f
feat(scheduled): address schedule assignments by id for multi-instanc…
jeroenrinzema Jun 29, 2026
eea493a
fix(console): refresh schedule schema map after creating a schedule
jeroenrinzema Jun 30, 2026
0b6dbbc
fix(auth): drop the unused oauth cookie session intake
jeroenrinzema Aug 26, 2026
c922cd7
feat(store): add admin identities and console sessions
jeroenrinzema Aug 26, 2026
9f59b70
fix(auth): bind accepted JWT algorithms to the configured driver
jeroenrinzema Aug 26, 2026
4dec378
fix(auth): require an expiry claim on admin session tokens
jeroenrinzema Aug 26, 2026
86cb40d
fix(auth): pin the clerk provider to RS256
jeroenrinzema Aug 26, 2026
960ef75
chore(compose): require an operator-supplied AUTH_JWT_SECRET
jeroenrinzema Aug 26, 2026
6ea69d9
feat(auth): exchange every admin login for one console session
jeroenrinzema Aug 26, 2026
cefbb9b
feat(console): revoke the session on logout and expose refresh
jeroenrinzema Aug 26, 2026
8e3d9bb
fix(auth): require a JWKS for the clerk driver
jeroenrinzema Aug 26, 2026
150fb28
chore: configure the console signing key for local development
jeroenrinzema Aug 26, 2026
7d24e89
feat(journeys): gate on how often a user passed a step
jeroenrinzema Aug 26, 2026
64a60fa
refactor(auth): validate console lifetimes and drop dead helpers
jeroenrinzema Aug 26, 2026
81aec59
feat(auth): record every impersonated request
jeroenrinzema Aug 26, 2026
24c8c21
test(store): pin that the admin-auth migrations run backwards
jeroenrinzema Aug 26, 2026
069bc7b
fix(auth): accept the request's own origin in the CSRF check
jeroenrinzema Aug 26, 2026
f3b19d3
fix(invites): guard against a nil actor before logging its id
jeroenrinzema Aug 26, 2026
c92f20d
feat(webhook): config-driven outbound hook engine
jeroenrinzema Aug 26, 2026
cd821c4
refactor(auth): expose the credential chain as an HTTP middleware
jeroenrinzema Aug 26, 2026
9ccd244
fix(proxy): require an admin session on the backoffice and courier ro…
jeroenrinzema Aug 26, 2026
811e46a
fix(rbac): make membership provisioning idempotent
jeroenrinzema Aug 26, 2026
4ad49fe
fix(auth): reject every published example secret, not just one
jeroenrinzema Aug 26, 2026
4a47ba6
fix(projects): stop reading a parseable id as proof of being an admin
jeroenrinzema Aug 26, 2026
d85fa24
fix(auth): reuse the session when upgrading a legacy cookie
jeroenrinzema Aug 26, 2026
0e43c4f
test(container): isolate the postgres fixture per test session
jeroenrinzema Aug 26, 2026
44ee146
fix(console): render search highlights as React nodes
jeroenrinzema Aug 26, 2026
99f7007
fix(container): give each test database a collision-proof name
jeroenrinzema Aug 26, 2026
03410cb
feat(console): keep an open tab's session alive
jeroenrinzema Aug 26, 2026
97ffac3
refactor(auth): share one mint path between exchange and upgrade
jeroenrinzema Aug 26, 2026
fdd4c8e
docs(projects): the caller is no longer identified by a JWT
jeroenrinzema Aug 26, 2026
cfb2993
fix(projects): stop reading a parseable id as proof of being an admin
jeroenrinzema Aug 26, 2026
0c40840
fix(rbac): reconcile organization role tuples when provisioning a mem…
jeroenrinzema Aug 26, 2026
f6c5674
fix(rbac): make project membership changes actually change access
jeroenrinzema Aug 26, 2026
a557146
fix(wasm): construct ProviderError for non-zero module exits
jeroenrinzema Aug 26, 2026
2e2962f
fix(broadcasts): publish inbox settlement so broadcasts complete
jeroenrinzema Aug 26, 2026
0d8ba58
fix(console): stop claiming SMS opt-out settings are enforced
jeroenrinzema Aug 26, 2026
0b339ee
feat(sms): suppress sends to opted-out recipients
jeroenrinzema Aug 26, 2026
78ca8e7
fix(projects): confine project reads, updates and deletes to the owni…
jeroenrinzema Aug 27, 2026
d2c28c8
fix(inbox): exclude failed messages from end-user inbox counts
jeroenrinzema Aug 27, 2026
172ea02
fix(console): correct Spanish spelling of ayuda in SMS help label
jeroenrinzema Aug 27, 2026
760142b
fix(rbac): name the organization in role sync failures
jeroenrinzema Aug 27, 2026
80de5b6
test(container): guard the session id truncation against short ids
jeroenrinzema Aug 27, 2026
7fad789
fix(outbound): fill retry defaults per field and require a basic_auth…
jeroenrinzema Aug 27, 2026
996a98e
fix(auth): classify a rejected Clerk token as 401 rather than 500
jeroenrinzema Aug 27, 2026
20c406a
fix(console): keep step visit conditions readable and clearable
jeroenrinzema Aug 27, 2026
3156ce0
fix(rbac): delete a project and its roster in one transaction
jeroenrinzema Aug 27, 2026
826a924
docs(auth): say that the published-secret list covers git history
jeroenrinzema Aug 27, 2026
9d59d91
fix(auth): return 401 for an unverifiable Clerk token and bind the se…
jeroenrinzema Aug 27, 2026
dfe09b2
fix(storage): record the upload content type on stored objects
jeroenrinzema Aug 27, 2026
9e053d3
test(container): rename postgresContainerName to containerName
jeroenrinzema Aug 27, 2026
287e4b5
refactor(journeys): move step visit counting into the journeys store
jeroenrinzema Aug 27, 2026
663c1dc
feat(storage): add an Azure Blob Storage driver
jeroenrinzema Aug 27, 2026
ab81326
fix(auth): keep an unverifiable Clerk token's own status
jeroenrinzema Aug 27, 2026
9f48cf2
fix(broadcasts): align enterprise broadcast tests with project-level …
jeroenrinzema Aug 27, 2026
b331097
ci: run the test suite with the enterprise build tag
jeroenrinzema Aug 27, 2026
8ecde6f
docs: document the media storage backends
jeroenrinzema Aug 27, 2026
d3e5125
fix(auth): drop the untraceable entry from the published-secret list
jeroenrinzema Aug 27, 2026
98002e1
test(container): session-scope every reused testcontainer
jeroenrinzema Aug 27, 2026
d401acb
fix(projects): take the actor-guard change as #299 wrote it
jeroenrinzema Aug 27, 2026
3a1fdea
refactor(sms): make suppression a set rather than a state machine
jeroenrinzema Aug 27, 2026
6e249eb
feat(api): surface message failure state and broadcast failed counts
jeroenrinzema Aug 27, 2026
1ffefe2
feat(console): show suppressed and failed messages
jeroenrinzema Aug 27, 2026
06753e2
Merge pull request #295 from lunogram/fix/test-database-name-collision
jeroenrinzema Aug 27, 2026
a99c6b9
Merge pull request #292 from lunogram/fix/testcontainer-isolation
jeroenrinzema Aug 27, 2026
c9ce09c
Merge pull request #306 from lunogram/fix/testcontainer-isolation-all
jeroenrinzema Aug 27, 2026
c375a5d
Merge pull request #296 from lunogram/feat/sms-compliance-suppression
jeroenrinzema Aug 27, 2026
adc6441
Merge pull request #303 from lunogram/feat/sms-compliance-api-surface
jeroenrinzema Aug 27, 2026
36a05db
Merge pull request #299 from lunogram/fix/project-admin-actor-guard
jeroenrinzema Aug 27, 2026
6fe7c4b
Merge pull request #301 from lunogram/feat/admin-auth-foundation
jeroenrinzema Aug 27, 2026
710b2e1
Merge pull request #291 from lunogram/fix/highlight-search-stored-xss
jeroenrinzema Aug 27, 2026
a04eb1f
Merge pull request #289 from lunogram/feat/gate-step-visits
jeroenrinzema Aug 27, 2026
424ca40
Merge pull request #304 from lunogram/fix/stale-enterprise-broadcast-…
jeroenrinzema Aug 27, 2026
181a66b
Merge pull request #305 from lunogram/feat/azure-blob-storage
jeroenrinzema Aug 27, 2026
795807d
Merge remote-tracking branch 'origin/main' into HEAD
jeroenrinzema Aug 27, 2026
e7a5239
Merge remote-tracking branch 'origin/main' into HEAD
jeroenrinzema Aug 27, 2026
e65a72f
Merge origin/main into fix/idempotent-membership-provisioning
jeroenrinzema Aug 27, 2026
45c8cd4
Merge origin/main into fix/admin-session-hardening
jeroenrinzema Aug 27, 2026
9ea1693
Merge origin/main into fix/project-access-lifecycle
jeroenrinzema Aug 27, 2026
1c17f47
Merge pull request #290 from lunogram/feat/webhook-engine
jeroenrinzema Aug 27, 2026
e738584
test(management): drop the duplicated membership test file
jeroenrinzema Aug 27, 2026
362493f
Merge pull request #294 from lunogram/fix/project-access-lifecycle
jeroenrinzema Aug 27, 2026
5ca38b1
test(auth): configure a JWKS where a fixture means to exercise clerk
jeroenrinzema Aug 27, 2026
cba948b
Merge pull request #300 from lunogram/fix/admin-session-hardening
jeroenrinzema Aug 27, 2026
2799f81
Merge origin/main into fix/idempotent-membership-provisioning
jeroenrinzema Aug 27, 2026
e56d783
Merge remote-tracking branch 'origin/main' into HEAD
jeroenrinzema Aug 27, 2026
510bdfa
Merge pull request #293 from lunogram/fix/idempotent-membership-provi…
jeroenrinzema Aug 27, 2026
617924b
Merge pull request #302 from lunogram/fix/project-organization-scoping
jeroenrinzema Aug 27, 2026
32838f8
feat(mailer): send the platform's own transactional auth mail
jeroenrinzema Aug 27, 2026
851296c
feat(auth): hash local passwords with argon2id and issue single-use a…
jeroenrinzema Aug 27, 2026
3025315
feat(auth): add local email and password credentials
jeroenrinzema Aug 27, 2026
aa39c8e
test(auth): cover the local credential flows end to end
jeroenrinzema Aug 27, 2026
b6e92bb
feat(console): sign in, register and recover with a password
jeroenrinzema Aug 27, 2026
4651be9
docs(auth): describe the password driver and the platform mailer
jeroenrinzema Aug 27, 2026
e33043b
fix(auth): stop a rejected password from burning the reset link
jeroenrinzema Aug 27, 2026
47ef46d
fix(auth): require a proved address before an invite grants membership
jeroenrinzema Aug 27, 2026
3a5557a
test(auth): give the clerk fixtures the JWKS the driver now requires
jeroenrinzema Aug 27, 2026
3f03d99
chore: drop the working spec from the branch
jeroenrinzema Aug 27, 2026
54c7676
fix(ci): stop the argon2 test cost from exhausting the runner
jeroenrinzema Aug 31, 2026
dabe63b
feat(config): layer YAML and environment, and route mail through a ch…
jeroenrinzema Aug 31, 2026
1712b35
fix(config): expand ${NAME} on the parsed document, not on its text
jeroenrinzema Aug 31, 2026
549a141
test(config): cover base64:// templates supplied through the environment
jeroenrinzema Aug 31, 2026
87e6ff7
fix(console): add password to the AuthDriver union
jeroenrinzema Aug 31, 2026
cb64eb7
refactor(auth): fold the password driver into basic, and act on the r…
jeroenrinzema Aug 31, 2026
720bd8b
fix(auth): act on the second review round
jeroenrinzema Aug 31, 2026
c4eca6c
fix(auth): act on the third review round
jeroenrinzema Aug 31, 2026
f66ec95
refactor(auth): drop the server-side password policy
jeroenrinzema Aug 31, 2026
0fd0ca9
chore(compose): move mailpit into the dependency stack
jeroenrinzema Aug 31, 2026
3987e88
feat(members): open source project membership and invitations
jeroenrinzema Aug 31, 2026
e332916
refactor(mail): drop the webhook network relaxations
jeroenrinzema Aug 31, 2026
04d176a
refactor(auth): drop the action token reconciliation task
jeroenrinzema Aug 31, 2026
38ca89d
docs: describe sign-in, members and mail as they now work
jeroenrinzema Aug 31, 2026
ddcd7bc
refactor(password): drop rehash-on-login and trim the hashing package
jeroenrinzema Aug 31, 2026
01fd166
fix(test): wait for Azurite to serve, not just to listen
jeroenrinzema Aug 31, 2026
cf570b2
Merge pull request #310 from lunogram/feat/admin-password-auth
jeroenrinzema Aug 31, 2026
ddf2c46
ci: run tests as an oss/enterprise build matrix
jeroenrinzema Aug 31, 2026
76b71c7
chore(deps): bump nanoid in /modules/webhook/preview (#313)
dependabot[bot] Aug 31, 2026
c654425
chore(deps): bump brace-expansion in /console (#315)
dependabot[bot] Aug 31, 2026
f47093d
chore(deps): bump next from 16.1.6 to 16.2.11 in /docs (#314)
dependabot[bot] Aug 31, 2026
0d91855
chore(console): remove unused npm lockfile (#317)
jeroenrinzema Aug 31, 2026
90632f3
feat(metrics): serve the registry and instrument dataset queries (#309)
jeroenrinzema Sep 1, 2026
e16742b
feat(auth): sign in with the deployment's OpenID Connect providers (#…
jeroenrinzema Sep 1, 2026
5f7f971
feat(auth): surface debuggable reasons for rejected issuer/session to…
jeroenrinzema Sep 1, 2026
74b6228
chore(console): remove legacy api.ts endpoints no longer served by th…
jeroenrinzema Sep 1, 2026
0bed64a
test(scheduled): stop anchoring recurring tests on the interval bound…
jeroenrinzema Sep 1, 2026
6cbbef2
ci: replace deprecated workflow telemetry action
IamKirbki Nov 5, 2026
8dfc99b
ci: fix killed and flaky test jobs (#343)
jeroenrinzema Nov 30, 2026
282d61d
fix(modules): pass provider webhook bodies to modules unaltered (#344)
jeroenrinzema Nov 30, 2026
0e7e282
docs: add AGENTS.md based on the Brainpod agent guide (#340)
jeroenrinzema Nov 30, 2026
92a57b5
feat(management): let an API key look up its own project (#327)
IamKirbki Nov 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@f974e0c5942f8f37973c4cc395704165fbe629ba # v2
uses: step-security/workflow-telemetry-action@dbe3c1c09393511e90d52c6f49096984d1b7fe3b # v2.0.0
with:
comment_on_pr: false
- uses: actions/checkout@v5
Expand All @@ -35,10 +35,22 @@ jobs:
run: make lint

tests:
runs-on: ubuntu-latest
name: tests (${{ matrix.edition }})
# Pinned: on the Ubuntu 26 ubuntu-latest image the test step gets SIGTERMed
# (exit 143) mid-run.
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- edition: oss
tags: ""
- edition: enterprise
tags: enterprise
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@f974e0c5942f8f37973c4cc395704165fbe629ba # v2
uses: step-security/workflow-telemetry-action@dbe3c1c09393511e90d52c6f49096984d1b7fe3b # v2.0.0
with:
comment_on_pr: false
- uses: actions/checkout@v5
Expand Down Expand Up @@ -67,7 +79,7 @@ jobs:
path: bin
key: ${{ runner.os }}-bin-${{ hashFiles('**/go.sum') }}
- name: Run tests
run: make test
run: make test TAGS=${{ matrix.tags }}

build:
runs-on: ubuntu-latest
Expand Down
113 changes: 113 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Working in Lunogram

This file is the entry point for coding agents. Read it before changing the repository.

## Sources of truth

Use this precedence when guidance conflicts:

1. The user's current request.
2. This file.
3. The OpenAPI specifications: `internal/http/controllers/v1/management/oapi/resources.yml`, `internal/http/controllers/v1/client/oapi/resources.yml`, and `oapi/webhooks.yml`.
4. [`internal/pubsub/README.md`](internal/pubsub/README.md) for the event pipeline and [`console/DESIGN.md`](console/DESIGN.md) for the console design system.
5. Existing code and tests.

If code conflicts with an OpenAPI specification, preserve the specification and call out the implementation gap unless the task is to change the contract.

## Repository map

- `cmd/lunogram/`: the single binary. Every node runs the HTTP server, the NATS consumers, and cluster membership; the elected leader also runs the scheduler.
- `internal/http/`: chi server, authentication, and controllers. `controllers/v1/management/` serves the console and admin API; `controllers/v1/client/` serves the public client API used by SDKs and end users.
- `internal/store/`: PostgreSQL access with sqlx, split across three schemas with their own embedded migrations: `management/`, `subjects/` (the `users` schema), and `journey/`.
- `internal/pubsub/`: NATS JetStream producers and consumers for events, lists, journeys, campaigns, broadcasts, and inboxes.
- `internal/journeys/`: journey step execution. `internal/rules/`: segmentation rule evaluation.
- `internal/cluster/`: consensus, leader election, and the scheduler.
- `internal/rbac/`: actors, roles, and OpenFGA-backed permission checks.
- `internal/wasm/`, `internal/providers/`, `internal/actions/`, `internal/integrations/`: hosts for WASM modules.
- `modules/`: TinyGo WASM providers and actions; `pkg/modules/` is the SDK they compile against. See [`modules/README.md`](modules/README.md).
- `internal/outbound/` and `internal/ssrf/`: outbound HTTP client and SSRF policy.
- `console/`: React and Vite operator console. Follow [`console/DESIGN.md`](console/DESIGN.md) and the primitives in `console/src/components/ui/` before adding or changing UI.
- `renderer/`: Deno service that compiles and renders React Email templates over NATS.
- `docs/`: Fumadocs user documentation, with content in `docs/content/docs/`.
- `.github/workflows/`: required CI checks.

Start with [`internal/pubsub/README.md`](internal/pubsub/README.md) for how events flow between components.

## Architectural guardrails

- A project is the ownership and authorization boundary. Every project-scoped query constrains `project_id`, and every handler checks permission through `internal/rbac` before reading or writing.
- End-user actors on the client API reach only their own subject. Follow the own-scope guards and their tests (`*_ownscope_test.go`, `*_idor_test.go`) when adding client endpoints.
- Verify ownership of every user-provided foreign key. Do not rely on a later query to make an unsafe lookup harmless.
- User-configured outbound HTTP (webhooks, actions, OIDC discovery, JWKS) goes through `internal/outbound` or the `internal/ssrf` policy so private networks stay unreachable.
- JetStream consumers use explicit acks and messages may be redelivered. Make every handler idempotent, and publish follow-up subjects only after the state they depend on is committed.
- Assume multiple nodes. Work that must happen once per cluster belongs to the leader's scheduler; use Redis locks or database constraints for anything else that must not run concurrently.
- The console currently calls the management API through both the legacy Axios client in `console/src/api.ts` and the typed `oapiClient` in `console/src/oapi/client.ts`. The target is `oapiClient` only: call it directly where the request is made, and do not add functions to `api.ts`, including `oapiClient` wrappers.
- Persisted JSONB (journey steps and state, templates, rules, delivery stats) is a compatibility contract. Existing rows must remain readable and executable after schema or behavior changes.
- Migrations are append-only once on `main`. golang-migrate orders versions numerically and never applies a version lower than the database's current one, so give a new migration a numeric prefix strictly greater than the highest version in the owning schema's `migrations/`. Do not rely on filename sort order: `management/` uses 13-digit versions while `subjects/` and `journey/` use 10-digit ones.
- Enterprise features are licensed separately (see [`LICENSE`](LICENSE)). Put Go enterprise code in `*_enterprise.go` files under `//go:build enterprise`, paired with a `//go:build !enterprise` counterpart, and gate console enterprise code on `isEnterprise` from `console/src/config/enterprise.ts`. Both editions must build and pass tests.

## Working rules

- Use the smallest change that satisfies the request. Prefer reusing or extending existing code over adding another path, component, helper, or abstraction. Keep Lunogram's core small and remove duplication instead of hiding it behind wrappers.
- The user's request and pull request description define scope. Review findings do not expand it. Fix defects introduced by the change; leave pre-existing, unaffected debt alone.
- Before editing code for review feedback, summarize the findings, classify what is in scope, and wait for user approval of one fix batch. An explicit user instruction naming the fixes to apply counts as that approval. When no user can respond, post the summary and stop without editing.
- Stop and ask before a review fix adds durable state, a migration, a NATS subject or consumer, a public API contract, a deployment change, or a new top-level package. Offer to narrow the implementation, split a prerequisite, or expand scope; do not choose silently.
- After fixing the approved batch, do not start another fix-and-review cycle without user approval.
- Follow existing patterns before introducing abstractions or dependencies. A new abstraction must replace meaningful duplication or enforce an architectural boundary.
- Write parameterized SQL in `internal/store/`; build dynamic placeholders with `store.QueryArgs` and never interpolate values into SQL.
- A new table with an `updated_at` column attaches the `set_updated_at()` trigger, as existing tables do.
- Do not edit generated files directly. Change their source (OpenAPI specs, `go:generate` inputs) and run `make generate`; CI fails when generated files are stale.
- Do not add secrets, decrypted values, credentials, or production data.
- Add comments only for non-obvious constraints or decision references.
- Use Conventional Commits with a scope naming the affected package or area, such as an `internal/` package or `console`: `fix(journeys): default exit to the first entrance on placement`.
- Run pnpm commands from `console/` or `docs/`, where their `package.json` lives.
- Do not run deployments or database migrations unless explicitly requested.

## Validation

Choose the smallest relevant validation. CI remains authoritative. Go tests start PostgreSQL, Redis, NATS, and storage emulators with testcontainers, so Docker must be running.

```shell
# Go static checks, both editions
go build ./...
go build -tags enterprise ./...

# Focused Go tests (add -tags enterprise for enterprise code)
go test ./internal/<package>/... -run <Test>

# Linters (golangci-lint and console ESLint)
make lint

# Generated files after spec or go:generate source changes (requires TinyGo)
make generate

# WASM modules are separate Go modules that `go build ./...` skips (requires TinyGo and Node)
make -C modules/<name> wasm

# Console
cd console
pnpm build
pnpm vitest run <file>

# Docs
cd docs && pnpm build
```

Tests and generators can be expensive or require services. Run them when the task requests them or when required by a changed source file, and state exactly what was and was not run.

## Pull request descriptions

Keep PR descriptions proportional to the change. A simple PR should use a few lines:

- **Why**: the problem or reason for the change.
- **How**: the implementation approach, without a file-by-file inventory.
- **Scope**: affected components and, when useful, explicit non-goals.
- **Alternatives**: optional; include only when a meaningful approach was tried or rejected.
- **Diagram**: optional; use a small Mermaid diagram only when it clarifies a flow or boundary.
- **Screenshots**: required when a PR adds or changes console UI components or pages. Include one screenshot per affected state at desktop width (1280px), plus a narrow-width (390px) shot for responsive layouts. Take them from the running console, cropped to the component. Never commit screenshots to the repository; upload them with `gh pr create --attach` or `gh pr edit --attach` (gh 2.99+). Reference each file in the body as `![state](./state-1280.png)` and pass `--attach './state-1280.png#state'`; `gh` rewrites the reference to the uploaded asset. Without a body flag, `gh pr edit --attach` appends to the existing body, so when review changes alter the UI, replace the screenshots by passing `--body-file` with a body that references the local files again, together with `--attach`.

Do not generate long summaries, exhaustive change lists, or boilerplate sections.

## Documentation requirements

During every change, check whether user, API, operational, setup, or architecture documentation became incomplete or false. Update existing documentation before adding another document. Update `docs/content/docs/` when user-, API-, or operator-visible behavior changes; [`internal/pubsub/README.md`](internal/pubsub/README.md) when subjects or event flows change; [`modules/README.md`](modules/README.md) when the module contract changes; and [`CONTRIBUTING.md`](CONTRIBUTING.md) when setup changes.
26 changes: 25 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,33 @@ REDIS_ADDRESS=redis://localhost:6379
NATS_URL=nats://localhost:4222
AUTH_DRIVER=basic
AUTH_BASIC_EMAIL=admin@localhost
AUTH_BASIC_PASSWORD=admin
AUTH_BASIC_PASSWORD=change-this-development-password

# Mail goes to the Mailpit the dependency stack runs; read it at
# http://localhost:8025. Mailpit's SMTP listener speaks plaintext, so the
# default of starttls has to be turned off for it.
MAIL_CHANNEL=smtp
MAIL_FROM_ADDRESS=no-reply@localhost
MAIL_SMTP_HOST=localhost
MAIL_SMTP_PORT=1025
MAIL_SMTP_TLS=none

# Signs the console session token. Required whenever AUTH_DRIVER is set; the
# server refuses to start without it rather than generating a throwaway key,
# which would log everyone out on each restart. Generate one with:
# openssl ecparam -name prime256v1 -genkey -noout
AUTH_CONSOLE_SIGNING_KEY="$(openssl ecparam -name prime256v1 -genkey -noout)"
```

`AUTH_DRIVER` accepts a comma-separated list, so `basic,clerk` gives you local
accounts and SSO at once. `AUTH_BASIC_EMAIL` / `AUTH_BASIC_PASSWORD` seed the
first account rather than being compared against on every login. Password reset
and project invitation mail goes to the Mailpit container the dependency stack
starts; read it at <http://localhost:8025>. The mail settings above are not optional: a
deployment offering password logins with nowhere to send mail is refused at
boot. Reach Mailpit at `localhost` rather than at `mailpit`, which only resolves
inside the compose network.

## How to Contribute

### Reporting Bugs
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ GO ?= GOGC=off $(shell which go)
TINYGO ?= $(shell which tinygo)
NODE ?= $(shell which node)
PNPM ?= $(shell which pnpm)
PKGS = $(or $(PKG),$(shell env $(GO) list ./...))
TAGS ?=
PKGS = $(or $(PKG),$(shell env $(GO) list -tags '$(TAGS)' ./...))
VERSION ?= $(shell git describe --tags --always --match=v*)
SHORT_COMMIT ?= $(shell git rev-parse --short HEAD)

Expand Down Expand Up @@ -82,12 +83,12 @@ lint: | $(EMBEDDED) $(GOLANGCI_LINT) $(BUF) ; $(info $(M) running linters…) @
$Q $(GOLANGCI_LINT) run --max-issues-per-linter 10 --timeout 5m

.PHONY: test
test: | $(EMBEDDED) ; $(info $(M) running tests) @ ## Run all tests
$Q $(GO) test $(PKGS) -timeout 600s -race -p 8
test: | $(EMBEDDED) ; $(info $(M) running tests) @ ## Run all tests (TAGS=enterprise for the enterprise build)
$Q $(GO) test -tags '$(TAGS)' $(PKGS) -timeout 1200s -race -p 4

.PHONY: test-short
test-short: | $(EMBEDDED) ; $(info $(M) running short tests) @ ## Run all short tests
$Q $(GO) test $(PKGS) -timeout 120s -race -count 1 -short
test-short: | $(EMBEDDED) ; $(info $(M) running short tests) @ ## Run all short tests (TAGS=enterprise for the enterprise build)
$Q $(GO) test -tags '$(TAGS)' $(PKGS) -timeout 120s -race -count 1 -short

.PHONY: fmt
fmt: | $(EMBEDDED) ; $(info $(M) running go fmt…) @ ## Run gofmt on all source files
Expand Down
Loading
Loading