Repository navigation
feat(scaffold): the blank template starts with the Starter app's companies and contacts - #37428
Conversation
…anies and contacts The sample `note` object goes. The template ships the platform Starter app's company and contact objects and their views as source, and its menu lists companies, contacts and the platform's sys_task / sys_note. A comment-blind AST pin holds each definition equal to the Starter's, modulo the namespace. Scaffolding now moves every quoted template-namespace literal, references included, not only `name:` literals. Claude-Session: https://claude.ai/code/session_01Utp6Cb7GD4hWCpfZKAZgDD Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 52 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 18 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 b293b2d5dc1e14ab9135e24aa60d64c0109ee227 && git checkout b293b2d5dc1e14ab9135e24aa60d64c0109ee227
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f71d488d6f4d7181cc6e075eb956f92489fb87ba 4bf5626c8c3c31086a4daee07ab7f5b1dce7997f && git checkout -B drift-repro f71d488d6f4d7181cc6e075eb956f92489fb87ba && git merge --no-ff 4bf5626c8c3c31086a4daee07ab7f5b1dce7997f
node scripts/docs-audit/affected-docs.mjs --json f71d488d6f4d7181cc6e075eb956f92489fb87ba
|
…plate's company and contact objects The blank template no longer ships note.object.ts; the two affordance sweeps exempt and pin its company.object.ts and contact.object.ts instead. Claude-Session: https://claude.ai/code/session_01Utp6Cb7GD4hWCpfZKAZgDD Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 973207c · 2026-11-26T09:07Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: PR #37428 (card #36945), declaration face, ① Derived judgmentsFindings
1. Does the generated project equal the Starter's company and contact? Yes, where ruling 7183516548 requires it. Read side by side with
What a user pays between this landing and the 19.0.0-next publish. A user who runs Three costs are real:
2. The expected red. Check-runs on the head at 2026-11-26T09:14Z, 73 runs: nothing else is red. Green among the required contexts: Lint & Repo Gates, Build Core, Governed Surface Queue Guard, Lint UI, Live E2E UI, Dogfood Regression Gate. Still running: Test Core shards 1 to 7 and 10 (8 and 9 green; the platform-objects sweeps are in 8), all Test UI shards but 12, Type Check UI, Build & E2E UI, and 3. The platform-objects edit. It changes only the 4. See S2 and S3: both need cards. 5. Tests that pin the template. The parity pin has a built-in CONTROL that cannot pass vacuously (if the mutation stops applying, the mutated text equals the Starter's and the control goes red) and vacuity guards on both namespaces and on each definition. The rewrite tests pin both directions: five reference shapes moved, four non-name shapes byte-identical. The dev's ablations are stated with counts (starter test 1 failed and 2 passed with the notes entry deleted; field-consumer controls 12, 7 and 0 red for the three helper widths; 14 red with a no-op helper). The nightly strip pattern in ② Semver level
③ Boundary flags
Implemented-by: VERDICT: FAIL |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…ct the scaffolder wrote Pack mode scaffolds with the repo-built create-objectstack, whose blank template now starts with companies (company.object.ts, name required); registry mode scaffolds with the published one, which still ships note.object.ts (title). The probe picks the file present and the field it requires, and fails by name when neither exists. Claude-Session: https://claude.ai/code/session_01Utp6Cb7GD4hWCpfZKAZgDD Co-authored-by: Claude <noreply@anthropic.com>
`os validate` on a fresh blank project plus one generated object now prints `Data: 3 Objects` (company, contact and the generated control). Claude-Session: https://claude.ai/code/session_01Utp6Cb7GD4hWCpfZKAZgDD Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 4bf5626 · 2026-11-26T09:46Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: PR #37428 (card #36945), declaration face, ① Derived judgmentsEarlier findings
New in this round
The stack-reach pin. The expected red. Check-runs on this head at 2026-11-26T09:47Z, 71 runs: 58 success, 10 skipped, 1 failure (the expected one), 2 still running: Test Core shards 3/10 and 5/10, both started 09:24Z. So the required context Unchanged from the earlier record, re-read on this head: the template's objects, views and four object menu entries are the Starter's code modulo the namespace; ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CY2uhJ1AYNPw5TUSVS Landing (zone o5-P) · 2026-11-26T09:57Z · ACCEPT 7188671773 at
Authority: the maintainer lifted the wait in the card thread at 2026-11-26T08:58Z (「你可以落地啊」); re-claim 7187337406. |
… packed tarballs (objectstack-ai#37655) Fixes objectstack-ai#37441 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:只改了「新建项目」这道检查,新建的项目改为装本仓库当场打出的包,再验证、测试、启动并装进官方镜像里启动。 - 为什么做:替改模板和 Docker 文件的 PR 解决「这道检查被已发布的旧版本卡红」的问题,属于起步应用那批后续收尾。 - 出错会怎样:这道检查不是必过项,出错只会让改模板或 Docker 文件的 PR 上这一项变红,用户碰不到;回退这一个文件即可撤回。 - 要你做什么:席位核对通过后,批准这个 PR(受管的工作流文件,需要你批准)。 ## What changes One file, the `scaffold-local` job ("Scaffold with repo dist") of `.github/workflows/scaffold-e2e.yml`, under ruling 7194715376 (Q1 A with C filed separately, Q2 A) and the execution terms of analysis 7194330907. - **Install from this checkout's packed tarballs.** The job builds the framework closure the scaffolded project declares (read off its `package.json`, never a hand list), packs every publishable package with `scripts/publish-smoke-pack.mjs` (reused read-only, as `os-create-smoke.yml` does), appends the name-to-tarball map to the project's own `pnpm-workspace.yaml` overrides and installs with pnpm. The dependency specs in `package.json` stay as scaffolded. A check after the install reds by name on any pinned package resolved from the registry, and on any declared `@objectstack/*` dependency not resolved from a tarball. - **Removed:** the `latest` fallback and the `engines.protocol` re-stamp (card Scope 2). - **Docker leg, three steps, nothing under `docker/**` or in the template edited** (Q2 A terms (i)-(v)): 1. `docker/Dockerfile` built as it stands with the PUBLISHED CLI that the registry's `latest` names (never the candidate's version), then the release smoke of `docker-publish.yml`: `os --version` must name that version, and `pg` / `mysql2` must `require()`. 2. The scaffolded Dockerfile's build stage, built unedited with `--target build`, on a base re-tagged on the runner as itself plus the tarballs at the path the lockfile names (base image, WORKDIR and tarball directory are all read from the files, not hardcoded). Its `node_modules` is then layered onto the step-1 image with `.bin` first on PATH, tagged as the runtime image the scaffolded `FROM` names; `os --version` in the layer must name the candidate CLI. 3. The scaffolded Dockerfile, unedited, built whole on top of that layer, run and health-probed (the existing block). Each step's comment states what it proves and what it does not. - **Timeout** 20 to 45 minutes; a turbo cache step like `os-create-smoke.yml`'s. - **Comments:** the two stale `note.test.ts` references now name `starter.test.ts` (card Scope 4); the pinned-shape step's comment no longer says the install step carries a fallback; the file header says Job 1 runs against the packed tarballs. - Unchanged: the pinned-shape step's commands, both skills steps, the nightly `Registry canary`. ## Tests Local replay at head 3ded0a6, the job's own `run:` text extracted from the YAML and executed under `bash -eo pipefail` with `RUNNER_TEMP` outside the repo (only the port literal changed, to avoid a shared container's 8080): | Step | Result | |---|---| | Pack | `packed 113/113`, `Wrote 113 override(s)` | | Install | `59 package(s) resolved from packed tarballs, 0 from the registry; all 6 declared @objectstack/* dependencies among them` | | Validate and build | exit 0 | | Test (`starter.test.ts`) | `Test Files 1 passed (1)`, `Tests 3 passed (3)` | | Boot | `/api/v1/ready` answered `"status":"ready"` | | Control: `notAnObjectKey: true` added to the company object in a copy | validate exit 1, `ObjectSchema.create('e2e_app_company'): unknown key(s) — notAnObjectKey.` | The Docker steps can run only on CI (no Docker daemon in the dispatch container). What was measured locally instead: - The build stage's frozen install, simulated: the Dockerfile's COPY set in a fresh directory, the tarballs one level up (the in-image path step 2 computes), a fresh pnpm store, the runner's absolute tarball directory moved away, `corepack pnpm@10` (10.34.9) `install --frozen-lockfile` exit 0, `os build` exit 0, and that tree's own CLI booted the artifact to ready (`@objectstack/cli/19.0.0-next.0`). Without the tarballs at that path: exit 254, ENOENT on the relative tarball path. - Steps 1 and 2 driven by a stub `docker` on PATH: the derived base `node:22-slim`, WORKDIR `/app`, tarball directory `../tarballs` to `/tarballs`, the two generated Dockerfiles, and both version guards red when the stub answers the wrong version. ## Acceptance notes - Acceptance probe: the card names PR objectstack-ai#37428's head; that PR merged, so per claim 7193414418 the probe is this PR's own "Scaffold with repo dist" run. - The control was measured by local replay of the job's own validate step. Running it on CI would need a template edit on this branch, which the ruling forbids. - The pinned-shape step's warning string still mentions "the install step's fallback". Its commands are left byte-identical under card Scope 3; only the comment above them was corrected. - The file header lines that describe Job 1 sit outside the job block; they were corrected because they would otherwise state the opposite of what the job now does (comment-only). - The workflow's `paths:` filter does not name `scripts/publish-smoke-pack.mjs`, so a change to the packer alone does not run this job (`os-create-smoke.yml` does run on it). Left as is: the trigger is outside the ruled surface. - In both `os start` blocks, `kill "$SERVER_PID"` stops the `npx` wrapper and leaves `os start` and its `serve` child running (seen in the local replay). It has no effect on CI because the VM is discarded. Pre-existing, and not changed here. - The timeout of 45 minutes is an estimate. This PR's first run measures it. ## Verification Read first: 1. `.github/workflows/scaffold-e2e.yml`, the step "Build the candidate runtime layer (scaffolded build stage + official image)". This is the riskiest hunk because it re-tags the build stage's base on the runner and layers the candidate `node_modules` onto the official image. 2. The same file, "Install generated project (this checkout's packed tarballs)". The leak and coverage check there is what keeps the job honest. 3. The same file, "Build official runtime image from this checkout". It uses the published CLI version, never the candidate's. Two-minute check: open this PR's "Scaffold with repo dist" check. Expected: green. The install step should print `0 from the registry`, step 1 `@objectstack/cli/18.6.0`, and step 2 `@objectstack/cli/19.0.0-next.0`, and the last step's container should become healthy. <details><summary>Derived gates (dispatch-gates --commands) at 3ded0a6</summary> All 38 derived commands exit 0 locally, and `--ran` reconciles `38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN`. Two reds on earlier heads were caused by this diff and are fixed: `check-self-test-wired --self-test` (the packer was spelled with a `$GITHUB_WORKSPACE` prefix that the invocation census keys as a path with no file behind it) and `check:pm-dispatch-gates` (its census pins `scaffold-e2e.yml:23` for the `no-check-families` marker, and a longer header moved it). CI's check-runs on this PR are the authority. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyyekQEqLjtrCLLAeV)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Bill · project thread
Fixes #36945
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The blank template (
packages/create-objectstack/src/templates/blank/):noteobject, its list view andnote.test.ts.src/objects/company.object.tsandcontact.object.ts, andsrc/views/company.view.tsandcontact.view.ts: the definitions ofexamples/app-starter(PR feat(examples): starter app — companies and contacts, with the platform's tasks and notes in the menu #37399), withstarter_names spelledblank_. Comments are the template's own (what the org-wide default means, field groups, how to remove the objects), so the shipped-comment rationale pins move fromnote.object.tstocompany.object.ts.src/apps/main.app.tskeeps its identity (blank_main_app, label Main) and its navigation is the Starter's four object entries: companies, contacts, andsys_task/sys_notewithrequiresObject(the same form as the Starter, until os validate refuses an app menu entry naming the built-in sys_task or sys_note unless it carries requiresObject #37404 lands). The Starter's dashboard entry is not carried: the template ships no dashboard, seed data or translations.starter.test.tsreplacesnote.test.ts: it boots the project withbootStackand asserts that a company is refused without a name, that a contact's lookup holds its company, and thatGET /meta/app/NAMEserves the four entries in order.noteobject" (what each file is, that Tasks and Notes are the platform's, how to remove companies and contacts), and the Console, Layout, Verify and Next steps sections follow it. The template'sobjectstack.config.ts/objectstack.manifest.jsondescriptions (dropped at scaffold time) and the registry line say what the project starts with.One source of truth: a consistency pin, not a build-time copy (A2).
src/blank-template-starter-parity.test.tsparses each template file and the Starter's with the TypeScript compiler and compares the printed definition (the argument ofObjectSchema.create/defineView, and each navigation entry) with comments removed, after spelling the Starter's'starter_…'literals as'blank_…'. Formatting and commentary are free; every key and value is held. Its CONTROL case changes one value (maxLength: 120to121) and requires the comparison to fail. A copy at build time was not chosen: the template undersrc/is what every other test in this package reads and whatnpm createusers get, so it has to hold the files itself.Scaffolder: every namespaced literal moves, references included (DEVIATION, declared).
rewriteObjectNamePrefixused to rewritename: 'blank_x'literals only, so the old template had to reach its object asNote.name. Company and contact reference each other (the contact's lookup, the company's related list), so imported references would be circular, and the Starter spells references as literals. The rewrite (and its self-checkfindStaleNamespacePrefixes) now moves every WHOLE quoted literal under the template namespace prefix:'blank_company',"blank_company"and the backtick form, wherever it stands. A literal that is not a whole namespaced name is left alone: a platform object ('sys_task'), a navigation id ('nav_blank_tasks'), a longer string containing the prefix, a literal under another namespace. New tests inrewrite-identity.test.tspin both directions (five reference shapes moved; four non-name shapes untouched, byte for byte). Measured on a real scaffold (my-app): everyblank_literal becamemy_app_, none survived.Closing summary. After "Environment created!", the scaffolder prints "Your project starts with:" (Companies and Contacts in
src/objects/, Tasks and Notes from the platform in the menu ofsrc/apps/main.app.ts), outside the "Next steps:" block thatscaffold-next-steps-pm.test.tsreads. The parity test holds those lines to the template tree.Fence additions, each approved by the zone (o5-P) for this card:
packages/cli/test/create-objectstack-wiring-parity.test.ts: the views-barrel line it expects is now the twocompany/contactlines (the template keeps the generator's default-export barrel shape).packages/cli/test/starter-field-consumers.test.ts: the control helper (withoutPlacement, waswithoutGroup) un-places a field from every placement the starter wrote: itsgroup, a field group'sfieldslist (how the Starter places fields),highlightFields, and related-listcolumns. See Acceptance notes for why the last one is on every object.packages/cli/test/starter-field-consumers.e2e.test.ts(nightly): the strip also removes field groups'fields: [...]lists, so the blank starter keeps a control.scripts/cross-package-test-inputs.mjs+turbo.json:create-objectstackdeclaresexamples/app-starter/src/**(with aheldBywitness, the walked root) andexamples/app-starter/objectstack.config.ts(the namespace line), so a Starter-only change re-runs the pin instead of replaying a cached green.content/docs/getting-started/your-first-project.mdxandbuild-with-claude-code.mdx: the tree, the object code block, the Console callout, the curl examples, the "extend the model" block and the agent prompt describe companies and contacts; the validate transcript reads3 Objects 18 Fieldsand3 Views(2 objects and 14 fields measured on a fresh scaffold, plus the guide's ticket).Two lines in
packages/platform-objects, OK'd by the maintainer in the card thread (2026-11-26 08:58Z).managed-api-method-affordance-sweep.test.ts:146andplatform-admin-affordance-standing.test.ts:82listed the template'snote.object.tsas the one scaffolding exemption and pinned it as still existing; they now listcompany.object.tsandcontact.object.ts(commit 973207c). Measured: both sweeps 12/12 passed,check:cross-package-test-inputsexit 0.Tests
create-objectstack:vitest run, 26 files, 396 tests passed;tsc --noEmitexit 0.blank-template-starter-parity.test.ts9 tests;rewrite-identity.test.ts+2.@objectstack/cliunit:create-objectstack-wiring-parity.test.tsandstarter-field-consumers.test.tsgreen (25 tests).create-objectstack my-app --skip-install --skip-skills, resolved against workspace packages):objectstack validatepassed (2 Objects 14 Fields,1 Apps 2 Views, no warning),objectstack lintall checks passed,tsc --noEmitexit 0,vitest run3/3 (starter.test.ts).Ablations
starter.test.tsred on the menu case (1 failed, 2 passed); restored, 3/3.starter-field-consumers.test.tscontrols: old helper (groupkey only) on the new template, 12 of 12 blank controls red; the helper withgroup+ field-group lists only, 7 red (the highlighted fields); the full helper, green. Old template (note.object.tsrestored in place) with the new helper: 14/14 green. Helper made a no-op: 14 controls red (12 blank + 2os init -t app).Acceptance notes
.github/workflows/scaffold-e2e.ymlis governed and not edited (A4). It runsnpm testonly (lines 143 to 147 and 568 to 570), never a filename, so the rename is safe; two comments there still namenote.test.ts(line 139, "The starter's own test (note.test.ts)", and line 562, "older than the starter'snote.test.ts"). They are stale prose for whoever next edits that file.sys_task/sys_notedo not exist there yet, but the two entries carryrequiresObject, andstarter.test.tsreads the served menu and writes no task or note. The job is still red at validate, for the reason in Landing ops §C.columnsto the object that DECLARES the list as well as to the listed object: the company's related list of contacts (phonecolumn, the contact's field) keepscompany.phonecredited. Measured through the control above: a parent field that nothing displays stays silent when a child's related-list column has the same name, andwithoutPlacementnow strips those columns on every object, which hides it from the control. Carried by field-consumer rule: an object-form relatedLists column name is credited to the declaring object, so an undisplayed parent field with the same name stays silent #37502 (fix the rule, then narrow the helper).packages/cli/src/commands/generate.ts(~294) still citesnote.object.tsas the starter's authoring style in a comment, and that comment is now partly false:os g objectplaces a field with a per-fieldgroup, while the starter places fields through a group'sfieldslist. That and the other stalenotecitations (includingcontent/docs/deployment/cli.mdx) are carried by blank template is company/contact now: stalenotecitations and the generator's "starter style" promise for field placement (family) #37503.packages/cli/src/utils/organization-ownership-inventory.tskeepsblank_noteas a census row fixed at its census commit, which is correct.Landing ops
§C Expected reds on this head, what they cost, and what unblocks them
One red is expected on this head; it is not a required context (
scripts/check-required-contexts.mjsREQUIRED_CONTEXTS).✗ ObjectSchema.create('e2e_app_company'): unknown key(s) — color.The job installs the generated project from the registry at^18.6.0(alsolatest; main is in changeset pre mode). 18.6.0 rejects three shapes the Starter's source uses: objectcolor,fieldGroups[].fields, and object-formrelatedListsentries. Measured against a real registry install: with those three stripped, validate passes, so nothing else in the template is unreleased.starter.test.ts, the boot probe, the skills boundary, the pinned shape and both Docker legs. No other CI job runsstarter.test.ts(this package's vitest excludessrc/templates/). Until scaffold-e2e: "Scaffold with repo dist" installs the generated project from this checkout's packed tarballs #37441 lands or a 19 prerelease is published, no CI run executes the new template's test or boots a generated project, on this PR or on any later PR that touchespackages/create-objectstack/**ordocker/**; a second template regression in that window would be hidden behind thecolorrefusal. The job has no push trigger, and the nightly leg runs only the registry canary.color,fieldGroups[].fieldsand object-formrelatedLists. The maintainer asked for this PR to land now (card thread, 2026-11-26 08:58Z).Fixed in this PR so it does not go red:
publish-smoke / packed-tarballs(contract review 7187700473, M1; the claim amended to addscripts/publish-smoke.sh). The smoke's REST CRUD probe readsrc/objects/note.object.tsand wrotetitle; in pack mode the project now comes from the repo-built scaffolder, so the file was gone and the smoke would have stopped at "REST CRUD probes" after the next Release run. The probe now drives whichever starter object the scaffolder wrote:company.object.tswith the requiredname(pack mode, and registry mode once the companies template is published), elsenote.object.tswithtitle(registry mode until then), and fails by name when neither exists (commit 1079be7). Measured:SMOKE_MODE=registry bash scripts/publish-smoke.shexit 0,Publish smoke passed (registry mode), the probe onsmoke_app_note(title): create 201, read 200, update 200, delete 200.create-objectstackand booted withobjectstack dev --freshon the workspace packages (a full pack-mode run needspnpm buildof every package, not run here), signed in as the seeded admin:smoke_app_company(name) create 201, read 200, update 200, delete 200.ENOENT … src/objects/note.object.ts.Cleared at 973207c: the platform-objects gap (the two sweeps and Cross-package test inputs).
Verification
Files to read first:
src/rewrite-identity.ts(the widened literal rule,namespacedLiteralRe),src/blank-template-starter-parity.test.ts,src/templates/blank/src/apps/main.app.ts.Two-minute check:
cd packages/create-objectstack && pnpm exec vitest run src/blank-template-starter-parity.test.ts src/rewrite-identity.test.ts, expect every case green, thennpx tsx src/index.ts my-app --skip-install --skip-skillsin a scratch directory and readmy-app/src/apps/main.app.ts: four entries,my_app_company,my_app_contact,sys_task,sys_note.Generated by Claude Code