Skip to content

Commit a0cbcf9

Browse files
committed
fix(cli): the derived row condition keeps its value lists read-only, as the ceremony's shared constant lists need
The spec's z.input arms carry mutable string arrays; the CLI's hand-written RowCondition had read-only ones, and the ceremony's own selectors (plan.ts SEEDED_BY) are readonly constants. Derive the CLI type from the spec arms with in / notIn read-only, so the merged apply step type-checks unchanged. Claude-Session: https://claude.ai/code/session_012uFegdfR6K6uqvLzt7XsdZ Co-authored-by: Claude <noreply@anthropic.com>
1 parent a133014 commit a0cbcf9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/cli/src/utils/organization-ownership-inventory.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,17 @@ export type InventoryCensus =
9898
| 'cloud-supplement'
9999
| 'host-supplement';
100100

101+
/** Each arm of `T` with its list-valued fields read-only. */
102+
type ReadonlyLists<T> = T extends unknown ? { [K in keyof T]: T[K] extends ReadonlyArray<infer U> ? readonly U[] : T[K] } : never;
103+
101104
/**
102105
* One condition on a row. A {@link RowPredicate} ANDs them. Spelled as data,
103106
* never as SQL text, so the plan binds every value and quotes every column.
107+
* The spec's arms, with `in` / `notIn` read-only: the platform's rows and the
108+
* ceremony's own selectors share constant value lists, and a spec-parsed row
109+
* (mutable lists) is assignable to it unchanged.
104110
*/
105-
export type RowCondition = OrganizationOwnershipRowCondition;
111+
export type RowCondition = ReadonlyLists<OrganizationOwnershipRowCondition>;
106112

107113
export type RowPredicate = readonly RowCondition[];
108114

0 commit comments

Comments
 (0)