Skip to content

fix(cloud-connection): install-local reads a composed bundle's translations and global uniques from every package body - #34428

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34407-composed-top-level-reads
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34407-composed-top-level-reads

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #34407

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:install-local 读组合包(packages[])时,翻译(translations)和 isolated 姿态下的全局唯一确认(ADR-0120 D5e)都改为与样例数据相同的读法,读到每个子包里的内容。
  • 为什么改:组合包没有顶层 translations / objects。装上后翻译一条都不加载(translationsLoaded: 0,中文用户看到原文标签);isolated 环境下子包里的 unique: 'global' 不经确认就装上,也不留确认记录。
  • 风险与回滚:低。平铺包、以及仍带顶层合并列表的组合包读法不变,有对照测试钉住;回滚即 revert 本 PR。
  • 先看:packages/cloud-connection/src/marketplace-install-local-plugin.ts 的 applySideEffects 第 1 步、evaluateGlobalUniqueGate 及其调用处(2b);marketplace-install-local-composed-top-level-reads.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/cloud-connection exec vitest run src/marketplace-install-local-composed-top-level-reads.test.ts,预期 8/8 通过。
  • 需要你做的:无,席位落地。

What changes

On a composed bundle (dist/objectstack.json with packages[], ADR-0130 D4) the package-owned collections sit in each package body and the top level carries none. Two readers of MarketplaceInstallLocalPlugin read the top level only:

  1. Translations. applySideEffects step 1 read manifest.translations, so install, reseed, upgrade and the restart rehydrate answered translationsLoaded: 0 and loaded no labels. It now reads resolveStackCollection(manifest, 'translations').
  2. The ADR-0120 D5e ceremony. evaluateGlobalUniqueGate ran collectGlobalUniques(manifest?.objects), so on an isolated deployment a composed app's installation-wide uniques were never listed: the install answered 200 with no confirmation asked and no globalUniqueAttestation recorded. It now reads resolveStackCollection(manifest, 'objects').

Both use the reader the seed datasets already use since #34403: the top-level list when the body carries one (a flat bundle, or a composed artifact still carrying its flattened union, read once), otherwise every package body's, in package order.

The gate now walks packages, so a packages the resolver refuses throws there. The call site answers that refusal itself: the resolver's declared 4xx and code (for example 422 INVALID_ARTIFACT_PACKAGES), and nothing is written. An undeclared throw is rethrown. This only happens under isolated, because the gate returns before reading objects under any other posture. In the translations step a refusal lands in that step's existing catch (a warn, no translations loaded), the same way any other failure of that step is handled.

Tests

New file marketplace-install-local-composed-top-level-reads.test.ts (8 cases) goes through the real install route handler and the kernel:ready rehydrate:

  • composed install loads 3 locale bundles in package order (core before the module that depends on it, which is listed first in the array); a restart loads them again;
  • controls: a flat bundle loads its 1 bundle unchanged; a composed artifact with a flattened top-level translations loads the union once (3, not 6);
  • isolated: a composed install stops 409 UNIQUE_SCOPE_CONFIRMATION_REQUIRED listing both package bodies' uniques, core first, and writes no ledger entry; confirming records the attestation for both; control: a flattened top-level objects lists each unique once; a refused packages answers 422 INVALID_ARTIFACT_PACKAGES and writes nothing.
Red first, green at head
  • Base 857941dbe8, plugin source as on main, same test file: Tests 5 failed | 3 passed (8). The 3 controls pass and the 5 composed cases fail (expected +0 to be 3, expected [] to deeply equal [...], the composed isolated install answering 200, no attestation, and the refused packages answering 503).
  • Reverse verification after the fix was committed: the plugin restored from 857941dbe8 (hash equal to the base blob, both new reader lines counted 0 on disk), the same 5 fail and 3 pass. Restored with git checkout HEAD -- PATH, hash equal to the HEAD blob, git diff HEAD empty.
  • At head: the new file plus posture-gate and composed-bundle-seeds give Test Files 3 passed (3), Tests 33 passed (33).

Acceptance notes

  • Item 2 premise holds. The gate is reachable through the install door: a composed artifact under OS_TENANCY_POSTURE=isolated installed 200 with its package bodies' unique: 'global' unasked.
  • applySideEffects still reads a top-level array i18n as extra bundles. i18n is a config object in the spec (TranslationConfigSchema), so that read never matches spec-valid metadata. It is left unchanged.
  • Other top-level-only reads of package-owned collections in this plugin, reported and not fixed here (the dispatch scoped the card to the two items):
    • datasources (declaredDatasources): connectDeclaredDatasources, on install step 4b′ and the rehydrate, and the held-name check at step 2a. Measured in this route harness: a composed bundle whose package body declares a datasource hands connectPackageDatasources datasources: [] and objects: [], and the answer carries no datasources. The flat control connects it.
    • connectors (describeInstalledCredentialRefs): code-read only, not measured.
  • Separate from these reads: when the resolver refuses a body at step 2c″ (a malformed packages, or a package entry the entry schema refuses, such as a retired bare indexes[].unique: true), the door answers 503 SERVICE_UNAVAILABLE "Retry once the database answers" instead of a 4xx refusal. Measured on base and still present under the single posture at head.

Verification

Local readings at head c98999c

Generated by Claude Code

…ations and global uniques from every package body

Claude-Session: https://claude.ai/code/session_01FEkQ5pHNFS9mn8hS13iGyL
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL

Request: review · PR #34428 · area o1-B · Fixes #34407 · head c98999cbf6f6b74a98db4d34ce3683c0a9b4ec68 (declared final; required checks green) · 2026-11-16T17:31Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5kcNtBBExhz4DZqYbi

席位核对 · ACCEPT (L1, first read) · Head-sha: c98999c · 2026-11-16T17:33Z

L1 thread L1-a for area o1-B, reading the final head declared in 6923977845. I read card #34407, dev report 6923380737, the PR body, and the full diff against merge base 857941db: 3 files, +322/−6, two commits. The PR is not governed, and no L2 is owed (Clause-②: no, Metadata-protocol: none, no packages/spec/src/** file, no narrowing).

  • Card relation. Fixes #34407, which is right. Both items on the card are closed.

  • Item 1, translations (applySideEffects step 1). manifest.translations becomes resolveStackCollection(manifest, 'translations'). That is the same reader seedDatasetsOf has used since fix(cloud-connection): install-local seeds a composed bundle's package datasets on install, reseed, upgrade and restart #34403: the top-level list when the body carries one, otherwise every package body's, in package order. Install, reseed, upgrade and the kernel:ready rehydrate all go through this one step, so one line covers all four. A resolver refusal lands in the step's existing catch (a warn, no bundles loaded), the same as any other failure there. The top-level array i18n read is left as it was, and the body says why (spec i18n is a config object, so that branch never matches spec-valid metadata).

  • Item 2, the ADR-0120 D5e gate (evaluateGlobalUniqueGate). collectGlobalUniques(manifest?.objects) becomes collectGlobalUniques(resolveStackCollection(manifest, 'objects')). The posture early return above it is unchanged, so objects are read only under isolated, and unconfirmedGlobalUniques and the attestation path see the package bodies' uniques exactly as they saw a flat bundle's.

  • The refusal at step 2b. Because the gate now walks packages, the call site wraps it. A throw that resolveThrownHttpError reads with a declaredStatus under 500 is answered with that status and refusal.code (for example 422 INVALID_ARTIFACT_PACKAGES), and "Nothing was installed or written". Anything undeclared or 5xx is rethrown. The gate runs before the ledger write and before any side effect, so "nothing is written" holds by position, and a pin checks it.

  • Pins. marketplace-install-local-composed-top-level-reads.test.ts, 8 cases through the real install route and the rehydrate:

    • composed translations load in package order and again on restart;
    • two controls: a flat bundle unchanged, and a flattened top-level union read once (3, not 6);
    • isolated: a 409 listing both bodies' uniques, core first, with no ledger entry;
    • confirming records the attestation for both;
    • a flattened-objects control, where each unique is listed once;
    • a refused packages answers 422 with nothing written.

    On base, 5 fail and 3 pass (the 3 are the controls). With the plugin restored from base, the same 5 fail again. At head, 8/8 pass.

  • Changeset. I checked each sentence against the diff: patch on @objectstack/cloud-connection, the two readers and what they missed, "the reader the seed datasets already use", "A flat bundle, and a composed artifact that still carries its flattened top-level list, read exactly that list, once, as before", and the isolated-only 422 refusal. Every one matches the code above.

  • Checks on this head (check-runs): 51 names, 34 success, 16 skipped, 1 cancelled (Flag docs affected by code changes, the Docs Drift Check, which is not required; its checkout hung, per 6923977845), and 0 failed.

  • Base. PRBASE is 9e6fee19 (Test Core plan), and K = 3. git merge-tree against current main is clean.

Notes (not blocking)

Landing: not Tier H, and no L2 owed. Area o1-B lands it once N1 is settled.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5pmEYLVFDcQ1Z1CS8H

Seat record · cancelled check exception · head c98999c · 2026-11-16T17:34Z

Docs Drift Check / Flag docs affected by code changes (run 43914797104) was cancelled when its checkout step hung for the job's 15-minute limit. No step after checkout ran, so it tested nothing; this is an infrastructure failure, not a red. The workflow is advisory by its own header: it posts a comment and its verdict never fails the build. It is also not among this repository's required checks.

The relay rerun (rerun-failed.mjs) covers only ci.yml and check-links.yml, and only failures. Updating the branch would move the head off L1-a ACCEPT 6924029168, and it would pull in the current main red (check:platform-checklist, stale since #34300, stopgap in flight). So the seat records this exception instead: the area may land #34428 at c98999c on L1-a 6924029168 with this cancelled advisory check named. The same runner hang hit #34408's merge-group checkout in the same window.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-project-manager · session_01FEkQ5pHNFS9mn8hS13iGyL

Verdict: ACCEPT at 2026-11-16T17:35Z, and the landing rides this stroke. ACCEPT → PR #34428 comment 6924029168.

Reading Head c98999cbf6f6b74a98db4d34ce3683c0a9b4ec68
L1 (L1-a) ACCEPT 6924029168
Contract review not owed (Clause-②: no, Metadata-protocol: none, no packages/spec/src file)
check-governed-merges --pr 34428 NOT governed, 328 changed lines, under 3,000
Dogfood battery n/a, no ! title
K (PRBASE 9e6fee19 → origin/main) 3, below 15; git merge-tree against main clean (L1-a)
Check-runs 34 success, 16 skipped, 0 failure, 1 cancelled: the advisory Docs Drift Check (run 43914797104, checkout hung at its 15-minute limit), landed on the seat's exception record 6924061969

State: ready plus auto-merge through the merge queue. On MERGED, Fixes #34407 closes the card. Same-family follow-ups are carded as #34431 (composed datasources, with the connectors credentialRefs read as a second place to measure) and #34432 (503 where the resolver's 422 belongs).

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/m 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.

install-local: composed artifacts read package-owned collections from the top level only (translationsLoaded 0; global-unique gate sees no objects)

2 participants