@wildo-ai/framework-knowledge 1.1.13 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/claude-marketplace/.claude-plugin/marketplace.json +1 -1
  2. package/dist/claude-marketplace/plugins/wildo/.claude-plugin/plugin.json +1 -1
  3. package/dist/claude-marketplace/plugins/wildo/references/composites-and-the-loop.md +12 -4
  4. package/dist/claude-marketplace/plugins/wildo/skills/build/SKILL.md +4 -0
  5. package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/external-framework-mapping.json +1 -1
  6. package/dist/knowledge/manifest.json +3 -3
  7. package/dist/knowledge/playbooks/bottom_up.foundation/method.md +6 -0
  8. package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +1 -1
  9. package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +11 -2
  10. package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +1 -1
  11. package/dist/knowledge/references/engine.client-bundle.allow-list.md +6 -0
  12. package/dist/knowledge/references/example.backend.addon-wiring.module.md +5 -1
  13. package/dist/knowledge/references/example.backend.custom-operation.declared-refusal-code.md +6 -0
  14. package/dist/knowledge/references/example.config.navigation.full.md +14 -0
  15. package/dist/knowledge/references/example.resource.status-lifecycle.quote.md +1 -1
  16. package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +8 -2
  17. package/dist/knowledge/references/platform.config.environment.deployment.md +60 -4
  18. package/dist/knowledge/references/saas.backend.custom-operation.hook-transaction-posture.md +12 -1
  19. package/dist/knowledge/references/saas.backend.system-access-service.md +30 -1
  20. package/dist/knowledge/references/saas.frontend.app-shell.shell-motion-contract.md +30 -0
  21. package/dist/knowledge/references/saas.models.frontend-provider-public-config-contract.md +6 -0
  22. package/dist/knowledge/references/saas.models.privacy.data-residency.md +188 -31
  23. package/dist/knowledge/references/saas.models.providers.compliance-choice.md +9 -0
  24. package/dist/knowledge/references/saas.models.resource-config.operation-condition-parameters.md +8 -1
  25. package/dist/knowledge/references/saas.specifications.processor-register.md +10 -0
  26. package/dist/knowledge/registries/assurance-authority-bases.json +1 -1
  27. package/dist/knowledge/registries/framework-topics.json +1 -1
  28. package/dist/knowledge/registries/playbooks.json +1 -1
  29. package/dist/knowledge/registries/source-tags.json +1038 -1038
  30. package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +5 -1
  31. package/dist/knowledge/skills/backend-custom-operation/references/declared-refusal-codes.md +28 -1
  32. package/dist/knowledge/skills/backend-custom-operation/references/framework-hook-transaction-posture-api.md +21 -1
  33. package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +11 -2
  34. package/dist/knowledge/skills/compliance-document-authoring/references/framework-processor-register-authoring.md +16 -0
  35. package/dist/knowledge/skills/compliance-document-authoring/references/framework-provider-compliance-choice-api.md +197 -31
  36. package/dist/knowledge/skills/config-app-shell/references/framework-shell-layout-api.md +30 -0
  37. package/dist/knowledge/skills/config-navigation/SKILL.md +14 -0
  38. package/dist/knowledge/skills/config-saas/references/compliance-declarations.md +19 -0
  39. package/dist/knowledge/skills/config-saas/references/framework-key-management-api.md +15 -1
  40. package/dist/knowledge/skills/infra-environment-config/SKILL.md +10 -6
  41. package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +60 -4
  42. package/dist/knowledge/skills/layout-2d-adoption/references/framework-shell-motion-api.md +30 -0
  43. package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-public-config-api.md +6 -0
  44. package/dist/knowledge/skills/provider-frontend-module/references/package-frontend-facets.md +4 -1
  45. package/dist/knowledge/skills/resource-config-wiring/SKILL.md +6 -2
  46. package/dist/knowledge/skills/resource-config-wiring/references/framework-operation-audit-api.md +4 -3
  47. package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +30 -1
  48. package/dist/knowledge/skills/resource-status-lifecycle/SKILL.md +3 -2
  49. package/dist/knowledge/skills/resource-status-lifecycle/references/framework-operation-condition-parameters-api.md +8 -1
  50. package/dist/knowledge/skills/resource-status-lifecycle/references/quote-lifecycle-worked-example.md +3 -3
  51. package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +8 -2
  52. package/dist/knowledge/skills/views-chart-authoring/SKILL.md +5 -1
  53. package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +6 -0
  54. package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +6 -0
  55. package/dist/knowledge/topic-index.json +110 -110
  56. package/dist/tsconfig.build.tsbuildinfo +1 -1
  57. package/package.json +4 -4
@@ -702,6 +702,21 @@
702
702
  },
703
703
  });
704
704
  }
705
+ // #3786: a PERSON is erased through `eraseSubjectAsSystem` only. That door consults both administrative-continuity
706
+ // floors, takes down the organization only the person lived in, and tears down their dependents; this one scrubs the
707
+ // row alone and consulted no floor, so a direct scrub of the last owner or super-administrator stranded the tenant or
708
+ // the application with no refusal and no record. It has no production caller, so the sibling door is closed rather
709
+ // than given a second copy of the orchestration: an invariant held at one door of two is not held.
710
+ if (isOrganizationOwnerFloorGovernedSubjectResource(resourceType) || isSuperAdminFloorGovernedSubjectResource(resourceType)) {
711
+ throw this.errorBuilder.buildError(ErrorType.CONFIGURATION, undefined, {
712
+ context: {
713
+ reason: 'person_erased_through_subject_erasure',
714
+ resourceType,
715
+ message: `'${String(resourceType)}' rows are people: erase them through eraseSubjectAsSystem, which applies the `
716
+ + 'administrative-continuity floors, takes down an organization only they belonged to, and tears down their dependents.',
717
+ },
718
+ });
719
+ }
705
720
  await this.impersonalizeRowsAsSystem(resourceType, typeof id_or_ids === 'string' ? [id_or_ids] : id_or_ids, options, ExternalDataCopyScrubCause.ERASURE_REQUEST);
706
721
  }
707
722
 
@@ -1160,13 +1175,26 @@
1160
1175
  // either, so reporting that first gives the operator the outer problem to solve.
1161
1176
  //
1162
1177
  // Also BEFORE `eraseSubjectInPlace`, so a refusal from either guard leaves nothing written.
1163
- await this.assertOrganizationOwnerFloorForSubjectErasure(
1178
+ const organizationsLeavingWithSubjects = await this.assertOrganizationOwnerFloorForSubjectErasure(
1164
1179
  resourceType,
1165
1180
  subjectIds,
1166
1181
  systemContext,
1167
1182
  options?.acknowledgeOrganizationOwnerFloorBreach,
1168
1183
  );
1169
1184
 
1185
+ // ── The organizations only the subjects lived in go with them (#3786) ──
1186
+ //
1187
+ // The floor refuses stranding, and these strand nobody: the subjects are their last usable owners AND their only
1188
+ // living members, which is the ordinary state of a person who signed up alone. Marked here, after both floors and
1189
+ // before anything of the subjects is written, so a refusal above still leaves nothing written and a failed mark
1190
+ // leaves the subjects untouched. See `takeDownOrganizationsLeavingWithSubjects` for why the outcome is explicit
1191
+ // rather than one transaction.
1192
+ const organizationsTakenDownWithSubject = await this.takeDownOrganizationsLeavingWithSubjects(
1193
+ organizationsLeavingWithSubjects,
1194
+ resourceType,
1195
+ subjectIds,
1196
+ );
1197
+
1170
1198
  // An erasure guard stood here (D6 stance 6c): rows in a system of record refused the erasure until a per-request
1171
1199
  // acknowledgement no request schema could carry. Removed by #2559 (epic #2558): the system of record answers requests
1172
1200
  // about its own records, and each such resource's effect reports HANDLED_AT_SOURCE, naming it, post-commit.
@@ -1187,6 +1215,7 @@
1187
1215
  const report = await this.getServicesRegistryHandler()
1188
1216
  .getService(resourceType)
1189
1217
  .eraseSubjectInPlace(resourceType, subjectIds, systemContext, options);
1218
+ if (organizationsTakenDownWithSubject.length > 0) report.organizationsTakenDownWithSubject = organizationsTakenDownWithSubject;
1190
1219
 
1191
1220
  // ── External, non-transactional effects — POST-COMMIT by construction ──
1192
1221
  //
@@ -155,6 +155,36 @@ export const SHELL_GHOST_LAYER_ATTRIBUTE = 'data-shell-ghost-layer';
155
155
  /** The attribute every ghost carries, with its kind (`ShellGhostKind`). */
156
156
  export const SHELL_GHOST_ATTRIBUTE = 'data-shell-ghost';
157
157
 
158
+ /**
159
+ * The markers a still picture of an engine element must NOT carry: everything a query for the real element, or for a
160
+ * control inside it, finds it by. A picture (a discarded pane leaving, an image behind an expanded pane, a pressed row
161
+ * flying into its pane) is inert and takes no pointer, but it is still in the document while it fades, and a picture
162
+ * that kept these was found by those queries as though it were the thing it shows.
163
+ *
164
+ * Measured 2026-11-14 on Your Application (morph layout): a closed todo pane's picture kept `data-navigation-back` for the
165
+ * ~650ms it took to leave, so a lookup of the pane's back control found the picture's (#3764 had to wait it out in
166
+ * `browser-nav-zones`). It never took a click (inert, `pointer-events: none`: the point under it hit the list), but
167
+ * the zone's own back control is identified by that attribute, and a picture must not answer to it.
168
+ *
169
+ * Styling hooks (`data-slot`, `data-state`) are NOT here: a picture keeps the look of what it shows. A caller that
170
+ * needs a narrower picture strips more on its own.
171
+ */
172
+ export const SHELL_PICTURE_STRIPPED_ATTRIBUTES: readonly string[] = [
173
+ 'id',
174
+ // The engine's pane and region markers.
175
+ 'data-content-area',
176
+ 'data-panel-id',
177
+ 'data-zone-hidden',
178
+ 'data-zone-emphasized',
179
+ 'data-component-area',
180
+ SHELL_OBJECT_ATTRIBUTE,
181
+ // The engine's control hooks: a zone's back control, an operation's trigger, a navigation item, a rail entry.
182
+ 'data-navigation-back',
183
+ 'data-operation-id',
184
+ 'data-nav-item-id',
185
+ 'data-ref',
186
+ ];
187
+
158
188
  /** The two kinds of ghost. */
159
189
  export enum ShellGhostKind {
160
190
  /** A dismissed side pane, flying away. */
@@ -28,6 +28,12 @@ export enum FrontendProviderPublicConfigRefusal {
28
28
  * key is called and whichever vendor the secret belongs to. Never negotiable.
29
29
  */
30
30
  SECRET_VALUE = 'SECRET_VALUE',
31
+ /**
32
+ * A provider contract marks a slot browser-public (`holdsBrowserPublicValue`) whose environment variable is one of the
33
+ * FRAMEWORK's own runtime secrets — a database password, a signing key. The mark would serve that value to every
34
+ * browser, and the backend's value screen cannot see framework secrets, so the contract is refused outright.
35
+ */
36
+ BROWSER_PUBLIC_SLOT_NAMES_FRAMEWORK_SECRET = 'BROWSER_PUBLIC_SLOT_NAMES_FRAMEWORK_SECRET',
31
37
  }
32
38
  ```
33
39
 
@@ -30,20 +30,35 @@
30
30
  *
31
31
  * Opt-in. Absent means the application states no residency and nothing is refused, which is not the same as "anywhere":
32
32
  * the documents then say no residency is declared.
33
+ *
34
+ * ## A second, weaker promise: stored at rest (`storedAtRestTerritories`, #2294, decided by Paul 2026-11-15)
35
+ *
36
+ * Most SaaS vendors' "data residency" keeps data AT REST in a region while processing it elsewhere (Notion, Slack,
37
+ * Atlassian, Sentry…), so `territories` refuses them. `storedAtRestTerritories` admits such a vendor when every place its
38
+ * chosen region keeps data at rest (`storageRegionTerritories` on its profile) lies inside it. It is a separate field and
39
+ * never a looser reading of `territories`: a storage-only vendor is never INSIDE the processing residency, its entry says
40
+ * `inside-at-rest`, and the documents state that weaker promise for it by name. Opt-in: absent, nothing changes.
33
41
  */
34
42
  export const ApplicationDataResidencySchema = z
35
43
  .strictObject({
36
44
  /** The places the data may be stored and processed in. A vendor region counts as inside when every place it covers is inside one of these. */
37
- territories: z.array(JurisdictionSlugSchema).min(1),
45
+ territories: z.array(JurisdictionSlugSchema).min(1)
46
+ .describe('The places the data may be stored and processed in, as jurisdiction slugs (`eu`, `de`, `ch`, `us`; the EEA is `eu`, `is`, `li` and `no`). A vendor region counts as inside when every place it covers is inside one of these.'),
47
+ /** The places a vendor may keep the data AT REST in while processing it elsewhere (opt-in, the weaker promise). */
48
+ storedAtRestTerritories: z.array(JurisdictionSlugSchema).min(1).optional()
49
+ .describe('Opt-in, the weaker promise: the places a vendor that processes elsewhere may keep the data at rest in. A vendor whose chosen region processes outside `territories` is admitted when every place that region stores data at rest lies inside one of these, and the documents say so for it. Absent: no vendor is admitted on storage alone.'),
38
50
  })
39
51
  .superRefine((residency, context) => {
40
- const duplicates = residency.territories.filter((territory, index) => residency.territories.indexOf(territory) !== index);
41
- if (duplicates.length > 0) {
42
- context.addIssue({
43
- code: 'custom',
44
- path: ['territories'],
45
- message: `data residency territory ${[...new Set(duplicates)].map((slug) => `"${slug}"`).join(', ')} is declared more than once`,
46
- });
52
+ for (const field of ['territories', 'storedAtRestTerritories'] as const) {
53
+ const listed = residency[field] ?? [];
54
+ const duplicates = listed.filter((territory, index) => listed.indexOf(territory) !== index);
55
+ if (duplicates.length > 0) {
56
+ context.addIssue({
57
+ code: 'custom',
58
+ path: [field],
59
+ message: `data residency territory ${[...new Set(duplicates)].map((slug) => `"${slug}"`).join(', ')} is declared more than once`,
60
+ });
61
+ }
47
62
  }
48
63
  });
49
64
  export type ApplicationDataResidency = z.infer<typeof ApplicationDataResidencySchema>;
@@ -85,8 +100,20 @@ export function organizationDataResidencyRefusal(
85
100
  + 'narrow: nothing has placed its providers in named places. Declare the application\'s residency first.';
86
101
  }
87
102
  const outside = organization.territories.filter((territory) => !application.territories.some((resident) => jurisdictionReachCovers(resident, territory)));
88
- if (outside.length === 0) return null;
89
- return `The organization's data residency names ${outside.join(', ')}, outside the application's (${application.territories.join(', ')}). `
103
+ if (outside.length > 0) {
104
+ return `The organization's data residency names ${outside.join(', ')}, outside the application's (${application.territories.join(', ')}). `
105
+ + 'An organization can only narrow the application\'s residency: name places inside it.';
106
+ }
107
+ // The weaker promise narrows the same way, and only where the application made it (#2294).
108
+ if (organization.storedAtRestTerritories === undefined) return null;
109
+ if (application.storedAtRestTerritories === undefined) {
110
+ return 'The organization admits vendors on storage at rest (storedAtRestTerritories), and the application does not: an organization '
111
+ + 'can only narrow the application\'s residency. Remove storedAtRestTerritories, or declare it on the application first.';
112
+ }
113
+ const appStored = application.storedAtRestTerritories;
114
+ const storedOutside = organization.storedAtRestTerritories.filter((territory) => !appStored.some((resident) => jurisdictionReachCovers(resident, territory)));
115
+ if (storedOutside.length === 0) return null;
116
+ return `The organization's at-rest residency names ${storedOutside.join(', ')}, outside the application's (${appStored.join(', ')}). `
90
117
  + 'An organization can only narrow the application\'s residency: name places inside it.';
91
118
  }
92
119
 
@@ -140,6 +167,40 @@ export function effectiveDataResidencyTerritories(
140
167
  }
141
168
  return [...kept].sort((left, right) => left.localeCompare(right));
142
169
  }
170
+
171
+ /**
172
+ * The residency a call for an organization must satisfy, both promises narrowed (#2294): the processing territories as
173
+ * {@link effectiveDataResidencyTerritories} computes them, and the at-rest ones the same way when BOTH residencies make
174
+ * that promise. An organization that does not admit storage-only vendors narrows the application's admission away; an
175
+ * application that does not, has nothing for an organization to narrow. `undefined` when the organization declares none.
176
+ */
177
+ export function effectiveDataResidency(
178
+ application: ApplicationDataResidency | undefined,
179
+ organization: OrganizationDataResidency | null | undefined,
180
+ ): ApplicationDataResidency | undefined {
181
+ const territories = effectiveDataResidencyTerritories(application, organization);
182
+ if (territories === undefined) return undefined;
183
+ const storedAtRestTerritories = organization?.storedAtRestTerritories === undefined
184
+ ? undefined
185
+ : application === undefined
186
+ ? [...organization.storedAtRestTerritories]
187
+ : application.storedAtRestTerritories === undefined
188
+ ? undefined
189
+ : narrowedTerritories(application.storedAtRestTerritories, organization.storedAtRestTerritories);
190
+ return { territories: [...territories], ...(storedAtRestTerritories === undefined ? {} : { storedAtRestTerritories }) };
191
+ }
192
+
193
+ /** Every place both lists contain, as the narrower of each pair; sorted. */
194
+ function narrowedTerritories(wider: readonly string[], narrower: readonly string[]): string[] {
195
+ const kept = new Set<string>();
196
+ for (const territory of narrower) {
197
+ for (const resident of wider) {
198
+ if (jurisdictionReachCovers(resident, territory)) kept.add(territory);
199
+ else if (jurisdictionReachCovers(territory, resident)) kept.add(resident);
200
+ }
201
+ }
202
+ return [...kept].sort((left, right) => left.localeCompare(right));
203
+ }
143
204
  ```
144
205
 
145
206
  ### Origin Package: `@wildo-ai/saas-models`
@@ -152,6 +213,12 @@ export function effectiveDataResidencyTerritories(
152
213
  export enum ProviderDataResidencyStatus {
153
214
  /** Every place the chosen region processes in lies inside the residency. */
154
215
  INSIDE = 'inside',
216
+ /**
217
+ * The weaker promise (`storedAtRestTerritories`, opt-in): the chosen region processes outside the residency, or nothing
218
+ * says where it processes, and every place it keeps data AT REST lies inside the at-rest territories. Admitted, and
219
+ * never INSIDE: the documents say the vendor stores the data in the region and processes it elsewhere.
220
+ */
221
+ INSIDE_AT_REST = 'inside-at-rest',
155
222
  /** The chosen region processes in at least one place outside the residency. */
156
223
  OUTSIDE = 'outside',
157
224
  /** The profile does not state which places the chosen region covers (a global region, or a map not yet researched). */
@@ -223,9 +290,30 @@ export interface ProviderDataResidencyEntry {
223
290
  readonly territories: readonly string[] | null;
224
291
  /** The places outside the residency, for {@link ProviderDataResidencyStatus.OUTSIDE}; empty otherwise. */
225
292
  readonly outsideTerritories: readonly string[];
293
+ /** The places the region keeps data at rest in, for {@link ProviderDataResidencyStatus.INSIDE_AT_REST}; `null` otherwise. */
294
+ readonly storageTerritories?: readonly string[] | null;
295
+ /**
296
+ * The account condition {@link storageTerritories} holds on (#3920), for {@link ProviderDataResidencyStatus.INSIDE_AT_REST}:
297
+ * what the operator attested by choosing the region. `null` when the map holds on the choice alone.
298
+ */
299
+ readonly storageCondition?: string | null;
226
300
  readonly status: ProviderDataResidencyStatus;
227
301
  }
228
302
 
303
+ /**
304
+ * Whether a provider at this status may be used under the residency (#2294): INSIDE, or INSIDE_AT_REST, the weaker promise
305
+ * the application opted into. Every admission site reads this, so a status added later is refused until it is placed here.
306
+ *
307
+ * A type guard, so a caller that returns early on an admitted status keeps an exhaustive switch over the rest (the
308
+ * placement below does): a plain boolean would leave INSIDE and INSIDE_AT_REST in the switch's type, which a strict
309
+ * program reports as a missing return.
310
+ */
311
+ export function providerDataResidencyAdmits(
312
+ status: ProviderDataResidencyStatus,
313
+ ): status is ProviderDataResidencyStatus.INSIDE | ProviderDataResidencyStatus.INSIDE_AT_REST {
314
+ return status === ProviderDataResidencyStatus.INSIDE || status === ProviderDataResidencyStatus.INSIDE_AT_REST;
315
+ }
316
+
229
317
  /** What the residency reads of a provider choice: who runs it, and in which region. */
230
318
  export type ProviderDataResidencyChoice = Pick<ApplicationProviderComplianceChoice, 'deploymentModel' | 'processingRegion'>;
231
319
 
@@ -295,6 +383,8 @@ function providerDataResidencyEntryOf(input: {
295
383
  processingRegion: choice.processingRegion,
296
384
  profileEstablished: established !== null,
297
385
  regionTerritories: established?.processingRegionTerritories?.[choice.processingRegion] ?? null,
386
+ regionStorageTerritories: established?.storageRegionTerritories?.[choice.processingRegion] ?? null,
387
+ regionStorageCondition: established?.storageRegionConditions?.[choice.processingRegion] ?? null,
298
388
  residency,
299
389
  });
300
390
  }
@@ -305,21 +395,37 @@ function vendorRegionDataResidencyEntry(input: {
305
395
  readonly processingRegion: string;
306
396
  readonly profileEstablished: boolean;
307
397
  readonly regionTerritories: readonly string[] | null;
398
+ readonly regionStorageTerritories: readonly string[] | null;
399
+ readonly regionStorageCondition: string | null;
308
400
  readonly residency: ApplicationDataResidency;
309
401
  }): ProviderDataResidencyEntry {
310
402
  const base = { providerRef: input.providerRef, processingRegion: input.processingRegion };
311
403
  if (!input.profileEstablished) {
312
404
  return { ...base, territories: null, outsideTerritories: [], status: ProviderDataResidencyStatus.NO_ESTABLISHED_PROFILE };
313
405
  }
314
- if (input.regionTerritories === null) {
315
- return { ...base, territories: null, outsideTerritories: [], status: ProviderDataResidencyStatus.TERRITORY_UNKNOWN };
316
- }
317
- const outsideTerritories = territoriesOutsideDataResidency(input.regionTerritories, input.residency);
406
+ const processing: ProviderDataResidencyEntry = input.regionTerritories === null
407
+ ? { ...base, territories: null, outsideTerritories: [], status: ProviderDataResidencyStatus.TERRITORY_UNKNOWN }
408
+ : (() => {
409
+ const outsideTerritories = territoriesOutsideDataResidency(input.regionTerritories, input.residency);
410
+ return {
411
+ ...base,
412
+ territories: [...input.regionTerritories],
413
+ outsideTerritories,
414
+ status: outsideTerritories.length === 0 ? ProviderDataResidencyStatus.INSIDE : ProviderDataResidencyStatus.OUTSIDE,
415
+ };
416
+ })();
417
+ // The processing promise first, always: a region inside it is INSIDE whatever it stores. The weaker one is asked only
418
+ // of a region the processing promise refuses, and only when the application opted into it (#2294).
419
+ if (processing.status === ProviderDataResidencyStatus.INSIDE) return processing;
420
+ const atRest = input.residency.storedAtRestTerritories;
421
+ if (atRest === undefined || input.regionStorageTerritories === null) return processing;
422
+ const storedOutside = input.regionStorageTerritories.filter((territory) => !atRest.some((resident) => jurisdictionReachCovers(resident, territory)));
423
+ if (storedOutside.length > 0) return processing;
318
424
  return {
319
- ...base,
320
- territories: [...input.regionTerritories],
321
- outsideTerritories,
322
- status: outsideTerritories.length === 0 ? ProviderDataResidencyStatus.INSIDE : ProviderDataResidencyStatus.OUTSIDE,
425
+ ...processing,
426
+ storageTerritories: [...input.regionStorageTerritories],
427
+ storageCondition: input.regionStorageCondition,
428
+ status: ProviderDataResidencyStatus.INSIDE_AT_REST,
323
429
  };
324
430
  }
325
431
 
@@ -340,6 +446,8 @@ export function dataResidencyEntriesOf(
340
446
  processingRegion: entry.choice.processingRegion!,
341
447
  profileEstablished: entry.offered !== null,
342
448
  regionTerritories: entry.regionTerritories,
449
+ regionStorageTerritories: entry.regionStorageTerritories,
450
+ regionStorageCondition: entry.regionStorageCondition,
343
451
  residency,
344
452
  }));
345
453
  }
@@ -385,6 +493,13 @@ export interface ProviderDataResidencyPlacement {
385
493
  readonly outcome: ProviderDataResidencyPlacementOutcome;
386
494
  /** The provider's vendor regions whose stated places all lie inside the residency, in the profile's order. */
387
495
  readonly regionsInside: readonly string[];
496
+ /**
497
+ * The vendor regions admitted only on the weaker promise (#3876): every place the region keeps data at rest lies inside
498
+ * the residency's `storedAtRestTerritories`, while it processes elsewhere. Empty when the residency declares no at-rest
499
+ * list, and never a region already in {@link regionsInside}. Read only when no region processes inside: a placement
500
+ * offers the stronger promise first.
501
+ */
502
+ readonly regionsInsideAtRest: readonly string[];
388
503
  /** The choice to write, for {@link ProviderDataResidencyPlacementOutcome.DERIVED} only. */
389
504
  readonly derivedChoice?: { readonly deploymentModel: ProviderDeploymentModel.VENDOR_HOSTED; readonly processingRegion: string };
390
505
  }
@@ -399,10 +514,16 @@ export interface ProviderDataResidencyPlacement {
399
514
  * Derived only when the residency leaves no choice: the provider is only offered vendor-hosted, exactly one of its
400
515
  * regions processes wholly inside, and no authored choice names a region. Everything else is a decision, and is
401
516
  * returned with the regions that would satisfy the residency so whoever takes it sees the options.
517
+ *
518
+ * When the application also declares an at-rest residency (#3876), a provider with NO region processing inside is placed
519
+ * on the weaker promise instead: derived when exactly one of its regions keeps everything at rest inside
520
+ * `storedAtRestTerritories`, a choice when several do. A region that processes inside always wins, because it keeps the
521
+ * stronger promise; a placement never trades it for a storage-only one.
402
522
  */
403
523
  export function placeProvidersInsideDataResidency(params: Parameters<typeof assessProviderProcessingAgainstDataResidency>[0]): readonly ProviderDataResidencyPlacement[] {
404
524
  return assessProviderProcessingAgainstDataResidency(params).flatMap((assessment): ProviderDataResidencyPlacement[] => {
405
- if (assessment.status === ProviderDataResidencyStatus.INSIDE) return [];
525
+ // An admitted provider needs no placement; an INSIDE_AT_REST one is admitted on the weaker promise the application made.
526
+ if (providerDataResidencyAdmits(assessment.status)) return [];
406
527
  const profile = Object.hasOwn(params.profilesByProviderRef, assessment.providerRef) ? params.profilesByProviderRef[assessment.providerRef] : undefined;
407
528
  const established = establishedProviderComplianceProfile(profile);
408
529
  const regionsInside = established === null
@@ -411,8 +532,15 @@ export function placeProvidersInsideDataResidency(params: Parameters<typeof asse
411
532
  const territories = established.processingRegionTerritories?.[region];
412
533
  return territories !== undefined && territoriesOutsideDataResidency(territories, params.residency).length === 0;
413
534
  });
535
+ const atRest = params.residency.storedAtRestTerritories;
536
+ const regionsInsideAtRest = established === null || atRest === undefined
537
+ ? []
538
+ : established.processingRegions.filter((region) => {
539
+ const stored = established.storageRegionTerritories?.[region];
540
+ return !regionsInside.includes(region) && stored !== undefined && territoriesOutsideDataResidency(stored, { territories: atRest }).length === 0;
541
+ });
414
542
  const placement = (outcome: ProviderDataResidencyPlacementOutcome): ProviderDataResidencyPlacement[] => [
415
- { providerRef: assessment.providerRef, assessment, outcome, regionsInside },
543
+ { providerRef: assessment.providerRef, assessment, outcome, regionsInside, regionsInsideAtRest },
416
544
  ];
417
545
  switch (assessment.status) {
418
546
  case ProviderDataResidencyStatus.NO_ESTABLISHED_PROFILE:
@@ -431,14 +559,17 @@ export function placeProvidersInsideDataResidency(params: Parameters<typeof asse
431
559
  if (assessment.status === ProviderDataResidencyStatus.NO_CHOICE && established.deploymentModels.includes(ProviderDeploymentModel.SELF_HOSTED)) {
432
560
  return placement(ProviderDataResidencyPlacementOutcome.DEPLOYMENT_MODEL_IS_A_CHOICE);
433
561
  }
434
- if (regionsInside.length === 0) return placement(ProviderDataResidencyPlacementOutcome.NO_REGION_INSIDE);
435
- if (regionsInside.length > 1) return placement(ProviderDataResidencyPlacementOutcome.SEVERAL_REGIONS_INSIDE);
562
+ // The stronger promise first: a region processing inside is never traded for one that only stores inside.
563
+ const candidates = regionsInside.length > 0 ? regionsInside : regionsInsideAtRest;
564
+ if (candidates.length === 0) return placement(ProviderDataResidencyPlacementOutcome.NO_REGION_INSIDE);
565
+ if (candidates.length > 1) return placement(ProviderDataResidencyPlacementOutcome.SEVERAL_REGIONS_INSIDE);
436
566
  return [{
437
567
  providerRef: assessment.providerRef,
438
568
  assessment,
439
569
  outcome: ProviderDataResidencyPlacementOutcome.DERIVED,
440
570
  regionsInside,
441
- derivedChoice: { deploymentModel: ProviderDeploymentModel.VENDOR_HOSTED, processingRegion: regionsInside[0]! },
571
+ regionsInsideAtRest,
572
+ derivedChoice: { deploymentModel: ProviderDeploymentModel.VENDOR_HOSTED, processingRegion: candidates[0]! },
442
573
  }];
443
574
  }
444
575
  }
@@ -453,16 +584,25 @@ export function placeProvidersInsideDataResidency(params: Parameters<typeof asse
453
584
  */
454
585
  export function dataResidencyPlacementStatement(placement: ProviderDataResidencyPlacement, residency: ApplicationDataResidency): string {
455
586
  const declared = residency.territories.join(', ');
587
+ const atRest = residency.storedAtRestTerritories?.join(', ');
456
588
  const at = `providerComplianceChoices.${placement.providerRef}`;
457
- const inside = placement.regionsInside.map((region) => `"${region}"`).join(', ');
589
+ // The candidates a placement chose among: the regions processing inside, else (#3876) the ones storing inside at rest.
590
+ const onlyAtRest = placement.regionsInside.length === 0 && placement.regionsInsideAtRest.length > 0;
591
+ const inside = (onlyAtRest ? placement.regionsInsideAtRest : placement.regionsInside).map((region) => `"${region}"`).join(', ');
458
592
  switch (placement.outcome) {
459
593
  case ProviderDataResidencyPlacementOutcome.DERIVED:
460
- return `Provider "${placement.providerRef}" processes in region "${placement.derivedChoice?.processingRegion}", the only one of its regions inside the data residency (${declared}).`;
594
+ return onlyAtRest
595
+ ? `Provider "${placement.providerRef}" uses region "${placement.derivedChoice?.processingRegion}", the only one of its regions keeping data at rest inside the at-rest residency (${atRest}). `
596
+ + `It processes outside the data residency (${declared}), so it is admitted on the weaker promise and the documents say so.`
597
+ : `Provider "${placement.providerRef}" processes in region "${placement.derivedChoice?.processingRegion}", the only one of its regions inside the data residency (${declared}).`;
461
598
  case ProviderDataResidencyPlacementOutcome.SEVERAL_REGIONS_INSIDE:
462
- return `Provider "${placement.providerRef}" has several regions inside the data residency (${declared}): ${inside}. Choose one as ${at}.processingRegion (deploymentModel VENDOR_HOSTED).`;
599
+ return onlyAtRest
600
+ ? `Provider "${placement.providerRef}" has several regions keeping data at rest inside the at-rest residency (${atRest}), none processing inside the data residency (${declared}): ${inside}. Choose one as ${at}.processingRegion (deploymentModel VENDOR_HOSTED).`
601
+ : `Provider "${placement.providerRef}" has several regions inside the data residency (${declared}): ${inside}. Choose one as ${at}.processingRegion (deploymentModel VENDOR_HOSTED).`;
463
602
  case ProviderDataResidencyPlacementOutcome.NO_REGION_INSIDE:
464
- return `Provider "${placement.providerRef}" has no region its profile states to process wholly inside the data residency (${declared}). `
465
- + 'Replace it with a provider that does, run it self-hosted if it is offered that way, or widen the residency.';
603
+ return `Provider "${placement.providerRef}" has no region its profile states to process wholly inside the data residency (${declared})`
604
+ + (atRest === undefined ? '' : `, nor to keep data at rest wholly inside the at-rest residency (${atRest})`)
605
+ + '. Replace it with a provider that does, run it self-hosted if it is offered that way, or widen the residency.';
466
606
  case ProviderDataResidencyPlacementOutcome.DEPLOYMENT_MODEL_IS_A_CHOICE:
467
607
  return `Provider "${placement.providerRef}" can be run by its vendor or by you: decide which as ${at}.deploymentModel`
468
608
  + (placement.regionsInside.length === 0 ? ` (none of its vendor regions lies inside the data residency, ${declared}).` : ` (vendor regions inside the data residency, ${declared}: ${inside}).`);
@@ -496,6 +636,7 @@ export function dataResidencyRefusalOf(
496
636
  : `providerComplianceChoices.${entry.providerRef}.processingRegion "${entry.processingRegion}"`;
497
637
  switch (entry.status) {
498
638
  case ProviderDataResidencyStatus.INSIDE:
639
+ case ProviderDataResidencyStatus.INSIDE_AT_REST:
499
640
  return null;
500
641
  case ProviderDataResidencyStatus.OUTSIDE:
501
642
  return `${where} processes in ${entry.outsideTerritories.join(', ')}, outside the declared data residency (${declared}). `
@@ -539,13 +680,14 @@ export function dataResidencyRefusalOf(
539
680
  * places goes only to a processor whose chosen region processes inside them.
540
681
  */
541
682
  export function assessProviderCallAgainstDataResidency(params: {
542
- readonly territories: readonly string[];
683
+ /** The residency the call must satisfy: both promises, narrowed for the organization ({@link effectiveDataResidency}). */
684
+ readonly residency: ApplicationDataResidency;
543
685
  readonly providerRef: string;
544
686
  readonly choice: ProviderDataResidencyChoice | undefined;
545
687
  readonly profile: ProviderComplianceProfile | undefined;
546
688
  readonly account: ProviderCallAccount;
547
689
  }): ProviderDataResidencyEntry | null {
548
- const residency: ApplicationDataResidency = { territories: [...params.territories] as ApplicationDataResidency['territories'] };
690
+ const { residency } = params;
549
691
  if (params.account === ProviderCallAccount.OWNER) {
550
692
  const established = establishedProviderComplianceProfile(params.profile);
551
693
  if (established !== null && providerIsAlwaysSelfHosted(established)) return null;
@@ -604,6 +746,8 @@ export function dataResidencyRefusals(entries: readonly ProviderDataResidencyEnt
604
746
  */
605
747
  export const RuntimeProviderDataResidencySchema = z.strictObject({
606
748
  territories: z.array(JurisdictionSlugSchema).min(1),
749
+ /** The opt-in at-rest territories (#2294), carried only when the application declares them. */
750
+ storedAtRestTerritories: z.array(JurisdictionSlugSchema).min(1).optional(),
607
751
  choices: z.record(z.string().min(1), z.strictObject({
608
752
  deploymentModel: z.enum(ProviderDeploymentModel),
609
753
  processingRegion: z.string().min(1).optional(),
@@ -621,6 +765,7 @@ export function runtimeProviderDataResidencyFor(input: {
621
765
  const choices = input.choices ?? {};
622
766
  return {
623
767
  territories: [...input.residency.territories],
768
+ ...(input.residency.storedAtRestTerritories === undefined ? {} : { storedAtRestTerritories: [...input.residency.storedAtRestTerritories] }),
624
769
  choices: Object.fromEntries([...new Set(input.providerRefs)].sort((left, right) => left.localeCompare(right))
625
770
  .filter((providerRef) => Object.hasOwn(choices, providerRef))
626
771
  .map((providerRef) => {
@@ -645,10 +790,22 @@ export function narrowRuntimeProviderDataResidency(
645
790
  if (runtime === undefined) return undefined;
646
791
  return {
647
792
  territories: [...runtime.territories],
793
+ ...(runtime.storedAtRestTerritories === undefined ? {} : { storedAtRestTerritories: [...runtime.storedAtRestTerritories] }),
648
794
  choices: Object.fromEntries(Object.entries(runtime.choices).filter(([providerRef]) => providerRefs.includes(providerRef))),
649
795
  };
650
796
  }
651
797
 
798
+ /**
799
+ * The application's declared residency as a runtime artifact carries it, both promises (#2294). The one reading the
800
+ * loader's re-check and the per-organization gate share, so neither can drop the at-rest territories the other applies.
801
+ */
802
+ export function applicationDataResidencyOfRuntime(runtime: RuntimeProviderDataResidency): ApplicationDataResidency {
803
+ return {
804
+ territories: [...runtime.territories],
805
+ ...(runtime.storedAtRestTerritories === undefined ? {} : { storedAtRestTerritories: [...runtime.storedAtRestTerritories] }),
806
+ };
807
+ }
808
+
652
809
  /**
653
810
  * The residency a runtime re-applies at load, over the providers it loaded: `providerRef` -> the refusal, for every one
654
811
  * that is not inside. The backend provider loader leaves each unresolved, so startup refuses naming it.
@@ -658,7 +815,7 @@ export function runtimeDataResidencyRefusalsByProvider(input: {
658
815
  readonly providerRefs: readonly string[];
659
816
  readonly profilesByProviderRef: Readonly<Record<string, ProviderComplianceProfile | undefined>>;
660
817
  }): ReadonlyMap<string, string> {
661
- const residency: ApplicationDataResidency = { territories: input.runtime.territories };
818
+ const residency = applicationDataResidencyOfRuntime(input.runtime);
662
819
  const refusals = new Map<string, string>();
663
820
  // Only the providers this host LOADED: a choice for one that failed to load for another reason must not replace that
664
821
  // reason, and a provider that is not loaded receives no call.
@@ -179,6 +179,13 @@ export interface ProviderComplianceChoiceAssessmentEntry {
179
179
  * region is chosen or the profile does not map it.
180
180
  */
181
181
  readonly regionTerritories: readonly string[] | null;
182
+ /**
183
+ * The places the chosen region keeps data at rest in, from the profile's `storageRegionTerritories` (#2294). `null` when
184
+ * no region is chosen or the profile does not map its storage.
185
+ */
186
+ readonly regionStorageTerritories: readonly string[] | null;
187
+ /** The condition the chosen region's storage map holds on, from `storageRegionConditions` (#3920); `null` when none. */
188
+ readonly regionStorageCondition: string | null;
182
189
  }
183
190
 
184
191
  /** Assess ONE choice against the provider's profile. See {@link ProviderComplianceChoiceAssessment}. */
@@ -222,6 +229,8 @@ export function assessProviderComplianceChoices(params: {
222
229
  offered: established === null ? null : { deploymentModels: established.deploymentModels, processingRegions: established.processingRegions },
223
230
  regionReach: choice.processingRegion === undefined ? null : established?.processingRegionReach?.[choice.processingRegion]?.kind ?? null,
224
231
  regionTerritories: choice.processingRegion === undefined ? null : established?.processingRegionTerritories?.[choice.processingRegion] ?? null,
232
+ regionStorageTerritories: choice.processingRegion === undefined ? null : established?.storageRegionTerritories?.[choice.processingRegion] ?? null,
233
+ regionStorageCondition: choice.processingRegion === undefined ? null : established?.storageRegionConditions?.[choice.processingRegion] ?? null,
225
234
  };
226
235
  });
227
236
  }
@@ -15,10 +15,17 @@
15
15
  *
16
16
  * The engine calls `enabledCondition` in TWO places with these parameters, so one function decides both: in the frontend
17
17
  * before it offers the action (a list judges each SUMMARY row, a record page the full row), and in the backend before the
18
- * operation runs, where a `false` refuses the call with 403 `service_resource_operation_disabled` before any hook. So a
18
+ * operation runs, where a `false` refuses the call with `service_resource_operation_disabled` before any hook. So a
19
19
  * condition must say EVERYTHING the operation's handler would refuse on the row's state or on who is asking, or the
20
20
  * action is offered and then refused.
21
21
  *
22
+ * The refusal's status follows what the condition READ on its way to `false`: only the row (and `objectContext`) is a
23
+ * refusal of the state, 409 Conflict; a read of `initiatorIds`, `initiatorUserContext` or `inputDto` may be a refusal of
24
+ * the caller, 403 Forbidden. `&&` stops at the first false operand, so write the state check FIRST
25
+ * (`currentObject.status === PENDING && currentObject.requestedByUserId !== initiatorIds.userId`): a refusal on the
26
+ * status then never reads the caller and answers 409. On a CREATE-shaped operation `currentObject` is the request body, so
27
+ * a refusal there is never a state conflict: 403.
28
+ *
22
29
  * - `currentObject` — the row as it stands. On a list row only its summary fields and the variant's
23
30
  * `enabledConditionFields` are present.
24
31
  * - `initiatorIds.userId` — the person asking (absent for a machine principal). Compare it with an owner field to offer an
@@ -271,6 +271,16 @@ const ProcessorIdentityFieldsSchema = z.object({
271
271
  * `Ireland`, `United States`), and a fixed list would be wrong for the next vendor.
272
272
  */
273
273
  processingRegions: z.array(z.string().trim().min(1)).min(1),
274
+ /**
275
+ * Where this processor keeps the data AT REST, when that differs from where it processes it (#3921): a vendor admitted
276
+ * on the application's opt-in at-rest residency stores in one place and processes in another, and a register that
277
+ * named only the processing region could not say the half a reader of the weaker promise needs.
278
+ *
279
+ * In the operator's words, like {@link processingRegions}. The framework SUGGESTS it from the vendor profile's storage
280
+ * map for the chosen region, and the operator adopts it by committing it here, like every other vendor fact (#1744).
281
+ * Absent means not stated; the international-transfers fact names every `inside-at-rest` provider whose entry lacks it.
282
+ */
283
+ storedAtRestIn: z.array(z.string().trim().min(1)).min(1).optional(),
274
284
  /**
275
285
  * The processor's own subprocessors.
276
286
  *
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "assurance-authority-bases",
3
3
  "metadata": {
4
- "generatedAt": "2026-11-14T09:36:56.594Z",
4
+ "generatedAt": "2026-11-16T14:58:04.129Z",
5
5
  "description": "Compiled portable assurance-authority bases."
6
6
  },
7
7
  "entries": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "framework-topics",
3
3
  "metadata": {
4
- "generatedAt": "2026-11-14T09:36:56.594Z",
4
+ "generatedAt": "2026-11-16T14:58:04.129Z",
5
5
  "description": "Topic registry derived from extracted framework-knowledge tags."
6
6
  },
7
7
  "entries": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "playbooks",
3
3
  "metadata": {
4
- "generatedAt": "2026-11-14T09:36:56.594Z",
4
+ "generatedAt": "2026-11-16T14:58:04.129Z",
5
5
  "description": "Compiled meta-workflow playbooks (app-creation methodology definitions)."
6
6
  },
7
7
  "entries": {