Skip to content

Commit 6859b2f

Browse files
docs(qa): RUNNER's connector self-URL entry follows the compile, not the boot's OS_PORT (#33406)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XAvhM3jY1jCc9QWVrVgRVuA)_ domain:devx#4 · os-project-manager · session_01FEkQ5ngu3885adndgvQofR Fixes #33371 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:只改 `docs/qa/platform-checklist/RUNNER.md` 里「showcase 自连连接器」那一条。旧文说导出 `OS_PORT` 就能修好,新文写明实测事实:连接器地址在编译时定下,`--no-compile` 启动时导出 `OS_PORT` 不起作用。两条可行路线都实测过,并写明哪条在共享检出上安全。另补一段端口被占时自动顺延的说明。 - 为什么改:旧文和 RUNNER 自己「共享检出用 `--no-compile`」的规定互相矛盾,照做的跑测会把正确的产品判成 BLOCKED。产品行为与 `self-url.ts` 头注释一致,过时的是 RUNNER。 - 风险与回滚:只改一份 QA 文档,不动产品、不发布。回滚即还原本 PR。 - 先看:`RUNNER.md` 连接器条目里的「Two routes work」两条路线,以及「A held port moves the boot」那一段。 - 两分钟验证:`pnpm check:platform-checklist`,预期退出码 0。 - 需要你做的:无,席位落地。 ## What changes `docs/qa/platform-checklist/RUNNER.md` only: - The connector self-URL entry is rewritten. The new headline says the connectors dial the self-URL the artifact was **compiled** with, so on a `--no-compile` boot an exported `OS_PORT` does not move it. The entry no longer prescribes `OS_PORT` as the fix there. Instead it says plainly that neither `OS_PORT` nor `SHOWCASE_SELF_URL` is read until the next compile. - It names two routes, each measured below, and says which is safe on a shared checkout. Route 1 compiles in a private copy and is safe. Route 2 uses the default compile on the tree, which rewrites the shared `dist/objectstack.json`, so it is only for a checkout no other runner boots. - It keeps the warning that `fetch failed` impersonates an egress block. The QA run #25817 reading (at `6679644a`) is now dated as pre-#26130 and marked as no longer holding. The `2889760a` paragraph is dropped because the measured entry supersedes it. - The stale "`-p` alone is not enough" headline is gone: `os dev` exports `-p` for its compile (`portFlagEnv`), and that was measured below. - New paragraph on the port shift: `os dev` takes the next free port and prints it twice, while the runner's shell keeps its `OS_PORT`. Runners should read the port from the boot log. - Two pointers: the `--no-compile` entry's #33025 sentence now points at the connector entry, and the canonical boot line says a connector run boots a private copy that compiles. `self-url.ts`, the showcase connectors, the CLI, `scripts/qa/**` and `areas/*.json` are untouched. ## Why At `e0ce1b52` the product matches `self-url.ts`'s own header, which says the metadata is served "as last built" under `os dev --no-compile` (leg A below). RUNNER's entry was the stale part. ## Tests — live measurements All legs ran at `origin/main` `e0ce1b52` after `pnpm build --concurrency=2` under the verify lock (VERDICT command-exit 0, 119/119). Each probe signs in as the seeded admin and creates a `showcase_task`. It then reads the newest run from `GET /api/v1/automation/showcase_declarative_connector_ping/runs`, then `GET /api/v1/meta/connector/showcase_status_api`, then `/api/v1/health` uptime. | leg | boot | artifact | ping run | metadata `baseUrl` | shared tree artifact | |---|---|---|---|---|---| | A — the freeze | tree, `--no-compile --no-watch -p 41781`, `OS_PORT=41781` exported | compiled with no `OS_PORT` (`127.0.0.1:3000` ×4) | **failed**, `connector_action(showcase_status_api.request) failed: fetch failed` | `http://127.0.0.1:3000` | — | | B — route 1 | private copy (`cp -a` and an absolute `node_modules` symlink), default compile, `--no-watch -p 41782`, `OS_PORT=41782` | `Compiling …` once; copy's artifact `127.0.0.1:41782` ×3 | **completed**, ping step success, `ping.body` uptime 7.4 s (health 13.6 s six seconds later) | `http://127.0.0.1:41782` | sha256 `04d18b8a9def596a…`, mtime 1794681892 before and after | | B′ — route 1, `-p` only | same copy, `OS_PORT`/`PORT` unset, `-p 41786` | `127.0.0.1:41786` ×3 | **completed**, uptime 9.6 s (health 15.8 s) | `http://127.0.0.1:41786` | — | | C — port shift | same copy, 41783 held by a listener, `-p 41783`, `OS_PORT=41783` | `127.0.0.1:41784` ×3 | **completed**, uptime 10.2 s (health 16.4 s) | `http://127.0.0.1:41784` | — | | D — route 2 | tree, default compile, `--no-watch -p 41785`, `OS_PORT=41785` | `Compiling …` once; the tree's artifact rewritten | **completed**, uptime 9.7 s (health 15.8 s) | `http://127.0.0.1:41785` | sha256 → `edbbc9076e31ccf8…`, port 41785 baked in ×3 | The one `127.0.0.1:3000` left in a recompiled artifact is the OpenAPI document's `servers[0].url`. The artifact's own note says the connector's `baseUrl` overrides it on every dispatch. In leg C the log printed `⚠ Port 41783 is in use — serving on 41784 instead.` at line 6, before the compile, and `↪ server bound to port 41784 (requested 41783)` at line 171. Every boot ran under `setsid` and was stopped by its process group, read from the listener; each port was free afterwards. Leg D ran in this dev's own worktree, not a shared one. No ablation was owed: the diff is docs only (os-dev.md). ## Acceptance notes - `skip-changeset`: `docs/qa/**` ships in no package (root `private: true`). - The branch was restarted from `origin/main` after #33367 merged (as `98c3a80440`). This PR's diff is only this card's two commits. ## Verification On head `7ffd1193` (merge base `origin/main` `e0ce1b52`), the derived list from `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` has 16 commands. Each exit code was captured before any pipe: <details><summary>16 derived, 16 run, all exit 0; --ran reconciliation exit 0</summary> ```text node scripts/check-adr-links.mjs :: exit 0 node scripts/check-adr-links.mjs --self-test :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 pnpm check:ci-filter-parity :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:doc-authoring :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:platform-checklist :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:watch-hint-literal :: exit 0 ``` `dispatch-gates --ran`: "16 run, 0 NOT-MEASURED (a DERIVED zero …)", exit 0. Also: `node scripts/check-platform-checklist.mjs --changed-from origin/main` exit 0, and the control-byte scan found 0 hits. </details> No package is touched, so no package build, test, typecheck or scoped lint is owed. Every other family belongs to CI. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (n/a) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (no lintable file touched) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing: `skip-changeset`) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (n/a) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5ngu3885adndgvQofR)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5ngu3885adndgvQofR --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8a8c21e commit 6859b2f

1 file changed

Lines changed: 65 additions & 43 deletions

File tree

‎docs/qa/platform-checklist/RUNNER.md‎

Lines changed: 65 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -302,51 +302,72 @@ contradicts it, and correct it here when it does.
302302
**Check:** fetch `/api/v1/meta/app` with no query first and read the names it actually
303303
returns, then filter.
304304

305-
- **A boot on its own non-3000 port breaks the showcase's self-pinging connectors
306-
unless you export `OS_PORT` — `-p` alone is not enough, and the symptom impersonates an
307-
egress block.** The showcase's REST/OpenAPI connector instances point at the running
308-
server itself, resolved by `resolveShowcaseSelfUrl()`
305+
- **The showcase's self-pinging connectors dial the self-URL the artifact was COMPILED
306+
with — on a `--no-compile` boot an exported `OS_PORT` does not move it, and the symptom
307+
impersonates an egress block.** The showcase's REST/OpenAPI connector instances point at
308+
the running server itself, resolved by `resolveShowcaseSelfUrl()`
309309
(`examples/app-showcase/src/system/self-url.ts`) in this order: `SHOWCASE_SELF_URL` →
310-
`OS_PORT` → `PORT` → the literal `http://127.0.0.1:3000`. Those are **environment**
311-
reads. The CLI's `-p` flag is only a *default sourced from* `OS_PORT`
312-
(`packages/cli/src/commands/serve.ts`: `port: Flags.string({ char: 'p', … default:
313-
readEnvWithDeprecation('OS_PORT','PORT') ?? '3000' })`) and nothing writes the variable
314-
back, so the dogfood §0 boot on its own port — `objectstack dev … -p <port>` with the env
315-
untouched — listens on `<port>` while every declarative connector dials **3000**. Every
316-
dispatch then fails `connector_action(showcase_status_api.request) failed: fetch failed`.
310+
`OS_PORT` → `PORT` → the literal `http://127.0.0.1:3000`. Those are environment reads
311+
made when the config is evaluated, which for the served connectors is the compile into
312+
`dist/objectstack.json`. A default `os dev` compiles under the boot's own environment
313+
first (#26130; the `compile` flag of `packages/cli/src/commands/dev.ts`, default on), and
314+
exports its `-p` for that compile (`portFlagEnv`, `packages/cli/src/utils/port-contract.ts`),
315+
so a default boot dials its own port. A `--no-compile` boot serves the artifact as last
316+
built, which is the behaviour `self-url.ts`'s header documents: its connectors dial the
317+
port that compile saw — `3000` when it saw none, another runner's when another runner
318+
compiled last. Measured at `e0ce1b52`: an artifact compiled with no `OS_PORT`, booted
319+
`--no-compile -p 41781` with `OS_PORT=41781` exported, failed the
320+
`showcase_declarative_connector_ping` run with
321+
`connector_action(showcase_status_api.request) failed: fetch failed`, and
322+
`GET /api/v1/meta/connector/showcase_status_api` answered `baseUrl`
323+
`http://127.0.0.1:3000` (QA runs #33048 and #33093 met the same).
317324
⚠️ **That string is not evidence of a sandbox network restriction**, and reading it as
318325
one is the expensive mistake: the module's own header records that #7516 burned a run
319-
proving it was an address problem by putting a TCP forwarder on 3000, and #7538 fixed
320-
the resolution but could not fix a boot that never exports the variable. **Check:**
321-
before scoring any connector clause, prove where the live dispatch lands: create a
322-
`showcase_task`, read the `showcase_declarative_connector_ping` run it fires, and confirm
323-
it completed with a `ping.body` whose uptime matches THIS boot, not another server's.
324-
⛔ Do not read the instance metadata for it: an `os dev --no-compile` boot serves the
325-
existing `dist/objectstack.json` as built, so `GET /api/v1/meta/connector/showcase_status_api`'s
326-
`item.providerConfig.baseUrl` can carry the build-time value. Since #26130 a default
327-
`os dev` compiles the config under the boot's own environment first
328-
(`packages/cli/src/commands/dev.ts`, the `compile` flag, default on), so on a default
329-
boot that read can follow an exported `OS_PORT` — the dispatch check above stays the
330-
proof on either boot. Before #26130 `os dev` booted the prebuilt artifact unless
331-
`--compile` was passed, and QA run #25817 at `6679644a` measured that old default: with `OS_PORT=41302`
332-
exported, that read still answered `http://127.0.0.1:3000`, while the live
333-
`connector_action` reached 41302 (`ping.body` uptime matched the boot, and nothing
334-
listened on 3000) — so the metadata read misreports the fixture in both directions.
335-
⛔ Nor `GET /api/v1/automation/connectors`: that route lists registry descriptors —
336-
`name`, `label`, `type`, `description`, `icon`, `origin`, `state`, `degradedReason`,
337-
`actions` (`getConnectorDescriptors()`,
326+
proving it was an address problem by putting a TCP forwarder on 3000.
327+
328+
**Two routes work, each measured at `e0ce1b52`; only the first is safe on a shared
329+
checkout.**
330+
1. **Compile in a private copy.** Make the scratch copy the `rsync` entry below
331+
describes, and boot the COPY without `--no-compile`, with `OS_PORT=<port>` exported
332+
beside `-p <port>` and `--no-watch`: `os dev` compiles into the copy's own
333+
`dist/objectstack.json`. With `-p 41782` the ping run completed, the
334+
metadata read answered `http://127.0.0.1:41782`, and the tree's
335+
`dist/objectstack.json` was byte-identical before and after (`-p 41786` with
336+
`OS_PORT` unset measured the same).
337+
2. **The default compile on the tree**, the canonical line without `--no-compile`: with
338+
`-p 41785` the ping completed and the metadata read answered `41785`, but the boot
339+
rewrote the tree's `dist/objectstack.json` with that port baked in, so every later
340+
`--no-compile` boot on the tree dials it. ⛔ Only on a checkout no other runner boots.
341+
342+
⛔ Exporting `OS_PORT` or `SHOWCASE_SELF_URL` for a `--no-compile` boot is not a fix:
343+
neither is read until the next compile.
344+
345+
**A held port moves the boot, not your shell's `OS_PORT`.** When the requested port is
346+
in use, `os dev` takes the next free one before it compiles and says so twice:
347+
`⚠ Port <port> is in use — serving on <next> instead.` at the top of its log, and
348+
`↪ server bound to port <next> (requested <port>)` once it listens
349+
(`formatDevPortShiftNotice()` in `packages/cli/src/commands/serve.ts`, then
350+
`packages/cli/src/commands/dev.ts`'s listening handler). The compile
351+
follows the shifted port, so the connectors still reach the boot (41783 held: served on
352+
41784, metadata `41784`, ping completed, at `e0ce1b52`), but the runner's shell keeps
353+
the `OS_PORT` it exported, and that port answers whatever holds it. **So:** read the
354+
port from the boot log's `server bound to port` line, or confirm no shift was printed,
355+
before the first request.
356+
357+
**Check:** before scoring any connector clause, prove where the live dispatch lands:
358+
create a `showcase_task`, read the `showcase_declarative_connector_ping` run it fires
359+
(`GET /api/v1/automation/showcase_declarative_connector_ping/runs`), and confirm it
360+
completed with a `ping.body` whose uptime matches THIS boot, not another server's. On
361+
every boot measured at `e0ce1b52` the metadata read above agreed with the dispatch, but
362+
the dispatch stays the proof. ⛔ Nor `GET /api/v1/automation/connectors`: that route
363+
lists registry descriptors — `name`, `label`, `type`, `description`, `icon`, `origin`,
364+
`state`, `degradedReason`, `actions` (`getConnectorDescriptors()`,
338365
`packages/services/service-automation/src/engine.ts`) — and carries no `baseUrl` at all.
339-
An older measurement, on `main` at `2889760a`, read the metadata as following the
340-
serving environment: `-p 47311`
341-
alone answered `http://127.0.0.1:3000`, and `showcase_declarative_connector_ping`
342-
(fired by a `showcase_task` create) failed `fetch failed`; `OS_PORT=47312` with
343-
`-p 47312` answered `http://127.0.0.1:47312` and the same flow completed, while
344-
`dist/objectstack.json` still held `http://127.0.0.1:3000`. The `self-url.ts` header
345-
still says only an artifact-only boot (`os start --artifact`) freezes the value at build
346-
time; at `6679644a` the served metadata was frozen on `os dev` too, which is why the
347-
Check reads the dispatch. If the ping does not complete, or its uptime belongs to
348-
another server, the fixture is misconfigured, not blocked. **Fix:** boot with `OS_PORT=<port>` exported (or
349-
`SHOWCASE_SELF_URL=http://127.0.0.1:<port>`) *in addition to* `-p <port>`. ⛔ Do not
366+
An older reading does not hold: QA run #25817 at `6679644a`, before #26130 made the
367+
compile the `os dev` default, measured an exported `OS_PORT=41302` reaching the live
368+
dispatch while the metadata read answered `3000`; at `87330e89` and `e0ce1b52` a
369+
`--no-compile` boot fails the dispatch instead. If the ping does not complete, or its
370+
uptime belongs to another server, the fixture is misconfigured, not blocked. ⛔ Do not
350371
record a connector clause as `blocked(environment)` on the strength of `fetch failed`
351372
alone.
352373

@@ -431,7 +452,7 @@ contradicts it, and correct it here when it does.
431452
means under the environment of whichever run compiled it last, not this boot's: every
432453
value the config reads from the environment at compile time is that run's, which is how
433454
a `--no-compile` boot in QA run #33025 sent the showcase's self-pinging connector to
434-
another runner's port. Add
455+
another runner's port (the connector entry above names the routes that work). Add
435456
`--no-watch` too while anyone may edit the app's sources: `--no-compile` stops only the
436457
boot compile, not the watch loop's recompiles. This one rule covers every item whose
437458
`fixtures.requires` carries that boot line; an item need not repeat it (QA run #27481).
@@ -623,7 +644,8 @@ contradicts it, and correct it here when it does.
623644
run adds what the entries above name: `OS_PORT=<port>` and
624645
`OS_STORAGE_LOCAL_ROOT=/tmp/<run>/uploads` exported, and `--no-compile --no-watch` after
625646
`dev` (a boot without the uploads root wrote nine files into the tree's
626-
`.objectstack/data/uploads/`, QA run #33081).
647+
`.objectstack/data/uploads/`, QA run #33081). A run that scores a self-pinging connector
648+
boots a private copy that compiles instead (the connector entry).
627649

628650
⚠️ **Why this is briefed rather than left to the error message: backgrounded — which is
629651
how a runner boots a server — a rejected flag looks exactly like a server that booted

0 commit comments

Comments
 (0)