Repository navigation
fix(create-objectstack): the scaffolded AGENTS.md lists only the src directories the config loads - #29091
Conversation
…directories the config loads Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5nNCtq276yJtjqKq8B
📓 Docs Drift Check
What this run could not see
Coarse fallback — 13 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
domain:server#1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC 席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Fixes #28954. 3 files (+90 / −6): the scaffolded AGENTS.md Project Structure block, a package test (agents-project-structure.test.ts) and a create-objectstack patch changeset. Metadata-protocol: none. No config change, no packages/spec/**, no gate. |
| Rule | The block lists exactly the eight directories the template's config wires (objects, views, actions, flows, dashboards, apps, skills, picklists) and drops reports/, agents/, i18n/ and handlers/. One added paragraph says a new src/ directory is never loaded nor validated until its barrel is imported in objectstack.config.ts. The test pins the block to the config's barrel imports. |
| Evidence | Pin red on base and green on head; ablation red, restore clean; create-objectstack suite 304 tests, typecheck and lint green. Local gates 55 of 59 (the last four were not run at the maintainer's wrap-up; CI runs them, and the PR body says so). CI on head decides; auto-merge waits for it. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z), and 「先确保已有的pr都合并」 (Leehom, 2026-11-02T07:11Z): ready and auto-merge through the relay, with every check green or an expected skip. |
Generated by Claude Code
Requested by Leehom · project thread
Fixes #28954
Clause-②: no
Metadata-protocol: none
维护者速读
AGENTS.md里「Project Structure」目录树,现在只列objectstack.config.ts真正加载的 8 个目录(objects、views、actions、flows、dashboards、apps、skills、picklists),去掉了从不加载的reports/、agents/、i18n/、handlers/,并加一句:新目录必须在 config 里接线,否则既不加载也不被 validate 检查。另加一条包内测试,把这棵目录树和模板 config 的 barrel 导入对齐。npm run validate还照样通过,用户以为是 AI 写坏了。packages/create-objectstack/src/templates/AGENTS.md(Project Structure 一节);packages/create-objectstack/src/agents-project-structure.test.ts(新增的对齐测试)。pnpm --filter create-objectstack exec vitest run src/agents-project-structure.test.ts,预期 3/3 通过(main 上 2 条红:多出 agents/handlers/i18n/reports,缺 picklists/skills)。Why
A newcomer on the "Build with Claude Code" path has a coding agent read
AGENTS.mdbefore it writes any metadata. The block told the agent to put reports insrc/reports/, AI agents insrc/agents/, translations insrc/i18n/and hooks insrc/handlers/. The scaffoldedobjectstack.config.tsimports none of those, so what the agent wrote there was never loaded, andnpm run validateneither counted nor checked it (the card's repro: an invalid report there,✓ Validation passed).What changes
packages/create-objectstack/src/templates/AGENTS.md, the Project Structure block. Thesrc/tree now lists exactly the eight directories the config wires, in the config's order:objects/,views/,actions/,flows/,dashboards/,apps/,skills/,picklists/.reports/,agents/,i18n/andhandlers/are gone. Below the tree, one paragraph: these are exactly the directoriesobjectstack.config.tswires, and a newsrc/directory is never loaded, andnpm run validateneither counts nor checks what it holds, until itsindex.tsbarrel is imported inobjectstack.config.tsand handed to its stack key there (the config's own comment says the same).packages/create-objectstack/src/agents-project-structure.test.ts. For every bundled template inTEMPLATESthat has anobjectstack.config.ts, the block'ssrc/directories equal the config'simport * as X from './src/X'barrels, as sets, both ways. A third case pins that the section namesobjectstack.config.tsand says "never loaded". A package test, not a gate script.AGENTS.mdis touched..changeset/scaffold-agents-md-wired-dirs.md:patchoncreate-objectstack(the templates ship inside itsdist), with both declaration lines and the one-line adoption note for an existing project.Step 1 measurement (the order's ruling 2).
TEMPLATES(src/template-registry.ts) has one bundled template,blank. All templates share oneAGENTS.md(src/templates/AGENTS.md, rendered byindex.tsinto every project); no template carries its own.blank/objectstack.config.tsimports eight barrels: objects, views, actions, flows, dashboards, apps, skills, picklists. The old block named tensrc/directories: six of those eight, plusreports/,agents/,i18n/,handlers/;skills/andpicklists/were missing.blank/README.md(its Layout section) already names exactly the eight, so it is unchanged.Tests
ee7518f9(AGENTS.mdchecked out from base, the new test kept): 2 failed, 1 passed. The set case receivedagents,handlers,i18n,reportsand lackedpicklists,skills; the wiring-sentence case failed. Restored:git status --porcelainempty, blob8f0801f4fac0equal to HEAD.Ablation (one-off, from committed HEAD)
node scripts/ablation-replace.mjsinserted│ ├── reports/ # ABLATED-28954 Analytics reportsback into the tree (anchor# BI dashboards+ newline + theapps/line, 1 → 0; blob8f0801f4fac0→fad5dd511c4f; the marker counted once on disk). The test: 1 failed, 2 passed, the set case receiving+ "reports". The tool restored the file and proved it: blob equal to HEAD8f0801f4fac0,git diff HEADempty;git status --porcelainempty after.Acceptance notes
AGENTS.md. The changeset says how to adopt the fix by hand.Verification
Package tests and typecheck
All readings at head
499412ef(baseee7518f9), afterpnpm install --frozen-lockfileandpnpm --filter 'create-objectstack...' build.pnpm --filter create-objectstack test: 20 files, 304 tests passed (the new file included). Lock verdictcommand-exit 0.pnpm --filter create-objectstack typecheck(tsc --noEmit): exit 0;--listFilescounts the new test file once, so the typecheck covers it.eslint --no-inline-config packages/create-objectstack: exit 0.Derived gates
node scripts/pm/dispatch-gates.mjs --commandsat499412ef: 59 commands. The lane was wound down mid-run (the maintainer's call to wrap up), so the record is partial: 55 ran, 4 NOT MEASURED because the run was stopped before them (check:type-check-debt,check:undeclared-dep-imports,check:watch-hint-literal,check:where-matcher). CI runs all four.check:dual-build-cjs-loadsexit 3, PREREQUISITE NOT MET (needs a full repo build), NOT MEASURED, left to CI.check:lean-entry-closureexit 3 in the loop (objectqldistmissing); afterpnpm --filter '@objectstack/objectql...' buildit answered exit 0 ("Admitted set held exactly (15 packages)").test:repo, the repo-wide lint, and the families outside the derivation. The PR's CI check-runs carry them.!, andClause-②has no(narrowing)arm.Human Minimum
None: the seat reviews and lands it.
Generated by Claude Code