Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

docs: correct the portos-ui port label and core port range in PORTS.md (#3912)

[._.]/ Adam Eivyab93448c9182
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c515417ec2..53f7b54d99 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -39,6 +39,8 @@
## Changed
+- `docs/PORTS.md` now matches the code it documents. The allocation table labelled `portos-ui`'s port 5554 `ui`, but the baseline app entry in `server/services/apps.js` has always registered it as `devUi` — so anyone matching the doc against `/api/apps` output saw a label that wasn't there. The recommended-range table was drifting the other way: it opened the core block at 5554, leaving the `:5553` loopback HTTP mirror undocumented as a reserved port, and closed it at 5560, which put `portos-db` on 5561 inside the "reserved for PortOS extensions" band. Core services now read 5553-5561 with extensions starting at 5562, and the common-labels list gained the `api-local` and `devUi` entries the table already uses.
+
- The series arc verifier can now see the world canon it was already judging against. A Universe Builder world keeps its factions, locations, vehicles, artifacts and interfaces as category variations; the named-canon trunks the verify prompt rendered stay empty until prose mints entities into them. So the verifier was handed a block labelled "world canon" that omitted the entire built world, and reported locked faction cards as invented and "absent from the World Canon" — findings no arc edit can ever close. That is a stall rather than a nuisance: the foundation gate's structure repair reverts its whole rewrite whenever verification leaves any blocker, so one permanent false positive discards every real fix beside it and the autopilot pauses. The sibling arc-resolve and volume-verify prompts already rendered this block, which is exactly why the verify/resolve pair could never converge. The arc-verify prompt now renders the category and composite canon, states that a listed entity is grounded, and a new contract test holds the pair to one world — plus the field-level half of the same class, asserting that every record field the checklist cites is one the context actually renders.
- `server/lib/ports.js` — the ESM mirror of the `PORTS` object in `ecosystem.config.cjs` — was missing both PostgreSQL ports, so server code reaching for a database port found nothing to import and hardcoded 5432/5561 by hand. The mirror now carries `POSTGRES_DOCKER` and `POSTGRES_NATIVE`, with the config's mode-dependent `POSTGRES` exposed as `resolvePostgresPort(pgMode)` rather than a constant, since resolving it eagerly would mean reading `.env` from a module nearly every server file imports. A new drift test compares the mirror against the config key by key and fails if either side gains, loses, or renumbers a port.
diff --git a/docs/PORTS.md b/docs/PORTS.md
index e2d74043b2..84fd0b9c44 100644
--- a/docs/PORTS.md
+++ b/docs/PORTS.md
@@ -14,7 +14,9 @@ PortOS uses a contiguous port allocation scheme to make it easy to understand wh
Common port labels:
- `api` - REST API server
+- `api-local` - Loopback-only HTTP mirror of an API that is served over HTTPS
- `ui` - Web UI / frontend
+- `devUi` - Vite dev server for a UI that production serves from its API process
- `cdp` - Chrome DevTools Protocol
- `health` - Health check endpoint
- `ws` - WebSocket server
@@ -24,7 +26,7 @@ Common port labels:
| Port | Process | Label | Description |
|------|---------|-------|-------------|
| 5553 | portos-server | api-local | Loopback-only HTTP mirror of the API (only listens when HTTPS is active on 5555). Lets `http://localhost:5553` work without cert warnings. Override with `PORTOS_HTTP_PORT`. |
-| 5554 | portos-ui | ui | Vite dev server (React UI) — only present in `npm run dev`; `npm start` serves the built client from :5555 directly. |
+| 5554 | portos-ui | devUi | Vite dev server (React UI) — only present in `npm run dev`; `npm start` serves the built client from :5555 directly. |
| 5555 | portos-server | api | Main API server — **always the user-facing port**. Switches between HTTP and HTTPS based on whether `data/certs/{cert,key}.pem` exists. |
| 5556 | portos-browser | cdp | Chrome DevTools Protocol |
| 5557 | portos-browser | health | Browser health check API |
@@ -115,10 +117,12 @@ PortOS automatically detects ports from env vars:
| Range | Purpose |
|-------|---------|
-| 5554-5560 | PortOS core services |
-| 5561-5569 | Reserved for PortOS extensions |
+| 5553-5561 | PortOS core services (includes the `:5553` loopback mirror and `portos-db` on `:5561`) |
+| 5562-5569 | Reserved for PortOS extensions |
| 5570-5599 | User applications |
+PostgreSQL in native mode listens on the system default `:5432`, outside these ranges.
+
## Viewing Port Usage
The PortOS apps list shows all ports for each process: