Skip to content

feat(runtime): export resolveArtifactCollections, the reader of every collection of a composed suite - #32928

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-vsl1ma
Nov 13, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/project-thread-vsl1ma

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #32827
Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:@objectstack/runtime 新导出一个函数 resolveArtifactCollections,它把「按包保留」方式组合出来的套件里,每个包各自的对象、应用、流程、翻译、钩子等合成一份完整视图。函数本身早已存在、启动时就在用,这次只是公开出来,没有新逻辑。
  • 为什么改:spec: a flat composeStacks (default manifest 'last') of packages with one app each yields one package id with several apps, and no door refuses it (the single-app rule of ADR-0019 D3 as amended) #32810 之后,把多个各带一个应用的包「扁平组合」会被拒绝;hotcrm 的测试视图正是靠扁平组合拿全套集合。公开这个读取器后,hotcrm 可以改成 resolveArtifactCollections(composeStacks(包列表, { manifest: 'preserve' })),不用在应用里自己抄一份合并逻辑。
  • 风险与回滚:纯新增导出,已有调用和已有产物不受影响(没有 packages[] 的产物原样返回);回滚即撤回 index.ts 的一行导出。
  • 先看:① packages/runtime/src/index.ts 新增的导出行;② packages/runtime/src/artifact-collections.public-reader.test.ts(从包入口导入,对比扁平组合的内容);③ artifact-collections.ts 的文档注释。
  • 两分钟验证:pnpm --filter @objectstack/runtime exec vitest run src/artifact-collections.public-reader.test.ts,预期 1 个文件 2 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

  • packages/runtime/src/index.ts: exports resolveArtifactCollections from ./artifact-collections.js. One export line; the merge itself is the existing one the boot paths read (app-plugin.ts, load-artifact-bundle.ts, standalone-stack.ts, app-artifact-handlers.ts, resolve-project-database.ts). No second copy.
  • packages/runtime/src/artifact-collections.ts: docblock only. resolveArtifactCollections gains a "Public reader" section that teaches the consumer use, resolveArtifactCollections(composeStacks(packageStacks, { manifest: 'preserve' })), and says why a flat composition is not the route (it puts every package's app under one package id, which STACK_SINGLE_APP_VIOLATION refuses for a suite, ADR-0019 D3 as amended). The note on packageOwnedCollectionKeys that said neither function is importable from @objectstack/runtime is corrected: that one stays module scope.
  • packages/runtime/src/artifact-collections.public-reader.test.ts (new): the consumer-side pin. A manifest: 'preserve' composition of one app package and two module packages, read through the reader imported from the package entry (./index), yields every input's objects, apps, flows, translations and hooks with the contents a flat composition gave. It also pins that the entry's export IS the module's function (no second copy).
  • .changeset/runtime-export-artifact-collections-reader.md: @objectstack/runtime patch, both declaration lines.

Tests

  • New pin: 2 tests. With the existing artifact-collections.test.ts: 2 files, 24 tests passed.
  • pnpm --filter @objectstack/runtime test: 589 files passed, 10253 tests passed, 19 skipped (run at merge head f58a4da; the later commit only adds one side-effect import to the new test file, re-run green).
  • pnpm --filter @objectstack/runtime run typecheck (includes check:test-typecheck): exit 0.
  • Ablations (each one-shot through scripts/ablation-replace.mjs, restore proved by blob == HEAD and an empty git diff HEAD; the test resolves the source entry, so no dist leg):
    • Drop the export line from index.ts: both new tests red.
    • Make the reader skip the merge (if (declared === undefined || 'ABLATED_MERGE') return artifact;): the consumer test red, objects: expected [] to deeply equal [ Array(3) ]; the identity test stays green.
  • Forward check against spec: a flat composeStacks (default manifest 'last') of packages with one app each yields one package id with several apps, and no door refuses it (the single-app rule of ADR-0019 D3 as amended) #32810: with the spec half of branch claude/project-thread-2eliu6 applied (git apply of its three-dot spec diff) and @objectstack/spec rebuilt, both reader files stay green (24/24), while a flat composition of an app and a module package with one app each is refused STACK_SINGLE_APP_VIOLATION 422 on that build. The pin's flat baseline is taken without the apps for exactly this reason. Tree restored and spec rebuilt from this branch afterwards.
  • Built entries, probed by hand after pnpm --filter @objectstack/runtime build:
    • node -e "const m=require('./dist/index.cjs');console.log('cjs', typeof m.resolveArtifactCollections)" prints cjs function.
    • node --input-type=module -e "const m=await import('./dist/index.js');console.log('esm', typeof m.resolveArtifactCollections)" prints esm function.
    • grep -c resolveArtifactCollections dist/index.d.ts dist/index.d.cts prints 5 for each.

Acceptance notes

  • check:api-surface is a packages/spec gate (packages/spec/api-surface/*.json); @objectstack/runtime has no api-surface baseline, so there is nothing to regenerate for this export.
  • No content/docs/** page documents this reader today, so no docs edit.
  • Out of scope, reported only: hotcrm's test/helpers/composed-stack.ts moves to the preserve composition plus this reader in the hotcrm lane, after the @objectstack/* bump that carries this export.

Verification

Local gates at head 3a3fc0b (merge of origin/main at f58a4da), file gates-ran-3a3fc0b8.txt:

dispatch-gates --ran: 60 derived, 58 run, 2 NOT MEASURED
  • node scripts/pm/dispatch-gates.mjs --ran FILE: exit 0, 60 derived famil(ies) accounted for — 58 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
  • NOT MEASURED, exit 3, prerequisite not met in this container (CI runs both):
    • node scripts/check-plugin-teardown-shape.mjs --self-test: its fixture is pinned to a commit a shallow clone cannot reach (the gate asks for git fetch --unshallow origin main).
    • pnpm check:dual-build-cjs-loads: it reads built output and 41 packages had no dist/ (only the runtime dependency closure was built). The runtime's own CJS and ESM entries were probed by hand instead, output under Tests.
  • check:test-source-alias was red once at f58a4da: the entry import reaches @objectstack/metadata through a dynamic import inside a clocked case. Fixed per the gate's prescription with a module-top import '@objectstack/metadata'; (the convention other runtime tests follow); re-run exit 0, with the test-file-reading gates (nul-bytes, cross-package-test-inputs, registry-log-declared, rest-log-spy-declared, refd-timer-probe, type-check-debt, logger-receiver-detach, tier-file-adoption, undeclared-dep-imports), all exit 0.
  • Also run, outside the derivation: pnpm lint exit 0; check:authz-resolver, check:changeset-fixed, check:error-code-casing, check:filter-alias-parity, check:route-ledger-census exit 0.

Dogfood battery: n/a (no ! in the title, no (narrowing) arm).


Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cxVtcSKjKVFjVEV46E

… collection of a composed suite

A `composeStacks(stacks, { manifest: 'preserve' })` artifact keeps each
collection in its package's body; the runtime's own merge across the
flattened top level and every `packages[]` body (ADR-0130 D4) is now
importable from `@objectstack/runtime`, so an app reads its suite without
a flat composition or a copy of the merge.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxVtcSKjKVFjVEV46E
…rtion, not a TypeError

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxVtcSKjKVFjVEV46E
…ollections reader

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxVtcSKjKVFjVEV46E
@github-actions github-actions Bot added size/m 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 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 2 changed file(s) yielded no anchor (packages/runtime/src/artifact-collections.ts, packages/runtime/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/runtime/src/artifact-collections.ts, packages/runtime/src/index.ts) — pages documenting those are invisible to this run
  • 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 — 29 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 e0cba9ddd7dcd0991ceb47fb4d86ce556961c8bf → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#8 · os-elon-musk · session_016WV4cwqTK71kjQzHae8T5J

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 3a3fc0b8f636d003646e9936d82a2a9e2b4f2893
Local-runs: none

Face: Clause-②: yes (widening) declaration alone. File list: packages/runtime/src/{index.ts,artifact-collections.ts,artifact-collections.public-reader.test.ts} and one changeset; no packages/spec/src/**, no governed rule text, no narrowing declaration.

① Derived judgments

  • Published surface: @objectstack/runtime's entry gains exactly one name, resolveArtifactCollections, re-exported from ./artifact-collections.js (one export { … } from line in index.ts). Its signature and body are unchanged in this diff; the function is the one the boot paths already call, so no second copy of the merge exists. The pin asserts the entry's binding IS the module's function. Right.
  • packageOwnedCollectionKeys stays module scope: the corrected docblock says so, and index.ts names only the reader. Right.
  • Accept sets: no schema, no route, no stored shape moves. An artifact with no packages[] comes back as the same object (existing early return, untouched). Nothing that existed narrows. Right.
  • The reason given for the route (STACK_SINGLE_APP_VIOLATION for a flat suite) describes #32810's rule, not main's: the docblock says "as amended", and the pin takes its flat baseline WITHOUT apps so it reads the same before and after that rule ships. Accepted as written; the dev's forward check with spec: a flat composeStacks (default manifest 'last') of packages with one app each yields one package id with several apps, and no door refuses it (the single-app rule of ADR-0019 D3 as amended) #32810's spec diff applied (24/24, flat compose refused 422) is in the report.

② Semver level

'@objectstack/runtime': patch, Clause-②: yes (widening), Metadata-protocol: none, identical in the PR body and the changeset. AGENTS.md: a non-protocol change, widening or breaking, under Metadata-protocol: none takes patch. Matches; only the package the diff moves is named.

③ Boundary flags

  • open_questions: none. security_findings: none.
  • NOT-MEASURED locally (2, both exit 3 prerequisites): check-plugin-teardown-shape --self-test (shallow clone) and check:dual-build-cjs-loads (dists absent); CI runs both, and the runtime entry's CJS/ESM/d.ts were probed by hand (report). The CI check-runs on this head are the verdict, read before landing.
  • Out of scope, carried: hotcrm's test/helpers/composed-stack.ts moves to the reader after the @objectstack/* bump that carries it (hotcrm lane; noted on the seat's ledger, not filed here).

Implemented-by: claude/project-thread-vsl1ma
Reviewed-by: session_016WV4cwqTK71kjQzHae8T5J

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#8 · os-elon-musk · session_016WV4cwqTK71kjQzHae8T5J

Contract review

Served-tier: TIER_DEFAULT
Head-sha: c9618342cf87e2863385cde0e92aaf8e86213a17
Local-runs: none

Head moved only by a merge of main (GitHub update-branch, K = 26 ≥ 15 per landing rules); the PR's net file list (4 files) and diff are unchanged from 3a3fc0b8 (record 6839310347; git patch-id --stable of the net diff identical on both heads, 991b1c12).

Face: Clause-②: yes (widening) declaration alone. File list: packages/runtime/src/{index.ts,artifact-collections.ts,artifact-collections.public-reader.test.ts} and one changeset; no packages/spec/src/**, no governed rule text, no narrowing declaration.

① Derived judgments

  • Published surface: @objectstack/runtime's entry gains exactly one name, resolveArtifactCollections, re-exported from ./artifact-collections.js (one export { … } from line in index.ts). Its signature and body are unchanged in this diff; the function is the one the boot paths already call, so no second copy of the merge exists. The pin asserts the entry's binding IS the module's function. Right.
  • packageOwnedCollectionKeys stays module scope: the corrected docblock says so, and index.ts names only the reader. Right.
  • Accept sets: no schema, no route, no stored shape moves. An artifact with no packages[] comes back as the same object (existing early return, untouched). Nothing that existed narrows. Right.
  • The reason given for the route (STACK_SINGLE_APP_VIOLATION for a flat suite) describes #32810's rule, not main's: the docblock says "as amended", and the pin takes its flat baseline WITHOUT apps so it reads the same before and after that rule ships. Accepted as written; the dev's forward check with spec: a flat composeStacks (default manifest 'last') of packages with one app each yields one package id with several apps, and no door refuses it (the single-app rule of ADR-0019 D3 as amended) #32810's spec diff applied (24/24, flat compose refused 422) is in the report.

② Semver level

'@objectstack/runtime': patch, Clause-②: yes (widening), Metadata-protocol: none, identical in the PR body and the changeset. AGENTS.md: a non-protocol change, widening or breaking, under Metadata-protocol: none takes patch. Matches; only the package the diff moves is named.

③ Boundary flags

  • open_questions: none. security_findings: none.
  • NOT-MEASURED locally (2, both exit 3 prerequisites): check-plugin-teardown-shape --self-test (shallow clone) and check:dual-build-cjs-loads (dists absent); CI runs both, and the runtime entry's CJS/ESM/d.ts were probed by hand (report). The CI check-runs on this head are the verdict, read before landing.
  • Out of scope, carried: hotcrm's test/helpers/composed-stack.ts moves to the reader after the @objectstack/* bump that carries it (hotcrm lane; noted on the seat's ledger, not filed here).

Implemented-by: claude/project-thread-vsl1ma
Reviewed-by: session_016WV4cwqTK71kjQzHae8T5J

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#8 · os-elon-musk · session_016WV4cwqTK71kjQzHae8T5J

ACCEPT · PR #32928 · head c9618342cf87e2863385cde0e92aaf8e86213a17 · 2026-11-13T02:28Z · Fixes #32827

席位核对

  1. Shape: draft PR to main, Fixes #32827 alone. Path surface (4 files): packages/runtime/src/{index.ts,artifact-collections.ts,artifact-collections.public-reader.test.ts}, one changeset. No governed path, no packages/spec/src/**. Tier S.
  2. Premise: resolveArtifactCollections already exists and the boot paths call it; the diff exports it from the package entry and documents the consumer route (composeStacks(…, { manifest: 'preserve' })). No logic change.
  3. Gates: check-runs on this head: 35 success, 16 skipped, 0 failed, 0 pending.
  4. Contract review: Clause-②: yes (widening) declaration, TIER_DEFAULT record PASS 6841987484 on this head (6839310347 on 3a3fc0b8; net diff patch-id identical).
  5. Prose checked sentence by sentence: the changeset (@objectstack/runtime patch; one new export, the reader of every collection of a composed suite; both declaration lines) and the docblock agree with the diff. Skills-docs: not owed (Metadata-protocol: none, no narrowing).
  6. Out of scope and carried: hotcrm test/helpers/composed-stack.ts moves to the reader after the @objectstack/* bump that carries it (hotcrm lane).

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

2 participants