You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Isolation is via per-instance DB + Temporal namespace/task queue + Kafka topic suffixing + instance-scoped Kafka consumer groups/client IDs (not per-instance infra containers).
92
-
- The workspace can have an **active instance** (stored in `.sentris-instance`, gitignored).
98
+
- The workspace has an **active instance** (stored in `.sentris-instance`, gitignored). If neither `SENTRIS_INSTANCE` nor `.sentris-instance` exists, cross-platform tooling initializes `.sentris-instance` to `0` instead of silently guessing.
93
99
- Instance env files are stored at `.instances/instance-N/{backend,worker,frontend}.env` and can be managed with `just instance-env ...`.
100
+
-`bun run dev` initializes or repairs the active instance env files before PM2 starts, so PowerShell and Bash dev startup use the same instance-scoped env behavior.
101
+
-`just dev`, `bun run dev`, `just dev clean`, and `bun run dev clean` prune oversized PM2 logs for the selected instance. The default cap is 64MB per app log file; override with `SENTRIS_PM2_LOG_MAX_BYTES`.
102
+
- Backend PM2 dev watch includes `backend/src`, `backend/scripts/seed-templates`, and `packages/shared/src`; worker PM2 dev watch includes worker source plus shared runtime package sources. Keep this in sync when template validation inputs, seed catalogs, or shared execution contracts move.
94
103
95
104
**Agent rule:** before running any dev commands, ensure you’re targeting the intended instance.
96
105
97
-
- Always check: `just instance show`
106
+
- Always check: `just instance show`; if `just` is unavailable, run `bun run instance show`. Either command initializes `.sentris-instance` to `0` when no active instance has been selected.
98
107
- If the task is ambiguous (logs, curl, E2E, “run locally”, etc.), ask the user which instance to use.
99
108
- If the user says “use instance N”, prefer either:
100
109
-`just instance use N` then run `just dev` / `bun run test:e2e`, or
101
-
- explicit env override (`SENTRIS_INSTANCE=N just dev ...`) for one-off commands.
102
-
- Local maintenance scripts that mutate or inspect local Postgres data must use the shared script runtime (`scripts/lib/local-script-runtime.ts`) instead of reading `DATABASE_URL` directly. `DATABASE_URL` is for the running app process, Drizzle CLI, and explicit app env files; local scripts should target `SENTRIS_INSTANCE` / `.sentris-instance` by default and only use script-specific overrides such as `TEMPLATE_SEED_DATABASE_URL` or the generic `SENTRIS_SCRIPT_DATABASE_URL`.
110
+
- explicit env override (`SENTRIS_INSTANCE=N just dev ...` or `SENTRIS_INSTANCE=N bun run dev`) for one-off commands.
111
+
- Local maintenance scripts that mutate or inspect local Postgres data must use the shared script runtime (`scripts/lib/local-script-runtime.ts`) instead of reading `DATABASE_URL` directly. `DATABASE_URL` is for the running app process, production Drizzle runs, and explicit app env files; local scripts should target `SENTRIS_INSTANCE` / `.sentris-instance` by default and only use script-specific overrides such as `TEMPLATE_SEED_DATABASE_URL`, `DRIZZLE_DATABASE_URL`, or the generic `SENTRIS_SCRIPT_DATABASE_URL`.
103
112
- Local scripts that start or inspect Temporal workflows must also use `getScriptTemporalTarget()` from the shared script runtime instead of reading `TEMPORAL_NAMESPACE` / `TEMPORAL_TASK_QUEUE` directly. Use script-specific `*_TEMPORAL_NAMESPACE` + `*_TEMPORAL_TASK_QUEUE` variables or `SENTRIS_SCRIPT_TEMPORAL_NAMESPACE` + `SENTRIS_SCRIPT_TEMPORAL_TASK_QUEUE` when intentionally targeting another namespace.
104
113
- Maintenance scripts must print the target database and/or Temporal target before mutating data or starting workflows.
105
114
@@ -111,8 +120,9 @@ Local development runs as **multiple app instances** (PM2) on top of **one share
111
120
112
121
#### E2E tests
113
122
114
-
- E2E targets the backend for `SENTRIS_INSTANCE` (or the active instance).
115
-
- When asked to run E2E, confirm the instance and ensure that instance is running: `SENTRIS_INSTANCE=N just dev start` (or `just instance use N` then `just dev start`).
123
+
- E2E targets the backend for `SENTRIS_INSTANCE`, then legacy `E2E_INSTANCE`, then the active instance.
124
+
-`bun run test:e2e*` uses the cross-platform Node runner at `scripts/e2e-test.js`; do not reintroduce Bash-only active instance lookup in package scripts.
125
+
- When asked to run E2E, confirm the instance and ensure that instance is running: `SENTRIS_INSTANCE=N just dev start`, `SENTRIS_INSTANCE=N bun run dev`, or `just instance use N` then `just dev start`.
116
126
117
127
#### Keep docs in sync
118
128
@@ -136,7 +146,7 @@ bun run lint # Lint
136
146
### Database
137
147
138
148
```bash
139
-
just db-reset # Reset database
149
+
just db-reset # Reset active instance database
140
150
bun --cwd backend run migration:push # Push schema
Copy file name to clipboardExpand all lines: README.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Get the dev environment running in 3 steps:
54
54
git clone https://github.com/zebbern/Sentris.git
55
55
cd Sentris
56
56
bun run setup # Install deps + create .env files
57
-
bun run dev # Start Docker infra + all apps
57
+
bun run dev # Start Docker infra + all apps for the active instance
58
58
```
59
59
60
60
Once running:
@@ -66,33 +66,34 @@ Once running:
66
66
| Temporal UI |<http://localhost:8081>|
67
67
68
68
```bash
69
-
bun run dev:stop # Stop everything (PM2 + Docker)
70
-
bun run dev:fe # Frontend-only dev (no Docker needed)
71
-
pm2 logs # View application logs
72
-
pm2 status # Check process status
69
+
bun run dev status # PM2 + Docker + runtime health for the active instance
70
+
bun run dev logs # View application logs for the active instance
71
+
bun run dev stop # Stop the active instance apps; instance 0 also stops Docker infra
72
+
bun run dev:stop # Compatibility alias for bun run dev stop
73
+
bun run dev:fe # Frontend-only dev (no Docker needed)
73
74
```
74
75
75
-
> **Advanced:**`just dev`remains available for multi-instance development, Clerk auth auto-detection, and TLS certificate generation. See the [Multi-Instance Guide](docs/MULTI-INSTANCE-DEV.mdx) for details.
76
+
> **Advanced:**`bun run dev`and `just dev` both support multi-instance development and active instance env files. `just dev` also handles Clerk auth auto-detection and TLS certificate generation. See the [Multi-Instance Guide](docs/MULTI-INSTANCE-DEV.mdx) for details.
-**10 live-validated security workflow templates** focused on bug bounty recon, takeover triage, exposed services, repository risk, secrets, and CVE/dependency research.
96
+
-**30 live-validated security workflow templates** focused on bug bounty recon, takeover triage, exposed services, repository risk, secrets, and CVE/dependency research.
96
97
-**One-click deployment**: Browse, preview, and create workflows from templates instantly.
97
98
-**Community publishing**: Share your workflows as templates via GitHub PR with automatic secret sanitization.
98
99
-**Maintainer preflight**: Run `bun run template-library:check` before changing templates, then `bun run template-library:verify` before handoff. These use the validation ledger and focused template tests, so unchanged templates are not rerun.
@@ -133,11 +134,16 @@ Run multiple isolated dev instances on one machine for parallel feature work:
0 commit comments