|
94 | 94 | * rather than only in an ADR. |
95 | 95 | */ |
96 | 96 |
|
97 | | -import { getMetadataTypeRedactor, METADATA_READ_DECORATIONS, MetadataProtectionFields } from '@objectstack/spec/kernel'; |
| 97 | +import { |
| 98 | + getMetadataTypeRedactor, |
| 99 | + METADATA_READ_DECORATIONS, |
| 100 | + MetadataProtectionFields, |
| 101 | + OverrideDeclarationFields, |
| 102 | +} from '@objectstack/spec/kernel'; |
98 | 103 |
|
99 | 104 | /** |
100 | 105 | * The deployment status a clone is created with: switched OFF. |
@@ -155,11 +160,22 @@ export const FLOW_CLONE_MUTATED_FIELDS = ['name', 'label', 'status'] as const; |
155 | 160 | * row stored before that refusal still carries it — `FlowSchema` declares the |
156 | 161 | * key, so the parse keeps it — and a copy that kept it would be refused over a |
157 | 162 | * block the admin never sent. Dropping it changes no verdict: it never bound. |
| 163 | + * |
| 164 | + * [ADR-0146 D2/D4] The override declaration (`OverrideDeclarationFields`, the |
| 165 | + * spread `FlowSchema` itself carries) is dropped too, derived the same way. |
| 166 | + * With a live override the source is the pair's item under the base's name |
| 167 | + * declaring `overrides: { package, basedOn }`, and that is the body the engine |
| 168 | + * holds for the name. A declaration names the base item it replaces BY NAME, |
| 169 | + * so under the copy's new name it would declare an override of a flow the |
| 170 | + * base does not ship, and the save gate refuses it (`403 NOT_OVERRIDABLE`). |
| 171 | + * New similar writes the pair's own item: it copies what the source serves |
| 172 | + * (the override's definition) and overrides nothing. |
158 | 173 | */ |
159 | 174 | export const FLOW_CLONE_DROPPED_KEYS: readonly string[] = Object.freeze([ |
160 | 175 | ...METADATA_READ_DECORATIONS, |
161 | 176 | ...Object.keys(MetadataProtectionFields), |
162 | 177 | 'protection', |
| 178 | + ...Object.keys(OverrideDeclarationFields), |
163 | 179 | ]); |
164 | 180 |
|
165 | 181 | /** |
|
0 commit comments