Repository navigation
refactor(contract): rename defaultControl → defaultControlPolicy (TML-2800) - #707
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 17 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (25)
📝 WalkthroughWalkthroughThis PR systematically renames the optional ChangesControl Policy Field Rename
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@prisma-next/extension-author-tools
@prisma-next/mongo-runtime
@prisma-next/family-mongo
@prisma-next/sql-runtime
@prisma-next/family-sql
@prisma-next/extension-arktype-json
@prisma-next/middleware-cache
@prisma-next/mongo
@prisma-next/extension-paradedb
@prisma-next/extension-pgvector
@prisma-next/extension-postgis
@prisma-next/postgres
@prisma-next/sql-orm-client
@prisma-next/sqlite
@prisma-next/target-mongo
@prisma-next/adapter-mongo
@prisma-next/driver-mongo
@prisma-next/contract
@prisma-next/utils
@prisma-next/config
@prisma-next/errors
@prisma-next/framework-components
@prisma-next/operations
@prisma-next/ts-render
@prisma-next/contract-authoring
@prisma-next/ids
@prisma-next/psl-parser
@prisma-next/psl-printer
@prisma-next/cli
@prisma-next/cli-telemetry
@prisma-next/emitter
@prisma-next/migration-tools
prisma-next
@prisma-next/vite-plugin-contract-emit
@prisma-next/mongo-codec
@prisma-next/mongo-contract
@prisma-next/mongo-value
@prisma-next/mongo-contract-psl
@prisma-next/mongo-contract-ts
@prisma-next/mongo-emitter
@prisma-next/mongo-schema-ir
@prisma-next/mongo-query-ast
@prisma-next/mongo-orm
@prisma-next/mongo-query-builder
@prisma-next/mongo-lowering
@prisma-next/mongo-wire
@prisma-next/sql-contract
@prisma-next/sql-errors
@prisma-next/sql-operations
@prisma-next/sql-schema-ir
@prisma-next/sql-contract-psl
@prisma-next/sql-contract-ts
@prisma-next/sql-contract-emitter
@prisma-next/sql-lane-query-builder
@prisma-next/sql-relational-core
@prisma-next/sql-builder
@prisma-next/target-postgres
@prisma-next/target-sqlite
@prisma-next/adapter-postgres
@prisma-next/adapter-sqlite
@prisma-next/driver-postgres
@prisma-next/driver-sqlite
commit: |
size-limit report 📦
|
…-2800) Substrate-first field rename completing the ubiquitous-language pass started in #699 (effectiveControl → effectiveControlPolicy). No behaviour change. Signed-off-by: Will Madden <[email protected]>
01360bf to
a4458e3
Compare
At a glance
A pure mechanical rename of the contract-level default field. No behaviour change.
The decision
The control-policy primitive (
ControlPolicy = 'managed' | 'tolerated' | 'external' | 'observed') introduced a contract-level default nameddefaultControl. Reading the merged slice PRs as a fresh team member, "control" is overloaded: the codebase already uses control plane as a load-bearing term, and the contract was using bare "control" as shorthand for "control policy". This rename completes theeffectiveControl → effectiveControlPolicycleanup landed in #699 — the field-name half of the same ubiquitous-language pass.After this PR, every policy-bearing identifier on the storage plane reads
…ControlPolicyrather than bare…Control(the per-node.controlIR field is the deliberate exception — renaming it would change every node's serialized contract hash, see "Alternatives considered").Scope
In:
defaultControl→defaultControlPolicyon the contract IR (@prisma-next/contractand the Mongo contract foundation), its arktype validators, the TS authoring builder option, and every reader (verifier, planner).projects/supabase-integration/example/migrations/supabase/contract.{json,d.ts}).Out (deliberately):
.controlfield — renaming it would alter the serialized JSON of every contract that uses control policies, regardless of the value. The collision the rename addresses is the default-side identifier; the per-node field stays.controlfor now.Hash impact
The feature was merged to
mainonly yesterday (#691 on 2026-06-02). No downstream contract is yet using a non-defaultdefaultControlvalue. The omit-when-default idiom means the JSON key only appears when the author explicitly sets a non-default policy; existing contracts in the wild that don't set it will be byte-for-byte unchanged.Verification
@prisma-next/contract,@prisma-next/mongo-contract, and@prisma-next/sql-contractrebuilt —dist/*.d.mtsexports the new field.pnpm lint:depsclean.defaultControltoken remains in source/tests (the design docs underprojects/control-policy/continue to spell the pre-rename name — they describe pre-rename state and are deleted at project close-out, mirroring the precedent refactor(contract): rename effectiveControl → effectiveControlPolicy (TML-2797) #699 set forplan.md).Alternatives considered
effectiveControl, removing the rebase hazard entirely..controlfield →.controlPolicy— would alter the serialized JSON of every node carrying a control policy, churning contract hashes for every consumer regardless of value. Not required to resolve the default-side ambiguity. Deliberately out of scope.Linear: TML-2800
Summary by CodeRabbit