Repository navigation
Conversation
- "Which layer refuses": on 18.2 both verbs strip a non-system caller's readonly value inside ObjectQL; engine.insert no longer keeps it, and the seed-history tripwire the old caveat cited is gone. Measured on 18.2.0. - Seed example: sys_user has no `username` column and 18 refuses a row that carries one; the example now writes `email`, as the test fixture does. - View overlay: the stored overlay is environment-wide on 18.2 (no organization column, response says `env-wide`), not org-scoped. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbaHbCfrMnaJ8UT44ob
维护者速读
改了什么: 只改
为什么改: 升级到 18 以后,这三句话都不对了。照旧文档写种子数据,那一行会被拒收;按旧说法理解只读保护和视图覆盖层的范围,开发者(包括 AI)会做出错误判断。三处都在 18.2 上实测过,或对照源码核实过。 风险与代价(含回滚): 纯文档改动,不影响运行中的应用。回滚只需 revert 这一个提交。两处没有改:一张注明「17.2 实测」的旧表保持原样,因为它是带日期的历史读数;各权限集的 席位意见: 建议合并。diff 只有 你要做的(一个动作): 确认措辞后合并本 PR,并在合并前把它从 draft 转为 ready。受管路径由你合并,席位不合。 席位核对ACCEPT (Tier H, waits for the maintainer) — PR #157 at head
Generated by Claude Code |
|
Seat note at 2026-11-02T06:39Z (duly lane seat, session
The seat does not push to this PR. It is governed and waits on the maintainer. Generated by Claude Code |
Requested by Warren · project thread
Fixes #156
Clause-②: no
Metadata-protocol: none
维护者速读(草稿)
AGENTS.md三处说明,代码、元数据、测试一行没动。①「哪一层拒绝只读字段」那段改写为 18.2 的真实行为;② 种子数据示例里给sys_user写的username换成email;③ 视图自定义覆盖层的存放范围从「按组织」改为「整个环境」。AGENTS.md的「Which layer refuses」一节(风险最大,整段重写),然后是种子示例的sys_user那两行,最后是「Who can customize a view」第一段。AGENTS.md,共 3 处 hunk,文中没有其它改动。What changes
AGENTS.mdonly, three hunks. Each old and new sentence is quoted below, with what it was checked against.1. The readonly-layer caveat (the "One caveat about which layer refuses" section)
Old:
New (heading now "Which layer refuses"):
Checked against:
@objectstack/objectql18.2.0dist/index.js.insert()runsstaticReadonlyCreateStrip(callingstripReadonlyFields(..., { verb: "insert", hookWrittenKeys })) insideif (!opCtx.context?.isSystem), after the post-hook data is collected.@objectstack/metadata-protocol18.2.0 says it in so many words: "Every create-side strip is the ENGINE's — runtime-ownedautonumber(#5503) and static author-declaredreadonly(#14147)". The drop warning reads "the caller-supplied value was DROPPED and the create is being COMMITTED WITHOUT IT — the call returns success while this column takes its declared defaultValue".## 17.4.0, b398ad2: "BREAKING (behaviour): a staticreadonlyfield is now stripped from a non-system caller's INSERT payload insideengine.insert". It also deletedstripReadonlyForInsertfrom metadata-protocol.test/seed-history.test.tsand deleted afterwards. It randata.insert('duly_task', { status: 'open', completed_at, … }, { context, onFieldsDropped }):completed_atread backonFieldsDroppednull{"object":"duly_task","fields":["completed_at"],"reason":"readonly"}{ isSystem: false }null{ isSystem: true }2026-05-04T09:00:00.000Ztest/seed-history.test.ts's header (from Upgrade to @objectstack 18.2.0 #144, c20d397) records the same history.assignment.flow.tssentence is dropped. It explained why flows escaped the hole, and the hole no longer exists.2.
usernamein the seed exampleOld:
New:
Checked against:
@objectstack/platform-objects18.2.0sys_userfields. There is nousername('username' in fieldsgivesfalse), andemailisrequired: true. The new example matchestest/seed-history.test.ts's ownuserSeed({ name: 'seed_user_alice', email: 'alice@example.invalid' }).sys_userrows, one withusername. The loader loggedFailed to write sys_user record #1 (name=seed_user_bob): Unknown field 'username' on object 'sys_user'(thrown by objectqlundeclaredWriteFieldErrors), and onlyseed_user_alicelanded. A direct systemdata.insertwithusernamethrewINVALID_FIELD.3. The org-scoped view overlay wording (around line 241): measured, then corrected
Old:
New:
Measured against a live
pnpm demoon this branch (@objectstack 18.2.0), signed in as the demo admin (platform admin):PUT /api/v1/meta/view/duly_task.defaultwithsortchanged answered200with"message":"Saved customization overlay (env-wide, state=active) — type=view, name=duly_task.default [seq=1]". On 17.2 the answer was(org=…).sys_metadatawent fromtotal: 0to1. The row isscope: "platform",owner: null,environment_id: null,package_id: null,state: "active".sys_metadataobject's field list (GET /api/v1/meta/object/sys_metadata) has noorganization_id.GETof the view returned the new sort, so the overlay replaces the declared view.Tests
Docs-only. The four gates ran on the tree committed as
98a0c23, with the scratch probe already deleted:pnpm validatefield-no-consumers)pnpm typecheckpnpm testpnpm builddist/objectstack.json(234.3 KB)Acceptance notes
@objectstack/rest17.2.0", and its 200 row quotes the 17.2 response(org=…). It is a dated historical measurement and stays true as labelled, so the card's "change nothing else" keeps it. If the seat wants it re-measured on 18.2, that needs a new card.manage_metadatagate for the three Duly sets on 18.2. reason: the demo refuses self-registration (POST /api/v1/auth/sign-up/emailanswered 403), so the three one-set accounts the 17.2 table used could not be created.@objectstack/rest18.2.0 still has the gate as source ("Rewriting stored metadata requires themanage_metadatacapability.", skipped only forisSystem). The sentence that names it was not touched. AnonymousPUTanswered401 UNAUTHENTICATED, the same as 17.2.sys_metadataunder.objectstack/datain my local worktree only. Nothing is committed.Verification
git diff origin/main --statlistsAGENTS.md | 47 +++++++++++++++++++++++++++++------------------, one file and three hunks.Generated by Claude Code