Add dynamic AI Workspace run profiles

This commit is contained in:
Codex
2026-06-13 17:30:48 +03:00
parent 385e2732e8
commit 6244b44c6e
21 changed files with 2179 additions and 52 deletions
+54
View File
@@ -0,0 +1,54 @@
# AI Workspace Config Contract
This contract keeps topology differences in env/config instead of product-code branches.
## URL Classes
- Worker-facing URL: returned to or used by the Codex worker. It must be reachable from the machine that executes Codex.
- Backend-internal URL: used by app backends, Platform Assistant, Hub, Gateway, and service-to-service calls.
- Browser URL: used by user-facing UI.
- Downstream app URL: used by an adapter service to mutate/read its owned app backend.
Do not mix these classes. A URL reachable from the Mac browser is not automatically reachable from a remote Codex worker.
## Current Profiles
`local/hybrid-prod-bridge`:
- Tasker UI: `http://task.local.nodedc`
- Platform Assistant: `http://127.0.0.1:18082`
- Local Hub process: `http://127.0.0.1:18081`
- Default worker-facing Hub: `wss://ai-hub.nodedc.ru/api/ai-workspace/hub`
- Ops entitlement adapter: `http://host.docker.internal:4100/api/internal/v1/ai-workspace/entitlements` when deliberately enabled
- Ops Gateway downstream Tasker: `http://task.local.nodedc`
- This profile is valid for contract smoke and local Ops vertical smoke, not proof of live local Codex worker e2e.
`synology/prod-public`:
- Browser Launcher: `https://hub.nodedc.ru`
- Browser Ops: `https://ops.nodedc.ru`
- Worker-facing Hub: `wss://ai-hub.nodedc.ru/api/ai-workspace/hub`
- Platform Assistant internal: `http://ai-workspace-assistant:18082`
- Platform to Ops entitlement: `http://172.22.0.222:18190/api/internal/v1/ai-workspace/entitlements`
- Ops Gateway worker-facing MCP: `https://ops-agents.nodedc.ru/mcp`
- Ops Gateway downstream Tasker: `http://172.22.0.222:18090`
- This is the preferred controlled runtime e2e target.
`tailscale/tunnel-local-e2e`:
- Allowed only as an explicit profile.
- All worker-facing URLs must be reachable from the executing Codex worker through Tailscale or a named tunnel.
- No product code should auto-fallback from localhost to Tailscale to public domains.
## Required Rule
New apps must join AI Workspace through app manifests/config/adapters:
- app id and surface id;
- context schema;
- entitlement adapter URL/token;
- MCP/tool pack URL and worker-facing public URL;
- smoke test contract;
- owner repo/service.
Do not add app-specific address logic to the agent installer, Engine, Ops, or Platform Assistant runtime flow.
+34
View File
@@ -44,6 +44,40 @@ Source fork:
/Users/dcconstructions/Downloads/mnt/data/dc_taskmanager/NODEDC_TASKMANAGER/plane-src
```
## AI Workspace Topology
Локальная доступность UI не равна честному AI Workspace e2e. Перед интерпретацией результата запускайте:
```bash
cd /Users/dcconstructions/Downloads/mnt/NODEDC/platform
infra/scripts/check-ai-workspace-topology.sh
```
Скрипт ничего не прокидывает и не меняет. Он только классифицирует текущий режим:
- `contract-only`: можно доверять только контрактным smoke-тестам без runtime e2e.
- `local-ops-vertical`: локальный Ops Gateway и локальный Tasker проверяются вертикально, без live Codex worker.
- `local-ui-only`: локальный UI доступен, но AI write path не доказан.
- `hybrid-prod-bridge`: часть контура локальная, а Hub/worker/MCP смотрят в публичный или другой контур. Такой результат нельзя считать local e2e.
- `true-local-e2e`: Engine, AI Workspace Assistant, Hub, Ops Gateway, Tasker и worker находятся в одной локальной топологии.
- `tunnel-local-e2e`: то же самое через явно выбранный tunnel/Tailscale-профиль.
Не надо пытаться неявно “дотянуть” Mac-local окружение до Synology. Если нужен Tailscale, это отдельный явный профиль: Hub public URL, Gateway public URL и Engine/Tasker downstream должны быть заданы так, чтобы именно выполняющий Codex worker мог их достичь. До этого UI-диалоги через удаленного агента считаются `hybrid-prod-bridge`, а не доказательством локальной записи.
Перед controlled Synology apply запускайте общий predeploy gate:
```bash
infra/scripts/check-ai-workspace-release-gates.sh
```
Он не деплоит, не перезапускает контейнеры и не меняет `.env`. Скрипт только выполняет meaningful проверки до runtime e2e: topology classification, Platform contract smoke, Ops Gateway static/build/smoke, Engine static check и diff hygiene.
Адресная модель описана в `docs/AI_WORKSPACE_CONFIG_CONTRACT.md`. При изменении env examples, compose или AI Workspace URL запускайте:
```bash
infra/scripts/check-ai-workspace-config-contract.sh
```
## Target local flow
Первый local infra milestone: