@praxisui/core 10.0.0-rc.8 → 10.0.0-rc.81

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.
package/README.md CHANGED
@@ -4,12 +4,227 @@ Shared contracts, tokens, services, metadata models, widget runtime primitives,
4
4
 
5
5
  Use this package directly when a host application or library needs Praxis UI types, global actions, metadata registries, schema clients, resource discovery, i18n, theme bridge, dynamic widget contracts, or shared runtime services.
6
6
 
7
+ `DomainRuleSnapshotGovernanceState` includes `WITHDRAWN`. A withdrawn head is
8
+ not executable (`executionReady=false`); its last selected snapshot key and
9
+ current ETag/revision are audit and concurrency information. Consumers must not
10
+ infer activation from the presence of that key. `DomainRuleService.withdrawSnapshotHead`
11
+ (`POST /api/praxis/config/domain-rules/snapshots/withdrawals`) submits a strong
12
+ `If-Match` precondition and an auditable `reason` (`1..1000` characters) to
13
+ record a tombstone head (`DomainRuleSnapshotWithdrawalResponse`), while
14
+ `DomainRuleService.getSnapshotHeadSet` (`GET /api/praxis/config/domain-rules/snapshots/head-set`)
15
+ reads a consistent, non-withdrawn multi-operation head bundle (`1..64` unique
16
+ `operationKeys`). Reentry after withdrawal requires the backend's governed
17
+ `REQUIRED` rollout (`createRollout` with the withdrawn head's `If-Match`) and
18
+ fresh preload quorum (`DomainRuleCandidateProbeResponse`).
19
+
20
+ ## Global dynamic pages defaults (`GlobalConfig.pages`)
21
+
22
+ `GlobalConfigService` supports `pages.defaults` (`GlobalDynamicPagesDefaultsConfig`) through `provideGlobalConfig` and runtime overrides:
23
+
24
+ - `layoutPreset`: Optional default `WidgetPageLayoutPresetId` when a page omits an explicit `layoutPreset`
25
+ - `themePreset`: Default `WidgetPageThemePresetId` (`operational-command`, `executive-clarity`, `editorial-canvas`)
26
+ - `shellPreset`: Default widget shell preset (`default`, `minimal`, `borderless`, `outlined`, `elevated`, `compact`, `spacious`)
27
+ - `columns` (1–24), `gap`, `paddingInline`, and `autoRows` (`fixed` | `content`)
28
+
29
+ `DynamicWidgetPageComponent` resolves page presentation with strict precedence:
30
+ `authored page property > GlobalConfig.pages.defaults > builtin preset/component fallback`, without polluting persisted canonical page documents with global defaults.
31
+
32
+ ## Closed page authoring profile
33
+
34
+ The additive page codec validates and preserves the Config-owned publication
35
+ profile, copies typed widget/link identities and materializes stable route/child
36
+ identities. Structural success is distinct from native validation and server
37
+ admission. See [the codec contract](https://github.com/codexrodrigues/praxis-ui-angular/blob/main/projects/praxis-core/docs/page-publication-codec.md) for APIs,
38
+ limits, examples and evidence scope. This API alone does not activate publication.
39
+
40
+ ## Runtime isolation and authoring policy safeguards
41
+
42
+ `DynamicWidgetPageComponent` enforces strict fail-closed isolation and authoring integrity across owner transitions and layout commits:
43
+
44
+ - **Owner & auto-persist fail-closed restoration**: when `persistenceOwnerKey`, `componentInstanceId`, or `pageIdentity` changes (or when `autoPersist` transitions from `true` to `false`), Core immediately clears `widgetShellRenderCache` and restores `factoryPageDefinition` before any asynchronous persisted load resolves—ensuring failed or slow storage reads never leak widgets from the previous owner or disabled persistence scope.
45
+ - **`WidgetInstanceAuthoringPolicy` runtime enforcement**: `removable: false`, `duplicable: false`, and `lockShellKind: true` (`shell.kind` and `shell.showHeader`) are re-enforced during `applyPageLayout` alongside shell mutations, restoring protected widgets and their baseline canvas coordinates even when external layout patches drop them.
46
+ - **Hidden row compaction on responsive reflow**: `computeCollapsedHiddenRows` compacts empty collapsed rows even when hidden widgets reflow onto narrow tablet or mobile breakpoints without explicit per-device `col`/`row` overrides.
47
+
48
+ ## Context-bound runtime navigation
49
+
50
+ `EnterpriseRuntimeContextService.navigation({ parentRef?, cursor?, pageSize? })`
51
+ reads one page from the host's existing `/api/praxis/runtime/navigation` endpoint.
52
+ It waits for a confirmed ready context and sends its `X-Praxis-Context-Version`
53
+ with the existing authenticated host headers. `pageSize` defaults to 50 (1–100);
54
+ `parentRef` is a canonical group UUID and the opaque cursor is bounded to 4096
55
+ characters. Omit `parentRef` for roots; use a returned group ID for its children.
56
+ The server remains responsible for current authorization, cursor admission,
57
+ ordering and the complete authorized projection.
58
+
59
+ The response uses `praxis-enterprise-runtime-navigation.v1` and requires `nodes`,
60
+ `capabilities`, `contextVersion`, `receiptEtag`, `headReceipts`, `nextCursor` and
61
+ `resolvedAt`; empty arrays and a null `nextCursor` are valid. Nodes can carry an
62
+ admitted icon identifier, and `children: null` denotes on-demand loading. Head
63
+ receipts use Core's existing `UiLayoutReleaseHeadReceipt`. The semantic read
64
+ receipt is distinct from each strong write `headEtag`; Core does not introduce
65
+ navigation caching or send `If-None-Match` in this slice.
66
+
67
+ The service captures the local context generation before awaiting readiness and
68
+ rejects stale success/error responses with `EnterpriseRuntimeContextObsoleteError`,
69
+ including A → B → A and a response confirming another context. An unconfirmed
70
+ context fails before navigation dispatch. HTTP errors in the current generation
71
+ remain HTTP errors; callers must handle unavailable or stale continuations rather
72
+ than silently restarting or combining pages. A cursor never grants access.
73
+
74
+ This is the Core wire/transport slice of [Config's frozen P3-B design](https://github.com/codexrodrigues/praxis-config-starter/blob/c161609f14ffcdc39024e66a886a1bd5df471fc8/docs/ai/contracts/page-publication-p0/P3B-DESIGN.md).
75
+ It does not install a host navigation provider. An absent provider remains
76
+ `503 RUNTIME_PROVIDER_UNAVAILABLE`. Shell rendering, published-page routes and
77
+ their visual E2E remain P4; real host HTTP proof remains P3-C. A service HTTP spec
78
+ and a direct-consumer build do not establish those later integrations.
79
+
80
+ ### Context lifecycle & cross-filter coordination primitives
81
+
82
+ - **`EnterpriseRuntimeContextLifecycleState` (`lifecycleState` / `isSwitching`):** `EnterpriseRuntimeContextService` exposes a readonly `lifecycleState` signal (`'idle' | 'loading' | 'switching' | 'ready' | 'error'`) and `isSwitching` getter so analytical surfaces mounted mid-switch defer remote queries until a context with `state === 'ready'` is confirmed; non-ready snapshots (`'selection-required'`, `'selection-invalid'`) transition to `'idle'` with `effectiveContext === null`.
83
+ - **Cross-filter & KPI micro-visualization metadata:** `PraxisCrossFilterSourceEntry.dimensionField` and `PraxisKpiInteractionSpec.crossFilter.{cardinality, dimensionField}` declare explicit analytical dimension identity and wire cardinality (`'scalar' | 'list'`) independently of field-naming heuristics, while `PraxisPresentationVisualizationConfig.activeSelectionCount` lets multi-value `stackedBar` segments distinguish incremental filter removal from full filter reset in assistive announcements.
84
+
85
+ ## Contextual table defaults
86
+
87
+ `createDefaultTableConfig()` leaves `pagination.strategy` and `sorting.strategy`
88
+ unset. These shared contracts cannot choose a data source: `@praxisui/table`
89
+ infers server processing for remote data and client processing for local data.
90
+ Explicit `client` or `server` choices remain authored choices. Optional strategy
91
+ properties allow sparse metadata and editor resets to preserve contextual
92
+ resolution; `auto` is not a public serialized value.
93
+
94
+ ## Governed bulk client: basic synchronous slice
95
+
96
+ `requestCancellation(contract, executionId)` follows the published cancel binding.
97
+ Cancellation is cooperative: the returned server state is authoritative, including
98
+ an execution that already completed. It does not undo confirmed items. Use
99
+ `readExecution` and `readResults` to resume observation from a retained execution ID.
100
+
101
+ `BulkOperationClientService` consumes the Metadata published `BulkExecutionContract`
102
+ from an action or CRUD capability. `discoverAction` and `discoverCapability` use the
103
+ existing resource discovery surface; operation paths and filtered schema URLs come
104
+ from that descriptor. `evaluationSchema` loads the backend's filtered request schema
105
+ for a caller to render the operation's form. The client admits only `SYNC`,
106
+ `EXPLICIT` and `PER_ITEM` in this first Angular slice. A descriptor that also
107
+ advertises query selection is usable only with an explicit target request here.
108
+
109
+ The Quickstart candidate migrates its existing uniform update operation to an
110
+ `ASYNC`-only profile; that host adoption is still being validated. BASIC omits
111
+ an `ASYNC`-only operation without a `SYNC` fallback. Angular ASYNC support needs
112
+ its own consumer implementation and acceptance; this note does not establish a
113
+ Render deployment or an ASYNC UI journey.
114
+
115
+ Provide the exact wire ID and opaque resource `expectedVersion` for every selected
116
+ target. In particular, int64/Long IDs remain decimal strings; do not convert them
117
+ through JavaScript numbers. Evaluate first, review the returned READY or BLOCKED
118
+ proposal and its authorized paged results, then confirm a READY proposal using
119
+ only `{ proposalId }` and one `Idempotency-Key`. `BulkSyncStateService.createSession`
120
+ keeps that key fixed across a retry of the same confirmation. A new intention gets
121
+ a new session. The key and proposal live only in that session; it makes no claim
122
+ of recovery across a page reload.
123
+
124
+ For a selected collection row that publishes a `self` link,
125
+ `readTargetVersion(row._links, wireId, identityPath, options)` reads that exact
126
+ item, verifies its returned identity and returns the original strong quoted ETag
127
+ as `expectedVersion`. It rejects absent/weak ETags, foreign origins and mismatched
128
+ IDs. Callers should bound concurrent reads and cancel them when their resource
129
+ context closes. A row value, schema ETag or locally inferred URL is not a resource
130
+ version.
131
+
132
+ ```ts
133
+ const contract = await firstValueFrom(bulkClient.discoverCapability(resourceResponse, operationId));
134
+ const session = bulkState.createSession(contract);
135
+ const proposal = await session.evaluate(explicitSyncRequest);
136
+ const preview = await firstValueFrom(bulkClient.readProposalResults(contract, proposal.proposalId));
137
+ // Present proposal and preview to the person; a BLOCKED proposal cannot be confirmed.
138
+
139
+ // In a separate, explicit confirmation action for a READY proposal:
140
+ await session.confirm(idempotencyKeyForThisIntent);
141
+ // On an uncertain HTTP failure, retain this session and retry with the same key.
142
+ // The host schedules further authorized readbacks for an accepted nonterminal execution.
143
+ const reads = new AbortController(); // This view owns GET lifetime, not confirmation custody.
144
+ if (!session.isTerminal()) await session.refreshExecution(reads.signal);
145
+ if (session.isTerminal()) {
146
+ const results = await session.readResults(200, undefined, reads.signal);
147
+ }
148
+ ```
149
+
150
+ `resourceResponse`, `operationId`, the explicit request and the key come from the
151
+ caller's governed selection and form flow; the client resolves operation URLs from
152
+ the descriptor. The caller controls when to read status again and presents each
153
+ authorized page of results. This example is a service integration sketch, not a
154
+ ready visual workflow or a deployment claim.
155
+
156
+ `refreshExecution(signal?)` and `readResults(size?, after?, signal?)` retain their
157
+ Promise API and optionally accept a standard `AbortSignal`. An already aborted
158
+ signal dispatches no GET; abort unsubscribes the actual HTTP request, releases the
159
+ read slot, and prevents a late Promise continuation from updating the session.
160
+ Abort listeners are removed on success, failure and cancellation. A cancelled GET
161
+ keeps the original proposal, confirmation key and accepted execution; it does not
162
+ mark that execution terminal or prove rollback. A new authorized read may observe
163
+ the same execution. Overlapping execution refreshes remain rejected, while an
164
+ aborted generation cannot release the slot of its successor.
165
+
166
+ The caller owns GET cancellation and its observation budget; the Core session does
167
+ not invent a global read timeout. Use a fresh read lifetime for a fresh consultation
168
+ and abort reads when the owning view closes. Do not race a Promise with a timer:
169
+ connect the signal to the read itself so the HTTP subscription is torn down.
170
+ `evaluate` and `confirm` do not accept this signal: a dispatched POST and its original
171
+ key stay in intent custody across view teardown. GET failure/cancellation must never
172
+ start a new evaluation or confirmation automatically.
173
+
174
+ The backend is the authority on proposal expiry. A client clock hint must not
175
+ block a same-key replay after an uncertain confirmation; the backend may return
176
+ 409 or 410 and the host must explain that state without inventing a new intent.
177
+
178
+ HTTP 202, `RUNNING`, `CANCEL_REQUESTED` and `RECONCILIATION_REQUIRED` are not
179
+ business success. Read the authorized execution until its reconciled terminal
180
+ state and use the paged result reader for each item outcome. Preserve backend
181
+ errors (including 409, 410, 429 and 503) for the host's governed UX mapping;
182
+ do not turn them into a new submission with a new key. The backend continues to
183
+ own authorization, policy, identity, idempotency, limits and the domain transaction.
184
+ The table library has a candidate visual path for a published CRUD
185
+ `bulk-update` capability in `UNIFORM_UPDATE` mode. It uses this client and a
186
+ separate review/confirmation surface; it does not add a second backend contract.
187
+ The service also supports typed command and per-item requests, but that table
188
+ surface does not advertise them. Query selection, ASYNC jobs and ATOMIC mode are
189
+ outside this Angular slice. This is not a claim that the reference host or full
190
+ backend B7 acceptance is complete.
191
+
192
+ ## Published asynchronous execution tracking
193
+
194
+ `PraxisBulkClientService.waitForExecution` is separate from the BASIC client
195
+ above. Use its published execution operation only when that operation actually
196
+ supports the asynchronous profile; an enum member does not enable a backend
197
+ profile. The Observable emits one canonical terminal snapshot, preserving
198
+ `COMPLETED`, `COMPLETED_WITH_ERRORS`, `CANCELLED`, `STOPPED` and
199
+ `RECONCILIATION_REQUIRED`. `CANCEL_REQUESTED` remains pending.
200
+
201
+ Each subscription starts its own strict overall deadline. At most one GET is in
202
+ flight: interval ticks do not abort a useful slow read or queue overlapping reads.
203
+ Pending responses do not renew the deadline, which also bounds a GET that never
204
+ responds. Terminal completion, transport error, deadline and unsubscribe release
205
+ the active read and polling timers; a late response cannot revive an expired
206
+ subscription. Stopping a GET does not reverse server effects or cancel a POST.
207
+
208
+ A read failure means the outcome is unknown. Explicitly resume reads for the same
209
+ execution and preserve the original proposal and confirmation key; do not confirm
210
+ or evaluate again to restore progress. This transport does not provide custody
211
+ across closing/reopening a dialog, reload recovery or operational ASYNC acceptance.
212
+
7
213
  ## Governed color palettes
8
214
 
9
215
  `materializeGovernedPaletteEntries(palette, purposes)` returns `MaterializedGovernedColorToken[]`, pairing each original `entry` with its resolved `color`. It preserves distinct token IDs even when CSS references/colors match, applies purpose filtering, and resolves fallback dependencies against the complete palette. Use this projection for identified swatches; do not zip color arrays to entries or infer identity from color equality. `materializeGovernedPaletteColors` remains the string-only projection of the same resolver.
10
216
 
11
217
  `GovernedColorPaletteService` is the canonical Angular client for color-palette projections published by Praxis Config. Published palettes carry a stable `familyKey`, an explicit `variant` identity and token-level `displayName`/`aliases`; incomplete legacy projections are rejected before caching. The service supports list/read/capabilities/preview, exact `list(familyKey)` queries, tenant/environment-isolated caching, conditional ETag revalidation and deterministic `version`/`etag` pins. Consumers may use names and aliases for presentation and discovery only: `paletteKey` and `tokenId` remain the persisted identities, and local metadata must not become a second source of governance. `GovernedColorTokenSelection` carries the exact palette/version/ETag/token observation beside the existing CSS-string field value; applications persist it only through an explicit domain field or mapping.
12
218
 
219
+ ## Declarative Page DataSources (`page.dataSources`)
220
+
221
+ `WidgetPageDefinition.dataSources` and `WidgetPageDataSourceRuntimeService` allow dynamic pages and dashboards to fetch backend KPIs, group-by aggregations, and time-series metrics without imperative host `HttpClient` orchestration:
222
+
223
+ - **Endpoint resolution (`endpointKey` + `resourcePath`)**: resolves URLs through the `API_URL` token using `endpointKey` (falling back to `'default'`) so multi-service enterprise hosts route each DataSource to its target microservice.
224
+ - **Transform presets & JsonLogic**: supports `{ kind: 'path', path }`, `{ kind: 'group-by-map', mappings, totalField }` (initializing declared keys with `0` for sparse buckets), `{ kind: 'timeseries-last', mappings }`, or arbitrary JsonLogic expressions.
225
+ - **Transient state overlay (`targetStatePath`)**: merges resolved payloads into a non-persisted runtime overlay over `page.state.values[targetStatePath]` and coalesces concurrent emissions via microtask batching before re-evaluating `page.state.derived` and `composition.links`. Live runtime payloads never dirty `authoredPageDefinition` or trigger `autoPersist` writes.
226
+ - **Resilience & visibility-aware polling**: `errorPolicy` (`'fallback' | 'silent' | 'propagate'`) applies `fallbackValue` only before the first successful response so transient network errors during polling (`refreshIntervalMs`) never overwrite live data with static fallbacks. Subsequent poll ticks pause while `document.visibilityState === 'hidden'` and resume immediately on `visibilitychange`.
227
+
13
228
  ## LLM Recommendation Guide
14
229
 
15
230
  - `BUILTIN_WIDGET_SHELL_PRESETS` is the canonical catalog for reusable shell
@@ -31,6 +246,9 @@ Use this package directly when a host application or library needs Praxis UI typ
31
246
  through `context.ui.shell.presets`, then widget-specific `appearance`; use CSS
32
247
  variables there for corporate theming. The `dark-glass` and `graphite` material palettes remain dark by default;
33
248
  adaptive finishes follow the host Material tokens. Do not mutate either exported catalog to configure an application.
249
+ Shell titles use the host Material title-medium weight by default, including
250
+ expanded and fullscreen states; `appearance.typography.titleWeight` remains
251
+ the more specific widget-authored override at desktop and narrow viewports.
34
252
  The deliberate `frameless` inset improvement differs from 9.0.67: persist
35
253
  `appearance.body.padding: "0"` when the original edge-to-edge layout is required.
36
254
  - `WidgetShellConfig.stickyHeader: true` retains the existing composition-derived
@@ -209,6 +427,14 @@ Peer dependencies:
209
427
  - `@angular/common`, `@angular/core`, `@angular/forms`, `@angular/material`, `@angular/platform-browser`, `@angular/router` `^21.0.0`
210
428
  - `rxjs` `~7.8.0`
211
429
 
430
+ ## Resource HTTP responses and revision custody
431
+
432
+ `GenericCrudService.getByIdHttpResponse(id, options?)` and `updateHttpResponse(id, entity, options?)` expose the original `HttpResponse<RestApiResponse<T>>`, pairing a representation with its response headers. Existing `getById`, `getByIdResponse`, `update` and `updateResponse` keep their original DTO/envelope return shapes.
433
+
434
+ `CrudOperationOptions.resourceVersion` overrides a write's shared item cache: a strong quoted ETag supplies the exact `If-Match`, `null` intentionally omits that precondition, and `undefined` preserves existing cache → DTO `resourceVersion` fallback (or the configured header when neither is present). Consumers that edit a captured representation must provide its original revision, rather than a revision obtained by another read. `readStrongResourceEtag` validates a single strong tag without normalizing its bytes; weak, unquoted and multi-valued headers cannot stand in for a write revision. An explicitly invalid/weak response header clears the previous cached token. When the header is absent, the existing Core cache can capture DTO `resourceVersion`; this legacy/manual fallback does not authorize an automatic Form snapshot. Explicit overrides never fall back to cached, DTO or configured tokens.
435
+
436
+ A table companion can read `GenericCrudService.lastCollectionFilterRequest()` from the table’s service instance. The signal captures the collection filter URL, input criteria and normalized POST body at subscription time. A resource or session change clears it. Custom collection surfaces, explicit row inclusions and endpoint-specific headers cannot establish a matching aggregate query and yield `null`.
437
+
212
438
  ## Theme And Icons
213
439
 
214
440
  ### Canonical SCSS Theming (Recommended)
@@ -272,8 +498,11 @@ Hosts should load the icon fonts they use. Without the classic Material Icons fo
272
498
  Use `PraxisIconButtonComponent` for icon-only actions. It keeps the native
273
499
  `button` contract, centers the glyph, and preserves a 44px pointer target even
274
500
  when the visible surface is compact. It accepts the same `mi:`, `mso:`, `msr:`
275
- and `mss:` icon-family prefixes as `PraxisIconDirective`; unprefixed names keep
276
- the legacy Material Icons behavior.
501
+ and `mss:` icon-family prefixes as `PraxisIconDirective`; explicit prefixes
502
+ always select their named family. Unprefixed names follow the configured
503
+ `MatIconRegistry` default for Material Icons or Symbols (outlined, rounded, or
504
+ sharp). Without a configured Symbols default, they retain legacy Material Icons
505
+ behavior; `providePraxisIconDefaults()` selects Symbols Outlined.
277
506
 
278
507
  ```ts
279
508
  import { Component, signal } from "@angular/core";
@@ -407,6 +636,17 @@ identity (`USER` when `X-User-ID` is present), and never sends a tenant ETag as
407
636
  `If-Match` for that user-owned write. Editing or deleting the tenant document
408
637
  requires an explicitly tenant-scoped provider.
409
638
 
639
+ `ApiConfigStorageOptions.canRead?: () => boolean` gates read requests (`loadConfig` and `loadConfigDocument`) when configured. Returning `false` skips remote GET dispatches and emits `null`, allowing hosts with deferred or session-gated authentication to avoid premature pre-session reads without replacing backend authorization.
640
+
641
+ `ApiConfigStorageOptions.canWrite?: () => boolean` and `ApiConfigStorageOptions.canWriteScope?: (scope: ConfigStorageScope) => boolean` gate remote config writes/clears (`saveConfig`, `clearConfig`, `deletePersonalOverrideAndReloadTenantBaseline`) and runtime scope switches (`setWriteScope`, `toggleWriteScope`). Both predicates are evaluated lazily inside `defer()`, complete without emitting (`EMPTY`, "not acknowledged" per `AsyncConfigStorage` semantics) without dispatching HTTP PUT/DELETE when denied, and expose `storage.canWriteConfig(key, options)` so runtimes like `DynamicWidgetPageComponent` avoid false `'saved'` states when writes are disabled. `providePraxisGlobalConfigBootstrap` also forwards `canRead`, `canWrite`, `canWriteScope`, `writeScope`, and `resolveWriteScope` into `ApiConfigStorageOptions`.
642
+
643
+ ### Workspace Customization Governance (`PraxisCustomizationModeService`)
644
+
645
+ `PraxisCustomizationModeService` coordinates layout customization across `@praxisui/core`, `@praxisui/page-builder`, `@praxisui/crud`, and `PraxisAppShellComponent`:
646
+
647
+ - `disableCustomization(reason?: string | null): () => void`: acquires a token-scoped lock (`isAvailable()` becomes `false`, `unavailableReason()` exposes the active lock reason, `isDisabled()` becomes `true`, and active customization exits automatically). Calling the returned release callback restores availability once all locks are released.
648
+ - `PraxisAppShellComponent` reflects `unavailableReason()` on the customization toggle's accessible metadata and blocks toggles while `isDisabled()` is `true`.
649
+
410
650
  ## Dynamic Page Runtime
411
651
 
412
652
  `DynamicWidgetPageComponent` renders `WidgetPageDefinition` documents.
@@ -439,6 +679,20 @@ export class PageComponent {
439
679
 
440
680
  Use `page.composition.links` for persisted wiring. `page.connections` is legacy/residual and should not be used for new pages or examples. Nested component ports should use `component-port` endpoints with `ref.nestedPath`.
441
681
 
682
+ ### Transient runtime overlays and persistence hooks
683
+
684
+ `DynamicWidgetPageComponent.patchWidgetInputs(widgetKey, inputsPatch, options?)` and `updateWidgetShell(widgetKey, shellPatch, options?)` treat runtime updates as non-persistable overlays by default (`options?.persistable === false` when omitted). Authored widget configuration and shell titles/actions remain intact in persisted snapshots and child editors unless `{ persistable: true }` is explicitly passed, and transient keys are restored before persistence emission.
685
+
686
+ Hosts using Core-managed persistence can supply opt-in hooks on `<praxis-dynamic-page>`:
687
+ - `reconcilePersistedPage?: (saved, current) => WidgetPageDefinition`: merges a loaded persisted document against the current canonical page before hydration.
688
+ - `preparePageForPersistence?: (page) => WidgetPageDefinition`: strips volatile runtime projections or normalizes layout geometry before `ASYNC_CONFIG_STORAGE.saveConfig(...)`.
689
+
690
+ The helper `cloneInputsPreservingLiveReferences(inputs)` is exported from `@praxisui/core` for deep-cloning plain input structures while preserving functions, Angular signals, RxJS observables, non-plain class instances, and circular references.
691
+
692
+ ### Header action pinning and keyboard tab navigation
693
+
694
+ `WidgetShellAction.pinned?: boolean` keeps critical shell actions directly visible in the card header before overflow collapsing is evaluated, even when compact header width (`< 480px`) limits unpinned header slots. Shell tabs follow WAI-ARIA roving `tabindex` (`0` on the active tab, `-1` on inactive tabs) with reactive `ArrowRight`, `ArrowLeft`, `Home`, and `End` keyboard navigation in `WidgetShellComponent`.
695
+
442
696
  When a host enables dynamic-page customization, it can pass a transient
443
697
  `WidgetPageAuthoringCapabilities` grant through `authoringCapabilities` to expose only the canvas,
444
698
  page settings, widget shell, component-input, removal and child-customization operations that the
@@ -592,6 +846,8 @@ promise failures produced after a host/global-action adapter accepts a delivery.
592
846
 
593
847
  If the problem is URL or HTTP execution, start with `resourcePath`. If the problem is semantic discovery, surface/action context, or stable runtime identity, start with `resourceKey`.
594
848
 
849
+ Use `normalizePraxisResourcePath(raw, styleOrOptions?)`, `extractPraxisApiPathPrefix(baseUrl)`, and `resolvePraxisSchemasFilteredUrl(apiBaseUrl, resourcePath, options?)` from `@praxisui/core` whenever components or services normalize `resourcePath` inputs. Calling these shared utilities ensures equivalent inputs such as `'/workforce/employees'`, `'workforce/employees'`, `'workforce/employees/'`, and `'/api/workforce/employees'` produce identical CRUD, `/schemas/filtered`, `/options/*`, `/stats/*`, and `/capabilities` URLs without double `/api/api/` prefixes or relative `baseUrl` failures. Pass `stripOperationalSuffix: false` to `resolvePraxisSchemasFilteredUrl(...)` for analytics or projection endpoints where trailing path segments belong to the target route (default `true`); portable configuration descriptors such as `PraxisCrudComponent`'s `advancedFilters.schemaUrl` keep the normalized relative `'/schemas/filtered?path=...'` format without embedding host origins or altering `{id}` templates.
850
+
595
851
  `ResourceCapabilitySnapshot.canonicalOperations` preserves structural support only.
596
852
  `operations` carries the current operation contract and availability for CRUD, query,
597
853
  options, stats, and export. The core keeps unknown operation IDs for forward compatibility;
@@ -599,6 +855,8 @@ it must not infer authorization from a `canonicalOperations` boolean or discard
599
855
 
600
856
  `ResourceRecordOpenService` materializes the minimal `ResourceRecordOpenRef` published by governed analytics. It resolves the target resource catalog, loads the real item, follows its HATEOAS `surfaces` relation, requires the exact item surface to be available for the current context, and only then delegates to `ResourceSurfaceOpenAdapterService`. Consumers must not replace this flow with `${item.id}`, a copied surface path, a label match, or a prebuilt `surface.open` payload.
601
857
 
858
+ When a readable item surface (`VIEW` or `READ_PROJECTION` with `scope === 'ITEM'` and no `relatedResource` of its own) is materialized from a contextual surface catalog, `ResourceSurfaceOpenAdapterService.extractRelatedSurfaces` filters the sibling `ITEM` surfaces that are authorized (`availability.allowed === true`) and publish a complete `relatedResource` contract (`childResourceKey`, `childResourcePath`, `childParentField`), sorted by `order`, and attaches them to `payload.context.relatedSurfaces`. `PraxisSurfaceHostComponent` automatically composes a `[data-testid="surface-related-resources"]` section containing `<praxis-related-resource-outlet>` cards in `mode="open-action"` (`compact: true`) by default so opening a 360° dossier with multiple `1:N` child collections never triggers an N-table HTTP prefetch storm. Activating any card dispatches `surface.open` with the parent `surfaceRuntime`, pushing the child `<praxis-table>` onto the `SurfaceDrawerComponent` navigation stack (`pushFrame`/`backFrame`). Callers may opt into inline tables (`context.relatedResourcesMode = 'inline'`) or suppress the section (`context.relatedResourcesMode = 'off'`).
859
+
602
860
  When a discovered item surface publishes `relatedResource`, `ResourceSurfaceOpenAdapterService` delegates to `RelatedResourceSurfaceResolverService`. The resulting table targets the canonical child resource and receives the parent identity through `queryContext.filters`; it does not prefetch the item projection and rebuild a host-local table before opening. When the child surface publishes `childParentField`, related create actions seed that field through `actions[].form.initialValue`, and both create/update command policies project it into `groupedCommand.contextFields`. The field therefore remains in the schema-backed form and submit payload without rendering a redundant lookup for context the dossier already established. The generated related-resource empty state is informational: CREATE remains the stable, capability-governed toolbar action instead of being duplicated inside the empty state. An explicit host `emptyState.actions` declaration is preserved when the product journey intentionally needs a different contextual action. The materializer declares `openMode: "drawer"` but does not redefine drawer geometry: positioning, viewport height, focus, and close behavior remain owned by `@praxisui/crud`. This keeps the drawer responsive and preserves child operations, empty states, endpoint routing, and resource identity from the backend contract.
603
861
 
604
862
  The outlet's `ComponentDocMeta.configEditor` intentionally owns presentation only: `title`, `subtitle`, `icon`, `mode`, `presentation`, `compact`, and the closed copy/layout subset of `emptyState`. Opening it does not resolve runtime/materialized inputs. Apply and Save preserve every other persisted input opaquely, including Table-owned `tableConfig` and behavior-bearing empty-state fields. The relationship path, parent field/id, operation, filters, query context, surface and runtime state remain metadata/runtime-owned and cannot be authored by this editor or its AI manifest.
@@ -618,12 +876,43 @@ Core exports schema and metadata infrastructure used by form, table, list, chart
618
876
  - form layout item models
619
877
  - JSON Logic models and runtime service
620
878
 
879
+ `SchemaNormalizerService` expands `x-ui.customFieldsContainer: true` into child
880
+ fields such as `customFields.numero_calcado`, preserving each child's label,
881
+ control type, group, order, validators and option source. It also recognizes an
882
+ object named `customFields` with inline `properties`. `FieldDefinition` and
883
+ `FieldMetadata` retain `customField`, `customFieldKey` and `customFieldScope`;
884
+ the container itself does not become a control. See [schema flow](https://github.com/codexrodrigues/praxis-ui-angular/blob/feat/custom-fields-runtime/projects/praxis-core/docs/schema-flow.md#custom-fields)
885
+ for the value path and identity defaults.
886
+
887
+ For scalar arrays, `FieldDefinition.items` and `FieldMetadata.items` preserve the
888
+ operation schema's `FieldScalarItemsSchema` (`type`, optional `format` and `enum`).
889
+ This is distinct from `array.itemSchema.fields` for object collections.
890
+ `normalizeScalarArrayValue` is the shared Core projection for UI tokens: it admits
891
+ only declared scalar types and the finite enum after conversion, rejects invalid
892
+ items without partial output, and does not infer types from labels or value shape.
893
+ Consumers must apply it at validation and query/submit boundaries; saved metadata
894
+ cannot widen the server's `items` or `enumValues` constraints.
895
+
896
+ Expansion does not make arbitrary property names safe Angular controls or turn
897
+ read-only into automatic omission. The canonical Metadata key policy rejects
898
+ reserved control names, and its command request projection excludes read-only
899
+ custom fields. Consumers must use that operation schema rather than merge a
900
+ response schema into a command. See the
901
+ [enterprise adoption review](https://github.com/codexrodrigues/praxis-ui-angular/pull/658)
902
+ for contract blockers, context/freshness limits and the exact proof boundary.
903
+
621
904
  For governed analytics cross-filtering, `bindings.primaryDimension.keyFilterField` is the public request field that receives the raw `bucket.key`. Consumers must preserve its type, verify the target request schema, and must not infer this field from the dimension name, display label, or backend property paths.
622
905
 
623
906
  `valuePresentation` is the shared display contract for scalar read-only values such as currency, number, date, datetime, time, percentage, and boolean.
624
907
  `presentation` is the shared semantic wrapper contract for presentation-capable consumers. It can request chip, badge, status or iconValue rendering while preserving the raw value used for filtering, sorting and export.
625
908
 
626
- `FieldPresentationConfig` is the shared semantic presentation contract for read-only surfaces that need a visual primitive around the value, such as `chip`, `badge`, `status`, `iconValue`, or `microVisualization`. It keeps business data in the original field and lets consumers map `tone`, `appearance`, `icon`, `tooltip`, and optional fixed `label` values to their own renderer and theme tokens.
909
+ `FieldPresentationConfig` is the shared semantic presentation contract for read-only surfaces that need a visual primitive around the value, such as `chip`, `badge`, `status`, `iconValue`, or `microVisualization`. It keeps business data in the original field and lets consumers map `tone`, `appearance`, `icon`, `tooltip`, and optional fixed `label` values to their own renderer and theme tokens. For `microVisualization` (`PraxisPresentationVisualizationConfig`), `@praxisui/core` publishes:
910
+
911
+ - `<praxis-micro-viz-host>` (`PraxisMicroVizHostComponent`) as the canonical, zero-ECharts-dependency presentation host used across `@praxisui/table`, `@praxisui/crud` (`kpiBand`), `@praxisui/rich-content`, `@praxisui/dynamic-fields`, and `@praxisui/charts` (`PraxisMicroVisualizationComponent`);
912
+ - the `@praxisui/core/micro-visualization` secondary entrypoint (`PraxisMicroVisualizationComponent`, which delegates cleanly to `<praxis-micro-viz-host [hostMarker]="false">` with zero ECharts dependency in `@praxisui/core`, and `PraxisKpiCardViewComponent`), alongside `@praxisui/core/theming/micro-visualization` (`define-praxis-micro-visualization-tokens` / `praxis-micro-visualization-styles`) and the canonical `praxis.microViz.*` i18n catalog (`resolvePraxisMicroVizMessage`);
913
+ - the optional `PRAXIS_MICRO_CHART_ENGINE` injection token (`PraxisMicroChartEngine` / `PraxisMicroChartRenderRequest`), allowing `@praxisui/charts` (`providePraxisCharts()`) to render all 6 vector/SVG kinds (`line`, `area`, `column`, `waterfall`, `radial`, and `harveyBall`) across all surfaces (including compact `table-cell` dials) via Apache ECharts `SVGRenderer` (`data-engine="echarts"`) while `@praxisui/core` handles structural HTML/CSS kinds (`stackedBar`, `comparison`, `bullet`, `delta`, `processFlow`) and falls back automatically for all 11 kinds (`data-engine="primitive"`) when no engine is provided or on engine error;
914
+ - `PraxisMicroVizIdSequenceService` (root-injected SSR/hydration-safe ID scoping, bounded scope map for SSR reuse), canonical normalization (`title`, `legend`, `targetLabel`, `bullet` non-zero `min`/negative auto-floor/open-ended thresholds, `harveyBall` default `100` denominator, `column` zero-anchored negative bar fallback parity, dual `target` + `baseline` reference lines, `compactValue` readouts, over-capacity `>100%` readouts), contract attributes (`data-praxis-micro-viz`, `data-kind`, `data-surface`, `data-size`, `data-engine`, `data-tone`, `data-suppressed-count`), and `PraxisMicroTooltipOverlayService`, a `document.body` / HTML Top Layer singleton portal for unclipped floating telemetry readouts (`data-micro-readout`) with optional `CSP_NONCE` propagation on its injected stylesheet;
915
+ - CSR strict-CSP compliance (`style-src-attr 'none'`) via CSSOM bindings on HTML/CSS primitives (noting Angular SSR still serializes `[style.*]` bindings into initial server HTML `style="..."` attributes until client hydration), plus native RTL logical mirroring (`bullet`, `stackedBar`, `processFlow`) with reversed horizontal keyboard arrows and locked `direction: ltr` cartesian scrub overlays (`line`, `area`, `column`, `waterfall`). Legacy HTML-string rendering (`renderPraxisPresentationVisualizationHtml`) has been removed; all consumers render via `<praxis-micro-viz-host>` using `PraxisPresentationVisualizationFormatOptions` (see `docs/2026-11-micro-visualizations-echarts-unification-adr.md`).
627
916
 
628
917
  ## Global Actions
629
918
 
@@ -682,7 +971,7 @@ the same value at runtime. Ordinary runtime change outputs keep using `pageChang
682
971
  composition targets still pass through canonical restoration before persistence.
683
972
  This lets Page Builder save the edited config instead of its previous draft.
684
973
 
685
- Dynamic widgets may implement `WidgetShellActionContributor` to publish transient, stateful content actions to their owning `WidgetShell`. The loader observes that signal and the shell merges contributions with authored actions by stable id without writing them into the page document. The widget remains the owner of command handling, localized labels, availability and controlled-region state; the shell owns responsive toolbar materialization and ARIA projection.
974
+ Dynamic widgets may implement `WidgetShellActionContributor` to publish transient, stateful content actions to their owning `WidgetShell`. The loader observes that signal and synchronizes header visibility (`setShellActionHostHeaderVisible`), and the shell merges contributions with authored actions by stable id without writing them into the page document. The primary header row (`.pdx-shell-header-main`) remains single-line across desktop and tablet card widths (`>= 448px`) using real `44px` icon-button touch-target budgets and standalone/`pinned` icon compaction before overflow, while preserving readable minimum identity (`min(14rem, 50%)`) and `44px` touch targets on narrow shells (`< 448px`) and keeping optional `.pdx-shell-tabs` on a dedicated secondary row below. Standalone, `pinned` (`compactVariant: 'icon'`), and segmented actions (`groupVariant: 'segmented'`, optional `groupLabel`, `compactVariant: 'icon'`, `selectionRole: 'radio'`) share the same width cascade along `icon + label -> icon-only + tooltip -> overflow menu (⋯)`, where grouped options render as labeled radio sections with checkmarks. The widget remains the owner of command handling, localized labels, availability and controlled-region state; the shell owns responsive toolbar materialization and ARIA projection.
686
975
 
687
976
  ## Global configuration snapshots
688
977
 
@@ -706,15 +995,52 @@ contracts are unchanged.
706
995
 
707
996
  `DomainKnowledgeService` and `DomainRuleService` are shared clients for governed semantic decision flows exposed by `praxis-config-starter`. `browseDefinitionCatalog` exposes the bounded, redacted and server-scoped decision catalog; consumers then use `getDefinition` with the exact returned definition id instead of downloading every rule body or joining versions by key. `getDefinitionFacts` projects the same definition's versioned fact vocabulary, including type, localized meaning, provider evidence, sensitivity and redaction policy; Angular must not reconstruct that vocabulary from JSON Logic or host-specific fixtures. `getDefinitionCapabilities` returns the authenticated principal's server-scoped `CREATE_NEW_VERSION` action per definition; consumers must not treat projection metadata such as editor support as authorization. For change workspaces, `getChangeWorkspaceCapabilities` returns the authenticated principal's `availableActions` and stable blockers; consumers must not infer submit, review or promotion authority from lifecycle status. `DomainRuleService` also exposes the safe RuleSet version catalog, active head/status, redacted execution summary, aggregate host alignment, forward activation and rollback protected by the current head ETag. The same client projects immutable rollout-policy versions, their independent anti-ABA head, maker-checker approval, activation and append-only timeline; policy authority and lifecycle validation remain server-owned. It also exposes the two-phase operational rollout through a recoverable human catalog, redacted readiness, create/cancel commands and candidate activation bound to the rollout identity. Consumers must obey the Config-owned `availableActions`; they must not recalculate quorum or head validity. Execution summaries contain only aggregate outcome counts, distinct-host count and observation timestamps for an immutable snapshot. Host-status summaries contain only aligned, snapshot-drifted, runtime-incompatible, unavailable and stale counts derived against the active head and its approved compatibility coordinates; facts and host identities remain outside Angular. Runtime surfaces should treat materializations as derived projections of backend-governed decisions, not as frontend-owned business rules.
708
997
 
998
+ `getDefinitionParameters` reads the same immutable definition's Engine-owned parameter template and typed constraints, together with declared/default/effective values. An absent `defaultValue` or `declaredValue` property differs from explicit JSON null; `origin` identifies the declared/default source. Consumers edit only workspace `parameters.parameterValues`, preserve other parameter metadata, and let Config derive the structural condition. Template identity, read-only flags, constraints, workspace ETags and publication through the governed snapshot lifecycle remain server-owned.
999
+
1000
+ An intact historical snapshot with a different runtime compatibility is `RUNTIME_INCOMPATIBLE`, remains available for authorized audit, and is not executable (`executionReady=false`). All non-`READY` versions expose `availableAction=UNAVAILABLE`, including an incompatible version still referenced by the active head. Consumers must preserve that historical identity without offering activation, rollback or rollout; `READY` still requires the current compiler and implementation catalog. Historical readability never authorizes execution.
1001
+
1002
+ Snapshot publication returns `DomainRuleSnapshotStored` (immutable content/hash), without selecting or refreshing an active head. Before a first activation, a server-published `CREATE_ROLLOUT` version action may authorize starting the staged flow together with the rollout catalog action. `createRollout` and `activateSnapshotCandidate` accept an explicit null head token for verified absence and send only `If-None-Match: *`; existing tokens send only `If-Match`. Candidate activation retains the actual rollout ID. The nullable expected snapshot/head pair records bootstrap absence; clients must never replace it with a content hash, fabricated head or local readiness calculation.
1003
+
1004
+ ## Testing Defaults (`providePraxisTestingDefaults`)
1005
+
1006
+ Full-page and host integration specs often import `appConfig.providers`, which installs `providePraxisGlobalConfigBootstrap(...)`, `providePraxisEnterpriseRuntimeContext(...)`, and `ApiConfigStorage`. Without test overrides, `TestBed` bootstraps can issue real HTTP calls to `/api/praxis/runtime/context` and `/api/praxis/config/ui` or leak `localStorage` schema/theme state between tests.
1007
+
1008
+ Spread `...providePraxisTestingDefaults(options?)` after `...appConfig.providers` (or standalone in `TestBed.configureTestingModule`):
1009
+
1010
+ ```ts
1011
+ import { provideHttpClient } from '@angular/common/http';
1012
+ import { provideHttpClientTesting } from '@angular/common/http/testing';
1013
+ import { providePraxisTestingDefaults } from '@praxisui/core';
1014
+
1015
+ TestBed.configureTestingModule({
1016
+ providers: [
1017
+ ...appConfig.providers,
1018
+ provideHttpClient(),
1019
+ provideHttpClientTesting(),
1020
+ ...providePraxisTestingDefaults({
1021
+ initialConfig: { 'table:employees': { pageSize: 20 } },
1022
+ }),
1023
+ ],
1024
+ });
1025
+ ```
1026
+
1027
+ What `providePraxisTestingDefaults()` configures:
1028
+
1029
+ - **`CONFIG_STORAGE` & `ASYNC_CONFIG_STORAGE`:** both bound to the same `InMemoryConfigStore` via `InMemoryConfigStorage` and `InMemoryAsyncConfigStorage` (with strong-ack `of(void 0)` emissions on save/clear and zero `localStorage` access).
1030
+ - **`EnterpriseRuntimeContextService`:** replaced with `InMemoryEnterpriseRuntimeContextService` (zero `HttpClient` dependency, zero calls to `/api/praxis/runtime/**`, supports `adoptConfirmedContext`, `choices`, `tenants`, `navigation`, and `applyHeaders`).
1031
+ - **Bootstrap initializers:** overrides `PRAXIS_GLOBAL_CONFIG_BOOTSTRAP_OPTIONS`, `PRAXIS_GLOBAL_CONFIG_BOOTSTRAP_READY`, `PRAXIS_ENTERPRISE_RUNTIME_CONTEXT_READY`, and `PRAXIS_ENTERPRISE_RUNTIME_CONTEXT_OPTIONS` (`includeGlobalFetchHeaders: false`, `blocking: false`, `errorPolicy: 'ignore'`) so `ApplicationInitStatus.donePromise` resolves immediately without triggering runtime-context HTTP/fetch calls.
1032
+ - **`API_URL` & caches:** defaults `API_URL` to `{ default: { baseUrl: '/api' } }` (unless `apiUrl: false`), sets `cache.disableSchemaCache: true` so `GenericCrudService` uses `MemoryCacheAdapter`, disables visibility `fetch` revalidation on `PraxisSessionTransportService`, disables `localStorage` writes in `PraxisThemeService`, and installs a silent `PRAXIS_TELEMETRY_TRANSPORT`.
1033
+ - **Optional defensive interceptor:** `createPraxisTestingNoopHttpInterceptor()` can be passed to `withInterceptors([...])` when a spec uses `provideHttpClient()` without `provideHttpClientTesting()`.
1034
+
709
1035
  ## Public API Areas
710
1036
 
711
1037
  Core exports:
712
1038
 
713
1039
  - shared services such as `GenericCrudService`, `GlobalConfigService`, `GlobalActionService`, `ResourceDiscoveryService`, `ComponentMetadataRegistry`, `PraxisJsonLogicService`, `LoadingOrchestratorService`
714
- - governed submit-error normalization through `ErrorMessageService`, preserving public `code`, `target`, `category`, and safe messages while keeping transport details out of UI fallbacks
715
- - tokens and providers for API URLs, global config, global actions, loading, i18n, settings panel bridge, surface drawer bridge, collection export, field selector registry, overlay/layer scale, the shared collection-search visual contract (`PRAXIS_COLLECTION_SEARCH_DEFAULTS`, `PRAXIS_COLLECTION_SEARCH_VARS`, `buildPraxisCollectionSearchCss`), and the shared action-control geometry contract (`PRAXIS_ACTION_CONTROL_DEFAULTS`, `PRAXIS_ACTION_CONTROL_VARS`, `buildPraxisActionControlCss`)
1040
+ - governed submit-error normalization through `ErrorMessageService`, preserving public `code`, `target`, `category`, `decision`, and safe messages while keeping transport details out of UI fallbacks; unknown decisions retain safe summary copy without implying a field correction
1041
+ - tokens and providers for API URLs, global config, global actions, loading, i18n, settings panel bridge, surface drawer bridge, collection export, field selector registry, overlay/layer scale, `providePraxisTestingDefaults()` / `InMemoryConfigStorage` / `createPraxisTestingNoopHttpInterceptor()`, the shared collection-search visual contract (`PRAXIS_COLLECTION_SEARCH_DEFAULTS`, `PRAXIS_COLLECTION_SEARCH_VARS`, `buildPraxisCollectionSearchCss`), and the shared action-control geometry contract (`PRAXIS_ACTION_CONTROL_DEFAULTS`, `PRAXIS_ACTION_CONTROL_VARS`, `buildPraxisActionControlCss`)
716
1042
  - models for table config, fields, forms, rich content, editorial content, widget pages, global actions, resource discovery, domain knowledge/rules, analytics, query context, loading, and collection export
717
- - helpers for schema ids, ETag fetch, field mapping, config merge, validation, IDs, inline filter controls, global action refs, and form hooks
1043
+ - helpers for canonical `resourcePath` normalization (`normalizePraxisResourcePath`, `extractPraxisApiPathPrefix`, `resolvePraxisSchemasFilteredUrl`), schema ids, ETag fetch, field mapping, config merge, validation, IDs, inline filter controls, global action refs, and form hooks
718
1044
  - dynamic widget/page runtime components and metadata
719
1045
  - UI helpers such as icon picker, empty state card, resource quick connect, schema viewer, `PraxisIconDirective`, and `PraxisIconButtonComponent`
720
1046
 
@@ -733,7 +1059,9 @@ Action-bearing components must use the semantic `--praxis-action-control-*` vari
733
1059
 
734
1060
  ### Catálogo no quick connect e isolamento do editor de página
735
1061
 
736
- `ResourceQuickConnectComponent` apresenta recursos publicados em `/schemas/catalog` usando o seletor `pdx-material-select` registrado em `ComponentMetadataRegistry`. O host deve registrar os descritores oficiais de DynamicFields. O controle é inicializado pelo protocolo `setInputMetadata` e ControlValueAccessor; Core não importa a biblioteca de campos. A conexão avançada por rota continua disponível.
1062
+ `ResourceQuickConnectComponent` apresenta recursos publicados em `/schemas/catalog` usando o seletor `pdx-material-select` registrado em `ComponentMetadataRegistry`. O host deve registrar os descritores oficiais de DynamicFields. O controle é inicializado pelo protocolo `setInputMetadata` e `ControlValueAccessor`; Core não importa a biblioteca de campos. A conexão avançada por rota continua disponível (com `<datalist>` de sugestões do catálogo e abertura automática da seção avançada quando o seletor dinâmico não está disponível ou quando o recurso atual é uma rota customizada fora do catálogo).
1063
+
1064
+ O componente expõe `[resourcePath]`, `(resourcePathChange)`, `[endpointKey]`, `[apiUrlEntry]`, `[intent]`, `ControlValueAccessor` (`ngModel` / `formControl`) e os hooks `reset()` / `acceptAppliedValue()` de `SettingsValueProvider`. A projeção e reconciliação de opções do catálogo são centralizadas em `ResourceDiscoveryService.getDiscoveredResources()`, `loadDiscoveredResources()`, `projectSchemaCatalogResources()` e `resolveCatalogResourceOptionValue()`, deduplicando chamadas concorrentes a `/schemas/catalog` por URL, consumindo `resourcePath`, `resourceReadOnly` e `resourceCapabilities` publicados pelo backend para eliminar falsos-positivos de capacidades (como endpoints herdados `/stats/*` desabilitados) e sinalizando recursos somente leitura no subtítulo do seletor. `ResourceDiscoveryService` reutiliza a instância do injetor ancestral quando um componente standalone cria injetor filho sem override local de `API_URL`.
737
1065
 
738
1066
  O editor de configurações da página recebe uma cópia da definição autoral. Dados carregados e entradas transitórias dos widgets não devem virar configuração ao alterar o layout.
739
1067
 
@@ -843,7 +1171,7 @@ interpolation does not add date masks, CPF masks or an expression language. Lite
843
1171
  separators remain when both bound fields are empty.
844
1172
  The canonical link pipeline now supports explicit `format-value` for civil dates,
845
1173
  digit masks and numeric presentation.
846
- The [complete identity recipe](../../examples/ai-recipes/praxis-dynamic-page.widget-selection-identity.json)
1174
+ The complete identity recipe (`examples/ai-recipes/praxis-dynamic-page.widget-selection-identity.json`)
847
1175
  resets the transient identity before formatting and composes only available subtitle
848
1176
  parts. The lab and Core integration test consume the same executable page artifact.
849
1177
 
@@ -913,10 +1241,17 @@ widget appearance/size, or registered content editor session. It uses the existi
913
1241
  `owner` option; no session identity is persisted in the page document.
914
1242
 
915
1243
  The session is cancelled when its panel closes, the page is destroyed, or an external
916
- page/context/identity/authoring input change invalidates it. A page-only acknowledgement
917
- identical to the current authored document keeps the session alive for subsequent
918
- Apply/Save. This is deliberately conservative: a different external document cancels
919
- open editors even when a particular widget happens to be unchanged.
1244
+ page/context/identity/authoring input change invalidates it. An acknowledgement identical
1245
+ to the current authored page keeps the session alive for subsequent Apply/Save, including
1246
+ when the host resends an equivalent `pageIdentity` object. After the first input change,
1247
+ identity equivalence means strict equality of its five fields: `appId`, `tenantId`,
1248
+ `userId`, `routePath` and `locale`; whitespace, delimiters and missing values are not
1249
+ normalized. Core retains a private snapshot of those accepted primitive values, so
1250
+ mutating the host's previous object before resending a clone still changes the scope.
1251
+ Resending only that equivalent identity also preserves data-source overlays,
1252
+ composition and persistence scope. Context, instance and authoring capability changes
1253
+ remain invalidating. A different external document cancels open editors even when a
1254
+ particular widget happens to be unchanged. This does not confirm an HTTP save.
920
1255
 
921
1256
  Confirmed widget removal cancels sessions targeting that key, plus page-wide settings
922
1257
  that could restore the removed widget. Asynchronous editor results cannot open a panel
@@ -1079,6 +1414,166 @@ blur does not become an inner widget's default. Intentional inheritance through
1079
1414
  `context.ui.shell.preset/presets` remains supported. This isolation does not remove
1080
1415
  the host's shared theme tokens.
1081
1416
 
1417
+ ## App shell: host appearance
1418
+
1419
+ `PraxisAppShellComponent` materializes the host theme for both the sidebar and
1420
+ header. The existing theme roles `--sidebar` (falling back to `--card`),
1421
+ `--surface-gradient` (falling back to `--card`), `--command-gradient`,
1422
+ `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-accent`,
1423
+ `--sidebar-accent-foreground`, `--primary-deep`, `--primary-foreground`,
1424
+ `--accent`, `--secondary`, `--overlay`
1425
+ and `--shadow-panel` apply to the native chrome and brand icon. Navigation,
1426
+ loading and mobile behavior do not change when these colors change. Without host
1427
+ theme tokens, the brand uses a dark blue fallback with a white icon; custom host
1428
+ colors should always supply their corresponding foreground roles.
1429
+
1430
+ Semantic badges use tinted surfaces with the host's foreground. Success,
1431
+ warning and info consume `--praxis-success`, `--praxis-warning` and
1432
+ `--praxis-info`; the established `--ready`/`--warning` variables and bounded
1433
+ fallbacks remain available. Error consumes `--destructive`. Hosts should use
1434
+ these existing roles rather than overriding private shell selectors. No new
1435
+ shell input, saved layout field or theme-specific component is required.
1436
+
1437
+ ## Governed Resource Quick View
1438
+
1439
+ `ResourceQuickViewBinding`, `PraxisQuickViewTriggerDirective` (`[praxisQuickView]`),
1440
+ `ResourceQuickViewService` and `PraxisQuickViewOverlayComponent` provide the
1441
+ canonical hover/focus/click contextual dossier across `@praxisui/table`,
1442
+ `@praxisui/list`, `@praxisui/dynamic-fields`, `@praxisui/dynamic-form`,
1443
+ `@praxisui/rich-content`, `@praxisui/charts`, `@praxisui/stepper` and
1444
+ `@praxisui/ai`:
1445
+
1446
+ - **Metadata synthesis (`resolveFieldQuickViewBinding` & `reconcileFieldQuickViewBinding`)**:
1447
+ Synthesizes `ResourceQuickViewBinding` from explicit `field.quickView`,
1448
+ backend `x-ui.resourceReference` (`@ResourceReference`) or
1449
+ `x-ui.optionSource.detail` when it declares a `resourceKey`. The binding reuses
1450
+ `recordOpen.sourceIdentityField` and `recordOpen.target.resourceKey/surfaceId`;
1451
+ `previewSurfaceId` can select a separate read projection. Persisted presentation
1452
+ preferences must preserve the server-owned record target and identity field.
1453
+ - **Context resolution (`resolveResourceQuickViewTarget`)**:
1454
+ Resolves `recordOpen.sourceIdentityField` from direct records or nested `row`,
1455
+ `item` and `values` envelopes, including dotted field paths, and extracts
1456
+ scalar IDs (`id`, `value`, `key`) when a form control holds an entity-lookup
1457
+ selection object.
1458
+ - **Enterprise security and request lifetime**:
1459
+ `ResourceQuickViewService` coalesces matching in-flight projections and invalidates
1460
+ the active generation on context changes; it does not retain a completed-record
1461
+ LRU cache. Every fresh open resolves the current item surface. Surface, action,
1462
+ capability and schema discovery share requests within the current runtime context
1463
+ generation. A context change cancels the whole record opening and invalidates
1464
+ late discovery responses, including a return to the same context. The hover trigger
1465
+ waits 280 ms by default; explicit activation starts immediately. Discovery reads
1466
+ the resource catalog, the item and its contextual surfaces before resolving the
1467
+ filtered response schema and projection. A pending HTTP request can therefore
1468
+ outlive dismissal even though its obsolete result cannot update that popover.
1469
+ Fields restricted by `x-ui.fieldAccess` are filtered or masked (`•••`) before
1470
+ rendering, and `recordOpen` actions are validated against the item's
1471
+ authorized `_links` / `surfaces` / `actions` snapshot. Confirmed saves or
1472
+ deletions inside an opened Quick View detail or contextual drawer invalidate
1473
+ the active projection cache and emit `ResourceQuickViewService.resourceMutation$`
1474
+ (`ResourceQuickViewMutationEvent`) so parent resource tables can refresh.
1475
+ - **Shared side-panel geometry (`side-panel-geometry.util` & `SurfaceSizeConfig`)**:
1476
+ Canonical helpers (`SIDE_PANEL_PRESET_WIDTHS`, `resolveSidePanelViewportWidth`,
1477
+ `resolveSidePanelPresetWidth`, `parseSidePanelWidthPx` with `px`/`rem`/`vw`/`%`/`min`/`max`/`clamp`
1478
+ support, `clampSidePanelWidthPx`, `resolveExpandedSidePanelWidthPx`,
1479
+ `canExpandSidePanel`, `readPersistedSidePanelWidth`, `writePersistedSidePanelWidth`)
1480
+ unify preset widths, viewport clamping, expand thresholds, and pixel persistence
1481
+ across `@praxisui/settings-panel`, `@praxisui/dialog`, and `@praxisui/table`.
1482
+ - **Metadata presentation**:
1483
+ Summary labels come from normalized domain metadata (`x-ui.label`), not field-name
1484
+ humanization. Explicit numeric `valuePresentation` uses the shared resolver and
1485
+ formatter for `currency`, `number` and `percentage`, including `currency.code`,
1486
+ zero precision and fractional `digitsInfo`. A presentation-level value config
1487
+ takes precedence over the field config. Existing field currency/decimal defaults
1488
+ remain the fallback when the explicit config omits them. Options, masking and
1489
+ presentation affixes retain their precedence. This numeric correction does not
1490
+ add support for compact notation or change the existing date/time formatting path.
1491
+
1492
+ Hosts must install `providePraxisQuickViewDialogPresenter()` from `@praxisui/dialog`.
1493
+ Bindings with `contentRef` also require the rich-content body renderer; the standard
1494
+ summary does not. Source changes require publication and consumer adoption before
1495
+ they can be claimed for an installed package.
1496
+
1497
+ ### Optional editing highlight
1498
+
1499
+ This feature was added in source after `10.0.0-rc.36`; it is not yet part of a published package release.
1500
+
1501
+ `WidgetShellConfig.appearance.card.interactionHighlight` selects `standard` or
1502
+ `gradient`. Omit it to inherit the shell preset; the final default is `standard`.
1503
+ An explicit `standard` overrides a gradient preset. This is editing chrome: it
1504
+ appears on selection or keyboard focus while customization is enabled, never as a
1505
+ permanent border in the published page. Focusing a child control does not change selection; the highlight itself does not emit selection.
1506
+ The gradient uses the current primary, tertiary and secondary theme tokens. Resize
1507
+ grips follow the same choice. Internal control focus indicators remain intact;
1508
+ blocked canvas operations retain the error indicator and forced colors use a solid
1509
+ system-color outline. The highlight follows the resolved card radius (square for
1510
+ content-only shells).
1511
+
1512
+ ```json
1513
+ {"shell":{"kind":"dashboard-card","appearance":{"card":{"interactionHighlight":"gradient"}}}}
1514
+ ```
1515
+
1516
+ In Widget settings → Appearance, choose Inherit, Standard or Gradient and inspect
1517
+ its preview. Apply updates the local draft; the host controls remote persistence.
1518
+ Saving the settings panel alone is not proof of a server write: the reference Page
1519
+ Builder host requires Save page. Reopening and Reset preserve the distinction between
1520
+ an omitted value and an explicit override. Editing appearance on a widget without a
1521
+ shell preserves content-only presentation (`kind: 'none'`); a card requires an explicit
1522
+ choice. The option does not change child component inputs or enable customization.
1523
+
1524
+ This preference controls editing appearance; it grants no authorization and carries
1525
+ no business selection state. The host integrates persistence, identity and tenant
1526
+ scope through the canonical configuration infrastructure, including its ETag
1527
+ contract; this option requires no separate ETag implementation in the host. Editing only this preference must preserve unrelated
1528
+ shell settings, including `bodyLayout`, `windowActions` and action `pressed` values.
1529
+ Local editor round-trip tests do not prove remote tenant isolation or ETag behavior.
1530
+
1531
+ The existing AI operation `widget.shell.configure` merges partial shell input.
1532
+ Omitting `interactionHighlight` from that input preserves an existing override; it
1533
+ does not perform the visual editor's Inherit action, which removes the field from
1534
+ the complete saved document. Explicit `standard` disables the gradient but remains
1535
+ an override. Resetting an existing override to inherited styling through this AI
1536
+ operation remains unsupported; this option does not imply full editor/AI parity.
1537
+
1538
+
1539
+
1540
+ ### Domain Rules: identidade explícita de operação (candidato G3)
1541
+
1542
+ As leituras `listSnapshotVersions`, `getSnapshotHeadStatus`, `getSnapshotHead`, `getSnapshotHostStatusSummary` e `getRolloutCatalog` exigem `operationKey` após `ruleSetKey`. A inspeção de lifecycle recebe `{ ruleSetKey, operationKey }` quando incluir snapshots. Nenhum método escolhe o primeiro perfil. As projeções de versão, head, rollout, status e publicação preservam essa identidade retornada pelo servidor.
1543
+
1544
+ O consumidor deve invalidar cache, requisições tardias e confirmações ao mudar de operação. Políticas de rollout permanecem familiares. Preparação neutra de candidato continua limitada ao endpoint host que resolve uma única operação registrada; não inventar um campo ou capacidade no cliente para compor famílias múltiplas. O corte público exige release coordenado do Core, bibliotecas dependentes e consumidores, seguido de instalação a partir do registry; tarball local só comprova candidato.
1545
+
1546
+ ## Canonical `configPersistenceStrategy` Contract
1547
+
1548
+ `@praxisui/core` publishes `PraxisConfigPersistenceStrategy` (`'local-first' | 'input-first' | 'volatile'`), `PraxisLegacyConfigPersistenceStrategy`, and `normalizeConfigPersistenceStrategy(strategy, fallback)` as the shared precedence contract across Praxis components (`@praxisui/table`, `@praxisui/crud`, `@praxisui/tabs`, `@praxisui/expansion`, `@praxisui/dynamic-form`, `@praxisui/list`, `@praxisui/charts`):
1549
+
1550
+ - `'local-first'` (canonical; `'storage-first'` accepted as legacy alias): hydrates persisted overrides and persists runtime/authoring customizations for the component identity.
1551
+ - `'input-first'`: prioritizes host-supplied `[config]` / `[metadata]` over stored overrides so composed pages retain declarative ownership.
1552
+ - `'volatile'`: strictly ephemeral in-memory execution; never reads, writes, or clears configuration storage (used by temporary previews, inspect-only hosts, and sandbox views).
1553
+
1554
+ ## Platform Governance, Enterprise Shell, and Reconciler Foundations
1555
+
1556
+ - **Theming & Layer Tokens (`_theming.scss` & `theme-bridge.css`):** Publishes `--praxis-info`, `--praxis-warning`, and canonical `--praxis-z-*` stacking tokens (`--praxis-z-drawer`, `--praxis-z-command-palette`, etc.) uniformly across Sass theming and runtime CSS bridge stylesheets, alongside `@media (forced-colors: active)` and GPU containment (`contain`) guidance for `--pdx-shell-card-backdrop-filter`.
1557
+ - **Fail-Closed Write Gates (`ApiConfigStorageOptions.canWriteTargetScope`):** Optional preflight resolver returning `boolean | ConfigStorageWriteDecision` (with structured `code` and `reason`) before `saveConfig`/`clearConfig` dispatch, preserving the fail-closed `EMPTY` return contract when blocked.
1558
+ - **Related Resource Outlet Customization (`PraxisRelatedResourceOutletComponent`):** Exposes `followShellCustomizationMode = input<boolean>(false)` so embedded related-resource surfaces opt in explicitly before inheriting shell customization state.
1559
+ - **Enterprise Shell & Command Palette:** Publishes the `praxis.shell.*` catalog (`pt-BR` and `en-US`), `PraxisContextSwitchGuard` for dirty-state verification, the `shell-scope-bar` projection slot, Global Settings / Create Page triggers decoupled from `customizationMode.isDisabled()`, and `<praxis-command-palette>` (`Ctrl+K`, RBAC filtering, `--praxis-z-*` layering, and conditional focus restoration).
1560
+ - **Authoring Contracts & Page Reconciliation:** Extends `ComponentDocMeta` with `schemaVersion`, `transientInputs`, `lockedInputs`, `visualOverrideKeys`, and `paletteVisibility` (`ComponentPaletteVisibility`: `'global' | 'explicit-only' | 'hidden'`); provides `PraxisPageReconcilerService` with fail-closed `PageIntegrityPolicy` (preserving `composition.links`, `layoutPreset`, `grouping`, and conservative `context` merges) and extended `WidgetPagePersistenceState.errorKind` (`'forbidden' | 'governance_denied' | 'network'`).
1561
+ - **Per-Widget Authoring Policy, Owner Rebind & Visual Row Compaction:** Exports `WidgetInstanceAuthoringPolicy` (`removable`, `duplicable`, `lockShellKind`) on `WidgetInstance.authoringPolicy`, enforced by `DynamicWidgetPageComponent` (toolbar/menu/projected shell actions, imperative duplicate/remove, shell constraints) and preserved/restored by `PraxisPageReconcilerService`; exposes `@Input() persistenceOwnerKey` on `DynamicWidgetPageComponent` to rehydrate scope-owned persistence without host `@for` teardown (`NG0956`); and compacts completely hidden grid rows visually in non-customizing `autoRows: 'content'` view mode without mutating authored `canvas.items`.
1562
+
1563
+ ## Epistemic Governance & Intelligence Job Primitives (`@praxisui/core`)
1564
+
1565
+ - **Shared Epistemic & Statistical Contracts:** Exports `PraxisEpistemicKind` (`'DETERMINISTIC_LAW' | 'CALIBRATED_PROBABILITY' | 'STOCHASTIC_SIMULATION' | 'CAUSAL_HYPOTHESIS' | 'OPTIMIZATION_RESULT'`), `PraxisEpistemicAvailabilityState` (`'AVAILABLE' | 'INSUFFICIENT_SAMPLE' | 'K_ANONYMITY_SUPPRESSED' | 'ENGINE_UNAVAILABLE' | 'DEGRADED'`), `PraxisEpistemicMeta`, `PraxisCanonicalNigriniConformity`, `PRAXIS_INTELLIGENCE_ERROR_CODES`, `PraxisAnalyticsInferenceStatsRequest`, `PraxisAnalyticsAnomalyScanStatsRequest`, and analytics provenance helpers (`normalizePraxisEpistemicMeta`, `normalizePraxisNigriniConformity`, `getPraxisEpistemicKindIcon`, `formatPraxisEpistemicNumber`, `formatPraxisQValueFdr`, `extractAnalyticsEpistemicMetadata`, `attachAnalyticsEpistemicMetadata`, `readAnalyticsEpistemicMetadata`, `deriveFailClosedEpistemicMetaFromError`).
1566
+ - **Analytical Calculation Trails & Discovery:** Extends `PraxisAnalyticalDrawerCalculationTrail` with `epistemicMeta` and expression bindings (`epistemicMetaExpr`, `epistemicKindExpr`, `epistemicAvailabilityStateExpr`, `statisticallySignificantExpr`, `qValueFdrExpr`, `sampleSizeExpr`, `suppressedCellCountExpr`, `provenanceHashExpr`, `modelCardIdExpr`, `datasetKeyExpr`, `methodologyNoteExpr`, `nigriniMadExpr`, `nigriniConformityExpr`), and adds `'inference' | 'anomalies'` (`'statsInference' | 'statsAnomalies'`) support across `AnalyticsStatsOperation`, `ResourceDiscoveryService`, and `WidgetPageDataSourceRuntimeService` for workforce/payroll analytics without synthetic `COUNT` injection.
1567
+ - **Jobs Client & Silent Polling (`PraxisIntelligenceJobsService`):** Exposes `getJob`, `cancelJob`, `pollJob`, `PRAXIS_INTELLIGENCE_JOBS_BASE_PATH`, and `PraxisIntelligenceJobError`, delegating tenant/request headers to `EnterpriseRuntimeContextService` (falling back to `PAX_FETCH_HEADERS` only when enterprise context is absent), applying `createSilentPraxisLoadingContext()` on background poll requests so `PRAXIS_LOADING_CTX` remains inspectable without triggering global loading UI, tolerating bounded transient poll errors (`maxTransientErrors`), and cancelling safely across tenant switches or teardown.
1568
+ - **Reusable Frameless Components & Widget Metadata:** Publishes `<praxis-epistemic-badge>` (`PraxisEpistemicBadgeComponent`, `compact | detailed`, expandable provenance details, async `provenanceHash` copy, fail-closed `matTooltip`, `PRAXIS_EPISTEMIC_BADGE_METADATA`, `providePraxisEpistemicBadgeMetadata`) and `<praxis-intelligence-job-status>` (`PraxisIntelligenceJobStatusComponent`, `receipt` input or managed `jobId` polling with `emitInitialTerminal`, `maxTransientErrors`, `cancel`/`cancelFailed`/`expired`/`completed`/`failed` outputs, inline `cancelError` alert, and `aria-live="polite"`, `PRAXIS_INTELLIGENCE_JOB_STATUS_METADATA`, `providePraxisIntelligenceJobStatusMetadata`), localized in `pt-BR` and `en-US` via `PRAXIS_INTELLIGENCE_I18N_NAMESPACE` and `providePraxisIntelligenceI18n`.
1569
+
1570
+ ### CSS Custom Properties (Icon Framing & Header Layout)
1571
+
1572
+ - **Widget Shell Header Layout (`<praxis-widget-shell>`):** `.pdx-shell-header` declares `container-type: inline-size` with `--pdx-shell-title-basis` (adjusting cleanly above `380px` to keep compact multi-icon desktop headers on one row) and `--pdx-shell-actions-gap`.
1573
+ - **Frameless KPI Icon Tokens (`<praxis-kpi-card-view>`):** Exposes `--prx-kpi-icon-size` (alias `--praxis-kpi-icon-size`), `--prx-kpi-icon-padding` / `--praxis-kpi-icon-padding`, `--prx-kpi-icon-radius` / `--praxis-kpi-icon-radius`, `--prx-kpi-icon-border` / `--praxis-kpi-icon-border`, `--prx-kpi-icon-bg` / `--praxis-kpi-icon-bg`, `--prx-kpi-icon-shadow` / `--praxis-kpi-icon-shadow`, `--prx-kpi-icon-glyph-size` / `--praxis-kpi-icon-glyph-size`, and `--prx-kpi-icon-fg` / `--praxis-kpi-icon-fg`.
1574
+ - **Surface Context Framing (`<praxis-surface-host>`):** `.pdx-surface-host__operation-context` exposes `--pdx-surface-context-border` (default `none`), `--pdx-surface-context-accent-border` (default `3px solid var(--md-sys-color-primary, currentColor)`), and `--pdx-surface-context-radius` (default `0 10px 10px 0`), letting hosts switch to a uniform perimeter border without left-edge stripes.
1575
+ - **Unified Governed File Port & Safe Blob Preview (`PRAXIS_FILE_UPLOAD_PORT`, `PraxisSafeBlobPreviewService`):** `PraxisFileUploadPort` (provided by `providePraxisHttpFileUploadPort()`) standardizes governed file config, upload, metadata (including `'PENDING_APPROVAL'`), confirm, delete, and authenticated `Blob` download (`fetchContentBlob`) with `PraxisFileOperationOptions` (`baseUrl`, `preserveExplicitContextHeaders` for async cancel/cleanup under tenant switches). `PraxisSafeBlobPreviewService` (`prepareInlinePreviewWindow()`, `openSafeBlob()`) pairs fail-closed inline MIME allowlisting with safe fallback download for active content (for example `text/html` and `image/svg+xml`) and automatic `URL.revokeObjectURL` cleanup.
1576
+
1082
1577
  <!-- praxis-npm-catalog-links:start -->
1083
1578
  ## Official documentation and examples
1084
1579