From 37e2e8ee40ac250d4533481c58cddf0b77b4a953 Mon Sep 17 00:00:00 2001 From: SaladDay <1203511142@qq.com> Date: Wed, 30 Sep 2026 06:52:43 +0000 Subject: [PATCH 1/7] docs: split operator guides into the default install path, options and one configuration reference install.md keeps only the default path; flags, external proxies, modes, split and native Core move to install-options.md. configuration.md owns the directory layout, every Core environment variable and the Runtime history bounds (rendered from the schema), replacing services/agents-api/runtime-history/README.md. operations.md gains oac domain, the single version policy, Core API scripting and corrected listener facts. --- .env.example | 12 +- apps/docs/scripts/guides.json | 6 +- apps/docs/scripts/verify-docs-facts.mjs | 4 +- contracts/agents-api/runtime-observability.md | 2 +- deploy/install/config.schema.json | 12 +- docs/configuration.md | 224 ++++---- docs/getting-started/README.md | 34 +- docs/getting-started/install-options.md | 365 +++++++++++-- docs/getting-started/install.md | 481 +++--------------- docs/getting-started/operations.md | 169 +++--- docs/getting-started/quickstart.md | 11 +- services/agents-api/runtime-history/README.md | 57 --- site/index.html | 4 +- 13 files changed, 634 insertions(+), 747 deletions(-) delete mode 100644 services/agents-api/runtime-history/README.md diff --git a/.env.example b/.env.example index d80007943..8379d84b9 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,5 @@ # Server-side Vite development proxy target. This value is never exposed to # browser JavaScript. -# Retired AGENTS_API_PROXY_* and AGENTS_CORE_WEB_* settings are rejected; use -# OAC_WEB_DEV_PROXY_* and OAC_WEB_* below, including in existing .env files. OAC_WEB_DEV_PROXY_TARGET=http://127.0.0.1:8091 # Legacy development proxy only. The console never calls /v1; the Vite server @@ -9,13 +7,9 @@ OAC_WEB_DEV_PROXY_TARGET=http://127.0.0.1:8091 # scripts/core-doctor.mjs (see docs/web/roadmap.md). Plaintext bearer file read # only by the local Vite server; if unset, it checks this conventional path. OAC_WEB_DEV_PROXY_TOKEN_FILE=~/.oac/dev/web-token -# Optional server-only OTLP/HTTP Runtime history exporter configuration. -# When unset, current observations and the Dashboard require no telemetry backend. -# Runtime history uses the Core PostgreSQL database with 30-second periodic sampling. -# Optional sampling/OTLP export overrides: services/agents-api/runtime-history/README.md -# OAC_HISTORY_SETTINGS_FILE=/absolute/path/runtime-history.json -# Set sample_interval_seconds (5..300) in that server-only file to change the -# sampling interval; omitted or zero keeps 30 seconds. + +# Core reads its own environment, not this file. Core settings, including +# Runtime history sampling and export, are in docs/configuration.md. # Alternative server-side value for the legacy /v1 development proxy. Never use a # VITE_ prefix, and do not set this together with OAC_WEB_DEV_PROXY_TOKEN_FILE. diff --git a/apps/docs/scripts/guides.json b/apps/docs/scripts/guides.json index 165a78af6..f3dc9bab8 100644 --- a/apps/docs/scripts/guides.json +++ b/apps/docs/scripts/guides.json @@ -21,13 +21,13 @@ "slug": "install", "source": "docs/getting-started/install.md", "title": "Install Core and Web", - "description": "Current distribution, host prerequisites, HTTPS, first sign-in and installation options." + "description": "Host prerequisites, installation, HTTPS, first sign-in, a default model and the first Project API key." }, { "slug": "install-options", "source": "docs/getting-started/install-options.md", - "title": "Installation options", - "description": "Listener addresses, ports and initial installation choices." + "title": "Installation options and advanced deployments", + "description": "Installer flags, sandbox backends, listeners, reverse proxies, split and native deployments and offline hosts." }, { "slug": "configure", diff --git a/apps/docs/scripts/verify-docs-facts.mjs b/apps/docs/scripts/verify-docs-facts.mjs index fce27c13d..4c246c4cf 100644 --- a/apps/docs/scripts/verify-docs-facts.mjs +++ b/apps/docs/scripts/verify-docs-facts.mjs @@ -18,10 +18,10 @@ const source = slug => fs.readFileSync(path.join(app, 'content/docs', slug + '.m for (const token of ['/v1', '/core/v1', '/api/v1', 'Project API key', 'Core key', 'executor']) assert.ok(source('public-api').includes(token), 'Credential matrix omits ' + token) for (const token of ['config.json', 'oac apply']) assert.ok(source('configure').includes(token), 'Configuration guide omits ' + token) for (const token of ['oac-node', '/var/lib/oac-node/.oac/nodes', 'Node installation and removal require root.']) assert.ok(source('hosted-providers').includes(token), 'Node guide omits ' + token) -// Keep the installation policy visible in the operator guides. +// Keep the installation policy visible in its operator guide; the node guide links to it. for (const [slug, tokens] of [ ['troubleshooting', ['In-place version upgrades, downgrades and historical conversions are not supported.', '.oac.lock']], - ['hosted-providers', ['Node program version updates are not supported.', '`--update` refuses']], + ['hosted-providers', ['/troubleshooting#installation-version-policy']], ]) for (const token of tokens) assert.ok(source(slug).includes(token), 'Installation policy drift in ' + slug + ': ' + token) for (const file of fs.readdirSync(path.join(app, 'content/docs')).filter(n => n.endsWith('.mdx'))) { const text = fs.readFileSync(path.join(app, 'content/docs', file), 'utf8') diff --git a/contracts/agents-api/runtime-observability.md b/contracts/agents-api/runtime-observability.md index d4c4cd9cb..cc1a4cb19 100644 --- a/contracts/agents-api/runtime-observability.md +++ b/contracts/agents-api/runtime-observability.md @@ -148,7 +148,7 @@ Core restart and browser reload without replaying execution. See the [design](runtime-observability-design.md), [current API](runtime-observability-api.md), [history API](runtime-history-api.md) -and [configuration](../../services/agents-api/runtime-history/README.md). +and [configuration](../../docs/configuration.md#settings). Additional provider telemetry and idle-policy authority remain separate work. The OTLP resource identifies Core with `service.name=oac-core` and diff --git a/deploy/install/config.schema.json b/deploy/install/config.schema.json index cfe508512..d56422e4e 100644 --- a/deploy/install/config.schema.json +++ b/deploy/install/config.schema.json @@ -229,17 +229,17 @@ "properties": { "transport": { "type": "string", - "description": "OTLP export transport.", + "description": "OTLP export transport: `otlp_http`. Required with endpoint.", "x-oac": {"restarts": ["core"]} }, "endpoint": { "type": "string", - "description": "OTLP collector endpoint. Omit it to keep history local.", + "description": "OTLP/HTTP metrics URL: HTTPS, or HTTP with insecure. Omit it to keep history local.", "x-oac": {"restarts": ["core"]} }, "insecure": { "type": "boolean", - "description": "Export without TLS.", + "description": "Export without TLS. Required for an HTTP endpoint and refused for HTTPS.", "x-oac": {"restarts": ["core"]} }, "headers": { @@ -250,17 +250,17 @@ }, "queue_capacity": { "type": "integer", - "description": "Export queue capacity.", + "description": "Capacity of the history write queue and of the export queue, up to 4096. Omitted or 0 selects 256.", "x-oac": {"restarts": ["core"]} }, "timeout_seconds": { "type": "integer", - "description": "Export and query timeout in seconds.", + "description": "History write, export and query timeout in seconds, up to 30. Omitted or 0 selects 2.", "x-oac": {"restarts": ["core"]} }, "sample_interval_seconds": { "type": "integer", - "description": "Periodic sampling interval in seconds.", + "description": "Periodic sampling interval in seconds, 5 to 300. Omitted or 0 selects 30.", "x-oac": {"restarts": ["core"]} } } diff --git a/docs/configuration.md b/docs/configuration.md index a0aaa69a8..b6c666bfb 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -5,21 +5,20 @@ Every setting of a Core installation has exactly one home. There are two kinds: | Kind | Examples | Home | Change it with | Takes effect | | --- | --- | --- | --- | --- | | [Process settings](#process-settings-configjson) | Public URL, ports, logging, harnesses, execution concurrency, audit retention, OAuth origins, database pool, Runtime history export | `config.json` in the installation directory (default `~/.oac/core`) | Web domain setup or `oac domain` for managed HTTPS; otherwise edit the file, then run `oac apply` | `oac apply` restarts the services that read the changed settings | -| [Runtime settings](#runtime-settings-web) | Sandbox backend and size, nodes, Projects and keys, default models, executor credentials | Core's PostgreSQL database | Web, or the Core API (`/core/v1`) with the Core key | Saved without a Core restart; node Runtime changes prepare asynchronously | +| [Runtime settings](#runtime-settings-web) | Sandbox backend and size, nodes, Projects and keys, default models, executor credentials | Core's PostgreSQL database | Web, or the Core API (`/core/v1`) with the Core key | Saved without a Core restart; nodes prepare Runtime changes asynchronously | -Web's **System** page shows both: the installation's addresses, the process settings -read-only under **Startup settings**, and managed HTTPS under **Domain and HTTPS** with the path of `config.json` and the apply -command, the default models, and the sandbox configuration. Secrets live in -[`secrets/`](#secrets-and-identity), one copy each. Each setting is set in one place; -the files in `generated/` are only derived from `config.json`. No configuration file -defines Projects or API keys. +Web's **System** page shows the installation's addresses, the default models, the +sandbox configuration and, under **Startup settings**, the process settings +read-only with the path of `config.json` and the apply command. Secrets live in +[`secrets/`](#installation-directory), one copy each. The files in `generated/` are +derived from `config.json`. No configuration file defines Projects or API keys. ## Process settings: config.json The installer writes every setting that applies to the installation's -[mode](getting-started/install.md#modes), so the file shows each value. Installer flags -listed in [Installation options](getting-started/install-options.md) only seed it. To change a -setting, edit the file and apply it: +[mode](getting-started/install-options.md#modes), so the file shows each value. +Installer flags listed in [installation options](getting-started/install-options.md) +only seed it. To change a setting, edit the file and apply it: ```sh ~/.oac/core/oac apply --dry-run # show the changed settings, files and restarts @@ -28,58 +27,61 @@ setting, edit the file and apply it: ### How oac apply works -1. It validates `config.json` and changes nothing if a value is invalid. `mode` and - `native_core` and `ingress` are fixed after installation; to change them, install into a new - directory. +1. It validates `config.json` and changes nothing if a value is invalid. `mode`, + `native_core` and `ingress` are fixed after installation; to change them, install + into a new directory. 2. It writes the files Core, Web and Compose read into `generated/`: `compose.json`, `core.env`, `core-key-digests.json`, `settings.json` and, when used, - `runtime-history.json`, the managed `Caddyfile` and the native Core unit. Don't edit them. A generated file - edited by hand stops `apply` until you move the change into `config.json` and run - `oac apply --discard-edits`, which keeps the edited copy as - `generated/.edited-