Skip to content

feat(scenarios): gallery export owes the template mode — unmanaged install with the sample data copied - #38646

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-35266-gallery-template-gate
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-35266-gallery-template-gate

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #35266

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:应用市场图库里的每个应用,上架前都要先像试用客户那样以"可编辑副本"方式装一遍,带着示例数据回答问数问题;导出的应用包本身也声明成可编辑副本安装的模板。
  • 为什么做:属于"客户可以从应用市场中下载安装试用"这条路,替图库发布(下一步上架到应用市场)先证明试用装得上、装上就能用。
  • 出错会怎样:试用安装被拒或副本上答错的应用不会进图库,原因写在图库 PR 的"Refused"一节;这是内部图库流水线,改动可整体回退。
  • 要你做什么:无。

What changes

  • Runner, --template-sample-data (src/runner/orchestrate.ts, cli.ts, app.ts, scorecard.ts): template mode installs the passing scratch build unmanaged with the card's seed rows as the package's data[] (the same sampleDataOf rows the export writes) and the install door's seed copy on (seedSampleData: true). The fresh copies a Run half moves to install the same way. The Run half then seeds nothing (seedFromCopy). It reads the card's rows back from the copy, and a row the copy does not hold is refused by name, so seedDependence leaves every turn that reads it not measured. It binds the copied rows to the persona users it creates after the copy: owner_id, a persona record's user field and a user-handle field, one data-API update per row, only where they differ. Then it asks over those rows. The record keeps the door's report (seed.copied), the bound fields (seed.bound) and template.seedSampleData. The scorecard's Seed cell reads N/M copied by the install. Without the flag nothing changes, and the flag is refused when --modes leaves template out.
  • Refresh (src/export/refresh.ts): runnerArgv asks for --modes scratch,template --template-sample-data, and the PR body's Run line says so.
  • Pass rule (src/export/pass.ts): the record owes the template mode run that way. Each of these keeps the card out with a reason of its own, which refreshPrBody lists under Refused: no template mode; a template mode without the copy; a skipped template mode; an unmanaged install the door refused (its status, code and message); a template half that did not pass.
  • Trial package (src/export/trial-package.ts, new src/export/stack-config.ts): the config's manifest literal gains installModes: ['unmanaged'] through an AST splice, every other byte kept, and objectstack.manifest.json gains solutionType: 'template'. The export is refused, each case with its reason, when the manifest cannot be read as written, when it declares install modes without unmanaged, or when the build carries code plugins (defineStack refuses that install mode beside code). Install modes already declared with unmanaged are kept.
  • Check (src/export/check.ts): new finding app-install-modes. It fires when the manifest: literal of source/objectstack.config.ts, read as written, has no installModes containing 'unmanaged'. The TypeScript API loads only when a config is judged, so an empty gallery still loads none.
  • README (modes table, refresh steps, check list) and one patch changeset.

Tests

The card's four pins, each ablated once and restored. Every mutation landed through scripts/ablation-replace.mjs, and each restore was proved by blob equal to HEAD and an empty git diff HEAD:

  1. A template-half refusal keeps a card out (exporter.test.ts, [#35266] the gallery owes the template half…). A 422 UNMANAGED_INSTALL_UNCOPYABLE install answer gives the door's words as the first reason, followed by the three template halves not-run. Nothing is exported, and the refresh PR body lists the card under ## Refused (1). A failed template half, a record with no template mode, and a template mode without the copy are each refused too. Ablation: pass.ts install-refusal branch replaced with else if (false), so 1 of 1 failed; restored.
  2. The sample-data questions run over the copied rows (orchestrate.test.ts, runCard — --template-sample-data…). Every template-mode app holds exactly sampleDataOf(card).datasets and made 0 runner seed loads. seed.copied is { mode: 'inline', inserted: 8, errors: 0 }, and Sam's accounts are bound to the sdr's user. When the copy does not hold a row, the template half's contact questions are not measured while the scratch half, which uses the runner's own seed, measures them. A copy that did not load refuses all 8 rows with the door's reason. Without the flag the half seeds as before. Ablation: seedCopy ? seedFromCopy( replaced with false ? …, so 4 of 5 failed; restored.
  3. The exporter writes both manifest keys (exporter.test.ts, the trial-package describes). Ablation (a) dropped withInstallModes from the config write: 2 failed. Ablation (b) deleted solutionType: 3 failed. Both restored.
  4. --check refuses a manifest without unmanaged (check.test.ts, checkGallery — install modes…). The finding fires for no installModes, for ['managed'], for a non-literal list and for a non-literal manifest. ['managed', 'unmanaged'] passes clean, and so does the exporter's own output. Ablation: the checkInstallModes call deleted, so 3 failed; restored. Also smoke-run on the built bin: node bin/objectstack-scenarios.js export-gallery --check on the exporter's clean tree printed gallery check: clean, exit 0. The same tree with the spliced line removed printed one app-install-modes finding, exit 1.
Package suite and typecheck at 6e32cf7
  • pnpm --filter @objectstack/scenarios build && pnpm --filter @objectstack/scenarios test under the verify lock: Test Files 45 passed (45), Tests 1424 passed (1424), VERDICT command-exit 0.
  • tsc --noEmit -p packages/qa/scenarios/tsconfig.json: exit 0.

Acceptance notes

  • The persona binding after the copy is the runner's. The copied rows are the trial package's rows, owned by the installer, with user-handle fields left unset. The persona users do not exist until the half creates them, so the runner sets only the owner, the persona record's user field and the handle fields, the same values its own seed writes, before asking. Without that step every persona-scoped question would read rows nobody owns. No row content comes from the runner.
  • What the template half installs is the scratch FIRST build, as template mode always has (runCard's verified). The iterate change is then applied to the copy. The exported source/ is the scratch project after its own iterate, so the unmanaged install of that exact iterated tree is not itself installed by the run. The new plugins refusal and the check cover the two keys that decide defineStack's verdict.
  • NOT MEASURED live: the seed copy's answer shape (data.seeded counts with no per-row list), the copy keeping the card's row ids, and the admin's data-API update of owner_id. These were read from the install door's source (marketplace-install-local-plugin.ts, loadUnmanagedCopySeeds) and its dogfood (install-local-unmanaged-seed-copy). The card's own verification comment measured the ids kept on a real install. No live AI driver run was made, per the dispatch. The proof is the package's doubles.
  • In copy mode the sample rows already exist while the agent authors the iterate change, as they would for a trial user. In runner-seeded mode they arrive after it.
  • The scorecard already drew one column per mode. A record now holds the template mode, so scorecard.md shows it, and its Seed cell says the rows were copied.
  • The gallery's existing export (asset_lifecycle) carries an app-install-modes finding under the next published check until the next refresh rewrites it. The changeset says so.
  • Outside this card, reported to the seat: the blank scaffold on main now declares data: [articles] (packages/create-objectstack/src/templates/blank/objectstack.config.ts). The exporter's existing withSampleData refuses such a config with "already declares data:" (probe on this tree: REFUSED). So once that scaffold reaches a stable release, every card built on it would stay out of the gallery. Not fixed here.

Verification

Read first, by risk: src/runner/orchestrate.ts (seedFromCopy and the withInstalledBuild hunk that adds data after the collections and the baseline are read), src/export/pass.ts (judgeRecord's template reasons), src/export/stack-config.ts.

Two minutes: pnpm --filter @objectstack/scenarios exec vitest run test/runner/orchestrate.test.ts -t template-sample-data. Expect 5 passed, with no -- before the filter.

Gates (local subset, at 6e32cf7)
  • Derived with node scripts/pm/dispatch-gates.mjs --commands at 6e32cf71e: 70 families. All 70 were run, and 69 exited 0.
  • node scripts/check-plugin-teardown-shape.mjs --self-test first exited 3 because this shallow clone could not reach its pinned fixture commit. I fetched that one commit (--depth=1) and reran it: exit 0, 48 cases pass.
  • pnpm check:dual-build-cjs-loads: exit 3, NOT MEASURED, reason PREREQUISITE NOT MET: 63 packages have no dist/, and a full-repo build is CI's job. Its --self-test passed (94 cases). As a narrower local probe, every built CJS entry of @objectstack/scenarios loads with require (bin, cli, export-check, export, index, runner, score-full, score). The CI check-run is the verdict.
  • dispatch-gates --ran with each exit code recorded: 70 derived famil(ies) accounted for — 69 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE

…sample data copied; the export owes it and writes the unmanaged install mode

Claude-Session: https://claude.ai/code/session_01ADHkmRar3Kkg6SpwVgaaVE
Co-authored-by: Claude <noreply@anthropic.com>
…install mode and the check's new finding

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

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/api/data-api.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/automation/connectors.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/concepts/metadata-lifecycle.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/data-modeling/external-datasources.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/data-modeling/schema-design.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/data-modeling/seed-data.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/deployment/app-dependencies.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/deployment/cli.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it), /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/deployment/install-modes.mdx (via installModes (literal, a string literal in declaredInstallModes), /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/deployment/marketplace-handbook.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/deployment/publish-and-preview.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/permissions/capabilities.mdx (via installModes (literal, a string literal in declaredInstallModes))
  • content/docs/permissions/permission-sets.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/protocol/objectui/actions.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/ui/actions.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))

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

  • content/docs/releases/v17/17-5.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/releases/v17/17-6.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/releases/v18/18-2.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/releases/v18/18-3.mdx (via /:object/export (route, bridged from symbol templateMode — its route source's handler names it))
  • content/docs/releases/v18/18-4.mdx (via seedSampleData (symbol, a field of interface InstalledBuild), /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))
  • content/docs/releases/v18/18-6.mdx (via /api/v1/marketplace/install-local (route, a path literal in installUnmanaged))

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 changed file(s) yielded no anchor (packages/qa/scenarios/README.md) — pages documenting those are invisible to this run
  • 3 anchor(s) matched too much of the corpus to be a work list: defineStack (literal, 90 pages), objectstack.config.ts (literal, 41 pages), owner_id (literal, 46 pages)
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 ac0f928b1b49a490031767f57ea25b85503b7926 → packageMentionDocs.

Which tree this was computed on

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

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

⚠️ 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 ac0f928b1b49a490031767f57ea25b85503b7926 → 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

repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE

Final head for L1: 6e32cf71ecd9b33f2617361f639bf7a75ded1242 — CI green on this head by the newest run of each check (33 success, 16 expected skip, none failed), mergeable_state clean, as of 2026-11-29T20:33Z. Card #35266; Clause-②: no, Metadata-protocol: none; no contract face (17 files, all under packages/qa/scenarios/** plus the changeset; no packages/spec/src/**, no governed path, no .github/workflows/**, no narrowing arm), so no L2 is owed.

Points for the reviewer:

  • Template half: with run-scenarios --template-sample-data the passing scratch build installs unmanaged with the card's sampleDataOf rows as the package's data[] and seedSampleData: true; the Run half seeds nothing itself, reads the rows back from the copy, refuses by name any row the copy lacks (those turns NOT MEASURED), binds copied rows to the persona users, then asks. seed.copied / seed.bound reach the record and scorecard.
  • Gate: gallery-refresh runs --modes scratch,template --template-sample-data; judgeRecord keeps a card out under Refused for no template mode, no seed copy, skipped, install refused (status, code, message), or a failed template half.
  • Exporter: AST-splices installModes: ['unmanaged'] into the config manifest and writes solutionType: 'template' into objectstack.manifest.json; refuses builds with code plugins or an unreadable manifest. export-gallery --check gains app-install-modes.
  • NOT MEASURED live (no AI driver run, per dispatch): the door's live seed-copy answer shape, row ids kept by the copy, the admin's owner_id update — read from marketplace-install-local-plugin.ts and the install-local-unmanaged-seed-copy dogfood.
  • Acceptance note: the template half installs the scratch FIRST build, not the exported iterated source/. Out of scope, filed by the seat as Gallery export refuses every app built from the blank scaffold: the template's objectstack.config.ts already declares data: [articles], and the exporter refuses a config that declares data: #38647: the create-objectstack blank scaffold's data: makes withSampleData refuse.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv
L1-a, the seat's L1 thread · 2026-11-29T20:39Z · first review

席位核对

ACCEPT @ 6e32cf71ecd9b33f2617361f639bf7a75ded1242 (card #35266, Fixes, zone o3-P). No L2 is owed: the diff is packages/qa/scenarios/** and .changeset/**, with no packages/spec/src, no governed path, Clause-②: no and no narrowing. The zone lands it.

Read at head:

  • The card is unblocked. Its blocker 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 closed on 2026-11-20.
  • Ask 1, export owes template mode.
    • pass.ts now refuses a record in four cases: it has no template mode; the template mode was skipped; the unmanaged install was refused (the door's status, code and message are the reason); or it ran without seedSampleData. A failed template half fails through its iterate rows, as before.
    • refresh.ts runs --modes scratch,template --template-sample-data, and the PR body's Run: line says so. Refusals reach Refused.
    • The scorecard gains the template column.
  • The managed fallback stays out of the gallery. withInstalledBuild's managedFallback is passed only by ask mode (orchestrate.ts:2569), and the JSDoc says template mode never falls back. So a refused unmanaged install reaches pass.ts as install.ok === false and keeps the card out.
  • Ask 2, sample data in the template run.
    • The install sends data: sampleDataOf(card).datasets with seedSampleData: true.
    • seedFromCopy then inserts nothing. It reads the copy's rows back, refuses by name any card row the copy does not hold (or every row, when the door's seeded.mode is not inline), and patches only owner_id, a persona's user field and user-handle fields to the persona users created afterwards.
    • So the questions run over the copied rows.
  • The trial package. objectstack.config.ts's manifest gains installModes: ['unmanaged'] and the listing manifest gains solutionType: 'template'. A build carrying code plugins is refused (TrialPackageRefusal). export-gallery --check gains app-install-modes, which reads the literal as written through the TypeScript API, loaded lazily.
  • My own runs, in a clean worktree at this head:
    • test/export plus test/runner/orchestrate.test.ts: 5 passed, 340 passed (340).
    • My ablation, dropping the "run without the sample data copied" reason in pass.ts, turns exactly its pin red (1 failed | 147 passed). Restored, tree clean.
  • Changeset, read sentence by sentence. It is true against the code: the flag and its refusal without template in --modes (cli.ts:344), seed.copied, seed.bound, template.seedSampleData, the N/M copied by the install Seed cell, the pass rule, the installModes and solutionType writes, the code-plugins refusal and the new check finding. The README changes say the same.
  • Mechanical face. l1-face is CLEAN. Checks at this head: 33 success, 16 expected skip, 0 failed. mergeable_state is clean. Fixes is right: Ask 1 to 3 are each delivered and pinned.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmRar3Kkg6SpwVgaaVE

Landing · 2026-11-29T20:40Z · head 6e32cf71ecd9b33f2617361f639bf7a75ded1242 · ACCEPT → PR #38646 comment 7262260833

Probe Reading
check-governed-merges.mjs --pr 38646 NOT governed; 830 changed lines ≤ 3000
landing-k.mjs --pr 38646 K = 0 < 15; no locale pack; no shared book moved

Checks: newest run of each check green (33 success, 16 expected skip). mergeable_state clean at landing. State: ready + auto-merge armed through the relay; Fixes #35266 closes the card on merge; #38647 (blank scaffold data:) queues after it.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 29, 2026 20:41
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 0ba5e06 Nov 29, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-35266-gallery-template-gate branch November 29, 2026 21:07
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/l 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.

Gallery export requires the runner's template mode (unmanaged install + iterate) to pass, with the sample data in the template run (split from #35132)

2 participants