Repository navigation
feat(cli,create-objectstack): os build says when the dev database holds Studio customizations it leaves behind; the starter docs name os package export - #30336
Conversation
…udio change stays in its database and name os package export (WIP) Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
…tomizations it leaves behind (WIP) Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
…ogin before os package export (WIP) Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
…angeset Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
…ate parity roster Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 36 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 41 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 32ba61cc9be28cf9a960af28c3059c0bd308b0bc && git checkout 32ba61cc9be28cf9a960af28c3059c0bd308b0bc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bfca0efb79ac5df2049f392cdecd3bbeeea9ec61 fd70306c18a3f467837edcf9e5c4c8f9e6fc0844 && git checkout -B drift-repro bfca0efb79ac5df2049f392cdecd3bbeeea9ec61 && git merge --no-ff fd70306c18a3f467837edcf9e5c4c8f9e6fc0844
node scripts/docs-audit/affected-docs.mjs --json bfca0efb79ac5df2049f392cdecd3bbeeea9ec61
|
…ning Claude-Session: https://claude.ai/code/session_01Utp6CbrroXG7sXSzmQs4uj Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF 席位意见:ACCEPT(#30119 服务端一半)。 席位核对Head-sha:
|
Requested by Bill · project thread
domain:server#4 · os-bill · session_01Utp6CZMkHvuDeVYgTD73qF
Refs #30119 (server half). The Studio notice "where a customization is saved" is the ui half and stays open on the card.
Clause-②: yes (widening) — the exported CompileCommand gains a protected reportsLocalCustomizations flag (default false); nothing removed or narrowed
Metadata-protocol: none
维护者速读
os build结束时,若本地开发库里有 Studio 定制(包名.custom的条目),打印一次提示:几条、在哪个包、库文件在哪,用os package export带走;脚手架的 AGENTS.md 和 README 写明 Studio 改动存在数据库里、不进src/,并说明代理该改src/。os dev里用 Studio 调好视图,再os build+ Dockerfile 部署,改动丢了且无任何提示(卡上实测,本 PR 在当前 main 复测成立)。--json输出、不新增服务端接口;回滚即 revert 本 PR。packages/cli/src/utils/local-customizations.ts(读库与提示文字),packages/cli/src/commands/compile.ts(只在 build 上打开的那段),packages/create-objectstack/src/templates/AGENTS.md。os dev,给todo_task.default存一个.custom覆盖,再跑os build,结尾应看到「This build does not carry 1 Studio customization…os package export」。What changes
os buildsays what the artifact leaves behind. After the artifact is written, the text face reads the SQLite fileos devopens for the project and counts thesys_metadatarows whosepackage_idends in.custom(ADR-0146 D2: a Studio change to a shipped item is an item ofBASE.custom). When there are any, it prints one warning and two dim lines: the count per pair, the database file, and the remedy (make the change insrc/, oros package exportwhileos devruns).resolveProjectDatabaseUrl(@objectstack/runtime), over this process's environment layered on the project's development.env*files the wayos devloads them (dotenv-flow, process wins), without loading them into the build's process.better-sqlite3, the CLI's optional dependency, assqlite-occupancy.tsalready does), one aggregateSELECT. No server door, no network round trip. A database that is not a local SQLite file (Postgres, MongoDB, libSQL,:memory:) is not probed and prints nothing.better-sqlite3, prints "Could not check FILE … (reason)" plus the remedy, never silence-as-empty. A database with nosys_metadatatable yet, or no.customrow, prints nothing. The probe never fails the build.os build:Compilegains a protectedreportsLocalCustomizations = false, andBuildsets ittrue.os devcompiles throughos compileon every boot and rebuild, so the notice never prints there.os build --jsonis unchanged: no new key.The starter's docs. The generated
AGENTS.mdgains "Change the app insrc/— a Studio change stays in its database", and the blank README's "Deploy" section gains "A Studio change is not in the image". Both say:PACKAGE_ID.custom, never intosrc/, sobuildand theDockerfileleave it behind.src/, never through Studio or the metadata API of a running server. A change a person tried in Studio is made again insrc/when it belongs to the app. No write-back is built, as the card asked.os loginand thenos package exportagainst the dev server, commitobjectstack-export/, thenos package install … --runtime URLon the deployment, in the numbered order.Tests
packages/cli/src/utils/local-customizations.test.ts(unit tier): the.envlayering (process wins, nothing loaded), which URLs name a local file,not_applicablefor a remote, unbooted or refused database, the notice text for found / unknown / none, and thatBuildturns the notice on whileCompilekeeps it off.packages/cli/src/utils/local-customizations.sqlite.test.ts(integration tier, because it importsbetter-sqlite3to write its fixture): counts per.custompackage and nothing else (a non-pair package, a package-less row,com.custom.toolsandcom.example.customsare not counted),nonefor no pair rows or no table, the file is byte-identical after the read,unknownfor a file that is not a database, andOS_DATABASE_URLis followed.packages/create-objectstack/src/studio-customization-disclosure.test.ts: both docs carry the section and say.custom, database,src/,Dockerfile,os package export,os package install; AGENTS.md tells the agent to make app changes insrc/.Local runs on 0baf7e9
Head
0baf7e9a4(after mergingorigin/mainonce, rebuilding the workspace,pnpm --filter @objectstack/spec check:generatedexit 0).pnpm --filter @objectstack/cli typecheckexit 0;pnpm --filter create-objectstack typecheckexit 0.pnpm --filter @objectstack/cli exec vitest run --project unit: 385/385 files, 5435/5435 tests.pnpm --filter @objectstack/cli exec vitest run src/utils/local-customizations.sqlite.test.ts(integration tier): 5/5. The rest of the CLI integration tier is declared to CI.pnpm --filter create-objectstack test: 24/24 files, 369/369 tests.node scripts/pm/dispatch-gates.mjs --commands: 62 families, each run with its exit code captured before any pipe, all exit 0;--ran: 62 derived, 62 run, 0 NOT-MEASURED, 0 UNRUN.pnpm lintexit 0.fd70306c1changes the changeset'sClause-②line only (the seat's ruling: the exportedCompileCommandgains a protected member). Re-run on it:check-adr-0087-registration,check-changeset-no-major,check-empty-changeset,check:changeset-gate-self-tests, all exit 0.test/validate-build-gate-parity.test.tsred: the closed roster of namescompile.tscalls did not classify the two new calls. They are now aNOT_A_GATErow with its reason (an advisory about the dev database, judges no metadata, refuses nothing).Acceptance notes
main(959c26b), app-todo, realos dev:POST /packages/com.example.todo/ensure-customizationthenPUT /meta/view/todo_task.default?package=com.example.todo.customwithoverrides: { package: 'com.example.todo', basedOn: '2.0.0' }is served (label changed). The row is insys_metadatawithpackage_id = com.example.todo.custom,state = active.src/: 0 hits for the change;os buildartifact: 0;os package export: 1, in01-com.example.todo.custom/objectstack.json. The card's premise holds.os buildon that project printed⚠ This build does not carry 1 Studio customization stored in your dev database: com.example.todo.custom (1).and the two lines under it, both withos devrunning (WAL, read-only open alongside the live server) and after it stopped.os dev's own boot compile printed nothing new..customitems, all states. An ensured pair with no item has no row and nothing to lose, so it is not counted. A package authored wholly in Studio (not a pair) is not counted either;os package exportcarries it, and the docs' "every package the database holds thatsrc/does not register" covers it.ui/**edit here.Verification
cd examples/app-todo && os dev, sign in,POST /api/v1/packages/com.example.todo/ensure-customization, then save any view override intocom.example.todo.custom.os buildin the same directory: the last block namescom.example.todo.custom (1), the database file, andos package export.os compile(oros build --json): no such block.Generated by Claude Code