Skip to content

feat(cloud-connection): the in-environment install door forwards a named package version - #31861

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-d7w1a6
Nov 9, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-d7w1a6

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #31799

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:环境内市场安装接口 POST /api/v1/cloud-connection/install 现在接受 version,用 SemVer 2.0.0 语法校验后转发给控制平面的安装动作;不传则与今天完全相同(装最新版)。
  • 为什么改:此前该接口不转发任何版本,环境内只能装最新版,无法安装或回装指定版本。
  • 风险与回滚:仅拓宽;不传 version 时发给控制平面的请求体逐字节不变(有 CONTROL 测试钉住)。格式错误的 version 返回 400 INVALID_REQUEST 且不发出任何请求。回滚即 revert 本 PR。
  • 先看:packages/cloud-connection/src/cloud-connection-plugin.ts 中新增的 packageVersionOf 和 /install 路由里的转发参数。
  • 两分钟验证:pnpm --filter @objectstack/cloud-connection exec vitest run src/cloud-connection-plugin.test.ts。
  • 需要你做的:无。控制平面参数名 version 取自卡片说明,本会话无法读取 cloud 仓库,未实测(见下)。

What changes

  • POST /api/v1/cloud-connection/install accepts an optional version in its body.
  • A string that matches SEMVER_2_0_0_VERSION_PATTERN (from @objectstack/spec/kernel, the grammar PackageVersionSchema.version, PATCH /api/v1/packages/:id and the plugin loader already use) is trimmed and forwarded as params.version to the control plane's sys_package/install_package action. No new regex.
  • Anything else (latest, 1.2, v1.2.3, ^1.2.3, a range, an empty string, a number, an object, an array) is refused with 400 INVALID_REQUEST and a message naming version, ending "Nothing was installed.", the same shape install_mode already uses. Nothing is forwarded.
  • Absent or null: no version key is sent, so the control plane installs the latest version exactly as today.
  • Every other refusal (an unknown version, a version the environment may not install) stays with the control plane, whose answer is relayed as before.
  • One spelling only: version. That is the key the unmanaged grant already echoes (data.version) and the install-local door takes. packageVersion is not an alias; like any unknown key it is ignored.

No new route, no new error code, no packages/spec/** edit.

Why

The in-environment install door forwarded no version, so a marketplace install from inside an environment could only ever take the latest version (#31799).

Verification

Clause-② measured: on base a body with version: '1.2.3' is accepted and the version is dropped (the forward carries no version); on head the same body forwards it. Bodies without version are forwarded byte-for-byte as on base. A malformed version that base silently ignored is now refused 400 before anything is sent; that is the card's asked-for validation, not a narrowing of any request that could install a named version before.

Step 0:

  • Spelling: version (grant echo, install-local door, card). The control plane's own param name is NOT MEASURED: the cloud repository is not reachable from this session, so it rests on the card.
  • Validator: SEMVER_2_0_0_VERSION_PATTERN, reused.
  • Overlap: every open PR's diff checked; none touches packages/cloud-connection/ except the release PR chore: version packages #29963 (CHANGELOG/package.json only).

Tests (cloud-connection-plugin.test.ts, three new):

  • A named version (1.2.3, 2.0.0-beta.1, 1.0.0+20260101) is forwarded as named; surrounding spaces are trimmed; version and install_mode travel together.
  • A malformed version (12 shapes, strings and non-strings) answers 400 INVALID_REQUEST naming version, and the control plane is never called.
  • CONTROL: absent and null version send exactly the body main sends (JSON.stringify compared), with no version key.

Base leg (main's source, these tests): the two new pins red, the CONTROL green.

Ablation (restored, git diff HEAD empty afterwards): shape check disabled → the malformed-version pin red ("latest": expected 200 to be 400).

Runs: cloud-connection full suite 80 files / 1125 tests green; typecheck green; lint (eslint --no-inline-config packages/cloud-connection) clean; every dispatch-gates --commands command run with stdin closed and reconciled with --ran, plus the four roster gates whose roster sits under a touched directory (check:dual-build-cjs-loads first exited 3 for missing dist/, green after a workspace build); check:nul-bytes OK; the dogfood files that boot cloud-connection (28 files, 245 tests) green locally. No route was added, so the whole dogfood package was not run.

Forced test edits: none. Only new tests were added.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (The ## 维护者速读 section is Chinese by the dispatch order.)
  • The Before Submitting list in CONTRIBUTING.md is done.

Generated by Claude Code

…med package version

POST /api/v1/cloud-connection/install accepts `version`, checks it against
SEMVER_2_0_0_VERSION_PATTERN (400 INVALID_REQUEST, nothing forwarded) and
forwards it as the control plane's `version` param. Omitted, nothing is
sent and the install is the latest, as before.

Claude-Session: https://claude.ai/code/session_01ADHkmQznRNHwfSHVJJUCj2
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cloud-connection, touching 2 documentable anchor(s).

11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/error-catalog.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/api/metadata-api.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/api/plugin-endpoints.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/automation/webhooks.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/data-modeling/import-mappings.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/deployment/install-modes.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/deployment/validating-metadata.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/permissions/attachments-access.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/permissions/authentication.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/permissions/sso.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/ui/forms.mdx (via INVALID_REQUEST (literal, a string literal in start))

⛔ 6 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/releases/v17/17-6.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/releases/v18/18-0.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/releases/v18/18-1.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/releases/v18/18-2.mdx (via INVALID_REQUEST (literal, a string literal in start))
  • content/docs/releases/v18/18-3.mdx (via INVALID_REQUEST (literal, a string literal in start))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 231 client-bound route-ledger rows — the other 166 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 166: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 107 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json cfe3563003933662ffc785e2b10041bb406551ce → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 587f6fa41f4c0d1f484c176eaf10fa61d70cb580 — the merge of head 7c22f5f74fc04f939215e2152b4cef321fb9bbb5 into base cfe3563003933662ffc785e2b10041bb406551ce, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 587f6fa41f4c0d1f484c176eaf10fa61d70cb580 && git checkout 587f6fa41f4c0d1f484c176eaf10fa61d70cb580
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin cfe3563003933662ffc785e2b10041bb406551ce 7c22f5f74fc04f939215e2152b4cef321fb9bbb5 && git checkout -B drift-repro cfe3563003933662ffc785e2b10041bb406551ce && git merge --no-ff 7c22f5f74fc04f939215e2152b4cef321fb9bbb5

node scripts/docs-audit/affected-docs.mjs --json cfe3563003933662ffc785e2b10041bb406551ce

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs cfe3563003933662ffc785e2b10041bb406551ce → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-steve · session_01ADHkmPF1skfu2kx89BEXZi

席位 ACCEPT · head 7c22f5f74fc04f939215e2152b4cef321fb9bbb5

#31799 (cloud#4011 consumer). Clause-②: yes (widening) / Metadata-protocol: none. The paths give no review face, so the seat reviewed it at TIER_DEFAULT. Not governed.

  • The door: POST /cloud-connection/install accepts version, under one spelling only. Its shape is checked with the reused SEMVER_2_0_0_VERSION_PATTERN from @objectstack/spec/kernel, with no hand-rolled regex.
    • A malformed or non-string value gets 400 INVALID_REQUEST. The error names the key, and nothing is forwarded.
    • A valid value is forwarded as version.
    • When the value is omitted or null, no key is sent. The forward body is byte-identical to main, and CONTROL pins this.
    • Every other refusal stays with the control plane.
  • Accepted: packageVersion is ignored, not refused, which is consistent with the route's other unknown keys.
  • Not measured: the control plane's param name version. The cloud repository is not reachable from here, so cloud carries this. The seat notifies the cloud mailbox on landing.
  • Evidence: the base leg had 2 pins red and CONTROL green. The ablation (shape check off) made the malformed-version pin red, then it was restored. The package suite is 1125/1125, gates 69/69 reconciled. 28 dogfood files that boot cloud-connection are green; there is no new route, so the whole package is not owed. The changeset is patch.

Landing: once CI is all green, check K, then relay pr_ready + automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 9, 2026 08:10
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 9, 2026 08:10
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit b6fa08e Nov 9, 2026
51 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-d7w1a6 branch November 9, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cloud-connection: the in-environment install door forwards no version, so an environment user cannot install a named package version

2 participants