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
{{ message }}
Repository navigation
Commit 43625fb
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AGENTS.md
+15-39Lines changed: 15 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Primary AI instruction file for this repo. Mirrored at `.github/copilot-instructions.md` — keep both in sync.
4
4
5
-
> **v5.0 breaking rename: `project` → `environment`.**The per-tenant business workspace (Org/Environment/Branch) is now `environment`everywhere: CLI (`--environment`/`-e`), HTTP (`/api/v1/environments/:environmentId/...`), header `X-Environment-Id`, env `OS_ENVIRONMENT_ID`, exports (`createSystemEnvironmentPlugin`, `SYSTEM_ENVIRONMENT_ID`), DB column `environment_id`, JSON `EnvironmentArtifact`. No aliases, no shims. See `.changeset/v5-project-to-environment-rename.md` and ADR-0006. "Project" only refers to the npm/monorepo sense.
5
+
> **v5.0 breaking rename: `project` → `environment`** everywhere (CLI `-e`, `/api/v1/environments/:id`, header `X-Environment-Id`, `OS_ENVIRONMENT_ID`, DB column `environment_id`). No aliases. See ADR-0006. "Project" now only means the npm/monorepo sense.
6
6
7
7
---
8
8
@@ -18,50 +18,25 @@ pnpm docs:dev # docs site
18
18
19
19
### Running the dev server
20
20
21
-
Two distinct scenarios — pick the right one:
22
-
23
-
| Scenario | Command | Port | State | Cleanup |
24
-
|:---|:---|:---|:---|:---|
25
-
|**Frontend debugging** (UI in `../objectui` calls backend) |`PORT=3000 pnpm dev:crm`|**Must be 3000** — UI is hard-wired | Persistent (`<cwd>/.objectstack/`) | Leave running |
26
-
|**Backend-only debugging** (API/protocols, no UI) |`pnpm dev:crm -- --fresh -p <random>`| Random high port (e.g. 38421) |**Ephemeral** tempdir, auto-seeded admin |**You must kill it** (`kill <PID>` via `lsof -ti tcp:<port>`) |
21
+
| Scenario | Command | Notes |
22
+
|:---|:---|:---|
23
+
|**Frontend debug** (UI in `../objectui` calls backend) |`PORT=3000 pnpm dev:crm`| Port **must** be 3000 (UI hard-wired); persistent state; leave running |
24
+
|**Backend-only debug**|`pnpm dev:crm -- --fresh -p <random>`| Random high port; ephemeral tempdir; **you must kill it** when done |
27
25
28
-
`--fresh` (added in `os dev`):
29
-
- Creates a unique tempdir under the OS tempdir and points `OS_HOME` + `OS_DATABASE_URL` + `OS_STORAGE_ROOT` into it.
30
-
- Auto-deletes the tempdir on normal exit.
31
-
- Implies `--seed-admin` — after the server is ready, POSTs to `/api/v1/auth/sign-up/email` and prints the credentials:
32
-
- default email: `admin@dev.local`
33
-
- default password: `admin12345`
34
-
- override with `--admin-email` / `--admin-password`; opt out with `--no-seed-admin`.
26
+
`--fresh`: ephemeral tempdir (auto-deleted on exit) + `--seed-admin` (POSTs sign-up, prints creds — default `admin@dev.local` / `admin12345`, override via `--admin-email`/`--admin-password`).
35
27
36
-
Rules:
37
-
-**Never start two backends on port 3000 simultaneously** — it collides with the UI dev session.
38
-
- For backend-only tasks, always pick a random high port AND tear it down after the task — don't leak processes.
39
-
- Use `pnpm dev:crm` (not raw `pnpm --filter ... dev`) so the example app is configured correctly. Flags after `--` are forwarded.
28
+
Rules: never run two backends on port 3000; for backend tasks pick a random port and tear it down; always use `pnpm dev:crm` (flags after `--` are forwarded), not raw `pnpm --filter`.
40
29
41
-
Example (backend-only debugging session, clean environment):
42
30
```bash
43
-
pnpm dev:crm -- --fresh -p 38421 # start
44
-
# ... debug via curl, http://localhost:38421 ...
45
-
kill$(lsof -ti tcp:38421)# tear down — tempdir auto-deletes
This framework repo ships **backend only** (protocols + services + REST). All Studio / Console UI work happens in the sibling repo `../objectui` (separate git repo, separate versions).
51
-
52
-
**Local dev workflow** (this is the assumed environment — `../objectui` is checked out next to `framework/`):
53
-
54
-
1.`cd ../objectui` — make UI changes there.
55
-
2. Commit & push in `../objectui` (the refresh script pulls from its git state).
This repo ships **backend only**. All Studio/Console UI work happens in `../objectui` (separate repo, checked out next to `framework/`). Workflow: edit + commit + push in `../objectui`, then in `framework/` run `pnpm objectui:refresh` to pull its build into `packages/console/`.
63
38
64
-
⚠️ Never hand-edit files under `packages/console/dist/` or `.cache/objectui-*/` — they are regenerated.
39
+
Other scripts: `objectui:bump` (pull only), `objectui:build`, `objectui:clean`. ⚠️ Never hand-edit `packages/console/dist/` or `.cache/objectui-*/` — regenerated.
6.**Object name = table name.** The object `name` is the canonical id everywhere (API, ObjectQL, REST, SDK, DB table). **Never** set `namespace` (deprecated) or `tableName` (always equals `name`). For module prefixes, embed in the name (`sys_user`, `ai_conversations`).
80
55
7.**One Zod source per metadata type.** Each type (`view`, `flow`, `agent`, …) has exactly one schema in `packages/spec/src/{domain}/`. Org overlay opt-in lives only in `allowOrgOverride` on `DEFAULT_METADATA_TYPE_REGISTRY` — no parallel whitelists. See ADR-0005.
81
56
8.**North Star alignment.** Read `content/docs/concepts/north-star.mdx` before structural changes. If a change doesn't advance §7 Built, shrink Drift, or unlock Missing — it probably shouldn't ship.
82
-
9.**`OS_` env-var prefix.** All ObjectStack-owned environment variables MUST start with `OS_`. When renaming a legacy var, use `readEnvWithDeprecation('OS_NEW_NAME', 'LEGACY_NAME')`(or pass an array of legacy names) from `@objectstack/types`so the legacy name still works for one release with a one-shot deprecation warning. Documented third-party exceptions (NOT renamed): `NODE_ENV`, `HOME`, `OPENAI_API_KEY`, `TURSO_*`, OAuth `*_CLIENT_ID` / `*_CLIENT_SECRET`, `RESEND_API_KEY`, `POSTMARK_TOKEN`, `AI_GATEWAY_*`, `SMTP_*`. (`PORT`, `DATABASE_URL`, `BETTER_AUTH_URL`, `BETTER_AUTH_SECRET` were absorbed: `OS_PORT`, `OS_DATABASE_URL`, `OS_AUTH_URL`, `OS_AUTH_SECRET` are canonical with the legacy names as fallback.) See issue#1382.
57
+
9.**`OS_` env-var prefix.** All ObjectStack-owned env vars MUST start with `OS_`. When renaming a legacy var, use `readEnvWithDeprecation('OS_NEW', 'LEGACY')` from `@objectstack/types`(keeps legacy working one release). Third-party exceptions kept as-is: `NODE_ENV`, `HOME`, `OPENAI_API_KEY`, `TURSO_*`, OAuth `*_CLIENT_ID/SECRET`, `RESEND_API_KEY`, `POSTMARK_TOKEN`, `AI_GATEWAY_*`, `SMTP_*`. See #1382.
83
58
84
59
---
85
60
@@ -219,8 +194,9 @@ export default {
219
194
## Post-Task Checklist
220
195
221
196
1.`pnpm test` — verify nothing broke.
222
-
2. Update `CHANGELOG.md` / `ROADMAP.md` if user-facing or architectural.
223
-
3.**Delete temporary artifacts** — screenshots, traces, scratch logs, `.playwright-mcp/`, throwaway `tmp*.ts`, ad-hoc scripts. Repo must look identical to before, minus intended changes.
197
+
2.**Add a changeset for feature work.** When the change is a feature or functional improvement, run `pnpm changeset` (or add a `.changeset/*.md` entry) describing it before committing. Pure bug fixes do **not** require a changeset.
198
+
3. Update `CHANGELOG.md` / `ROADMAP.md` if user-facing or architectural.
199
+
4.**Delete temporary artifacts** — screenshots, traces, scratch logs, `.playwright-mcp/`, throwaway `tmp*.ts`, ad-hoc scripts. Repo must look identical to before, minus intended changes.
0 commit comments