Repository navigation
feat(metadata-protocol): a refused field removal or type change names the views, forms and dashboard cards that still show the field - #35239
Conversation
…ill shows a removed or retyped field Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…er shape and the operator-fit export Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…lit-module family; pins read the computed empty list Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…he new engine double is recorded and bounded Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 175 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 df15ab8302918b497686cc22cb72b3a3703e7d1b && git checkout df15ab8302918b497686cc22cb72b3a3703e7d1b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 00110fd768efd225285dc2d83e8ebd9619fb5b60 92307330a4af57f6f14742254dee68fd54f0469b && git checkout -B drift-repro 00110fd768efd225285dc2d83e8ebd9619fb5b60 && git merge --no-ff 92307330a4af57f6f14742254dee68fd54f0469b
node scripts/docs-audit/affected-docs.mjs --json 00110fd768efd225285dc2d83e8ebd9619fb5b60
|
…-state aliases Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…protocol added The authorable-surface api shard moved by 9 rows for the two new response schemas, so the declaration is added and spec grades minor (seat amendment 6987803352). Adds the Skills-docs line. Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Contract-review-claim: session_01JQwxbXGvw43spR79ztEvWt · head Contract review ( |
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Contract reviewServed-tier: First full review of PR #35239 (card #35147), net diff against merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
S1 (should-fix) — the
Otherwise the schema holds.
Holds as the one judgement. Its single row references
Nits (no effect on correctness or the contract as landed):
No must-fix. One should-fix, S1. Implemented-by: VERDICT: PASS |
…vives a namer failure, loads lint lazily The served view listing never presents an aggregated container, so the type-change half reads a view item's config and the item's own root, plus the userFilters tab filters of either; the unreachable list/listViews rungs are gone. A throw while naming items is caught at the save's call site so the 409 stands. The lint root is loaded with a dynamic import, off the save path's static graph. Describes and changeset say what the served listing produces. Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…ine double Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…oad lint where the refusal now reaches it Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
…structive-still-shown-by
Claude-Session: https://claude.ai/code/session_01JQwxbXGvw43spR79ztEvWt Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Contract-review-claim: session_01JQwxbXGvw43spR79ztEvWt · head Delta contract review ( |
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Contract reviewServed-tier: Delta review of ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentS1: closed. Measured in The tab walk is right. A view item's N1: closed. N2: closed. N6: taken, with a new nit, N9. N7: closed in part, accepted. A test now parses every produced finding through N8: closed. All three sentences are corrected in the changeset. N3, N4, N5: not taken, left as recorded in 6989169773. Accepted deviations. No must-fix, no should-fix. Nits (no effect on correctness or the contract as landed):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#1 · os-warren · session_01JQwxbXKtHccbeakAgquNs9 L1 review · ACCEPT · 2026-11-18T22:07ZHead: At
|
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Landing · 2026-11-18T22:08Z · head
#35244 conflicts with this PR only on the generated |
Fixes #35147
Clause-②: yes (widening: the DESTRUCTIVE_CHANGE answer gains stillShownBy; a new exported operator-fit table)
Metadata-protocol: added
Skills-docs: none — no skill in
skills/**teaches the409 DESTRUCTIVE_CHANGEsave refusal or itsissues[]. The finding's own message now names the items, so a client relaying it says them without being taught.维护者速读
field_removed发现会列出仍在显示该字段的列表视图、表单、数据集、仪表盘卡片、页面、流程和报表(stillShownBy,带具体位置);改类型时列出运算符不再适配新类型的列表视图筛选(例如改成数字后的contains)。os validate那几项检查;读失败时该字段缺省、拒绝照旧。回滚即回退本 PR,无数据或结构迁移。packages/metadata-protocol/src/destructive-still-shown-by.ts(按「有字段/无字段」各判一次取差集)、packages/spec/src/data/filter-operator-field-type-fit.ts(唯一的运算符适配表,只引用文本运算符门的既有裁决)、packages/metadata-protocol/src/protocol-save.ts中接线的那一处。pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.destructive-still-shown-by.test.ts,预期 12 个用例全绿,其中删除status的拒绝同时点名列表视图crm_lead_open与表单crm_lead_edit。What changes
saveMetaItem's409 DESTRUCTIVE_CHANGErefusal of anobjectsave attachesstillShownByto eachfield_removedandfield_type_changefinding inerr.issues. The finding's message ends by naming the same items. Every door already relaysissuesverbatim, so no door changed: the RESTPUTdoors relay it as top-levelissues, the runtime dispatcher asdetails.issues, and the MCP draft door (save_metadata_draft,mode: 'draft') aserror.issues. The duplicate, external-import and unmanaged-import faces carry the message only, and the message names the items.os validateruns:validateReferenceIntegrity,validateFormLayoutandvalidateWidgetBindingsfrom@objectstack/lint. Every finding the second run adds is a place that still shows the field. A widget that reads a dangling dataset dimension or measure is namedviathat dataset. The saved body is judged as the save would write it, with the removed fields' stored definitions put back. The three judges are on lint's root entry only, so they are loaded with a dynamicimport()taken only when afield_removedfinding needs them; the object save path keeps reaching lint through@objectstack/lint/runtimealone ([runtime/metadata] 作者时规则只存在于 CLI:Studio/REST/MCP 的运行时授权面是第四扇门,26 条规则一条不跑——#4409 修完后最大的敞口 #4463), and a failed load leavesstillShownByabsent.viewlisting never presents an aggregated{ list, listViews }container (protocol-meta-list-reads.tsfilters them out after expanding stored ones; measured), so the rules read are a view item'sconfig.filter(the canonical served shape), a flattened list overlay's ownfilter, and theuserFilters.tabs[].filterof either, including inside any-of groups.filterOperatorFieldTypeFitjudges the fit.@objectstack/spec/datagainsfilterOperatorFieldTypeFitandFILTER_OPERATOR_FIELD_TYPE_FIT, with one row per declared-type door that judges an operator class. Today that is the text-operator door, referenced by its own exports (TEXT_FILTER_OPERATORS,textOperatorDoorVerdict), not re-listed.dollarFilterOperatorOfexports the loweringcanonicalAstOperatoralready folds through. I searched for an existing operator-by-type table first: the spec filter vocabulary, the ui filter builder and lint. The engine's declared-type doors live in spec, and the new judgement reuses the one of them that judges operators.operatorsForFieldTypeinui/packages/componentsdecides what a dropdown offers, andpackages/cannot import it. See Acceptance notes.@objectstack/spec/apigainsDestructiveChangeIssueSchemaandFieldStillShownBySchema, plus their author and parsed aliases. ThestillShownBydescribe states what is computed and what is not seen.getMetaItems) and only when a finding needs it: views alone for a type change, and seven types for a removal. It reads no records and no drafts. A listing that cannot be read, a judge that throws or cannot load, or any throw while naming the items leaves the key absent, which means "not computed", and the 409 still throws: the call site catches it, so the enclosing catch never reads it as "skip the safety check".[]means "computed, shown nowhere".Cloud source ported
Read at cloud
origin/mainc21b3723c41a66a9a3c0c27e0f80b87dec8f86f9, read-only:packages/service-ai-studio/src/tools/field-shown-by.ts: the judge-twice semantics, path-to-item grouping and the widget-through-dataset step. These were adapted to this repo's served listings and nestedissues[].packages/service-ai-studio/src/tools/mcp-destructive.ts: thefield_shownentry shape (type/name/where/via). Its MCPconfirmargument and its card copy are hosted-door behaviour and were not moved. Its column-summary rule,view_summary_unfit, was not moved either: that question is about aggregates, and the card asks about filter operators.Nothing hosted-only, no endpoint, no credential and no tenant data moved.
Tests
packages/metadata-protocol/src/protocol.destructive-still-shown-by.test.ts(12 cases). It drives the real producer and covers a removal named on a list view and a form, an exactwhere, an empty[], the HTTP relay (resolveThrownHttpError), the MCP draft save shape, a type change naming acontainsfilter, a served view item at itsconfigpositions (columns, filter and auserFilterstab filter, on both halves), a dashboard card namedviaa dataset, absent versus[]when a listing fails, the 409 standing when naming the items throws, every produced finding parsing throughDestructiveChangeIssueSchema, and a listing bound that is positive and does not grow with the item count.packages/metadata-protocol/src/destructive-still-shown-by.lint-entry.test.ts. No module inprotocol-save.ts's static import closure imports the lint root as a value; the module uses a dynamicimport().packages/rest/src/meta-destructive-still-shown-by-flat-issues.test.ts. The REST door's own writer (handleRouteError) answers the real producer's refusal with a non-emptystillShownByin the flat top-levelissues.packages/spec/src/data/filter-operator-field-type-fit.test.ts. It checks the verdict against everyFieldTypex every text operator, the view-spelling folds, unknown spellings and the formula deferral.protocol.destructive-gate-reachable-types.test.tsand the dogfoodmeta-object-unstored-field-removal.dogfood.test.tsnow also expect the computedstillShownBy: []in their exactissuesassertions.Acceptance notes
protocol-save.ts, notprotocol-write-face.ts; the claim named the wrong file, and seat amendment 6987803352 widened the file surface toprotocol-save.ts(Q1 answered A). The wiring there is 10 lines: one call, plusgetMetaItemsin the host pick.protocol-write-face.tsis untouched. The reader lives indestructive-still-shown-by.ts, outside theprotocol-*split-module family. It is not a moved body, and aprotocol-*name puts its lint collection keyobjectsunder theobjects-tolerance scan.operatorsForFieldType(ui/packages/components/src/custom/filter-builder.tsx) is a dropdown's offer table, not a refusal judge. It answers a different question. Pointing it atfilterOperatorFieldTypeFitwould be aui/change outside this card.formula), dotted paths, drafts, and item types not listed. All of this is stated in the describe, together with the literal(root)inwhereand an item appearing in more than one entry.config.columns[1],columns[1]), and the unreachablelist/listViews.*rungs and the container-name fallback are gone. N1, N2, N7 and N8 are taken; N3 to N6 are recorded only. The L1 note on the lint entry is taken too: the root is loaded lazily, and a lint-entry test pins it.@objectstack/lint/runtimedoes not export the three judges, and adding them there would mean editingpackages/lint/src/**, which is outside this claim.#35240landed, soorigin/mainb02484e13awas merged into the branch throughscripts/pm/os-regen-merge.sh. Afterwards the generated chain was rebuilt on the committed merge:gen:schema,gen:export-origins,gen:declaration-map,gen:api-surface,gen:strictness-ledgerandgen:docs, withcheck:generatedreporting all 14 current. Against main, the branch's generated diff holds only this PR's rows.packages/spec/authorable-surface/api.jsonmoved: 9 rows for the two new response schemas. That is a protocol addition, so the declaration isMetadata-protocol: addedand the changeset grades@objectstack/specminor(seat amendment 6987803352, Q2);@objectstack/metadata-protocolstayspatch.Verification
Fix round: red on the previous head, N1 ablation, dogfood file
Red leg:
destructive-still-shown-by.tsandprotocol-save.tswere restored from8ee295be69. The pins went 4 failed, 10 passed of 14: the two lint-entry cases, the 409-stands-on-throw case, and theuserFilterstab filter on a type change. The 10 that passed pin behaviour that this round leaves unchanged. Restored withgit checkout HEAD; blob hashes matched HEAD andgit diff HEADwas empty.N1 ablation (source-resolved;
metadata-protocoltests import./protocol.js):scripts/ablation-replace.mjsputthrow error;into the call-site catch inprotocol-save.ts, and the anchor went 1 to 0 on disk. The pin went 1 failed, 11 passed: the 409-stands-on-throw case. On restore, the blob matched HEADd5b5ad9a9a45.Dogfood: after building the dogfood dependency closure,
meta-object-unstored-field-removal.dogfood.test.tsran under the lock withVERDICT command-exit 0: 1 file, 3 tests passed.Red on main's wiring, green with it
The red leg restored
protocol-save.tsfromec227fc7b1: 5 failed, 1 passed of 6. The one pass is the read-bound case, which passes trivially with no reads. Restored to HEAD, with a hash match: 6/6 passed.Ablation (dist-resolved, spec rebuilt both legs)
The mutation was
verdict === 'door-refusal' ? 'unfit'becomingverdict === 'ABLATED_35147' ? 'unfit'infilter-operator-field-type-fit.ts, done viascripts/ablation-replace.mjs.ablation-dist-preflightfound the marker in 2 built files, and the pin went 1 failed, 5 passed: the type-change case. On restore, the blob matched HEAD, the spec was rebuilt, preflight with--absentfound the marker in none of 608 files, the pin went 6/6, and the whole-treegit statuswas clean.Generated by Claude Code