Skip to content

feat(lint): refuse a transferBehavior cascade the Change Owner action can never offer - #37382

Queued
objectstack-fleet[bot] wants to merge 8 commits into
mainfrom
claude/issue-36714-transfer-cascade-lint
Queued

objectstack-fleet[bot] wants to merge 8 commits into
mainfrom
claude/issue-36714-transfer-cascade-lint

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Fixes #36714
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #35769 (row 7178935378: skills/objectstack-data/rules/relationships.md, the three lint refusals)

维护者速读

  • 用户能看到什么变化:应用作者在命令行校验、构建或检查应用时,若关联字段声明了「变更负责人时连带转移」而这种转移永远不会发生(父对象不提供变更负责人、经对象扩展加到不支持它的对象上、或子对象的接口不允许更新),现在会直接报错并写明怎么改;最终用户无感,运行时行为不变。
  • 为什么做:数据模型专区「声明了就要生效」的收尾,替变更负责人连带转移功能补上作者期的提醒。
  • 出错会怎样:若判断有误,作者的应用会在命令行校验时被误拦,改字段或对象即可通过;不影响已部署的应用和工作室保存,可直接撤回。
  • 要你做什么:无。

What changes

A transferBehavior: 'cascade' that the Change Owner endpoint can never offer used to parse silently (ADR-0049, declared but not enforced). One new @objectstack/lint rule, validateTransferCascades, refuses each of the card's three cases at error, with the fix in the hint:

Rule id Case Verdict from (spec, @objectstack/spec/data)
transfer-cascade-parent-without-change-owner 1: the reference points at a parent in the stack that does not offer Change Owner resolveUserActionTransfer + transferIneligibilityReason (what the endpoint's changeOwnerOffReason asks)
transfer-cascade-extension-child-ineligible 2: an objectExtensions[].fields field cascades onto an object that cannot take a cascade transferCascadeIneligibilityReason (what refuseIneligibleTransferCascades and transferCascadeRelations ask)
transfer-cascade-child-update-unexposed 3: the child's enable block does not serve update apiExposureDenialReason (canServeApiOperation is its boolean face, the exposure filter in transferCascadeRelations)
  • packages/lint/src/validate-transfer-cascades.ts: the walk only. Objects are judged as served (objectsAsServed, every extension field folded in), since transferCascadeRelations reads the registered, merged definitions. An object the stack does not declare is skipped on either side. Only single-value lookup / master_detail fields are judged; off-type, multi-value and sys_-parent cascades stay the field parse's refusals and are not reported twice.
  • Registered in authoring-rules.ts: gating, all three commands, surfaces: CLI_ONLY with a surfaceReason (see Acceptance notes). Exported from the barrel (rule ids included), and the three ids have os explain entries in rule-explanations.ts (inserted, not reordered).
  • packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts: the ADR-0087 ledger entry check:adr-0087-registration requires for a Metadata-protocol: narrowed changeset. It is a data file, not a schema change.
  • Docs: one sentence in content/docs/api/data-api.mdx beside the existing multi-value refusal, and the CLI transcripts' author-time rule count 79 → 80 (check:docs-transcript-drift).
  • Changeset: @objectstack/lint minor, @objectstack/spec minor (the kind is narrowed).

Mechanism assumptions measured at origin/main 98bda0a before code: A1 holds (the predicates are exported from @objectstack/spec/data; lint imports them the way validate-managed-api-methods.ts does, no third copy). A2: error, following validateManagedApiMethods (a declaration decidable from the stack that the runtime silently drops) and the parse's own refusal of the declaring object's half. A3 holds (child.enable through the exposure predicate). A4: the two validate-predicate-path-refs.test.ts pins count form predicates, not registry entries; nothing moved.

Files to read first, by risk:

  1. packages/lint/src/validate-transfer-cascades.ts — validateTransferCascades, the served-object lookup and the sys_ / not-declared skips.
  2. packages/lint/src/authoring-rules.ts — the new entry's tier and surfaceReason.
  3. packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts.

Tests

packages/lint/src/validate-transfer-cascades-36714.test.ts: every fixture is a full ObjectSchema / ObjectExtensionSchema parse, so each refusal is one the parse lets through. Each case is refused with its rule, severity, where, path and the reason fragment its message names; each eligible shape passes (an eligible parent, a parent outside the stack, a sys_ parent, an eligible extension target, a target outside the stack, update served); the packages[] artifact shape is read; and the fieldPatches arm is pinned as refused by the schema.

Local runs at 3e1fa4a (lint, spec, ablation)
  • pnpm --filter @objectstack/lint test: Test Files 236 passed (236), Tests 9648 passed, 5 skipped (VERDICT command-exit 0).
  • pnpm --filter @objectstack/lint typecheck: VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec test: Test Files 894 passed, 1 skipped (895), Tests 28417 passed (VERDICT command-exit 0).
  • pnpm --filter @objectstack/cli exec vitest run test/migrate-meta-engine-guidance.test.ts: 3 passed.
  • Ablation (rule committed first): scripts/ablation-replace.mjs replaced the walk's for (const site of cascadeSites(stack)) with an empty loop, x0 -> x1 on disk; the card's test file went 15 failed, 9 passed (24). Every refusal case red, every pass case green. Restored: blob == HEAD, git diff HEAD empty.

Acceptance notes

  • The Clause-②: line carries the (narrowing) arm (body and changeset, commit 8737482): Check Changeset reads Metadata-protocol: narrowed beside a clause line without the arm as a contradiction. The claim's Clause-②: no was copied first, at 3e1fa4a.
  • Premise, partly narrower than written: case 2's fieldPatches arm cannot occur. A field patch carries display properties only (label, description, inlineHelpText, placeholder), and ObjectExtensionSchema refuses transferBehavior there as an unrecognized key, so the rule walks extension fields only; a test pins the refusal.
  • Not on the runtime publish gate yet (surfaces: CLI_ONLY): the door's objects are served definitions carrying the injected owner_id as a declared field, which the eligibility predicate reads (its readonly, and on an external object whether it is declared). Crossing owes that measurement or a read-back to the authored shape, as lintDuplicateFieldLabels does. Until then a Studio or MCP save of these shapes still passes. The runtime stays safe.
  • Boundary: a cascade on a field an object declares itself, where only an extension makes the served object ineligible, is not reported as case 2 (the card scopes case 2 to extension fields; the object's own half is the parse's).
  • File surface: the ADR-0087 ledger entry under packages/spec/src/migrations/entries/semantic/ is outside the claim's listed surface. check:adr-0087-registration requires it for narrowed; it changes no schema and no runtime.
  • First-party exposure: zero. No example app, platform object, skill or docs sample declares a cascade.
  • Other open PRs that add an author-time rule (feat(ai): a context pack's related list takes where / orderBy / limit (ADR-0160 row 11) #37354, feat(security)!: View All and Modify All stop opening fields; viewAllFields is the one every-field bit #37371) move the same transcript count; whichever lands second gets a one-number docs conflict or a check:docs-transcript-drift red.

Verification

Two-minute check: pnpm --filter @objectstack/lint exec vitest run src/validate-transfer-cascades-36714.test.ts prints 24 passed.

Gates: local derivation and reconciliation

node scripts/pm/dispatch-gates.mjs --ran at 3e1fa4a: 117 derived, 113 run, 4 NOT-MEASURED, 0 UNRUN. All 113 run exited 0. NOT-MEASURED, left to CI:

  • check:type-check-debt: the 300 s local timeout fired (repo-wide tsc census).
  • check-plugin-teardown-shape.mjs --self-test: shallow checkout.
  • spec check:skill-examples: its client SDK surface reads packages/client-react dist, not built locally.
  • check:dual-build-cjs-loads: reads every workspace dist.

Outside the derivation, local-only: check:dev-prereqs exit 1, because 104 of 110 workspace packages are unbuilt in this container (machine state, not this diff).

🤖 Generated with Claude Code

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 28 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/lint/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/queues-and-assignment-rules.mdx (via business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/data-modeling/objects.mdx (via business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/deployment/validating-metadata.mdx (via AUTHORING_RULES (symbol, a top-level const object), business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/permissions/index.mdx (via business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/permissions/permissions-matrix.mdx (via business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/permissions/sharing-rules.mdx (via business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/protocol/objectql/security.mdx (via business_unit (literal, a string literal in a comment on a changed line))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/implementation-status.mdx (via business_unit (literal, a string literal in a comment on a changed line))
  • content/docs/releases/v17/17-0.mdx (via business_unit (literal, a string literal in a comment on a changed line))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/lint/src/index.ts) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: master_detail (literal, 49 pages)
  • 14 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 176 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f13af1dc014a8c6819c02500dda8f683bbabd108 — the merge of head df622665dbdf34a43b0790ac4887404f7281a802 into base ff6f9768d2969c4f2f42819f461424965238e30f, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f13af1dc014a8c6819c02500dda8f683bbabd108 && git checkout f13af1dc014a8c6819c02500dda8f683bbabd108
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ff6f9768d2969c4f2f42819f461424965238e30f df622665dbdf34a43b0790ac4887404f7281a802 && git checkout -B drift-repro ff6f9768d2969c4f2f42819f461424965238e30f && git merge --no-ff df622665dbdf34a43b0790ac4887404f7281a802

node scripts/docs-audit/affected-docs.mjs --json ff6f9768d2969c4f2f42819f461424965238e30f

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs ff6f9768d2969c4f2f42819f461424965238e30f → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…e reference-target arbiter

Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Final head for L1 + L2 · area o5-D · 2026-11-26T01:47Z
Head-sha: ffd2cb6dad60dea5c001504c889831f969a869e9
Check-runs at this head: 70 completed — 60 success, 10 skipped (expected: no UI path, queue/push-only, opt-in), 0 failure. Draft.
Diff: +674 −4, 13 files (packages/lint/src/** new rule + card test + registration, one test-only CALLERS row in packages/core/src/security/second-object-read-exposure.pin.test.ts, changeset). Clause-②: no (narrowing) · Metadata-protocol: narrowed (claim amendment 7180121254) · Skills-docs: follow-up #35769. Not governed. Owes a contract-review-tier L2 (narrowing).
Earlier reds: Check Changeset (clause/level contradiction, fixed 8737482b); Test Core 9/10 (pin CALLERS row, fixed ffd2cb6d); Type Check / Test UI at 3e1fa4a6 were runs cancelled by the next push. Dogfood battery: passed at 8737482b; the re-run at this head is under way and lands as a fresh os-dev-report on #36714.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head ffd2cb6 · 2026-11-26T01:48Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: ffd2cb6dad60dea5c001504c889831f969a869e9
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts + packages/lint/src/validate-transfer-cascades.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/rule-explanations.ts, packages/lint/src/index.ts, packages/lint/src/validate-transfer-cascades-36714.test.ts, packages/core/src/security/second-object-read-exposure.pin.test.ts, .changeset/transfer-cascade-lint.md
Security-touching: yes
Rule-change-verified: none

Inputs read: card #36714 (body, triage 7102255110, claim 7177897953, dev report 7178906203, claim amendment 7180121254), the PR body, the net diff origin/main...pr-37382 (13 files, +674/−4), and the 70 check-runs on this head (60 success, 10 skipped, 0 failure; Check Changeset, Lint · CI, release & engine gates, Test Core, TypeScript Type Check, Dogfood Regression Gate, Build Docs all success). Code outside the diff was read on origin/main, never reviewed: packages/core/src/security/change-record-owner.ts, packages/rest/src/change-owner-routes.ts, packages/spec/src/data/user-action-transfer.ts, api-derivation.ts, injected-system-column-provenance.ts, field.zod.ts, object.zod.ts, packages/lint/src/object-graph.ts.

① Derived judgments

  • Accept set of os validate / os build / os lint: narrowed. Right, and declared. A stack that parsed and built before is now refused at error (tier gating, all three commands) in three shapes. Clause-②: no (narrowing) + Metadata-protocol: narrowed on the PR body, the changeset and claim amendment 7180121254 agree.
  • The refused set equals the runtime's never-offered set, for what a stack can decide. Right. Read against main:
    • Case 1 (transfer-cascade-parent-without-change-owner): the cascade is reachable only through a Change Owner of the parent; both doors (offeredDefinition in core, the GET …/change-owner/cascades handler in rest) throw 403 CHANGE_OWNER_DISABLED when changeOwnerOffReason(object, def) answers, before transferCascadeRelations is called. The rule's parentOffReason is the same three-step function (resolveUserActionTransfer(def).enabled → transferIneligibilityReason → authored switch vs controlled_by_parent default), on the same spec predicates. No arm refused that the endpoint serves.
    • Case 2 (transfer-cascade-extension-child-ineligible): transferCascadeRelations drops a child when transferCascadeIneligibilityReason(child) !== undefined; the rule asks the same predicate of the served child. Limited to extension fields because refuseIneligibleTransferCascades already refuses the object's own fields at parse.
    • Case 3 (transfer-cascade-child-update-unexposed): the runtime filter is canServeApiOperation(child.enable, 'update'), defined as apiExposureDenialReason(…) === null; the rule calls apiExposureDenialReason(childDef.enable, 'update'). Identical verdict.
    • Field filter: declaresCascade is byte-for-byte the runtime's ('cascade', lookup | master_detail, multiple !== true), and the parent is read through referenceTargetOf with the same try/catch.
  • No false refusal found. Unknown objects are skipped on both sides (a parent or an extension target the stack does not declare), a sys_ parent is left to FieldSchema. Authored vs registered shape: transferIneligibilityReason reads resolveInjectedSystemColumns / resolveInjectedColumnProvenance, which are documented and built to give one verdict for pre-injection and post-injection input (an absent owner_id and the platform's own definition both read as the platform anchor), and ownerFieldDeclaredReadonly reads both fields shapes, so judging the authored stack agrees with the runtime judging the registered definition. ObjectExtensionSchema's merge carries no userActions, ownership, managedBy, sharingModel or enable, so no other package can flip a verdict except by adding a field, which objectsAsServed folds in for the stack's own extensions.
  • fieldPatches arm of the card's case 2 cannot occur. Right. The patch shape refuses transferBehavior as an unrecognised key; a test pins it. The card's premise is narrower than written, and the PR says so.
  • Public surface of @objectstack/lint: added (validateTransferCascades, three rule-id constants, TransferCascadeFinding). Right, exported from the barrel beside its siblings.
  • @objectstack/spec: one data file (the ADR-0087 semantic entry); no schema, no export, no generated artifact moves. Right.
  • @objectstack/core: one CALLERS row in a .pin.test.ts. The package publishes dist, README.md, CHANGELOG.md only; nothing ships. Right, and the row's classification (not-a-served-read, authoring-time static analysis) is true of the new caller of referenceTargetOf.
  • Wiring matches the siblings (validateAiContext / ai-context-*, feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173): registry entry in authoring-rules.ts with source, surfaces and a surfaceReason; barrel export; one os explain entry per id in rule-explanations.ts and in RULE_EXPLANATIONS; the second-object-read-exposure pin row; the four CLI transcripts 79 → 80 (no fifth transcript carries the count).

② Semver level

  • @objectstack/lint minor and @objectstack/spec minor: right. The kind is narrowed, which takes at least minor on each package the diff moves; both are moved, @objectstack/core is not (test file only) and is correctly absent.
  • Clause-②: no (narrowing): right. No published accept set of the spec schema or public surface widens (new lint exports are additive API, not a metadata accept set); the authoring tools refuse what they accepted. The arm is on the PR body, the changeset body and the claim amendment.
  • ADR-0087: the changeset carries exactly one marker, registered transfer-cascade-never-offered-refused, and the entry of that id exists in the diff. The FROM → TO and the one-line fix are in the changeset body (Fix: set the field's transferBehavior to 'none' or remove it, or change the object the message names).
  • S1 (should-fix) — the changeset has no **BREAKING** banner and no ! in its summary (feat(lint): refuse …). scripts/check-changeset-no-major.mjs names the banner as a mandatory carrier of breaking-ness during the launch window, AGENTS.md calls (narrowing) BREAKING, and all twelve Clause-②: no (narrowing) changesets sampled on main carry it. The gate is green because the arm alone is a breaking signal, but the text that ships as CHANGELOG.md in two npm packages tells a consumer about the break only through a process token. Fix: feat(lint)!: and a **BREAKING:** lead on the paragraph that names the three refusals.

③ Boundary flags

  • Dev flag, file surface widened to packages/spec/src/migrations/entries/semantic/: accepted. check:adr-0087-registration requires the entry for narrowed; the claim's ⛔ was on schema changes under packages/spec/src/**, and this is ledger data. The amendment 7180121254 adds the core pin row to the surface; same judgment.
  • Dev flag, surfaces: CLI_ONLY: accepted for this PR, with S2 below. A Studio or MCP save of the three shapes still passes; the runtime stays safe because transferCascadeRelations re-judges.
  • S2 (should-fix) — the crossing to the runtime publish gate is owed in three places (surfaceReason, the explanations' scope paragraph, the changeset) and no card number carries it. Until it lands, ADR-0049 holds at the CLI door only and the two doors disagree on the same document. The stated obstacle also looks weaker than written: resolveInjectedColumnProvenance is built to answer the same for an injected owner_id present in the registered definition as for one absent from the authored document, so the measurement is likely short. File the card and name it in the surfaceReason.
  • Dev flag, an own-field cascade made ineligible only by an extension is not reported: see N1.
  • Dev flag, transcript-count collision with feat(ai): a context pack's related list takes where / orderBy / limit (ADR-0160 row 11) #37354 / feat(security)!: View All and Modify All stop opening fields; viewAllFields is the one every-field bit #37371: a queue-order matter, no contract effect; whichever lands second moves one number.
  • Skills-docs: follow-up #35769 (row 7178935378): verified. The row exists on Skills revisions · week of 2026-11-20: shipped skills/** text fixes batched into one PR #35769 (open), names skills/objectstack-data/rules/relationships.md and the three refusals, ordered after this PR merges. The skill paragraph on main stays true after this PR (it lists the parse refusals); it is incomplete, not wrong.
  • Dogfood battery on the final head (owed by the amendment): Dogfood Regression Gate success on this head.
  • No open_questions on the card or the report.
  • SQL push-down: not applicable. The rule reads metadata only; no query, no id materialisation, no in-app join.

④ Design judgment

The narrowing against the published spec on main: it takes no declared capability away. transferBehavior: 'cascade' keeps every case in which the Change Owner endpoint acts on it; the three refused shapes are ones the endpoint already drops on every call, silently. The rule makes the spec's own contract (liveness row transferBehavior: "offers and runs only declared single-value cascades whose child offers Change Owner") real at author time, which is what ruling 7000907189 point 4 ("parse or lint") and ADR-0049 ask. error is the right severity: each verdict is decidable from the stack, and the object's-own-field half of case 2 is already a parse error, so a warning here would grade the same mistake two ways.

  • packages/lint/src/validate-transfer-cascades.ts against change-record-owner.ts: agrees, as ① sets out. The file imports the predicates and holds only the walk, so the two cannot drift by re-implementation; the remaining drift surface is the walk's field filter, which is the runtime's.
  • packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts against the rule: surface lists every arm transferIneligibilityReason has plus both switch-off origins, both extension and own-field carriers, and both exposure reasons; replacement names the three ids; the acceptance route GET /api/v1/data/PARENT/change-owner/cascades is the registered route. "No mechanical rewrite" is right: dropping the cascade and changing the object are different intents.
  • rule-explanations.ts: the three entries state where the verdicts come from, what is skipped and that the publish gate does not run them yet. Accurate against the code.
  • content/docs/api/data-api.mdx: the added sentence is accurate and sits beside the existing multi-value refusal.
  • N1 (nit) — a cascade on a field the object declares itself, on an object that is eligible as authored but ineligible as served (an in-stack extension declares owner_id readonly: true on it, or the like), is refused by neither the parse (authored object is eligible) nor case 2 (extension fields only), and the runtime never offers it. Exotic, disclosed, runtime-safe. The served child is already in hand at that point: judging every site against it and reporting a non-extension site only when the authored object passes would close it.
  • N2 (nit) — the test pins four of the parent arms (org, none, managedBy, switch off) and the controlled_by_parent default. business_unit, systemFields: false, a readonly owner_id, an unprovable external owner and the object form userActions.transfer: { enabled: false } are covered only through the shared predicate's own tests. Enough for the contract; a row for the readonly owner_id arriving through an extension would also pin the served-object read on the parent side.
  • N3 (nit) — parent !== undefined && in the case-1 condition is redundant (parentReason is defined only when parentDef is, which requires parent).

No must-fix. S1 and S2 are text and a card; neither changes what the rule refuses.

Implemented-by: claude/issue-36714-transfer-cascade-lint
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: ffd2cb6dad
REWORK — L1, seat repo:objectstack#5: the two should-fix findings of contract record 7180267565 are fixed in this PR before landing, and the dogfood battery is read on the final head; the rest of L1 reads clean.

  1. Shape: open draft against main, 13 files (+674/−4), Fixes #36714, Clause-②: no (narrowing) and Metadata-protocol: narrowed (amendment 7180121254). l1-face flags two items:
    • changeset on @objectstack/core is a false positive: the only core file is second-object-read-exposure.pin.test.ts, which ships nothing.
    • dogfood is owed on the final head. The battery passed at 8737482b, and the refreshed os-dev-report at the final head is still due.
  2. Premise: the record finds the rule refuses exactly what the Change Owner runtime on main never offers, and no false refusal. Case 1 shares changeOwnerOffReason, case 2 shares transferCascadeIneligibilityReason, and case 3 is apiExposureDenialReason behind canServeApiOperation. The rule is wired like the ai-context-* siblings.
  3. Owed in this PR:
  4. Accepted deviations: contract nits N1 (an own-field cascade made ineligible only by an in-stack extension, disclosed, runtime safe), N2 (the five unpinned parent arms, covered by the shared predicate's tests) and N3 (a redundant parent !== undefined).
  5. Out of scope and where it went: Skills-docs follow-up row 7178935378 on Skills revisions · week of 2026-11-20: shipped skills/** text fixes batched into one PR #35769. The publish-gate crossing goes to the card S2 asks for.
  6. Landing terms: ungoverned, default tier, Security-touching: yes. A same-head at-tier PASS with S1 and S2 closed, a dogfood_battery on that head in the os-dev-report, and an ACCEPT are owed. The area lands it.

…rossing named as follow-up #37397

Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head df62266 · 2026-11-26T02:43Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: df622665dbdf34a43b0790ac4887404f7281a802
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts + packages/lint/src/validate-transfer-cascades.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/rule-explanations.ts, packages/lint/src/index.ts, packages/lint/src/validate-transfer-cascades-36714.test.ts, packages/core/src/security/second-object-read-exposure.pin.test.ts, .changeset/transfer-cascade-lint.md
Security-touching: yes
Rule-change-verified: none

Delta review. The prior record of this session reviewed ffd2cb6d whole; this one re-reads the head df622665 as the net diff against main (13 files, +682/−4) and the delta ffd2cb6d..df622665 (3 files, +10/−2: the changeset, a comment in authoring-rules.ts, a comment in rule-explanations.ts). No executable line, string literal, test or schema moved in the delta, so every judgment below that cites code stands as read on the earlier head. Inputs read: card #36714 (body, triage 7102255110, claim 7177897953, report 7178906203, claim amendment 7180121254, report 7181027705), follow-up #37397, the PR body, and the 70 check-runs on this head (60 success, 10 skipped, 0 failure; Check Changeset, Lint · CI, release & engine gates, Lint · docs & code guards, Test Core, TypeScript Type Check, Dogfood Regression Gate, Build Docs all success). Code outside the diff was read on origin/main, never reviewed: packages/core/src/security/change-record-owner.ts, packages/rest/src/change-owner-routes.ts, packages/spec/src/data/user-action-transfer.ts, api-derivation.ts, injected-system-column-provenance.ts, field.zod.ts, object.zod.ts, packages/lint/src/object-graph.ts, and for the deviation scripts/check-doc-authoring.mjs and packages/lint/src/rule-explanations.test.ts.

① Derived judgments

  • Accept set of os validate / os build / os lint: narrowed. Right, and declared. A stack that parsed and built before is now refused at error (tier gating, all three commands) in three shapes. Clause-②: no (narrowing) + Metadata-protocol: narrowed on the PR body, the changeset and claim amendment 7180121254 agree.
  • The refused set equals the runtime's never-offered set, for what a stack can decide. Right. Read against main:
    • Case 1 (transfer-cascade-parent-without-change-owner): the cascade is reachable only through a Change Owner of the parent; both doors (offeredDefinition in core, the GET …/change-owner/cascades handler in rest) throw 403 CHANGE_OWNER_DISABLED when changeOwnerOffReason(object, def) answers, before transferCascadeRelations is called. The rule's parentOffReason is the same three-step function (resolveUserActionTransfer(def).enabled → transferIneligibilityReason → authored switch vs controlled_by_parent default), on the same spec predicates. No arm refused that the endpoint serves.
    • Case 2 (transfer-cascade-extension-child-ineligible): transferCascadeRelations drops a child when transferCascadeIneligibilityReason(child) !== undefined; the rule asks the same predicate of the served child. Limited to extension fields because refuseIneligibleTransferCascades already refuses the object's own fields at parse.
    • Case 3 (transfer-cascade-child-update-unexposed): the runtime filter is canServeApiOperation(child.enable, 'update'), defined as apiExposureDenialReason(…) === null; the rule calls apiExposureDenialReason(childDef.enable, 'update'). Identical verdict.
    • Field filter: declaresCascade is byte-for-byte the runtime's ('cascade', lookup | master_detail, multiple !== true), and the parent is read through referenceTargetOf with the same try/catch.
  • No false refusal found. Unknown objects are skipped on both sides (a parent or an extension target the stack does not declare), a sys_ parent is left to FieldSchema. Authored vs registered shape: transferIneligibilityReason reads resolveInjectedSystemColumns / resolveInjectedColumnProvenance, which are documented and built to give one verdict for pre-injection and post-injection input (an absent owner_id and the platform's own definition both read as the platform anchor), and ownerFieldDeclaredReadonly reads both fields shapes, so judging the authored stack agrees with the runtime judging the registered definition. ObjectExtensionSchema's merge carries no userActions, ownership, managedBy, sharingModel or enable, so no other package can flip a verdict except by adding a field, which objectsAsServed folds in for the stack's own extensions.
  • fieldPatches arm of the card's case 2 cannot occur. Right. The patch shape refuses transferBehavior as an unrecognised key; a test pins it. The card's premise is narrower than written, and the PR says so.
  • Public surface of @objectstack/lint: added (validateTransferCascades, three rule-id constants, TransferCascadeFinding). Right, exported from the barrel beside its siblings.
  • @objectstack/spec: one data file (the ADR-0087 semantic entry); no schema, no export, no generated artifact moves. Right.
  • @objectstack/core: one CALLERS row in a .pin.test.ts. The package publishes dist, README.md, CHANGELOG.md only; nothing ships. Right, and the row's classification (not-a-served-read, authoring-time static analysis) is true of the new caller of referenceTargetOf.
  • Wiring matches the siblings (validateAiContext / ai-context-*, feat(ai): ai_context context packs and the get_record_context tool over MCP (ADR-0160 row 5) #37173): registry entry in authoring-rules.ts with source, surfaces and a surfaceReason; barrel export; one os explain entry per id in rule-explanations.ts and in RULE_EXPLANATIONS; the second-object-read-exposure pin row; the four CLI transcripts 79 → 80 (no fifth transcript carries the count).

② Semver level

  • @objectstack/lint minor and @objectstack/spec minor: right. The kind is narrowed, which takes at least minor on each package the diff moves; both are moved, @objectstack/core is not (test file only) and is correctly absent.
  • Clause-②: no (narrowing): right. No published accept set of the spec schema or public surface widens (new lint exports are additive API, not a metadata accept set); the authoring tools refuse what they accepted. The arm is on the PR body, the changeset body and the claim amendment.
  • ADR-0087: the changeset carries exactly one marker, registered transfer-cascade-never-offered-refused, and the entry of that id exists in the diff. The FROM → TO and the one-line fix are in the changeset body (Fix: set the field's transferBehavior to 'none' or remove it, or change the object the message names).
  • S1: closed. The changeset body now opens its prose with **BREAKING** for a stack that declares one of these cascades: …, naming who is broken, that the fix follows, and that no data changes. The banner is the spelling check-adr-0087-registration reads as its BREAKING signal, beside the arm and the kind; Check Changeset and Lint · CI, release & engine gates are success on this head. The marker count is still exactly one.

③ Boundary flags

④ Design judgment

The narrowing against the published spec on main: it takes no declared capability away. transferBehavior: 'cascade' keeps every case in which the Change Owner endpoint acts on it; the three refused shapes are ones the endpoint already drops on every call, silently. The rule makes the spec's own contract (liveness row transferBehavior: "offers and runs only declared single-value cascades whose child offers Change Owner") real at author time, which is what ruling 7000907189 point 4 ("parse or lint") and ADR-0049 ask. error is the right severity: each verdict is decidable from the stack, and the object's-own-field half of case 2 is already a parse error, so a warning here would grade the same mistake two ways.

  • packages/lint/src/validate-transfer-cascades.ts against change-record-owner.ts: agrees, as ① sets out (file unchanged in the delta). The file imports the predicates and holds only the walk, so the two cannot drift by re-implementation; the remaining drift surface is the walk's field filter, which is the runtime's.
  • packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts against the rule: surface lists every arm transferIneligibilityReason has plus both switch-off origins, both extension and own-field carriers, and both exposure reasons; replacement names the three ids; the acceptance route GET /api/v1/data/PARENT/change-owner/cascades is the registered route. "No mechanical rewrite" is right: dropping the cascade and changing the object are different intents.
  • rule-explanations.ts: the three entries state where the verdicts come from, what is skipped and that the publish gate does not run them yet. Accurate against the code.
  • content/docs/api/data-api.mdx: the added sentence is accurate and sits beside the existing multi-value refusal.
  • N1 (nit) — a cascade on a field the object declares itself, on an object that is eligible as authored but ineligible as served (an in-stack extension declares owner_id readonly: true on it, or the like), is refused by neither the parse (authored object is eligible) nor case 2 (extension fields only), and the runtime never offers it. Exotic, disclosed, runtime-safe. The served child is already in hand at that point: judging every site against it and reporting a non-extension site only when the authored object passes would close it.
  • N2 (nit) — the test pins four of the parent arms (org, none, managedBy, switch off) and the controlled_by_parent default. business_unit, systemFields: false, a readonly owner_id, an unprovable external owner and the object form userActions.transfer: { enabled: false } are covered only through the shared predicate's own tests. Enough for the contract; a row for the readonly owner_id arriving through an extension would also pin the served-object read on the parent side.
  • N3 (nit) — parent !== undefined && in the case-1 condition is redundant (parentReason is defined only when parentDef is, which requires parent).

No must-fix and no should-fix open. The delta breaks nothing: it adds one changeset paragraph and two comments, and every check-run on this head is success or skipped. N1 to N3 stand as nits; N1 is not in #37397's scope and may ride with it or be left.

Implemented-by: claude/issue-36714-transfer-cascade-lint
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: df622665dbdf34a43b0790ac4887404f7281a802
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 13 files, Fixes #36714, Clause-②: no (narrowing), Metadata-protocol: narrowed. The delta since ffd2cb6d is 3 files (+10/−2): a changeset paragraph, a changeset clause and two code comments.
  2. Rework closed (contract record 7181096465):
  3. Gates: check-runs at df622665db: 60 success, 10 expected skip, 0 failed. Dogfood Regression Gate is green. dogfood_battery at this head is in the os-dev-report, card comment 7181027705 (487 files passed, 3 skipped, exit 0).
  4. Accepted deviations: (a) the comment-only placement of lint: refuse the three never-offered transferBehavior: 'cascade' shapes at the runtime publish gate too (Studio and MCP saves), not only in os validate / build / lint #37397 (above); (b) contract nits N1–N3.
  5. Out of scope and where it went: the publish-gate crossing goes to lint: refuse the three never-offered transferBehavior: 'cascade' shapes at the runtime publish gate too (Studio and MCP saves), not only in os validate / build / lint #37397. Skills-docs is row 7178935378 on Skills revisions · week of 2026-11-20: shipped skills/** text fixes batched into one PR #35769.
  6. Landing terms: ungoverned, default tier, narrowing. L2 at CONTRACT_REVIEW_TIER: PASS, comment 7181096465, same head, no must-fix, no should-fix. Security-touching: yes. The area lands it via landing-operations §B (--land reads the dogfood report).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Landing · area o5-D · 2026-11-26T02:49Z · on L1 ACCEPT 7181123147 and contract review PASS 7181096465 at df622665dbdf34a43b0790ac4887404f7281a802

Probe Reading
check-governed-merges.mjs --pr 37382 NOT governed · 0 of 13 paths · 686 changed lines ≤ 3000
landing-k.mjs --pr 37382 K = 5 < 15 · no locale pack · no shared book moved
dogfood battery ((narrowing) arm) run at this head, os-dev-report 7181027705: 487 files passed, 3 skipped; VERDICT command-exit 0

State: ready + auto-merge now; on MERGED the area closes out #36714 (Fixes); the publish-gate half stays on #37397.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 02:49
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Any commits made after this event will not be merged.
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

  • 改了什么:新增一条校验规则。对象字段写了 transferBehavior: 'cascade'(换负责人时连带转移子记录),但运行时的「换负责人」动作永远不会提供这个连带时,os validate 和构建直接报错。三种情况:父对象关了换负责人、子对象是不合格的扩展、子对象不开放更新接口。
  • 为什么:这类声明写了也不会生效。按「声明即强制」改为构建时响亮拒绝,防止 AI 写出无效配置。
  • 风险:属于收窄,以前能构建的这三种写法现在报错。规则与运行时共用同一组判定函数,复核没有找到误拒;dogfood 全量在现 head 通过(487 个文件)。Studio/MCP 保存时还不拦,后续卡 lint: refuse the three never-offered transferBehavior: 'cascade' shapes at the runtime publish gate too (Studio and MCP saves), not only in os validate / build / lint #37397 跟进。
  • 要你做什么:批准合并。契约复核 PASS 在评论 7181096465,Head-sha df622665dbdf34a43b0790ac4887404f7281a802。

席位意见:ACCEPT。拒收集合与运行时永不提供的集合一致,收窄仪式齐全(BREAKING 横幅、ADR-0087 标记、迁移说明、dogfood)。上一条核对把落地条款写成「无需治理」是席位的错,申报收窄须人工批准,本条更正。

席位核对

Head-sha: df622665dbdf34a43b0790ac4887404f7281a802
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 13 files, Fixes #36714, Clause-②: no (narrowing), Metadata-protocol: narrowed. The delta since ffd2cb6d is 3 files (+10/−2): a changeset paragraph, a changeset clause and two code comments.
  2. Rework closed (contract record 7181096465):
  3. Gates: check-runs at df622665db: 60 success, 10 expected skip, 0 failed. Dogfood Regression Gate is green. dogfood_battery at this head is in the os-dev-report, card comment 7181027705 (487 files passed, 3 skipped, exit 0).
  4. Accepted deviations: (a) the comment-only placement of lint: refuse the three never-offered transferBehavior: 'cascade' shapes at the runtime publish gate too (Studio and MCP saves), not only in os validate / build / lint #37397 (above); (b) contract nits N1–N3.
  5. Out of scope and where it went: the publish-gate crossing goes to lint: refuse the three never-offered transferBehavior: 'cascade' shapes at the runtime publish gate too (Studio and MCP saves), not only in os validate / build / lint #37397. Skills-docs is row 7178935378 on Skills revisions · week of 2026-11-20: shipped skills/** text fixes batched into one PR #35769.
  6. Landing terms: Tier H by the declared-narrowing leg (correcting 7181123147 §6, which wrongly said ungoverned). L2 at CONTRACT_REVIEW_TIER: PASS, comment 7181096465, same head, no must-fix, no should-fix. Security-touching: yes. Waits for the approver; after approval the seat lands it (ready, auto-merge, queue).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Approval requested (declared narrowing: Clause-②: no (narrowing), Metadata-protocol: narrowed; the queue guard dequeued it at the narrowed-spec leg). Seat ACCEPT: comment 7181530291. Contract review PASS at CONTRACT_REVIEW_TIER: comment 7181096465, Head-sha df622665dbdf34a43b0790ac4887404f7281a802. dogfood_battery at this head: card comment 7181027705. After approval the seat lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue security size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants