Repository navigation
fix(create-objectstack): name the help articles in the scaffold summary and descriptions - #38584
Conversation
…ry and descriptions The "Your project starts with:" summary gains an Articles line, pinned against the template's object files so the next object fails the pin until the summary names it. The blank template's and the Starter's descriptions name the help articles (zh-CN in the Starter only). The platform-objects sweeps exclude the scaffolder's template directory instead of a two-file path list, with the control kept. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
The literal keeps the package's declared object-file glob held for the cross-package input gate and pins the exclusion's coverage of it. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
…affold-articles-sweep
…and its mirrors The blank template's registry description (printed as the Template line on every run), the package README and the two getting-started pages that quote it, the Starter's English app description, its package.json description and the two index.ts comments quoting the template's own description now name the help articles. The summary pin also holds the printed Template line to the template's object files. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
…affold-articles-sweep
…tion Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
… the README tree The getting-started tutorial's validate output and its prose now read four objects and twenty-two fields with four views (measured: a fresh blank scaffold plus the page's ticket files), and name the help articles among what the blank template scaffolded. The package README's "What you get" tree lists article.object.ts and the src/data/ seed. Claude-Session: https://claude.ai/code/session_01QsR2jSh8tZmU5uBqzpvg3o Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check1 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3357f2fc98653ffd1a33342da4af67e47b4274d6 && git checkout 3357f2fc98653ffd1a33342da4af67e47b4274d6
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 696d02f587184095c7b36600c4395cac42dbdd08 3df792a9f513218b9aec728f0222cb9fe2bf5b51 && git checkout -B drift-repro 696d02f587184095c7b36600c4395cac42dbdd08 && git merge --no-ff 3df792a9f513218b9aec728f0222cb9fe2bf5b51
node scripts/docs-audit/affected-docs.mjs --json 696d02f587184095c7b36600c4395cac42dbdd08 |
|
repo:objectstack#1 · zhuangjianguo · session_01QsR2jSyQBDMyRnrrWKy7WS 席位核对 — ACCEPT · delta L1 by seat repo:objectstack#1, review thread R1 · Head-sha
|
…d while the knowledge service is not enabled (objectstack-ai#38599) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Jianguo** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbEfAFjBdY8togk8ou6SwAJF)_ Part of objectstack-ai#38369 (part 2 of 3; part 3, items 4–5, follows from `main` after this merges) Clause-②: no (narrowing) — a save door that answered 200 while the service was held now refuses with 503 naming each missing half; no key added Metadata-protocol: narrowed Skills-docs: follow-up objectstack-ai#38475 ## 维护者速读 - 自托管部署如果运行时挂了知识服务但没启用(缺嵌入模型或知识存储),作者在设计器、元数据接口、MCP 里保存知识源,或把无包知识源移进包里,现在会被当场拒绝,并说明缺哪一半、怎么补;以前保存成功,但知识源只是挂着,从不建索引也搜不到。 - 属于知识库检索这条线,执行您对知识服务"挂载不等于启用"的裁决(作者保存时拒绝、四点全按推荐);这是三单中的第二单,第一单已合并,状态页和命令行文字是第三单。 - 只影响作者保存;安装应用包、种子数据、复制应用包照常,配齐两半或宿主自己挂载知识服务的部署不变;出问题可整单撤回。 - 要你做的:批准这次收窄(按审批流程)。 ## What changes Authority: the ADR-0161 K8 dated note on item 12 (◆ "an author's save", ◆ points 1 and 4), ruling record 7248214179 (amendment 7248231750, points 1 and 4) and build note 3 of 7248592159. Card items covered: item 3. - **The held refusal lives in the service's own verdict** (`packages/services/service-knowledge/src/knowledge-service.ts`, `KnowledgeService.admitAuthoredSource`). While the boot read a runtime-composed service as not enabled (`heldReading()` set by PR 1), an author's save is refused `503` with code `SERVICE_UNAVAILABLE`, ahead of the identity check and every gate, and nothing is written. The sentence names each half that is missing and the ruled remedy (point 4): no embedder → "save an embedder provider, restart, then save" (as "…, restart, then save the source."); the deployment's store not mounted → it says so, that the boot's log names the reason, and "mount the deployment's knowledge store, restart, then save"; both → both, in one remedy. A provider saved without its key carries that cause in the parenthesis beside the ruled words (build note 3). The engine's own write (`isSystem`) is admitted, so a shipped source still installs and is held. The package duplicate (`door: 'duplicate'`) is not refused for it, as the note rules. - **Every save door answers it unchanged**: `PUT /meta/:type/:name` on both transports and the MCP draft save ask `authoredKnowledgeSourceRefusal`, which forwards the service's verdict; `POST /packages/:id/move-in` of a package-less source already asks it with the save door (point 1), so it is refused with the save's remedy. No door value is added. - **No-service refusal** (`packages/metadata-core/src/knowledge-source-save-admission.ts`, card item 3's "gains 'and save an embedder provider'"). The save door's sentence now reads "… restart the server, save an embedder provider and restart again, then save the source again: the service is mounted when the server starts, never while it runs, and the one the stack requires serves only once an embedder is configured." The provider is saved after the first restart because the `ai.embedder_*` keys are contributed by the knowledge service itself (the note's "Alternatives not taken"), so the card's literal "and save an embedder provider" beside the token would name a step that cannot be done before the restart. The duplicate door's sentence is unchanged (the note: "What it answers where no knowledge service is registered … is unchanged"). - **ADR-0087**: `packages/spec/src/migrations/entries/semantic/19.knowledge-source-save-refused-while-knowledge-service-not-enabled.ts` (notice only, no D2 conversion: the fix is the deployment's configuration). The changeset carries `registered` with that id. - **Docs**: `content/docs/ai/knowledge-rag.mdx` (a "saved only while the service is enabled" bullet, and the no-service fix gains the embedder step); `content/docs/protocol/knowledge.mdx` (a "A service that is not enabled saves no source either" paragraph after the no-service one, which gains the embedder step). ## Tests - `packages/services/service-knowledge/src/__tests__/knowledge-settings-contribution.test.ts`, new describe inside PR 1's runtime-composed describe, booted on `LiteKernel` (6 cases): no embedder (503, the ruled words, no store half; system admitted; zero store calls); the duplicate door not refused for the held state; a provider saved without its key (cause plus ruled words); store not mounted (store half only, no embedder words); both halves; controls (enabled through a host embedder, and a host-mounted plugin: never refused for a held state). - `packages/runtime/src/domains/packages-knowledge-source-gate.test.ts`, new describe on a real `ObjectKernel` running `KnowledgeServicePlugin({ runtimeComposed })` with no embedder (5 cases): the boot reads it held; `PUT /meta/knowledge_source/faq` refused 503 with the remedy, `saveMetaItem` never called; `POST /packages/pkg-a/move-in` of the loose source refused with the save's remedy, `moveIntoPackage` never called, the engine's move goes on; `POST /packages/pkg-a/duplicate` copies; control: host-mounted plugin, the same save and move-in go on. - `packages/runtime/src/domains/meta-save-capability-gate.test.ts`: the dispatcher PUT on a kernel registering a real `KnowledgeService` settled held on the store half (store sentence, no embedder words, nothing saved). - `packages/runtime/src/domains/mcp-authoring.test.ts`: `save_metadata_draft` with a real `KnowledgeService` settled held on the embedder half (503, the ruled words, nothing written). - `packages/rest/src/meta-write-door-capability-enumeration.test.ts`: REST answers the service's held 503 verdict as sent (this package does not depend on `@objectstack/service-knowledge`; the sentence itself is pinned at the service and the runtime doors). - `packages/metadata-core/src/knowledge-source-save-admission.test.ts`: the save door's no-service sentence orders "restart the server, save an embedder provider and restart again, then save the source again"; the duplicate's names no embedder. ## Acceptance notes - **Pending window.** Between `kernel:ready` and `kernel:bootstrapped` the reading is pending; a save that arrived then would not be refused for the held state (it is judged by the other gates, and the source is then held like any other). The save doors are served after the boot completes, so this is noted, not built. - **Wording deviation, named above**: the no-service refusal puts the embedder step after the first restart, not beside the token, because the setting cannot be saved before the service is mounted. ## Verification **Code head `83d6c45081`** (the next commit, `1ec1c93f`, only copies the claim's Clause-② line into the changeset). Shared container; every build and test ran through `scripts/pm/os-verify-lock.sh`. Branch off `origin/main` `696d02f5`; `main` has gained three commits since (objectstack-ai#38584, objectstack-ai#38582, objectstack-ai#38574), none touching a package this diff touches, so it is not merged in. - **Dogfood battery at `83d6c45081`**: closure build (`--filter '@objectstack/dogfood^...' --filter '@objectstack/cli...' --filter '@objectstack/lint...' --filter '@objectstack/client-react...'`) VERDICT command-exit 0; `pnpm --filter @objectstack/dogfood test` VERDICT command-exit 0 · Test Files 495 passed, 3 skipped (498) · Tests 4187 passed, 68 skipped (4255) · 0 failed. - `@objectstack/service-knowledge` `pnpm test`: Test Files 24 passed, Tests 812 passed. `@objectstack/metadata-core` `pnpm test`: Test Files 29 passed, Tests 1118 passed. - Runtime door files (`packages-knowledge-source-gate`, `meta-save-capability-gate`, `mcp-authoring`): 3 files, 191 passed. REST `meta-write-door-capability-enumeration`: 82 passed. - `typecheck` exit 0 for `@objectstack/spec` (after `build`, which regenerates the migration registry with the new entry), `service-knowledge`, `metadata-core`, `runtime` and `rest`. ESLint over every changed `.ts` file: exit 0. <details><summary>Ablation</summary> At `83d6c45081`: the held guard in `admitAuthoredSource` was edited to `if (false && this.held && options?.door !== 'duplicate')`. `knowledge-settings-contribution.test.ts`: 5 failed / 48 passed (the five held-save cases; the controls stayed green). Restored with `git restore --source=HEAD --staged --worktree`; `git status --porcelain` empty. </details> <details><summary>Gates</summary> `dispatch-gates --ran` at `83d6c45081`: 122 derived families accounted for, 121 run with exit 0, 1 NOT MEASURED: `check:dual-build-cjs-loads` exits 3 (prerequisite: dist of packages outside this closure); CI runs it. `pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts` and `check:skill-examples` first exited on a missing `create-objectstack` / `client-react` dist, and passed (exit 0) after the closure build. Among the run: `check-adr-0087-registration` (1 declared-breaking changeset, `registered knowledge-source-save-refused-while-knowledge-service-not-enabled`, new here), `check-changeset-no-major`, `check-empty-changeset`, spec `check:upgrade-guide`, `check:spec-changes`, `check:api-surface`, `check:docs`, `check:doc-authoring`, `check-affected-docs`, `check:adr-anchors`, `check:error-status-conformance`, `check:type-check-debt`, `check:nul-bytes`. PR body gated before opening: `check-changeset-no-major`, `check-adr-0087-registration`, `check-closing-keyword-parity`, `check-partof-closing-keyword` exit 0. `overlap-check` before each push: VERDICT clean against `origin/main`. </details> CI check-runs: not yet read (PR just opened). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jREKp1JAmqK54ADBYS --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Jianguo · project thread
Fixes #38483
Clause-②: no
Metadata-protocol: none
Supersedes #38568 (same commits, continued on this branch: seat 5's dev ran out of tokens, and seat 1 took the card over in claim 7255582169 and its amendment 7255673725). #38568 is closed (7256137004).
维护者速读
What changes
All three places were re-read on
mainat 4a43d6c first; none was already fixed.npm create objectstacknow prints anArticlesline in "Your project starts with:", between Companies and Contacts and Tasks and Notes, pointing atsrc/objects/andsrc/views/and at the sample help articles insrc/data/(packages/create-objectstack/src/index.ts, the summary block only).manifest.description(inobjectstack.config.tsandobjectstack.manifest.json) and the Starter'smanifest.descriptionnow name the help articles in English. The Starter's zh-CN package description now reads 公司、联系人与知识文章,菜单中附带平台的任务和备注。, using the article object's existing zh-CN label. The blank template stays English-only, per the seat's rulings 7249604628 and 7251614638. A scaffolded project still drops the template's description from its own files, so this text reaches only the template's own readers.managed-api-method-affordance-sweep.test.tsandplatform-admin-affordance-standing.test.tsnow exclude the scaffolder's template directory (packages/create-objectstack/src/templates/). They no longer use a path list that named only company and contact. The next template object is excluded with no edit. The control in the managed-api sweep is kept and widened. It checks four things: the directory matches at least one walked file; every match is an object file in a template's ownsrc/objects/; the matches equal the template object files read off disk without the walk, witharticle.object.tsnamed; and the filter removes nothing outside the directory.Template: blank — …on every run. That description now readsCompanies, contacts and help articles, with tasks and notes from the platform in the menu — ready to extend, the same phrase as the manifest and config (packages/create-objectstack/src/template-registry.ts). It is mirrored in the package README's template table and in the two getting-started pages that quote it (your-first-project.mdx,build-with-claude-code.mdx). Also updated: the Starter's English app description (Companies, contacts and help articles, with tasks and notes), theexamples/app-starter/package.jsondescription, and the twoindex.tscomments that quote the template's own description.content/docs/getting-started/build-with-claude-code.mdxsaid the blank template scaffolded only the companies and contacts, so the validate output read three objects and eighteen fields. The prose now names the help articles (article.object.ts, four fields, with its view and sample articles) and reads four objects and twenty-two fields; the validate block readsData: 4 Objects 22 FieldsandUI: 1 Apps 4 Views 1 Actions. Those numbers are measured, not summed: a fresh--template blankscaffold plus the page's own ticket files, throughos validate(see Verification). The "What you get" tree inpackages/create-objectstack/README.mdnow listsarticle.object.ts, a grid for articles beside the companies' and contacts' grid and board, adata/entry for the seed, and articles in the menu.Changeset
.changeset/38483-scaffold-names-articles.md: patch oncreate-objectstackand@objectstack/example-starter(the latter is private and versioned only, the same pair the help-articles changeset used). It now also names the README tree.@objectstack/platform-objectsgets no changeset: only its test files change.Read first (by risk):
packages/platform-objects/src/managed-api-method-affordance-sweep.test.ts, theisScaffoldingTemplatepredicate and the "skips only scaffolding templates" control. A predicate that is too wide would silently stop sweeping real objects.packages/create-objectstack/src/scaffold-description.test.ts, the new derived summary pin and the Template line pin.packages/create-objectstack/src/index.ts, the summary block.Tests
describeinscaffold-description.test.ts(the file's existing real-CLI harness, now capturing stdout). It derives the expected entries from the template: everysrc/objects/*.object.tsmust be named in the printed block by itspluralLabel, and the block must point atsrc/data/while the template'ssrc/data/index.tsexports a seed. A file with nopluralLabelfails loudly. Control: the derived list contains Companies, Contacts and Articles, so a moved directory cannot pass vacuously.describealso holds the printedTemplate: blank — …line to the template: each object's plural label must appear in it (case-insensitive). So the registry description cannot drift from the tree either.Ablations (prior rounds, at 9f2a6cf and 80f23ea; each restored; restore proved by blob equal to HEAD and an empty git diff HEAD)
Articlessummary line inindex.ts(anchor 1 to 0):scaffold-description.test.tswent red, 2 failed / 4 passed. Message: "the summary does not name Articles, an object the template ships", and thesrc/data/case failed too.invoice.object.tswithpluralLabel: 'Invoices'to the template'ssrc/objects/(the "next object" case): red, 1 failed / 5 passed. Message: "the summary does not name Invoices, an object the template ships". File removed, status clean.pluralLabeltoInvoices: red on the control (1 failed / 5 passed).Companies and contacts, with …: red, 1 failed / 6 passed. Message: "the Template line does not name Articles, an object the template ships".isScaffoldingTemplatein the managed-api sweep back to company and contact only: "skips only scaffolding templates, and those still exist" went red, expected 2 entries to equal 3.Suites (re-run at head 3df792a, after merging origin/main 3014176 in 08bb2af)
@objectstack/cli,create-objectstack,@objectstack/example-starterand@objectstack/platform-objectsclosures (71 tasks successful), underos-verify-lock:create-objectstacktest: Test Files 26 passed (26), Tests 411 passed (411); typecheck exit 0.@objectstack/example-startertest (the boot test): Test Files 2 passed (2), Tests 14 passed (14); typecheck exit 0.@objectstack/platform-objectstest: Test Files 130 passed (130), Tests 2218 passed (2218); typecheck exit 0.Acceptance notes
starter.translation.tsnow reads公司、联系人与知识文章,菜单中附带平台的任务和备注。, the same wording as its zh-CN package description (second claim amendment).packages/**/*.object.tsglob held. The old two-path list was that witness. The control's namedarticle.object.tsliteral now holds it, andcheck:cross-package-test-inputsis green.overlap-checknames the bot-generated Version Packages PR chore: version packages (next) #38192, which bumpsexamples/app-starter/package.json's version on the line next to its description. That PR is regenerated frommain, so the text conflict resolves on its next refresh. It also names fix(create-objectstack): name the help articles in the scaffold summary and descriptions #38568, which this PR supersedes; both merge cleanly with main.build-with-claude-code.mdxbeyond the lines that quote the template description, as seat L1 7255063318 asked. Measuring it showed two things on that page this PR does not change: the page's ownsrc/apps/support.app.tsbeside the template'smain.app.tsfailsos validate("An 'app' package must define at most one app", ADR-0019 D3), and the validate block'sRuntime: 3 pluginsline reads0 pluginsin an uninstalled scaffold. The counts above were taken with the template's single app. Both are older than the help articles and are left to the seat.Verification
Two-minute check:
pnpm --filter create-objectstack exec vitest run --maxWorkers=2 src/scaffold-description.test.tsshould show 7 passed, including "names each template object by its plural label" and "names each template object in the printed Template line too".How the tutorial's counts were measured (item 5)
At 08bb2af (built):
node packages/create-objectstack/dist/index.js support-desk --template blank --skip-install --skip-skillsin a scratch directory whosenode_modules/@objectstack/speclinks to this tree'spackages/spec, thennode packages/cli/bin/run.js validatethere.✓ Validation passed,Data: 3 Objects 18 Fields,UI: 1 Apps 3 Views(company 7 + contact 7 + article 4 fields).title=code blocks written verbatim (ticket object, Resolve action, ticket view, support app) and one export line each in the barrels, minus the support app's export (see the acceptance notes):✓ Validation passed,Data: 4 Objects 22 Fields,UI: 1 Apps 4 Views 1 Actions.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 117 commands (the docs families included). All 117 were run, each exit captured before any pipe;--ranreconciliation reads "117 derived famil(ies) accounted for — 117 run, 0 NOT-MEASURED (a DERIVED zero — all 117 recorded an exit code and none of them is 3)".check-plugin-teardown-shape --self-testafter fetching its pinned fixture commit ("48 cases pass");check:skill-examples,check:dual-build-cjs-loadsandcheck:i18n-coverageafter a full turbo build ("352 prose examples type-check"; "126 published require entry point(s) across 74 package(s) load"; "OK (15 config(s), 577 baselined untranslated string(s), none new)").overlap-check --branch=HEADbefore the push of 3df792a: "origin/main: merges cleanly"; fix(create-objectstack): name the help articles in the scaffold summary and descriptions #38568 merges cleanly; chore: version packages (next) #38192 (Version Packages) conflicts onexamples/app-starter/package.json, see the acceptance notes.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jSh8tZmU5uBqzpvg3o