Skip to content

feat(scenarios): the gallery export writes each app as a trial package (listing text, facet, sample data); the check refuses an app with no sample data - #35430

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-35132-trial-package-export
Nov 19, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-35132-trial-package-export

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #35132
Clause-②: yes
Metadata-protocol: none

维护者速读

  • 改了什么:应用市场画廊导出的每个应用,现在都带上场景卡的中英文标题和简介、业务职能分类,以及卡上的种子数据(作为安装时的示例数据)。画廊检查会拒绝没有示例数据的应用。
  • 为什么改:目标是「客户可以从应用市场中下载安装试用」。之前导出的应用装上后是空的,名字是 Demoasset,也没有分类。
  • 风险与回滚:风险低。只改导出副本和检查,不碰运行时,不碰被评分的构建。回滚就是还原这个 PR。用旧版导出器写出的画廊目录,在下一次刷新重新导出之前,新检查会报 app-sample-data;检查只读不写,不会删除任何应用。
  • 先看:packages/qa/scenarios/src/export/trial-package.ts(withSampleData 对 AI 写的配置做的 AST 拼接,以及四种拒绝情况)→ src/export/check.ts(checkSampleData)→ src/export/exporter.ts(trialPackageSource 的调用点)。
  • 两分钟验证:pnpm --filter @objectstack/scenarios exec vitest run --maxWorkers=2 test/export,预期 4 个文件、132 个测试全部通过。
  • 需要你做的:无,席位落地。

What changes

The gallery exporter (packages/qa/scenarios/src/export/) now writes each app's source/ as a package a customer can install and try. It does this after scoring, into the export copy only. The run's own project is never written.

  • objectstack.manifest.json: displayName and description are the card's English title and prompt.short. The Chinese pair goes under translations.zh. businessFunctions is the card's own list. The build's other keys are kept.
  • src/sample-data.json: the card's seed rows as stack data: datasets. There is one dataset per object, named demoCODE_object, with externalId: 'id' and rows as the card states them. A run.userHandleFields field is left out, and the app README names it.
  • objectstack.config.ts: gets one import line and data: gallerySampleData as the first property of the default-exported defineStack({ … }) literal. The edit is a TypeScript AST splice, and every other byte stays as the AI wrote it. Four cases are refused with a located reason, never guessed: there is no such literal, the literal already declares data: or spreads a value, a seeded object is missing from the build, or the build already wrote the file.
  • export-gallery --check has a new finding, app-sample-data. It reports a missing source/src/sample-data.json, a file that is not a non-empty list of SeedSchema-valid datasets each with a record, or a config that does not import it.
  • typescript moves from devDependencies to dependencies. It was already in the install closure through @objectstack/lint. The exporter loads it with a dynamic import(), so export-gallery --check (dist/export-check.js) never loads it.
  • Not written, per the seat's re-split on the card: installModes, solutionType: 'template', and the check's installModes refusal. These moved to Gallery export requires the runner's template mode (unmanaged install + iterate) to pass, with the sample data in the template run (split from #35132) #35266, which is blocked by Unmanaged install: an AI-built app cannot be a template — its capability items are runtime-uncreatable and the scaffold's default connector plugins are code, so installModes: ['unmanaged'] is refused #35157. With installModes: ['unmanaged'], defineStack refuses an app carrying plugins or capability items (packages/spec/src/stack.zod.ts:2843).

Tests

All at head 30a918ccf0.

  • test/export/exporter.test.ts has a new top-level describe, "the trial package". It pins the manifest's four keys with the build's keys kept. It pins the sample data: namespaced, keyed on id, crm's account.owner left out. It pins the config edit: one import, data first, and the rest byte-identical to the authored file. It checks that the run's project is untouched and that the README line is present. It also covers a scaffold-shaped config, a config with no import line, six refused config shapes, three refused sources, one refusal through exportGallery (no app directory written), and sampleDataOf over every card in the library.
  • test/export/check.test.ts: the exporter's own output is still clean. There are four app-sample-data cases, and the code roster is updated.
Readings: package suite, typecheck, ablations
  • os-verify-lock … vitest run --maxWorkers=2 (whole @objectstack/scenarios suite): Test Files 40 passed (40), Tests 1199 passed (1199), VERDICT command-exit 0.
  • pnpm --filter @objectstack/scenarios typecheck: exit 0.
  • Ablation 1: ablation-replace.mjs deleted the checkSampleData(dir, app, add); call (anchor 1 → 0, blob 0d9fd6d4 → 0c9d9b17). Result: Tests 4 failed | 37 passed (41), which is exactly the four sample-data cases. Restored blob 0d9fd6d4 equals the HEAD blob, and git diff HEAD is empty.
  • Ablation 2: the trialPackageSource call was replaced with the authored files as they are (blob 7b14425e → 16986a84). Result: Tests 32 failed | 67 passed (99) across exporter and check suites. Among them are the layout test, the trial-package export test and the data: refusal export test; the check's clean tree goes red, as do the other cases that copy it. Restored blob 7b14425e equals HEAD.

Acceptance notes

  • Measured, as the seat asked: the exported source still passes objectstack validate with the new keys, on a managed stack. A probe project used the blank scaffold's objectstack.config.ts verbatim (connector plugins included), the recorded travel_expense build's 7 objects, and trialPackageSource output with 757 rows. os validate printed ✓ Validation passed, exit 0. The control project without the trial edits also exited 0. A negative leg, with one dataset renamed to demotravel_nope, exited 1 with Seed data references object 'demotravel_nope' which is not defined in objects., so the validator reads the imported JSON. The probe dropped the three state_machine validations from the probe objects in both projects. Without that, both projects failed identically on state-machine-no-initial-states, an author-time rule unrelated to data:. The probe projects were deleted.
  • Measured, as the seat asked: no app the exporter emits on refresh is refused or deleted by the new refusals. The check pin "the exporter's own output … has no finding" runs the new check over this exporter's output. The exporter's new refusals cannot fire on the gallery's apps as far as in-repo evidence reaches. Every one of the 9 cards seeds only objects in its expect.objects, and the recorded travel_expense build declares all 7 seeded objects. That build artifact carries no data, and the probe's scaffold config shape takes the edit. For asset_lifecycle, 6973237961 added data: to the gallery source by hand, and 559 rows (the card's full count) inserted with 0 errors, so the source had no data: of its own. The gallery repository itself is not readable from this session, so its other listed apps were not checked directly. A tree written by the earlier exporter has no sample-data file, so the check reports each of its apps until the next refresh re-exports it. The check writes nothing.
  • order_to_cash's English title is 131 characters. PackageSchema.displayName allows at most 128, and its objectstack.manifest.json fails TemplateManifestSchema (measured). The exporter writes it anyway rather than refuse the app (a refusal would delete a listed app). This is reported to the seat as a decision; see the report.
  • The scaffold's objectstack.manifest.json keeps readmePath: 'README.md', but the exporter never copies the scaffold README into source/. os package publish reads readmePath and exits 1 when the file is missing (publish.ts:883, read, not run). carrier: gallery-publish: publish each merged gallery app to the marketplace as an unmanaged template version (os package publish --submit), so customers can install it to try #35134.
  • manifest.name in the config (the in-app package name, e.g. Demoasset) is unchanged: the listing name is objectstack.manifest.json displayName. carrier: gallery-publish: publish each merged gallery app to the marketplace as an unmanaged template version (os package publish --submit), so customers can install it to try #35134.
  • Sample rows carry the card's own dates (its asOf), not the run date's rebase.
  • Public surface of @objectstack/scenarios/export: new exports sampleDataOf, listingManifest, withSampleData, trialPackageSource, TrialPackageRefusal, SAMPLE_DATA_FILE, SAMPLE_DATA_SPECIFIER, SAMPLE_DATA_BINDING and the type SampleDataset. FINDING_CODES gains app-sample-data, so the check accepts less. There is one new runtime dependency, typescript.

Verification

Gates (local subset, head 30a918c)
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 75 families. All 75 ran: ✓ dispatch-gates --ran: 75 derived famil(ies) accounted for — 75 run, 0 NOT-MEASURED (a DERIVED zero …).
  • pnpm check:cross-package-test-inputs was red on a first draft, which read the blank scaffold config from create-objectstack. The pin now uses an inline scaffold-shaped fixture, and the gate exits 0 (OK: 32 package(s) read outside themselves, all declared …).
  • pnpm check:dts-closure and pnpm check:dual-build-cjs-loads both exited 1 once in the sweep, naming only @objectstack/organizations's dist/index.d.ts (a package this diff does not touch) while its dist/ was being rewritten. On re-run both exited 0: 260/260 declared declaration file(s) present, and 124 published require entry point(s) … load.
  • node scripts/check-platform-checklist.mjs --changed-from origin/main: exit 0, 0 anchored files.
  • node scripts/pm/overlap-check.mjs: VERDICT clean exit 0 (origin/main, chore: version packages #35129 and fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223 merge cleanly).
  • The repo-wide lint and the full CI battery are left to CI.

Generated by Claude Code

…e (listing text, facet, sample data) — WIP

Claude-Session: https://claude.ai/code/session_01Q4EjjNq58cmHeqckjZkTFE
Co-authored-by: Claude <noreply@anthropic.com>
…fusal; README and changeset

Claude-Session: https://claude.ai/code/session_01Q4EjjNq58cmHeqckjZkTFE
Co-authored-by: Claude <noreply@anthropic.com>
…ixture, declaring no input outside the package

Claude-Session: https://claude.ai/code/session_01Q4EjjNq58cmHeqckjZkTFE
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l dependencies Pull requests that update a dependency file 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 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/scenarios, touching 20 documentable anchor(s). ⚠️ 3 changed file(s) yielded no anchor (packages/qa/scenarios/README.md, packages/qa/scenarios/package.json, packages/qa/scenarios/src/export/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/data-modeling/field-types.mdx (via externalId (symbol, a field of interface SampleDataset))
  • content/docs/data-modeling/fields.mdx (via externalId (symbol, a field of interface SampleDataset))
  • content/docs/data-modeling/seed-data.mdx (via externalId (symbol, a field of interface SampleDataset))
  • content/docs/data-modeling/validation-rules.mdx (via externalId (symbol, a field of interface SampleDataset))
  • content/docs/deployment/cli.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))
  • content/docs/deployment/marketplace-handbook.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))
  • content/docs/getting-started/examples.mdx (via externalId (symbol, a field of interface SampleDataset))
  • content/docs/getting-started/your-first-project.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))
  • content/docs/upgrading.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))

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

  • content/docs/releases/v17/17-5.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))
  • content/docs/releases/v18/18-0.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))
  • content/docs/releases/v18/18-3.mdx (via externalId (symbol, a field of interface SampleDataset))
  • content/docs/releases/v18/18-4.mdx (via objectstack.manifest.json (literal, a string literal in LISTING_FILE))

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
  • 3 changed file(s) yielded no anchor (packages/qa/scenarios/README.md, packages/qa/scenarios/package.json, packages/qa/scenarios/src/export/index.ts) — pages documenting those are invisible to this run
  • 2 anchor(s) matched too much of the corpus to be a work list: defineStack (literal, 88 pages), objectstack.config.ts (literal, 38 pages)
  • 2 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 1 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 6f36818f032edd8d9cff7aaf65f762374b62e070 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 67ba03d6a0ecaacef80e996cf2a4dbad104809c6 — the merge of head 3a00aa5efa77b1b231fc13c0be18ae9dfd593aed into base 6f36818f032edd8d9cff7aaf65f762374b62e070, 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 67ba03d6a0ecaacef80e996cf2a4dbad104809c6 && git checkout 67ba03d6a0ecaacef80e996cf2a4dbad104809c6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6f36818f032edd8d9cff7aaf65f762374b62e070 3a00aa5efa77b1b231fc13c0be18ae9dfd593aed && git checkout -B drift-repro 6f36818f032edd8d9cff7aaf65f762374b62e070 && git merge --no-ff 3a00aa5efa77b1b231fc13c0be18ae9dfd593aed

node scripts/docs-audit/affected-docs.mjs --json 6f36818f032edd8d9cff7aaf65f762374b62e070

⚠️ 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 6f36818f032edd8d9cff7aaf65f762374b62e070 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…iden @objectstack/scenarios/export)

Claude-Session: https://claude.ai/code/session_01Q4EjjNq58cmHeqckjZkTFE
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 662bbb68abce05cdeaeca13687dff65c3cb415f2
Local-runs: none
Scope: packages/qa/scenarios/src/export/trial-package.ts, packages/qa/scenarios/src/export/index.ts, packages/qa/scenarios/src/export/check.ts + packages/qa/scenarios/package.json
Security-touching: no

① Derived judgments

Face: the Clause-②: yes declaration alone (no published schema, no governed path; check-governed-merges --pr 35430: 0 of 11 paths governed). The widening: @objectstack/scenarios/export gains new exports (sampleDataOf, listingManifest, withSampleData, trialPackageSource, TrialPackageRefusal, SAMPLE_DATA_*, type SampleDataset). The new app-sample-data finding is a QA tool's report over a gallery tree, not a published metadata accept set, so no (narrowing) arm; it writes and deletes nothing.

② Semver level

Metadata-protocol: none ⇒ patch on @objectstack/scenarios (AGENTS.md Post-Task Checklist step 3). Both declaration lines line-initial in the changeset and the PR body.

③ Boundary flags

installModes / solutionType not written (moved to #35266 behind #35157; defineStack refuses them beside code plugins / capability items). typescript moves to runtime dependencies, loaded by dynamic import on the export path only; already in the closure through @objectstack/lint.

④ Design judgment

The config edit is an AST splice that leaves every other byte as authored and refuses (located) when the shape is not a defineStack({…}) literal or already carries data, rather than guessing. Sample data is checked against the spec's SeedSchema. Pins cover the new finding and each refusal; two ablations red.

Implemented-by: claude/issue-35132-trial-package-export
Reviewed-by: session_01Q4EjjNq58cmHeqckjZkTFE

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE

席位核对

ACCEPT · head 662bbb68ab · 2026-11-19T09:21Z · L1 by the dispatching seat against GitHub, not the report.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjNq58cmHeqckjZkTFE

Landing · 2026-11-19T11:43Z · ACCEPT 7004999361 and TIER_DEFAULT PASS 7004989638 (head 662bbb68ab); the head moved only by the relay's clean base sync (pr_update_branch, K was 28 ≥ 15), same patch, now 3a00aa5efa.

Reading Value
check-runs on 3a00aa5efa success 58, skipped 9, none red or pending
check-governed-merges --pr 35430 NOT governed; 556 changed lines ≤ 3000

State: ready + auto-merge; on MERGED Fixes #35132 closes the card (items 2–3 and the install-mode keys live on #35266; the title fix is #35431).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation size/l 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